Add tests based on TestAllTypes from the C++ test.capnp. Fix problems uncovered in capnp.pyx. Requires capnproto-c++-0.3.0-rc5, as I found a bug in the base library.
This commit is contained in:
71
test/all-types.txt
Normal file
71
test/all-types.txt
Normal file
@@ -0,0 +1,71 @@
|
||||
( boolField = true,
|
||||
int8Field = -123,
|
||||
int16Field = -12345,
|
||||
int32Field = -12345678,
|
||||
int64Field = -123456789012345,
|
||||
uInt8Field = 234,
|
||||
uInt16Field = 45678,
|
||||
uInt32Field = 3456789012,
|
||||
uInt64Field = 12345678901234567890,
|
||||
float32Field = 1234.5,
|
||||
float64Field = -1.23e47,
|
||||
textField = "foo",
|
||||
dataField = "bar",
|
||||
structField = (
|
||||
boolField = true,
|
||||
int8Field = -12,
|
||||
int16Field = 3456,
|
||||
int32Field = -78901234,
|
||||
int64Field = 56789012345678,
|
||||
uInt8Field = 90,
|
||||
uInt16Field = 1234,
|
||||
uInt32Field = 56789012,
|
||||
uInt64Field = 345678901234567890,
|
||||
float32Field = -1.25e-10,
|
||||
float64Field = 345,
|
||||
textField = "baz",
|
||||
dataField = "qux",
|
||||
structField = (
|
||||
textField = "nested",
|
||||
structField = (
|
||||
textField = "really nested" ) ),
|
||||
enumField = baz,
|
||||
voidList = [void, void, void],
|
||||
boolList = [false, true, false, true, true],
|
||||
int8List = [12, -34, -128, 127],
|
||||
int16List = [1234, -5678, -32768, 32767],
|
||||
int32List = [12345678, -90123456, -2147483648, 2147483647],
|
||||
int64List = [123456789012345, -678901234567890, -9223372036854775808, 9223372036854775807],
|
||||
uInt8List = [12, 34, 0, 255],
|
||||
uInt16List = [1234, 5678, 0, 65535],
|
||||
uInt32List = [12345678, 90123456, 0, 4294967295],
|
||||
uInt64List = [123456789012345, 678901234567890, 0, 18446744073709551615],
|
||||
float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],
|
||||
float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],
|
||||
textList = ["quux", "corge", "grault"],
|
||||
dataList = ["garply", "waldo", "fred"],
|
||||
structList = [
|
||||
( textField = "x structlist 1" ),
|
||||
( textField = "x structlist 2" ),
|
||||
( textField = "x structlist 3" ) ],
|
||||
enumList = [qux, bar, grault] ),
|
||||
enumField = corge,
|
||||
voidList = [void, void, void, void, void, void],
|
||||
boolList = [true, false, false, true],
|
||||
int8List = [111, -111],
|
||||
int16List = [11111, -11111],
|
||||
int32List = [111111111, -111111111],
|
||||
int64List = [1111111111111111111, -1111111111111111111],
|
||||
uInt8List = [111, 222],
|
||||
uInt16List = [33333, 44444],
|
||||
uInt32List = [3333333333],
|
||||
uInt64List = [11111111111111111111],
|
||||
float32List = [5555.5, inf, -inf, nan],
|
||||
float64List = [7777.75, inf, -inf, nan],
|
||||
textList = ["plugh", "xyzzy", "thud"],
|
||||
dataList = ["oops", "exhausted", "rfc3092"],
|
||||
structList = [
|
||||
( textField = "structlist 1" ),
|
||||
( textField = "structlist 2" ),
|
||||
( textField = "structlist 3" ) ],
|
||||
enumList = [foo, garply] )
|
||||
Reference in New Issue
Block a user