Skip to content

Commit

Permalink
test: add vector with NS and DS
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Nov 26, 2021
1 parent b8d4e62 commit b28d783
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
44 changes: 43 additions & 1 deletion test/data/resource_vectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef struct resource_vector {
* Vectors
*/

static const resource_vector_t resource_vectors[10] = {
static const resource_vector_t resource_vectors[11] = {
// {
// "records": [
// {
Expand Down Expand Up @@ -292,5 +292,47 @@ static const resource_vector_t resource_vectors[10] = {
},
sizeof(hsk_type_map_txt),
hsk_type_map_txt
},

// {
// "records": [
// {
// "type": "DS",
// "keyTag": 57355,
// "algorithm": 8,
// "digestType": 2,
// "digest": "95a57c3bab7849dbcddf7c72ada71a88146b141110318ca5be672057e865c3e2"
// },
// {
// "type": "GLUE6",
// "ns": "ns1.test-all.",
// "address": "4:8:15:16:23:42:108:815"
// },
// {
// "type": "TXT",
// "txt": [":-)"]
// }
// ]
// }
{
"test-all.",
{
0x00, 0x00, 0xe0, 0x0b, 0x08, 0x02, 0x20, 0x95, 0xa5, 0x7c, 0x3b, 0xab,
0x78, 0x49, 0xdb, 0xcd, 0xdf, 0x7c, 0x72, 0xad, 0xa7, 0x1a, 0x88, 0x14,
0x6b, 0x14, 0x11, 0x10, 0x31, 0x8c, 0xa5, 0xbe, 0x67, 0x20, 0x57, 0xe8,
0x65, 0xc3, 0xe2, 0x03, 0x03, 0x6e, 0x73, 0x31, 0x08, 0x74, 0x65, 0x73,
0x74, 0x2d, 0x61, 0x6c, 0x6c, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x15,
0x00, 0x16, 0x00, 0x23, 0x00, 0x42, 0x01, 0x08, 0x08, 0x15, 0x06, 0x01,
0x03, 0x3a, 0x2d, 0x29
},
76,
{
{HSK_DNS_DS, "DS", 2, 0, 0, false, true},
{HSK_DNS_NS, "NS", 0, 3, 1, false, false},
{HSK_DNS_TXT, "TXT", 0, 3, 1, false, false},
{HSK_DNS_A, "A", 0, 3, 1, false, false}
},
0,
NULL
}
};
2 changes: 1 addition & 1 deletion test/hnsd-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void
test_decode_resource() {
printf("test_decode_resource\n");

for (int i = 0; i < 10; i++) {
for (int i = 0; i < 11; i++) {
resource_vector_t resource_vector = resource_vectors[i];

hsk_resource_t *res = NULL;
Expand Down

0 comments on commit b28d783

Please sign in to comment.