func Test_Read_MsgContainerEmpty(t *testing.T) {
	expect := &mock.MsgContainer{}
	data := []byte{
		0xdc, 0xf8, 0xf1, 0x73,
		0x0, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #2
0
func Test_Read_SingleBuiltinInt(t *testing.T) {
	expect := &mock.SingleBuiltinInt32{232688356}
	data := []byte{
		0xee, 0x70, 0x1b, 0x1f,
		0xe4, 0x8a, 0xde, 0xd}
	utils.ReadCheck(t, expect, data)
}
Example #3
0
func Test_Read_SingleBuiltinLong(t *testing.T) {
	expect := &mock.SingleBuiltinLong{232688356}
	data := []byte{
		0x90, 0x29, 0x9e, 0x6f,
		0xe4, 0x8a, 0xde, 0xd, 0x0, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
func Test_Read_MultiVectorBoxed(t *testing.T) {
	expect := &mock.SingleMultiVectorBoxed{
		[][]mock.SingleBuiltinBox{
			{*((&mock.SingleBuiltinInt32{45}).Box().(*mock.SingleBuiltinBox)),
				*((&mock.SingleBuiltinInt32{678}).Box().(*mock.SingleBuiltinBox))},
			{*((&mock.SingleBuiltinInt32{45}).Box().(*mock.SingleBuiltinBox)),
				*((&mock.SingleBuiltinInt32{678}).Box().(*mock.SingleBuiltinBox))},
		},
	}
	data := []byte{
		0x2, 0x8f, 0x86, 0xa4,
		0x15, 0xc4, 0xb5, 0x1c,
		0x2, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0xa6, 0x2, 0x0, 0x0,
		0x15, 0xc4, 0xb5, 0x1c,
		0x2, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0xa6, 0x2, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #5
0
func Test_Read_SingleBuiltinDouble(t *testing.T) {
	expect := &mock.SingleBuiltinDouble{232688356.34}
	data := []byte{
		0x9f, 0x99, 0x66, 0x61,
		0x7b, 0x14, 0xae, 0xc8, 0x15, 0xbd, 0xab, 0x41}
	utils.ReadCheck(t, expect, data)
}
Example #6
0
func Test_Read_SingleX(t *testing.T) {
	expect := &mock.SingleX{*builtin.NewObject(&mock.SingleBuiltinInt32{45})}
	data := []byte{
		0xa9, 0xb7, 0x84, 0x75,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #7
0
func Test_Read_SingleMultiIntR4(t *testing.T) {
	expect := &mock.SingleMultiInt32R4{[]int32{1, 2, 3, 4}}
	data := []byte{
		0xf9, 0x6e, 0xac, 0x3a,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #8
0
func Test_Read_SingleMultiInt32_1(t *testing.T) {
	expect := &mock.SingleMultiInt32{[]int32{1, 2}}
	data := []byte{
		0xe5, 0x7b, 0xed, 0xf5,
		0x2, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
	}
	utils.ReadCheck(t, expect, data)
}
Example #9
0
func Test_Read_VectorBytes(t *testing.T) {
	expect := &mock.SingleVectorBytes{[][]byte{[]byte("test1"), []byte("test2")}}
	data := []byte{
		0xd2, 0xca, 0xdf, 0x51,
		0x15, 0xc4, 0xb5, 0x1c,
		0x2, 0x0, 0x0, 0x0,
		0x5, 0x74, 0x65, 0x73, 0x74, 0x31, 0x0, 0x0,
		0x5, 0x74, 0x65, 0x73, 0x74, 0x32, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #10
0
func Test_Read_VectorLong(t *testing.T) {
	expect := &mock.SingleVectorLong{[]int64{1, 2, 3, 4}}
	data := []byte{
		0xe8, 0x95, 0xe0, 0xff,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #11
0
func Test_Rear_VectorDouble(t *testing.T) {
	expect := &mock.SingleVectorDouble{[]float64{1.1, 2.2, 3.3, 4.4}}
	data := []byte{
		0xae, 0xd, 0xd5, 0xfb,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0x3f,
		0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0x1, 0x40,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xa, 0x40,
		0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0x11, 0x40}
	utils.ReadCheck(t, expect, data)
}
Example #12
0
func Test_Read_VectorString(t *testing.T) {
	expect := &mock.SingleVectorString{[]string{"test1", "test2"}}
	data := []byte{
		0x8, 0x5e, 0x7d, 0x7,
		0x15, 0xc4, 0xb5, 0x1c,
		0x2, 0x0, 0x0, 0x0,
		0x5,
		0x74, 0x65, 0x73, 0x74, 0x31, 0x0, 0x0,
		0x5,
		0x74, 0x65, 0x73, 0x74, 0x32, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #13
0
func Test_Read_VectorInt(t *testing.T) {
	expect := &mock.SingleVectorInt{[]int32{1, 2, 3, 4}}
	data := []byte{
		0xc8, 0xa2, 0xc3, 0xcd,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #14
0
// dskgfsf
func Test_Read_SingleMultiBoxed(t *testing.T) {
	expect := &mock.SingleMultiBoxed{[]mock.SingleBuiltinBox{
		(&mock.SingleBuiltinInt32{45}).Boxed(),
		(&mock.SingleBuiltinInt32{678}).Boxed(),
	}}
	data := []byte{
		0xfc, 0x21, 0x1, 0xef,
		0x2, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0xa6, 0x2, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #15
0
func Test_Read_SingleVectorX(t *testing.T) {
	expect := &mock.SingleVectorX{
		[]builtin.ObjectBox{
			*builtin.NewObject(&mock.SingleBuiltinInt32{45}),
		},
	}
	data := []byte{
		0xa7, 0x3b, 0x53, 0x68,
		0x15, 0xc4, 0xb5, 0x1c,
		0x1, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
func Test_Read_MsgContainer(t *testing.T) {
	expect := &mock.MsgContainer{[]mock.Message{
		mock.Message{34, 3, 67, *(builtin.NewObject(&mock.SingleBuiltinInt32{45}))},
	}}
	data := []byte{
		0xdc, 0xf8, 0xf1, 0x73,
		0x1, 0x0, 0x0, 0x0,
		0x22, 0x0, 0x0, 0x0,
		0x0, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x43, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #17
0
func Test_Read_SingleMultiBoxedR4(t *testing.T) {
	expect := &mock.SingleMultiBoxedR4{[]mock.SingleBuiltinBox{
		*((&mock.SingleBuiltinInt32{45}).Box().(*mock.SingleBuiltinBox)),
		*((&mock.SingleBuiltinInt32{678}).Box().(*mock.SingleBuiltinBox)),
		*((&mock.SingleBuiltinInt32{89}).Box().(*mock.SingleBuiltinBox)),
		*((&mock.SingleBuiltinString{"test"}).Box().(*mock.SingleBuiltinBox)),
	}}
	data := []byte{
		0xc4, 0xd4, 0x10, 0x21,
		0xee, 0x70, 0x1b, 0x1f,
		0x2d, 0x0, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0xa6, 0x2, 0x0, 0x0,
		0xee, 0x70, 0x1b, 0x1f,
		0x59, 0x0, 0x0, 0x0,
		0x64, 0x27, 0x23, 0x16,
		0x4, 0x74, 0x65, 0x73,
		0x74, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
Example #18
0
func Test_Read_SingleBuiltinBytes(t *testing.T) {
	expect := &mock.SingleBuiltinBytes{[]byte("Мама мыла Раму. Рама был индус.")}
	data := []byte{
		0xe9, 0xae, 0x23, 0x60,
		0x37, 0xd0, 0x9c, 0xd0,
		0xb0, 0xd0, 0xbc, 0xd0,
		0xb0, 0x20, 0xd0, 0xbc,
		0xd1, 0x8b, 0xd0, 0xbb,
		0xd0, 0xb0, 0x20, 0xd0,
		0xa0, 0xd0, 0xb0, 0xd0,
		0xbc, 0xd1, 0x83, 0x2e,
		0x20, 0xd0, 0xa0, 0xd0,
		0xb0, 0xd0, 0xbc, 0xd0,
		0xb0, 0x20, 0xd0, 0xb1,
		0xd1, 0x8b, 0xd0, 0xbb,
		0x20, 0xd0, 0xb8, 0xd0,
		0xbd, 0xd0, 0xb4, 0xd1,
		0x83, 0xd1, 0x81, 0x2e}
	utils.ReadCheck(t, expect, data)
}
Example #19
0
func Test_Read_SingleBuiltinString(t *testing.T) {
	expect := &mock.SingleBuiltinString{"Мама мыла Раму. Рама был индус."}
	data := []byte{
		0x64, 0x27, 0x23, 0x16,
		0x37, 0xd0, 0x9c, 0xd0,
		0xb0, 0xd0, 0xbc, 0xd0,
		0xb0, 0x20, 0xd0, 0xbc,
		0xd1, 0x8b, 0xd0, 0xbb,
		0xd0, 0xb0, 0x20, 0xd0,
		0xa0, 0xd0, 0xb0, 0xd0,
		0xbc, 0xd1, 0x83, 0x2e,
		0x20, 0xd0, 0xa0, 0xd0,
		0xb0, 0xd0, 0xbc, 0xd0,
		0xb0, 0x20, 0xd0, 0xb1,
		0xd1, 0x8b, 0xd0, 0xbb,
		0x20, 0xd0, 0xb8, 0xd0,
		0xbd, 0xd0, 0xb4, 0xd1,
		0x83, 0xd1, 0x81, 0x2e}
	utils.ReadCheck(t, expect, data)
}
func Test_Read_MultiVectorInt(t *testing.T) {
	expect := &mock.SingleMultiVectorInt{[][]int32{
		{1, 2, 3, 4},
		{1, 2, 3, 4},
	}}
	data := []byte{
		0xfe, 0xae, 0xd6, 0xea,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}
func Test_Read_VectorDeepInt(t *testing.T) {
	expect := &mock.SingleVectorDeepInt{[][]int32{
		{1, 2, 3, 4},
		{1, 2, 3, 4},
	}}
	data := []byte{
		0xf5, 0x85, 0xce, 0xa9,
		0x15, 0xc4, 0xb5, 0x1c,
		0x2, 0x0, 0x0, 0x0,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0,
		0x15, 0xc4, 0xb5, 0x1c,
		0x4, 0x0, 0x0, 0x0,
		0x1, 0x0, 0x0, 0x0,
		0x2, 0x0, 0x0, 0x0,
		0x3, 0x0, 0x0, 0x0,
		0x4, 0x0, 0x0, 0x0}
	utils.ReadCheck(t, expect, data)
}