new tests 60/6660/2
authormichele papalini <[email protected]>
Fri, 12 May 2017 09:23:06 +0000 (11:23 +0200)
committermichele papalini <[email protected]>
Fri, 12 May 2017 09:31:31 +0000 (11:31 +0200)
Change-Id: I76790b0963ac2b477bf0b707224bd8380b231c0c
Signed-off-by: michele papalini <[email protected]>
12 files changed:
libccnx-common/ccnx/common/CMakeLists.txt
libccnx-common/ccnx/common/codec/schema_v1/test/test_ccnxCodecSchemaV1_OptionalHeadersDecoder.c
libccnx-common/ccnx/common/codec/schema_v1/test/test_ccnxCodecSchemaV1_PacketEncoder.c
libccnx-common/ccnx/common/codec/schema_v1/test/testrig_packetwrapper.c
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_content_nameA_crc32c.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_content_nameA_keyid1_rsasha256.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_content_nameless_nosig.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_interest_bad_validation_alg.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_interest_nameA.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_interest_nameA_badcrc32c.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_interest_nameA_crc32c.h
libccnx-common/ccnx/common/codec/schema_v1/testdata/v1_interest_validation_alg_overrun.h

index 66d82a4..81a7054 100644 (file)
@@ -265,8 +265,8 @@ install(FILES ${TESTDATA_HDRS}           DESTINATION ${CMAKE_INSTALL_PREFIX}/inc
 install(FILES ${SCHEMAV1_HDRS}           DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ccnx/common/codec/schema_v1 COMPONENT headers)
 install(FILES ${SCHEMAV1_TESTDATA_HDRS}  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ccnx/common/codec/schema_v1/testdata COMPONENT headers)
 
-#add_subdirectory(test)
-#add_subdirectory(validation/test)
-#add_subdirectory(codec/test)
-#add_subdirectory(internal/test)
-#add_subdirectory(codec/schema_v1/test)
+add_subdirectory(test)
+add_subdirectory(validation/test)
+add_subdirectory(codec/test)
+add_subdirectory(internal/test)
+add_subdirectory(codec/schema_v1/test)
index abe4760..0f4097b 100644 (file)
@@ -61,13 +61,13 @@ static uint8_t packet_with_headers[] = {
     0x61, 0x71, 0x81, 0x91,
     // ------------------------
     // byte 32
-    0x00, 0x03, 0x00, 0x0C, // Interest Fragment (type 3)
+    0x00, 0x04, 0x00, 0x0C, // Interest Fragment (type 4)
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08, // fragment 0x0102030405060708
     0x05, 0xDC, 0x04, 0x00, // MTU 1500, fragcnt 4, fragnum 0
     // ------------------------
     // byte 48
-    0x00, 0x04, 0x00, 20,   // ContentObject Fragment (type 4)
+    0x00, 0x05, 0x00, 20,   // ContentObject Fragment (type 5)
     0xC1, 0xC2, 0xC3, 0xC4,
     0xC5, 0xC6, 0xC7, 0xC8, // fragment 0xC1C2C3C4C5C6C7C8
     0x05, 0xDC, 0x04, 0x00, // MTU 1500, fragcnt 4, fragnum 0
index eb79502..799d106 100755 (executable)
@@ -256,7 +256,7 @@ LONGBOW_TEST_CASE(ContentObject, no_cryptosuite)
     assertNotNull(encoded, "got null output buffer");
 
     // it should be 33 bytes without a signature
-    assertTrue(parcBuffer_Remaining(encoded) == 33, "Wrong length exepcted 33 got %zu", parcBuffer_Remaining(encoded));
+    assertTrue(parcBuffer_Remaining(encoded) == 38, "Wrong length exepcted 38 got %zu", parcBuffer_Remaining(encoded));
 
     parcBuffer_Release(&encoded);
     ccnxCodecTlvEncoder_Destroy(&encoder);
index 9a213b1..7416cf2 100644 (file)
@@ -381,6 +381,7 @@ testBufferGetter(TestData *data, int truthTableKey, bool containerDecoder(CCNxCo
     PARCBuffer *test = getter(data->dictionary);
 
     // look up the true name buffer from the truth table
+    printf("table key = %d\n", truthTableKey);
     TlvExtent extent = getTruthTableExtent(data->truthTable, truthTableKey);
     PARCBuffer *truth = parcBuffer_Wrap(data->packet, data->packetLength, extent.offset, extent.offset + extent.length);
 
index e469584..af55949 100644 (file)
@@ -65,7 +65,7 @@ static uint8_t v1_content_nameA_crc32c[] = {
     0x01, 0x01, 0x00, 85,       // ver = 1, type = content object, length = 85
     0x00, 0x00, 0x00, 44,       // HopLimit = 31, reserved = 0, header length = 44
     // ------------------------
-    0x00, 0x04, 0x00, 20,       // ContentObject Fragment, length = 20
+    0x00, 0x05, 0x00, 20,       // ContentObject Fragment, length = 20
     0x12, 0x23, 0x34, 0x45,
     0x56, 0x67, 0x78, 0x89,     // fragid 0x1223344556677889
     0x05, 0xDC, 0x01, 0x00,     // MTU 1500, fragcnt 1, fragnum 0
index ef37fb5..01ee2cf 100644 (file)
 
 __attribute__((unused))
 static uint8_t v1_content_nameA_keyid1_rsasha256[] = {
-    0x01, 0x01, 0x01, 0xB4,// ver = 1, type = content object, length = 436
-    0x00, 0x00, 0x00, 32,  // HopLimit = 0, reserved = 0, header length = 32
+    0x01, 0x01, 0x01, 0xB9,// ver = 1, type = content object, length = 441
+    0x00, 0x00, 0x00, 37,  // HopLimit = 0, reserved = 0, header length = 37
     // ------------------------
-    0x00, 0x04, 0x00, 20,  // ContentObject Fragment, length = 20
+    0x00, 0x05, 0x00, 20,  // ContentObject Fragment, length = 20
     0x12, 0x23, 0x34, 0x45,
     0x56, 0x67, 0x78, 0x89,// fragid 0x1223344556677889
     0x05, 0xDC, 0x01, 0x00,// MTU 1500, fragcnt 1, fragnum 0
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08,// interest fragment 0x0102030405060708
+    //-----------------------
+    0x00, 0x03, 0x00, 1, //path label, lenght = 1     //36 bytes
+    0x00,
     // ------------------------
     0x00, 0x02, 0x00, 58,  // type = content object, length = 58
     // ------------------------
@@ -101,17 +104,17 @@ static uint8_t v1_content_nameA_keyid1_rsasha256[] = {
     'h',  'e',  'l',  'l', // "hello"
     'o',
     0xF0, 0x00, 0x00, 0x04,// type = app, length = 4
-    'o',  'u',  'c',  'h', // "ouch"
+    'o',  'u',  'c',  'h', // "ouch"                //62 bytes
     // ------------------------
     0x00, 0x05, 0x00, 1,   // PayloadType
     1,    // type 1 = key
-    0x00, 0x06, 0x00, 0x08,// expiry time in msec
+    0x00, 0x06, 0x00, 0x08,// expiry time in msec  //71 bytes
     0x00, 0x00, 0x01, 0x43,// 1,388,534,400,000 msec
     0x4B, 0x19, 0x84, 0x00,
     0x00, 0x19, 0x00, 4,   // end chunk number
-    0x06, 0x05, 0x04, 0x03,
+    0x06, 0x05, 0x04, 0x03,                         //87 bytes
     // ------------------------
-    0x00, 0x01, 0x00, 8,   // payload, length = 8
+    0x00, 0x01, 0x00, 8,   // payload, length = 8   //91
     0x73, 0x75, 0x72, 0x70,
     0x72, 0x69, 0x73, 0x65,
     // ------------------------
@@ -161,16 +164,16 @@ static TruthTableEntry
 TRUTHTABLENAME(v1_content_nameA_keyid1_rsasha256)[] =
 {
     { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_E2EFRAG,       .bodyManifest = false, .extent = { 12,  20  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_CONTENTOBJECT, .bodyManifest = true,  .extent = { 36,  58  } },
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_CONTENTOBJECT, .bodyManifest = true,  .extent = { 41,  58  } }, //36 //41
     { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_NAME,          .bodyManifest = true,  .extent = { 40,  17  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOADTYPE,   .bodyManifest = true,  .extent = { 61,  1   } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_EXPIRY_TIME,   .bodyManifest = true,  .extent = { 66,  8   } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ENDSEGMENT,    .bodyManifest = true,  .extent = { 78,  4   } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOAD,       .bodyManifest = true,  .extent = { 86,  8   } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ValidationAlg, .bodyManifest = true,  .extent = { 94,  206 } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_KEYID,         .bodyManifest = true,  .extent = { 106, 32  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PUBKEY,        .bodyManifest = true,  .extent = { 142, 162 } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_SIGBITS,       .bodyManifest = true,  .extent = { 308, 128 } },
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOADTYPE,   .bodyManifest = true,  .extent = { 66,  1   } }, //61 //66
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_EXPIRY_TIME,   .bodyManifest = true,  .extent = { 71,  8   } }, //66 //71
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ENDSEGMENT,    .bodyManifest = true,  .extent = { 83,  4   } }, //78 //83
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOAD,       .bodyManifest = true,  .extent = { 91,  8   } }, //86 //91
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ValidationAlg, .bodyManifest = true,  .extent = { 94,  206 } }, //94 //99
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_KEYID,         .bodyManifest = true,  .extent = { 111, 32  } }, //106 //111
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PUBKEY,        .bodyManifest = true,  .extent = { 147, 162 } }, //142 //147
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_SIGBITS,       .bodyManifest = true,  .extent = { 313, 128 } }, //308 //313 
     { .wellKnownType = false, .indexOrKey = T_INVALID,                     .extent       = { 0,   0 } },
 };
 
index f1fc59c..5b6d304 100644 (file)
@@ -52,11 +52,11 @@ __attribute__((unused))
 static TruthTableEntry
 TRUTHTABLENAME(v1_content_nameless_nosig)[] =
 {
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_CONTENTOBJECT, .bodyManifest = true, .extent = { 12, 37 } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOADTYPE,   .bodyManifest = true, .extent = { 17, 1  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_EXPIRY_TIME,   .bodyManifest = true, .extent = { 22, 8  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ENDSEGMENT,    .bodyManifest = true, .extent = { 30, 4  } },
-    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOAD,       .bodyManifest = true, .extent = { 41, 8  } },
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_CONTENTOBJECT, .bodyManifest = true, .extent = { 12, 37 } }, //12 //17
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOADTYPE,   .bodyManifest = true, .extent = { 17, 1  } }, //17 //22
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_EXPIRY_TIME,   .bodyManifest = true, .extent = { 22, 8  } }, //22 //27
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_ENDSEGMENT,    .bodyManifest = true, .extent = { 30, 4  } }, //30 //35
+    { .wellKnownType = true,  .indexOrKey = V1_MANIFEST_OBJ_PAYLOAD,       .bodyManifest = true, .extent = { 41, 8  } }, //41 //46
     { .wellKnownType = false, .indexOrKey = T_INVALID,                     .extent       = { 0,  0 } },
 };
 
index 9c4c311..01a2efb 100644 (file)
@@ -36,7 +36,7 @@ static uint8_t v1_interest_bad_validation_alg[] = {
     0x01, 0x00, 0x00, 65,       // ver = 1, type = interest, length = 65
     0x20, 0x00, 0x00, 24,       // HopLimit = 32, reserved = 0, header length = 24
     // ------------------------
-    0x00, 0x03, 0x00, 12,       // Interest Fragment
+    0x00, 0x04, 0x00, 12,       // Interest Fragment
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08,     // fragment 0x0102030405060708
     0x05, 0xDC, 0x00, 0x00,     // MTU 1500, fragcnt 0, fragnum 0
index 4bee1e4..1049530 100644 (file)
@@ -38,7 +38,7 @@ static uint8_t v1_interest_nameA[] = {
     0x20, 0x00, 0x00, 36,       // HopLimit = 31, reserved = 0, header length = 36
     // ------------------------
     // ------------------------
-    0x00, 0x03, 0x00, 12,       // Interest Fragment
+    0x00, 0x04, 0x00, 12,       // Interest Fragment
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08,     // fragment 0x0102030405060708
     0x05, 0xDC, 0x00, 0x00,     // MTU 1500, fragcnt 0, fragnum 0
index 6af04f4..d9fd0e1 100644 (file)
@@ -36,7 +36,7 @@ static uint8_t v1_interest_nameA_badcrc32c[] = {
     0x01, 0x00, 0x00, 41,       // ver = 1, type = interest, length = 65
     0x20, 0x00, 0x00, 24,       // HopLimit = 31, reserved = 0, header length = 24
     // ------------------------
-    0x00, 0x03, 0x00, 0x0C,     // Interest Fragment
+    0x00, 0x04, 0x00, 0x0C,     // Interest Fragment
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08,     // fragment 0x0102030405060708
     0x05, 0xDC, 0x00, 0x00,     // MTU 1500, fragcnt 0, fragnum 0
index 64edf56..b71e0f9 100644 (file)
@@ -56,7 +56,7 @@
         0x01, _type, 0x00, 65,   /* ver = 1, type = interest, length = 65 */          \
         0x20, _code, 0x00, 24,   /* HopLimit = 32, reserved = 0, header length = 24*/ \
         /* ------------------------ */                                                    \
-        0x00, 0x03, 0x00, 12,   /* Interest Fragment */                               \
+        0x00, 0x04, 0x00, 12,   /* Interest Fragment */                               \
         0x01, 0x02, 0x03, 0x04,                                                           \
         0x05, 0x06, 0x07, 0x08, /* fragment 0x0102030405060708 */                     \
         0x05, 0xDC, 0x00, 0x00, /* MTU 1500, fragcnt 0, fragnum 0 */                  \
index 8f3b55a..3d188c2 100644 (file)
@@ -36,7 +36,7 @@ static uint8_t v1_interest_validation_alg_overrun[] = {
     0x01, 0x00, 0x00, 65,       // ver = 1, type = interest, length = 65
     0x20, 0x00, 0x00, 24,       // HopLimit = 32, reserved = 0, header length = 24
     // ------------------------
-    0x00, 0x03, 0x00, 12,       // Interest Fragment
+    0x00, 0x04, 0x00, 12,       // Interest Fragment
     0x01, 0x02, 0x03, 0x04,
     0x05, 0x06, 0x07, 0x08,     // fragment 0x0102030405060708
     0x05, 0xDC, 0x00, 0x00,     // MTU 1500, fragcnt 0, fragnum 0