You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2020/08/12 16:15:09 UTC

[qpid-proton] branch array-of-lists-first-list-empty updated: PROTON-2244: Removed array tests of all but array of lists, as this is the issue. The consensus is that we need to make the tests compare encoded bytes with expected encoded bytes, not perform an encode/decode comparison as these tests do at present. This should be done at a later time.

This is an automated email from the ASF dual-hosted git repository.

kpvdr pushed a commit to branch array-of-lists-first-list-empty
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/array-of-lists-first-list-empty by this push:
     new 5975c20  PROTON-2244: Removed array tests of all but array of lists, as this is the issue. The consensus is that we need to make the tests compare encoded bytes with expected encoded bytes, not perform an encode/decode comparison as these tests do at present. This should be done at a later time.
5975c20 is described below

commit 5975c2000a0a222d944d955a0e0e111eab501bcc
Author: Kim van der Riet <kp...@apache.org>
AuthorDate: Wed Aug 12 12:14:37 2020 -0400

    PROTON-2244: Removed array tests of all but array of lists, as this is the issue. The consensus is that we need to make the tests compare encoded bytes with expected encoded bytes, not perform an encode/decode comparison as these tests do at present. This should be done at a later time.
---
 c/tests/data_test.cpp | 175 --------------------------------------------------
 1 file changed, 175 deletions(-)

diff --git a/c/tests/data_test.cpp b/c/tests/data_test.cpp
index 7b4f227..c7a6b6d 100644
--- a/c/tests/data_test.cpp
+++ b/c/tests/data_test.cpp
@@ -148,172 +148,6 @@ static void check_array(const char *fmt, ...) {
 	check_encode_decode(src);
 }
 
-TEST_CASE("array_null") {
-	check_array("@T[]", PN_NULL);
-	check_array("@T[nnn]", PN_NULL);
-}
-
-TEST_CASE("array_bool") {
-	check_array("@T[]", PN_BOOL);
-	check_array("@T[oooo]", PN_BOOL, true, false, false, true);
-}
-
-TEST_CASE("array_ubyte") {
-	check_array("@T[]", PN_UBYTE);
-	check_array("@T[BBBBB]", PN_UBYTE, uint8_t(0), uint8_t(1), uint8_t(0x7f), uint8_t(0x80), uint8_t(0xff));
-}
-
-TEST_CASE("array_byte") {
-	check_array("@T[]", PN_BYTE);
-	check_array("@T[bbbbb]", PN_BYTE, int8_t(-0x80), int8_t(-1), int8_t(0), int8_t(1), int8_t(0x7f));
-}
-
-TEST_CASE("array_ushort") {
-	check_array("@T[]", PN_USHORT);
-	check_array("@T[HHHHH]", PN_USHORT, uint16_t(0), uint16_t(1), uint16_t(0x7fff), uint16_t(0x8000), uint16_t(0xffff));
-}
-
-TEST_CASE("array_short") {
-	check_array("@T[]", PN_SHORT);
-	check_array("@T[hhhhh]", PN_SHORT, int16_t(-0x8000), int16_t(-1), int16_t(0), int16_t(1), int16_t(0x7fff));
-}
-
-TEST_CASE("array_uint") {
-	check_array("@T[]", PN_UINT);
-	check_array("@T[IIIII]", PN_UINT, uint32_t(0), uint32_t(1), uint32_t(0x7fffffff), uint32_t(0x80000000), uint32_t(0xffffffff));
-}
-
-TEST_CASE("array_int") {
-	check_array("@T[]", PN_INT);
-	check_array("@T[iiiii]", PN_INT, int32_t(-0x80000000), int32_t(-1), int32_t(0), int32_t(1), int32_t(0x7fffffff));
-}
-
-TEST_CASE("array_char") {
-	// TODO: PROTON-2249: This test will pass, but is not checking array contents
-	// correctly until this issue is fixed.
-	auto_free<pn_data_t, pn_data_free> src(pn_data(1));
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_CHAR);
-	pn_data_enter(src);
-	pn_data_exit(src);
-	check_encode_decode(src);
-
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_CHAR);
-	pn_data_enter(src);
-	pn_data_put_char(src, pn_char_t(0));
-	pn_data_put_char(src, pn_char_t('5'));
-	pn_data_put_char(src, pn_char_t('a'));
-	pn_data_put_char(src, pn_char_t('Z'));
-	pn_data_put_char(src, pn_char_t(0x7f));
-	pn_data_exit(src);
-	check_encode_decode(src);
-}
-
-TEST_CASE("array_ulong") {
-	check_array("@T[]", PN_ULONG);
-	check_array("@T[LLLLL]", PN_ULONG, uint64_t(0), uint64_t(1), uint64_t(0x7fffffffffffffff), uint64_t(0x8000000000000000), uint64_t(0xffffffffffffffff));
-}
-
-TEST_CASE("array_long") {
-	check_array("@T[]", PN_LONG);
-	check_array("@T[lllll]", PN_LONG, int64_t(-0x8000000000000000), int64_t(-1), int64_t(0), int64_t(1), int64_t(0x8000000000000000));
-}
-
-TEST_CASE("array_timestamp") {
-	check_array("@T[]", PN_TIMESTAMP);
-	check_array("@T[ttt]", PN_TIMESTAMP, int64_t(0), int64_t(std::time(0)*1000), int64_t(0x123456789abcdef));
-}
-
-TEST_CASE("array_float") {
-	check_array("@T[]", PN_FLOAT);
-	check_array("@T[fff]", PN_FLOAT, float(0.0), float(3.14), float(1.234e56), float(-1.234e-56));
-}
-
-TEST_CASE("array_double") {
-	check_array("@T[]", PN_DOUBLE);
-	check_array("@T[ddd]", PN_DOUBLE, double(0.0), double(3.1416), double(1.234e56), double(-1.234e-56));
-}
-
-TEST_CASE("array_decimal32") {
-	auto_free<pn_data_t, pn_data_free> src(pn_data(1));
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL32);
-	pn_data_enter(src);
-	pn_data_exit(src);
-	check_encode_decode(src);
-
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL32);
-	pn_data_enter(src);
-	pn_data_put_decimal32(src, pn_decimal32_t(0));
-	pn_data_put_decimal32(src, pn_decimal32_t(0x01234567));
-	pn_data_exit(src);
-	check_encode_decode(src);
-}
-
-TEST_CASE("array_decimal64") {
-	auto_free<pn_data_t, pn_data_free> src(pn_data(1));
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL64);
-	pn_data_enter(src);
-	pn_data_exit(src);
-	check_encode_decode(src);
-
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL64);
-	pn_data_enter(src);
-	pn_data_put_decimal64(src, pn_decimal64_t(0));
-	pn_data_put_decimal64(src, pn_decimal64_t(0x0123456789abcdef));
-	pn_data_exit(src);
-	check_encode_decode(src);
-}
-
-TEST_CASE("array_decimal128") {
-	auto_free<pn_data_t, pn_data_free> src(pn_data(1));
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL128);
-	pn_data_enter(src);
-	pn_data_exit(src);
-	check_encode_decode(src);
-
-	pn_data_clear(src);
-	pn_data_put_array(src, false, PN_DECIMAL128);
-	pn_data_enter(src);
-	pn_decimal128_t d1;
-	memset(d1.bytes, 0, sizeof(d1.bytes)); // set to all zeros
-	pn_data_put_decimal128(src, d1);
-	pn_decimal128_t d2;
-	char val[] = {'\x01', '\x23', '\x45', '\x67', '\x89', '\xab', '\xcd', '\xef', '\x01', '\x23', '\x45', '\x67', '\x89', '\xab', '\xcd', '\xef'};
-	memcpy(d2.bytes, val, sizeof(val)); // copy value
-	pn_data_put_decimal128(src, d2);
-	pn_data_exit(src);
-	check_encode_decode(src);
-}
-
-TEST_CASE("array_binary") {
-	check_array("@T[]", PN_BINARY);
-	check_array("@T[ZZZZZ]", PN_BINARY, 0, "", 2, "\x00\x00", 4, "\x00\x01\xfe\xff", 8, "abcdefgh", 16, "1234567890123456");
-}
-
-TEST_CASE("array_string") {
-	check_array("@T[]", PN_STRING);
-	// TODO: PROTON-2248: using S and s reversed
-	check_array("@T[SSSSS]", PN_STRING, "", "hello", "bye", "abcdefg", "the quick brown fox jumped over the lazy dog 0123456789");
-}
-
-TEST_CASE("array_symbol") {
-	check_array("@T[]", PN_SYMBOL);
-	// TODO: PROTON-2248: using S and s reversed
-	check_array("@T[sssss]", PN_SYMBOL, "", "hello", "bye", "abcdefg", "the quick brown fox jumped over the lazy dog 0123456789");
-}
-
-TEST_CASE("array_array") {
-	check_array("@T[]", PN_ARRAY);
-	// TODO: PROTON-2248: using S and s reversed
-	check_array("@T[@T[]@T[ooo]@T[ii]@T[nnnn]@T[sss]]", PN_ARRAY, PN_UBYTE, PN_BOOL, false, false, true, PN_INT, -100, 100, PN_NULL, PN_SYMBOL, "aaa", "bbb", "ccc");
-}
-
 TEST_CASE("array_list") {
 	check_array("@T[]", PN_LIST);
 	// TODO: PROTON-2248: using S and s reversed
@@ -324,12 +158,3 @@ TEST_CASE("array_list") {
 	// only empty lists
 	check_array("@T[[][][][][]]", PN_LIST);
 }
-
-TEST_CASE("array_map") {
-	check_array("@T[]", PN_MAP);
-	// TODO: PROTON-2248: using S and s reversed
-	check_array("@T[{}{sS}{}{IhIoIf}{iSiSiSiS}]", PN_MAP, "key", "value", 123, -123, 255, false, 0, 0.25, 0, "zero", 1, "one", 2, "two", 3, "three");
-}
-
-
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org