-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTest.cs
More file actions
26 lines (23 loc) · 733 Bytes
/
Test.cs
File metadata and controls
26 lines (23 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Test {
static void assert(bool exp) {
if (!exp) {
System.Console.Write("Bad things\n");
}
}
static void Main() {
Sirikata.PB.TestMessage.Builder tm=Sirikata.PB.TestMessage.CreateBuilder();
tm.Xxfr=1.25f;
tm.V3F=new PBJ.Vector3f(1,2,3);
tm.Extmesser= new Sirikata.PB.ExternalMessage();
Sirikata.PB.TestMessage xti=tm.BuildPartial();
byte[] s=xti.ToByteArray();
System.Console.Write(s.Length);
Sirikata.PB.TestMessage ti;
ti=Sirikata.PB.TestMessage.ParseFrom(s);
assert(ti!=null);
assert(ti.V3F.x==1);
assert(ti.V3F.y==2);
assert(ti.V3F.z==3);
assert(ti.Xxfr==1.25);
}
}