• Home
  • Raw
  • Download

Lines Matching full:builder

35             var builder = new FlatBufferBuilder(1);  in TestNumbers()
36 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestNumbers()
37 builder.AddBool(true); in TestNumbers()
38 Assert.ArrayEqual(new byte[] { 1 }, builder.DataBuffer.ToFullArray()); in TestNumbers()
39 builder.AddSbyte(-127); in TestNumbers()
40 Assert.ArrayEqual(new byte[] { 129, 1 }, builder.DataBuffer.ToFullArray()); in TestNumbers()
41 builder.AddByte(255); in TestNumbers()
42 … Assert.ArrayEqual(new byte[] { 0, 255, 129, 1 }, builder.DataBuffer.ToFullArray()); // First pad in TestNumbers()
43 builder.AddShort(-32222); in TestNumbers()
44 …Assert.ArrayEqual(new byte[] { 0, 0, 0x22, 0x82, 0, 255, 129, 1 }, builder.DataBuffer.ToFullArray(… in TestNumbers()
45 builder.AddUshort(0xFEEE); in TestNumbers()
46 …Assert.ArrayEqual(new byte[] { 0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1 }, builder.DataBuffer.ToFull… in TestNumbers()
47 builder.AddInt(-53687092); in TestNumbers()
48 …, 0, 0, 0, 204, 204, 204, 252, 0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1 }, builder.DataBuffer.ToFull… in TestNumbers()
49 builder.AddUint(0x98765432); in TestNumbers()
50 …x76, 0x98, 204, 204, 204, 252, 0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1 }, builder.DataBuffer.ToFull… in TestNumbers()
56 var builder = new FlatBufferBuilder(1); in TestNumbers64()
57 builder.AddUlong(0x1122334455667788); in TestNumbers64()
58 …rrayEqual(new byte[] { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }, builder.DataBuffer.ToFull… in TestNumbers64()
60 builder = new FlatBufferBuilder(1); in TestNumbers64()
61 builder.AddLong(0x1122334455667788); in TestNumbers64()
62 …rrayEqual(new byte[] { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }, builder.DataBuffer.ToFull… in TestNumbers64()
68 var builder = new FlatBufferBuilder(1); in TestVector_1xUInt8()
69 builder.StartVector(sizeof(byte), 1, 1); in TestVector_1xUInt8()
70 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt8()
71 builder.AddByte(1); in TestVector_1xUInt8()
72 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt8()
73 builder.EndVector(); in TestVector_1xUInt8()
74 … Assert.ArrayEqual(new byte[] { 1, 0, 0, 0, 1, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt8()
80 var builder = new FlatBufferBuilder(1); in TestVector_2xUint8()
81 builder.StartVector(sizeof(byte), 2, 1); in TestVector_2xUint8()
82 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_2xUint8()
83 builder.AddByte(1); in TestVector_2xUint8()
84 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 1, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_2xUint8()
85 builder.AddByte(2); in TestVector_2xUint8()
86 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 2, 1, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_2xUint8()
87 builder.EndVector(); in TestVector_2xUint8()
88 … Assert.ArrayEqual(new byte[] { 2, 0, 0, 0, 2, 1, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_2xUint8()
94 var builder = new FlatBufferBuilder(1); in TestVector_1xUInt16()
95 builder.StartVector(sizeof(ushort), 1, 1); in TestVector_1xUInt16()
96 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt16()
97 builder.AddUshort(1); in TestVector_1xUInt16()
98 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt16()
99 builder.EndVector(); in TestVector_1xUInt16()
100 … Assert.ArrayEqual(new byte[] { 1, 0, 0, 0, 1, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_1xUInt16()
106 var builder = new FlatBufferBuilder(1); in TestVector_2xUInt16()
107 builder.StartVector(sizeof(ushort), 2, 1); in TestVector_2xUInt16()
108 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, builder.DataBuffer.ToFullArray()); in TestVector_2xUInt16()
109 builder.AddUshort(0xABCD); in TestVector_2xUInt16()
110 … Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0, 0, 0xCD, 0xAB }, builder.DataBuffer.ToFullArray()); in TestVector_2xUInt16()
111 builder.AddUshort(0xDCBA); in TestVector_2xUInt16()
112 …Assert.ArrayEqual(new byte[] { 0, 0, 0, 0, 0xBA, 0xDC, 0xCD, 0xAB }, builder.DataBuffer.ToFullArra… in TestVector_2xUInt16()
113 builder.EndVector(); in TestVector_2xUInt16()
114 …Assert.ArrayEqual(new byte[] { 2, 0, 0, 0, 0xBA, 0xDC, 0xCD, 0xAB }, builder.DataBuffer.ToFullArra… in TestVector_2xUInt16()
120 var builder = new FlatBufferBuilder(1); in TestCreateAsciiString()
121 builder.CreateString("foo"); in TestCreateAsciiString()
122 …rrayEqual(new byte[] { 3, 0, 0, 0, (byte)'f', (byte)'o', (byte)'o', 0 }, builder.DataBuffer.ToFull… in TestCreateAsciiString()
124 builder.CreateString("moop"); in TestCreateAsciiString()
135 }, builder.DataBuffer.ToFullArray()); in TestCreateAsciiString()
141 var builder = new FlatBufferBuilder(1); in TestCreateSharedAsciiString()
142 builder.CreateSharedString("foo"); in TestCreateSharedAsciiString()
143 …rrayEqual(new byte[] { 3, 0, 0, 0, (byte)'f', (byte)'o', (byte)'o', 0 }, builder.DataBuffer.ToFull… in TestCreateSharedAsciiString()
145 builder.CreateSharedString("foo"); in TestCreateSharedAsciiString()
146 …rrayEqual(new byte[] { 3, 0, 0, 0, (byte)'f', (byte)'o', (byte)'o', 0 }, builder.DataBuffer.ToFull… in TestCreateSharedAsciiString()
152 var builder = new FlatBufferBuilder(1); in TestCreateArbitarytring()
153 builder.CreateString("\x01\x02\x03"); in TestCreateArbitarytring()
158 }, builder.DataBuffer.ToFullArray()); // No padding in TestCreateArbitarytring()
159 builder.CreateString("\x04\x05\x06\x07"); in TestCreateArbitarytring()
170 }, builder.DataBuffer.ToFullArray()); // No padding in TestCreateArbitarytring()
176 var builder = new FlatBufferBuilder(1); in TestEmptyVTable()
177 builder.StartTable(0); in TestEmptyVTable()
178 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestEmptyVTable()
179 builder.EndTable(); in TestEmptyVTable()
185 builder.DataBuffer.ToFullArray()); in TestEmptyVTable()
191 var builder = new FlatBufferBuilder(1); in TestVTableWithOneBool()
192 builder.StartTable(1); in TestVTableWithOneBool()
193 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestVTableWithOneBool()
194 builder.AddBool(0, true, false); in TestVTableWithOneBool()
195 builder.EndTable(); in TestVTableWithOneBool()
206 builder.DataBuffer.ToFullArray()); in TestVTableWithOneBool()
212 var builder = new FlatBufferBuilder(1); in TestVTableWithOneBool_DefaultValue()
213 builder.StartTable(1); in TestVTableWithOneBool_DefaultValue()
214 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestVTableWithOneBool_DefaultValue()
215 builder.AddBool(0, false, false); in TestVTableWithOneBool_DefaultValue()
216 builder.EndTable(); in TestVTableWithOneBool_DefaultValue()
225 builder.DataBuffer.ToFullArray()); in TestVTableWithOneBool_DefaultValue()
231 var builder = new FlatBufferBuilder(1); in TestVTableWithOneInt16()
232 builder.StartTable(1); in TestVTableWithOneInt16()
233 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestVTableWithOneInt16()
234 builder.AddShort(0, 0x789A, 0); in TestVTableWithOneInt16()
235 builder.EndTable(); in TestVTableWithOneInt16()
246 builder.DataBuffer.ToFullArray()); in TestVTableWithOneInt16()
252 var builder = new FlatBufferBuilder(1); in TestVTableWithTwoInt16()
253 builder.StartTable(2); in TestVTableWithTwoInt16()
254 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestVTableWithTwoInt16()
255 builder.AddShort(0, 0x3456, 0); in TestVTableWithTwoInt16()
256 builder.AddShort(1, 0x789A, 0); in TestVTableWithTwoInt16()
257 builder.EndTable(); in TestVTableWithTwoInt16()
268 builder.DataBuffer.ToFullArray()); in TestVTableWithTwoInt16()
274 var builder = new FlatBufferBuilder(1); in TestVTableWithInt16AndBool()
275 builder.StartTable(2); in TestVTableWithInt16AndBool()
276 Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray()); in TestVTableWithInt16AndBool()
277 builder.AddShort(0, 0x3456, 0); in TestVTableWithInt16AndBool()
278 builder.AddBool(1, true, false); in TestVTableWithInt16AndBool()
279 builder.EndTable(); in TestVTableWithInt16AndBool()
290 builder.DataBuffer.ToFullArray()); in TestVTableWithInt16AndBool()
296 var builder = new FlatBufferBuilder(1); in TestVTableWithEmptyVector()
297 builder.StartVector(sizeof(byte), 0, 1); in TestVTableWithEmptyVector()
298 var vecEnd = builder.EndVector(); in TestVTableWithEmptyVector()
300 builder.StartTable(1); in TestVTableWithEmptyVector()
302 builder.AddOffset(0, vecEnd.Value, 0); in TestVTableWithEmptyVector()
303 builder.EndTable(); in TestVTableWithEmptyVector()
317 builder.DataBuffer.ToFullArray()); in TestVTableWithEmptyVector()
323 var builder = new FlatBufferBuilder(1); in TestVTableWithEmptyVectorAndScalars()
324 builder.StartVector(sizeof(byte), 0, 1); in TestVTableWithEmptyVectorAndScalars()
325 var vecEnd = builder.EndVector(); in TestVTableWithEmptyVectorAndScalars()
327 builder.StartTable(2); in TestVTableWithEmptyVectorAndScalars()
328 builder.AddShort(0, 55, 0); in TestVTableWithEmptyVectorAndScalars()
329 builder.AddOffset(1, vecEnd.Value, 0); in TestVTableWithEmptyVectorAndScalars()
330 builder.EndTable(); in TestVTableWithEmptyVectorAndScalars()
344 builder.DataBuffer.ToFullArray()); in TestVTableWithEmptyVectorAndScalars()
351 var builder = new FlatBufferBuilder(1); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
352 builder.StartVector(sizeof(short), 2, 1); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
353 builder.AddShort(0x1234); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
354 builder.AddShort(0x5678); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
355 var vecEnd = builder.EndVector(); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
357 builder.StartTable(2); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
358 builder.AddOffset(1, vecEnd.Value, 0); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
359 builder.AddShort(0, 55, 0); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
360 builder.EndTable(); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
375 builder.DataBuffer.ToFullArray()); in TestVTableWith_1xInt16_and_Vector_or_2xInt16()
381 var builder = new FlatBufferBuilder(1); in TestVTableWithAStruct_of_int8_int16_int32()
382 builder.StartTable(1); in TestVTableWithAStruct_of_int8_int16_int32()
383 builder.Prep(4+4+4, 0); in TestVTableWithAStruct_of_int8_int16_int32()
384 builder.AddSbyte(55); in TestVTableWithAStruct_of_int8_int16_int32()
385 builder.Pad(3); in TestVTableWithAStruct_of_int8_int16_int32()
386 builder.AddShort(0x1234); in TestVTableWithAStruct_of_int8_int16_int32()
387 builder.Pad(2); in TestVTableWithAStruct_of_int8_int16_int32()
388 builder.AddInt(0x12345678); in TestVTableWithAStruct_of_int8_int16_int32()
389 var structStart = builder.Offset; in TestVTableWithAStruct_of_int8_int16_int32()
390 builder.AddStruct(0, structStart, 0); in TestVTableWithAStruct_of_int8_int16_int32()
391 builder.EndTable(); in TestVTableWithAStruct_of_int8_int16_int32()
405 builder.DataBuffer.ToFullArray()); in TestVTableWithAStruct_of_int8_int16_int32()
411 var builder = new FlatBufferBuilder(1); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
412 builder.StartVector(sizeof(byte)*2, 2, 1); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
413 builder.AddByte(33); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
414 builder.AddByte(44); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
415 builder.AddByte(55); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
416 builder.AddByte(66); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
417 var vecEnd = builder.EndVector(); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
419 builder.StartTable(1); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
420 builder.AddOffset(0, vecEnd.Value, 0); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
421 builder.EndTable(); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
439 builder.DataBuffer.ToFullArray()); in TestVTableWithAVectorOf_2xStructOf_2xInt8()
445 var builder = new FlatBufferBuilder(1); in TestVTableWithSomeElements()
446 builder.StartTable(2); in TestVTableWithSomeElements()
447 builder.AddByte(0, 33, 0); in TestVTableWithSomeElements()
448 builder.AddShort(1, 66, 0); in TestVTableWithSomeElements()
449 var off = builder.EndTable(); in TestVTableWithSomeElements()
450 builder.Finish(off); in TestVTableWithSomeElements()
467 Assert.ArrayEqual(padded, builder.DataBuffer.ToFullArray()); in TestVTableWithSomeElements()
472 Assert.ArrayEqual(unpadded, builder.DataBuffer.ToSizedArray()); in TestVTableWithSomeElements()
478 var builder = new FlatBufferBuilder(1); in TestTwoFinishTable()
479 builder.StartTable(2); in TestTwoFinishTable()
480 builder.AddByte(0, 33, 0); in TestTwoFinishTable()
481 builder.AddByte(1, 44, 0); in TestTwoFinishTable()
482 var off0 = builder.EndTable(); in TestTwoFinishTable()
483 builder.Finish(off0); in TestTwoFinishTable()
485 builder.StartTable(3); in TestTwoFinishTable()
486 builder.AddByte(0, 55, 0); in TestTwoFinishTable()
487 builder.AddByte(1, 66, 0); in TestTwoFinishTable()
488 builder.AddByte(2, 77, 0); in TestTwoFinishTable()
489 var off1 = builder.EndTable(); in TestTwoFinishTable()
490 builder.Finish(off1); in TestTwoFinishTable()
523 builder.DataBuffer.ToFullArray()); in TestTwoFinishTable()
529 var builder = new FlatBufferBuilder(1); in TestBunchOfBools()
530 builder.StartTable(8); in TestBunchOfBools()
533 builder.AddBool(i, true, false); in TestBunchOfBools()
535 var off = builder.EndTable(); in TestBunchOfBools()
536 builder.Finish(off); in TestBunchOfBools()
566 Assert.ArrayEqual(padded, builder.DataBuffer.ToFullArray()); in TestBunchOfBools()
571 Assert.ArrayEqual(unpadded, builder.DataBuffer.ToSizedArray()); in TestBunchOfBools()
577 var builder = new FlatBufferBuilder(1); in TestBunchOfBoolsSizePrefixed()
578 builder.StartTable(8); in TestBunchOfBoolsSizePrefixed()
581 builder.AddBool(i, true, false); in TestBunchOfBoolsSizePrefixed()
583 var off = builder.EndTable(); in TestBunchOfBoolsSizePrefixed()
584 builder.FinishSizePrefixed(off); in TestBunchOfBoolsSizePrefixed()
614 Assert.ArrayEqual(padded, builder.DataBuffer.ToFullArray()); in TestBunchOfBoolsSizePrefixed()
619 Assert.ArrayEqual(unpadded, builder.DataBuffer.ToSizedArray()); in TestBunchOfBoolsSizePrefixed()
625 var builder = new FlatBufferBuilder(1); in TestWithFloat()
626 builder.StartTable(1); in TestWithFloat()
627 builder.AddFloat(0, 1, 0); in TestWithFloat()
628 builder.EndTable(); in TestWithFloat()
641 builder.DataBuffer.ToFullArray()); in TestWithFloat()
650 var builder = new FlatBufferBuilder(1); in CheckObjects()
656 builder.StartTable(fieldCount); in CheckObjects()
666 builder.AddBool(j, FuzzTestData.BoolValue, false); in CheckObjects()
671 builder.AddSbyte(j, FuzzTestData.Int8Value, 0); in CheckObjects()
676 builder.AddByte(j, FuzzTestData.UInt8Value, 0); in CheckObjects()
681 builder.AddShort(j, FuzzTestData.Int16Value, 0); in CheckObjects()
686 builder.AddUshort(j, FuzzTestData.UInt16Value, 0); in CheckObjects()
691 builder.AddInt(j, FuzzTestData.Int32Value, 0); in CheckObjects()
696 builder.AddUint(j, FuzzTestData.UInt32Value, 0); in CheckObjects()
701 builder.AddLong(j, FuzzTestData.Int64Value, 0); in CheckObjects()
706 builder.AddUlong(j, FuzzTestData.UInt64Value, 0); in CheckObjects()
711 builder.AddFloat(j, FuzzTestData.Float32Value, 0); in CheckObjects()
716 builder.AddDouble(j, FuzzTestData.Float64Value, 0); in CheckObjects()
725 var offset = builder.EndTable(); in CheckObjects()
736 … var table = new TestTable(builder.DataBuffer, builder.DataBuffer.Length - objects[i]); in CheckObjects()