diff --git a/src/test/tests_dict.can b/src/test/tests_dict.can deleted file mode 100644 index bbea0b58..00000000 --- a/src/test/tests_dict.can +++ /dev/null @@ -1,85 +0,0 @@ -TESTPROG tests_dict START -TESTCASE tests_dict:tst_create BEGIN - tests_dict:tst_create: getdns_dict_create - tests_dict:tst_create: getdns_dict_destroy(dict) - tests_dict:tst_create: getdns_dict_destroy(NULL) -TESTCASE tests_dict:tst_create END -TESTCASE tests_dict:tst_bindatasetget BEGIN - tests_dict:tst_bindatasetget: getdns_dict_get_bindata() empty dict - tests_dict:tst_bindatasetget: line 61: getdns_dict_get_bindata(NULL, key, &ans_bdata),retval = 305 - tests_dict:tst_bindatasetget: line 65: getdns_dict_get_bindata(dict, key, NULL),retval = 305 - tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, NULL, &ans_bindata) - tests_dict:tst_bindatasetget: line 70: getdns_dict_get_bindata,retval = 305 - tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, key, &ans_bdata) - tests_dict:tst_bindatasetget: line 75: getdns_list_get_bindata,retval = 305 - tests_dict:tst_bindatasetget: getdns_dict_set_bindata(dict, key, bindata) - tests_dict:tst_bindatasetget: line 93: getdns_dict_set_bindata,retval=0,key=foo - tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, key, &ans_bdata) - tests_dict:tst_bindatasetget: line 98: getdns_dict_get_bindata,retval=0,key=foo,data=foobar -TESTCASE tests_dict:tst_bindatasetget END -TESTCASE tests_dict:tst_dictsetget BEGIN - tests_dict:tst_dictsetget: getdns_dict_get_dict() empty dict - tests_dict:tst_dictsetget: line 136: getdns_dict_get_dict(NULL, key, &ansdict),retval = 305 - tests_dict:tst_dictsetget: line 140: getdns_dict_get_dict(dict, key, NULL),retval = 305 - tests_dict:tst_dictsetget: getdns_dict_get_dict(dict, NULL, &ansdict) - tests_dict:tst_dictsetget: line 145: getdns_dict_get_dict,retval = 305 - tests_dict:tst_dictsetget: getdns_dict_get_dict(dict, key, &ansdict) - tests_dict:tst_dictsetget: line 150: getdns_list_get_dict,retval = 305 - tests_dict:tst_dictsetget: getdns_dict_set_dict(dict, key, newdict) - tests_dict:tst_dictsetget: line 168: getdns_dict_set_dict,retval=0,key=foo - tests_dict:tst_dictsetget: getdns_dict_get_dict(dict, key, &ansdict) - tests_dict:tst_dictsetget: line 177: getdns_dict_get_dict,retval=0,key=foo,int1=42,int2=52 -TESTCASE tests_dict:tst_dictsetget END -TESTCASE tests_dict:tst_intsetget BEGIN - tests_dict:tst_intsetget: getdns_dict_get_int() empty dict - tests_dict:tst_intsetget: line 375: getdns_dict_get_int(NULL, key, &ans_int),retval = 305 - tests_dict:tst_intsetget: line 379: getdns_dict_get_int(dict, key, NULL),retval = 305 - tests_dict:tst_intsetget: getdns_dict_get_int(dict, NULL, &ans_int) - tests_dict:tst_intsetget: line 384: getdns_dict_get_int,retval = 305 - tests_dict:tst_intsetget: getdns_dict_get_int(dict, key, &ans_int) - tests_dict:tst_intsetget: line 389: getdns_list_get_int,retval = 305 - tests_dict:tst_intsetget: getdns_dict_set_int(dict, key, newint) - tests_dict:tst_intsetget: line 405: getdns_dict_set_int,retval=0,key=foo,int=42 - tests_dict:tst_intsetget: getdns_dict_get_int(dict, key, &ans_int) - tests_dict:tst_intsetget: line 410: getdns_dict_get_int,retval=0,key=foo,int=42 - tests_dict:tst_intsetget: getdns_dict_set_int(dict, key, newint) - tests_dict:tst_intsetget: line 417: getdns_dict_set_int,retval=0,key=bar,int=52 - tests_dict:tst_intsetget: getdns_dict_get_int(dict, key, &ans_int) - tests_dict:tst_intsetget: line 422: getdns_dict_get_int,retval=0,key=bar,int=52 - tests_dict:tst_intsetget: getdns_dict_get_data_type(dict, key, &dtype) - tests_dict:tst_intsetget: line 427: getdns_dict_get_data_type,retval=0,key=bar,dtype=2 -TESTCASE tests_dict:tst_intsetget END -TESTCASE tests_dict:tst_listsetget BEGIN - tests_dict:tst_listsetget: getdns_dict_get_list() empty dict - tests_dict:tst_listsetget: line 297: getdns_dict_get_list(NULL, key, &anslist),retval = 305 - tests_dict:tst_listsetget: line 301: getdns_dict_get_list(dict, key, NULL),retval = 305 - tests_dict:tst_listsetget: getdns_dict_get_list(dict, NULL, &anslist) - tests_dict:tst_listsetget: line 306: getdns_dict_get_list,retval = 305 - tests_dict:tst_listsetget: getdns_dict_get_list(dict, key, &anslist) - tests_dict:tst_listsetget: line 311: getdns_list_get_list,retval = 305 - tests_dict:tst_listsetget: getdns_dict_set_list(dict, key, newlist) - tests_dict:tst_listsetget: line 331: getdns_dict_set_list,retval=0,key=foo - tests_dict:tst_listsetget: getdns_dict_get_list(dict, key, &anslist) - tests_dict:tst_listsetget: line 340: getdns_dict_get_list,retval=0,key=foo,int1=42,int2=52 -TESTCASE tests_dict:tst_listsetget END -TESTCASE tests_dict:tst_getnames BEGIN - tests_dict:tst_getnames: getdns_dict_get_names(NULL, &list) - tests_dict:tst_getnames: getdns_dict_get_names(dict, NULL) - tests_dict:tst_getnames: getdns_dict_get_names(dict, &list), empty dictionary - list item 0: t_int, value=3 - list item 1: t_int, value=1 - list item 2: t_int, value=0 - list item 3: t_int, value=2 -TESTCASE tests_dict:tst_getnames END -TESTCASE tests_dict:tst_copy BEGIN - tests_dict:tst_copy: empty list cases - tests_dict:tst_copy: dict1 populate -key="bar", type="int", value="52" -key="foo", type="int", value="42" -key="quz", type="int", value="62" - tests_dict:tst_copy: getdns_dict_copy(dict1, &dict2) -key="bar", type="int", value="52" -key="foo", type="int", value="42" -key="quz", type="int", value="62" -TESTCASE tests_dict:tst_copy END -TESTPROG tests_dict END diff --git a/src/test/tests_dict.good b/src/test/tests_dict.good index f7be44a1..eacb45ae 100644 --- a/src/test/tests_dict.good +++ b/src/test/tests_dict.good @@ -6,12 +6,12 @@ TESTCASE tests_dict:tst_create BEGIN TESTCASE tests_dict:tst_create END TESTCASE tests_dict:tst_bindatasetget BEGIN tests_dict:tst_bindatasetget: getdns_dict_get_bindata() empty dict - tests_dict:tst_bindatasetget: test 1: getdns_dict_get_bindata(NULL, key, &ans_bdata),retval = 305 - tests_dict:tst_bindatasetget: test 2: getdns_dict_get_bindata(dict, key, NULL),retval = 305 + tests_dict:tst_bindatasetget: test 1: getdns_dict_get_bindata(NULL, key, &ans_bdata),retval = 311 + tests_dict:tst_bindatasetget: test 2: getdns_dict_get_bindata(dict, key, NULL),retval = 311 tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, NULL, &ans_bindata) - tests_dict:tst_bindatasetget: test 3: getdns_dict_get_bindata,retval = 305 + tests_dict:tst_bindatasetget: test 3: getdns_dict_get_bindata,retval = 311 tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, key, &ans_bdata) - tests_dict:tst_bindatasetget: test 4: getdns_list_get_bindata,retval = 306 + tests_dict:tst_bindatasetget: test 4: getdns_list_get_bindata,retval = 305 tests_dict:tst_bindatasetget: getdns_dict_set_bindata(dict, key, bindata) tests_dict:tst_bindatasetget: test 5: getdns_dict_set_bindata,retval=0,key=foo tests_dict:tst_bindatasetget: getdns_dict_get_bindata(dict, key, &ans_bdata) @@ -19,10 +19,10 @@ TESTCASE tests_dict:tst_bindatasetget BEGIN TESTCASE tests_dict:tst_bindatasetget END TESTCASE tests_dict:tst_dictsetget BEGIN tests_dict:tst_dictsetget: getdns_dict_get_dict() empty dict - tests_dict:tst_dictsetget: test 7: getdns_dict_get_dict(NULL, key, &ansdict),retval = 305 - tests_dict:tst_dictsetget: test 8: getdns_dict_get_dict(dict, key, NULL),retval = 305 + tests_dict:tst_dictsetget: test 7: getdns_dict_get_dict(NULL, key, &ansdict),retval = 311 + tests_dict:tst_dictsetget: test 8: getdns_dict_get_dict(dict, key, NULL),retval = 311 tests_dict:tst_dictsetget: getdns_dict_get_dict(dict, NULL, &ansdict) - tests_dict:tst_dictsetget: test 9: getdns_dict_get_dict,retval = 305 + tests_dict:tst_dictsetget: test 9: getdns_dict_get_dict,retval = 311 tests_dict:tst_dictsetget: getdns_dict_get_dict(dict, key, &ansdict) tests_dict:tst_dictsetget: test 10: getdns_list_get_dict,retval = 305 tests_dict:tst_dictsetget: getdns_dict_set_dict(dict, key, newdict) @@ -32,12 +32,12 @@ TESTCASE tests_dict:tst_dictsetget BEGIN TESTCASE tests_dict:tst_dictsetget END TESTCASE tests_dict:tst_intsetget BEGIN tests_dict:tst_intsetget: getdns_dict_get_int() empty dict - tests_dict:tst_intsetget: test 19: getdns_dict_get_int(NULL, key, &ans_int),retval = 305 - tests_dict:tst_intsetget: test 20: getdns_dict_get_int(dict, key, NULL),retval = 305 + tests_dict:tst_intsetget: test 19: getdns_dict_get_int(NULL, key, &ans_int),retval = 311 + tests_dict:tst_intsetget: test 20: getdns_dict_get_int(dict, key, NULL),retval = 311 tests_dict:tst_intsetget: getdns_dict_get_int(dict, NULL, &ans_int) - tests_dict:tst_intsetget: test 21: getdns_dict_get_int,retval = 305 + tests_dict:tst_intsetget: test 21: getdns_dict_get_int,retval = 311 tests_dict:tst_intsetget: getdns_dict_get_int(dict, key, &ans_int) - tests_dict:tst_intsetget: test 22: getdns_list_get_int,retval = 306 + tests_dict:tst_intsetget: test 22: getdns_list_get_int,retval = 305 tests_dict:tst_intsetget: getdns_dict_set_int(dict, key, newint) tests_dict:tst_intsetget: test 23: getdns_dict_set_int,retval=0,key=foo,int=42 tests_dict:tst_intsetget: getdns_dict_get_int(dict, key, &ans_int) @@ -51,12 +51,12 @@ TESTCASE tests_dict:tst_intsetget BEGIN TESTCASE tests_dict:tst_intsetget END TESTCASE tests_dict:tst_listsetget BEGIN tests_dict:tst_listsetget: getdns_dict_get_list() empty dict - tests_dict:tst_listsetget: test 13: getdns_dict_get_list(NULL, key, &anslist),retval = 305 - tests_dict:tst_listsetget: test 14: getdns_dict_get_list(dict, key, NULL),retval = 305 + tests_dict:tst_listsetget: test 13: getdns_dict_get_list(NULL, key, &anslist),retval = 311 + tests_dict:tst_listsetget: test 14: getdns_dict_get_list(dict, key, NULL),retval = 311 tests_dict:tst_listsetget: getdns_dict_get_list(dict, NULL, &anslist) - tests_dict:tst_listsetget: test 15: getdns_dict_get_list,retval = 305 + tests_dict:tst_listsetget: test 15: getdns_dict_get_list,retval = 311 tests_dict:tst_listsetget: getdns_dict_get_list(dict, key, &anslist) - tests_dict:tst_listsetget: test 16: getdns_list_get_list,retval = 306 + tests_dict:tst_listsetget: test 16: getdns_list_get_list,retval = 305 tests_dict:tst_listsetget: getdns_dict_set_list(dict, key, newlist) tests_dict:tst_listsetget: test 17: getdns_dict_set_list,retval=0,key=foo tests_dict:tst_listsetget: getdns_dict_get_list(dict, key, &anslist) diff --git a/src/test/tests_list.can b/src/test/tests_list.can deleted file mode 100644 index e4866ebb..00000000 --- a/src/test/tests_list.can +++ /dev/null @@ -1,78 +0,0 @@ -TESTPROG tests_list START -TESTCASE tests_list:tst_create BEGIN - tests_list:tst_create: getdns_list_create - tests_list:tst_create: getdns_list_destroy(list) - tests_list:tst_create: getdns_list_destroy(NULL) - tests_list:tst_create: getdns_add_item(list) past block size - tests_list:tst_create: getdns_list_get_length(list) - tests_list:tst_create: list length = 12 - tests_list:tst_create: getdns_list_get_length() - tests_list:tst_create: NUll, &i, retval = 304 - tests_list:tst_create: NUll, NULL, retval = 304 - tests_list:tst_create: list, NULL, retval = 304 -TESTCASE tests_list:tst_create END -TESTCASE tests_list:tst_bindatasetget BEGIN - tests_list:tst_bindatasetget: getdns_list_get_bindata() empty list - tests_list:tst_bindatasetget: getdns_list_get_bindata(NULL, index, &ans_bindata),retval = 304 - tests_list:tst_bindatasetget: getdns_list_get_bindata(list, index, NULL),retval = 304 - tests_list:tst_bindatasetget: getdns_list_get_bindata(list, 0, &ans_bindata) - tests_list:tst_bindatasetget: getdns_list_get_bindata,retval = 304 - tests_list:tst_bindatasetget: getdns_list_get_bindata(list, 1, &ans_bindata) - tests_list:tst_bindatasetget: getdns_list_get_bindata,retval = 304 - tests_list:tst_bindatasetget: getdns_list_set_bindata() empty list - tests_list:tst_bindatasetget: getdns_list_set_bindata(NULL, index, ans_bindata),retval = 304 - tests_list:tst_bindatasetget: getdns_list_set_bindata(list, 0, ans_bindata) - tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 304 - tests_list:tst_bindatasetget: getdns_list_set_bindata(list, 1, ans_bindata) - tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 304 - tests_list:tst_bindatasetget: getdns_list_set/get_bindata,retval = 0, bindata->data = 7,foobar -TESTCASE tests_list:tst_bindatasetget END -TESTCASE tests_list:tst_dictsetget BEGIN - tests_list:tst_dictsetget: getdns_list_get_dict() empty list - tests_list:tst_dictsetget: getdns_list_get_dict(NULL, index, &dict),retval = 304 - tests_list:tst_dictsetget: getdns_list_get_dict(list, index, NULL),retval = 304 - tests_list:tst_dictsetget: getdns_list_get_dict(list, 0, &dict) - tests_list:tst_dictsetget: getdns_list_get_dict,retval = 304 - tests_list:tst_dictsetget: getdns_list_get_dict(list, 1, &dict) - tests_list:tst_dictsetget: getdns_list_get_dict,retval = 304 - tests_list:tst_dictsetget: getdns_list_set_dict() empty list - tests_list:tst_dictsetget: getdns_list_set_dict(NULL, index, dict),retval = 304 - tests_list:tst_dictsetget: getdns_list_set_dict(list, 0, dict) - tests_list:tst_dictsetget: getdns_list_set_dict,retval = 304 - tests_list:tst_dictsetget: getdns_list_set_dict(list, 1, dict) - tests_list:tst_dictsetget: getdns_list_set_dict,retval = 304 - tests_list:tst_dictsetget: getdns_list_set/get_dict,retval=0, ans=42 -TESTCASE tests_list:tst_dictsetget END -TESTCASE tests_list:tst_intsetget BEGIN - tests_list:tst_intsetget: getdns_list_get_int() empty list - tests_list:tst_intsetget: getdns_list_get_int(NULL, index, &ans_int),retval = 304 - tests_list:tst_intsetget: getdns_list_get_int(list, index, NULL),retval = 304 - tests_list:tst_intsetget: getdns_list_get_int(list, 0, &ans_int) - tests_list:tst_intsetget: getdns_list_get_int,retval = 304 - tests_list:tst_intsetget: getdns_list_get_int(list, 1, &ans_int) - tests_list:tst_intsetget: getdns_list_get_int,retval = 304 - tests_list:tst_intsetget: getdns_list_set_int() empty list - tests_list:tst_intsetget: getdns_list_set_int(NULL, index, ans_int),retval = 304 - tests_list:tst_intsetget: getdns_list_set_int(list, 0, ans_int) - tests_list:tst_intsetget: getdns_list_set_int,retval = 304 - tests_list:tst_intsetget: getdns_list_set_int(list, 1, ans_int) - tests_list:tst_intsetget: getdns_list_set_int,retval = 304 - tests_list:tst_intsetget: getdns_list_set/get_int,retval = 0, ans = 42 -TESTCASE tests_list:tst_intsetget END -TESTCASE tests_list:tst_listsetget BEGIN - tests_list:tst_listsetget: getdns_list_get_list() empty list - tests_list:tst_listsetget: getdns_list_get_list(NULL, index, &ans_list),retval = 304 - tests_list:tst_listsetget: getdns_list_get_list(list, index, NULL),retval = 304 - tests_list:tst_listsetget: getdns_list_get_list(list, 0, &ans_list) - tests_list:tst_listsetget: getdns_list_get_list,retval = 304 - tests_list:tst_listsetget: getdns_list_get_list(list, 1, &ans_list) - tests_list:tst_listsetget: getdns_list_get_list,retval = 304 - tests_list:tst_listsetget: getdns_list_set_list() empty list - tests_list:tst_listsetget: getdns_list_set_list(NULL, index, ans_list),retval = 304 - tests_list:tst_listsetget: getdns_list_set_list(list, 0, ans_list) - tests_list:tst_listsetget: getdns_list_set_list,retval = 304 - tests_list:tst_listsetget: getdns_list_set_list(list, 1, ans_list) - tests_list:tst_listsetget: getdns_list_set_list,retval = 304 - tests_list:tst_listsetget: getdns_list_set/get_list,retval = 0, ans[0] = 42 -TESTCASE tests_list:tst_listsetget END -TESTPROG tests_list END diff --git a/src/test/tests_list.good b/src/test/tests_list.good index 009e66be..ef12bd8c 100644 --- a/src/test/tests_list.good +++ b/src/test/tests_list.good @@ -3,40 +3,36 @@ TESTCASE tests_list:tst_create BEGIN tests_list:tst_create: getdns_list_create tests_list:tst_create: getdns_list_destroy(list) tests_list:tst_create: getdns_list_destroy(NULL) - tests_list:tst_create: getdns_add_item(list) past block size + tests_list:tst_create: getdns_list_set_int(list, i) past block size tests_list:tst_create: getdns_list_get_length(list) tests_list:tst_create: list length = 12 tests_list:tst_create: getdns_list_get_length() - tests_list:tst_create: NUll, 12, retval = 304 - tests_list:tst_create: NUll, NULL, retval = 304 - tests_list:tst_create: list, NULL, retval = 304 + tests_list:tst_create: NUll, 12, retval = 311 + tests_list:tst_create: NUll, NULL, retval = 311 + tests_list:tst_create: list, NULL, retval = 311 TESTCASE tests_list:tst_create END TESTCASE tests_list:tst_bindatasetget BEGIN tests_list:tst_bindatasetget: getdns_list_get_bindata() empty list - tests_list:tst_bindatasetget: getdns_list_get_bindata(NULL, index, &ans_bindata),retval = 304 - tests_list:tst_bindatasetget: getdns_list_get_bindata(list, index, NULL),retval = 304 + tests_list:tst_bindatasetget: getdns_list_get_bindata(NULL, index, &ans_bindata),retval = 311 + tests_list:tst_bindatasetget: getdns_list_get_bindata(list, index, NULL),retval = 311 tests_list:tst_bindatasetget: getdns_list_get_bindata(list, 0, &ans_bindata) tests_list:tst_bindatasetget: getdns_list_get_bindata,retval = 304 tests_list:tst_bindatasetget: getdns_list_get_bindata(list, 1, &ans_bindata) tests_list:tst_bindatasetget: getdns_list_get_bindata,retval = 304 - tests_list:tst_bindatasetget: getdns_list_set_bindata() empty list - tests_list:tst_bindatasetget: getdns_list_set_bindata(NULL, index, ans_bindata),retval = 304 - tests_list:tst_bindatasetget: getdns_list_set_bindata(list, 0, ans_bindata) - tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 304 + tests_list:tst_bindatasetget: getdns_list_set_bindata(list, -1, ans_bindata) + tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 311 tests_list:tst_bindatasetget: getdns_list_set_bindata(list, 1, ans_bindata) - tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 304 + tests_list:tst_bindatasetget: getdns_list_set_bindata,retval = 311 tests_list:tst_bindatasetget: getdns_list_set/get_bindata,retval = 0, bindata->data = 7,foobar TESTCASE tests_list:tst_bindatasetget END TESTCASE tests_list:tst_dictsetget BEGIN tests_list:tst_dictsetget: getdns_list_get_dict() empty list - tests_list:tst_dictsetget: getdns_list_get_dict(NULL, index, &dict),retval = 304 - tests_list:tst_dictsetget: getdns_list_get_dict(list, index, NULL),retval = 304 + tests_list:tst_dictsetget: getdns_list_get_dict(NULL, index, &dict),retval = 311 + tests_list:tst_dictsetget: getdns_list_get_dict(list, index, NULL),retval = 311 tests_list:tst_dictsetget: getdns_list_get_dict(list, 0, &dict) tests_list:tst_dictsetget: getdns_list_get_dict,retval = 304 tests_list:tst_dictsetget: getdns_list_get_dict(list, 1, &dict) tests_list:tst_dictsetget: getdns_list_get_dict,retval = 304 - tests_list:tst_dictsetget: getdns_list_set_dict() empty list - tests_list:tst_dictsetget: getdns_list_set_dict(NULL, index, dict),retval = 304 tests_list:tst_dictsetget: getdns_list_set_dict(list, 0, dict) tests_list:tst_dictsetget: getdns_list_set_dict,retval = 304 tests_list:tst_dictsetget: getdns_list_set_dict(list, 1, dict) @@ -45,15 +41,13 @@ TESTCASE tests_list:tst_dictsetget BEGIN TESTCASE tests_list:tst_dictsetget END TESTCASE tests_list:tst_intsetget BEGIN tests_list:tst_intsetget: getdns_list_get_int() empty list - tests_list:tst_intsetget: getdns_list_get_int(NULL, index, &ans_int),retval = 304 - tests_list:tst_intsetget: getdns_list_get_int(list, index, NULL),retval = 304 + tests_list:tst_intsetget: getdns_list_get_int(NULL, index, &ans_int),retval = 311 + tests_list:tst_intsetget: getdns_list_get_int(list, index, NULL),retval = 311 tests_list:tst_intsetget: getdns_list_get_int(list, 0, &ans_int) tests_list:tst_intsetget: getdns_list_get_int,retval = 304 tests_list:tst_intsetget: getdns_list_get_int(list, 1, &ans_int) tests_list:tst_intsetget: getdns_list_get_int,retval = 304 - tests_list:tst_intsetget: getdns_list_set_int() empty list - tests_list:tst_intsetget: getdns_list_set_int(NULL, index, ans_int),retval = 304 - tests_list:tst_intsetget: getdns_list_set_int(list, 0, ans_int) + tests_list:tst_intsetget: getdns_list_set_int(list, -1, ans_int) tests_list:tst_intsetget: getdns_list_set_int,retval = 304 tests_list:tst_intsetget: getdns_list_set_int(list, 1, ans_int) tests_list:tst_intsetget: getdns_list_set_int,retval = 304 @@ -61,18 +55,16 @@ TESTCASE tests_list:tst_intsetget BEGIN TESTCASE tests_list:tst_intsetget END TESTCASE tests_list:tst_listsetget BEGIN tests_list:tst_listsetget: getdns_list_get_list() empty list - tests_list:tst_listsetget: getdns_list_get_list(NULL, index, &ans_list),retval = 304 - tests_list:tst_listsetget: getdns_list_get_list(list, index, NULL),retval = 304 + tests_list:tst_listsetget: getdns_list_get_list(NULL, index, &ans_list),retval = 311 + tests_list:tst_listsetget: getdns_list_get_list(list, index, NULL),retval = 311 tests_list:tst_listsetget: getdns_list_get_list(list, 0, &ans_list) tests_list:tst_listsetget: getdns_list_get_list,retval = 304 tests_list:tst_listsetget: getdns_list_get_list(list, 1, &ans_list) tests_list:tst_listsetget: getdns_list_get_list,retval = 304 - tests_list:tst_listsetget: getdns_list_set_list() empty list - tests_list:tst_listsetget: getdns_list_set_list(NULL, index, ans_list),retval = 304 - tests_list:tst_listsetget: getdns_list_set_list(list, 0, ans_list) - tests_list:tst_listsetget: getdns_list_set_list,retval = 304 + tests_list:tst_listsetget: getdns_list_set_list(list, -1, ans_list) + tests_list:tst_listsetget: getdns_list_set_list,retval = 311 tests_list:tst_listsetget: getdns_list_set_list(list, 1, ans_list) - tests_list:tst_listsetget: getdns_list_set_list,retval = 304 + tests_list:tst_listsetget: getdns_list_set_list,retval = 311 tests_list:tst_listsetget: getdns_list_set/get_list,retval = 0, ans[0] = 42 TESTCASE tests_list:tst_listsetget END TESTPROG tests_list END diff --git a/src/test/tests_stub_async.good b/src/test/tests_stub_async.good index 6f90de20..9e953d57 100644 --- a/src/test/tests_stub_async.good +++ b/src/test/tests_stub_async.good @@ -1,15 +1,41 @@ { "answer_type": 800, - "canonical_name": , + "canonical_name": , "just_address_answers": [ - , - , - + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + } ], "replies_full": [ - + , + ], "replies_tree": [ @@ -19,53 +45,142 @@ [ { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 300, - "type": 1 + "ttl": 227, + "type": GETDNS_RRTYPE_A }, { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 300, - "type": 1 + "ttl": 227, + "type": GETDNS_RRTYPE_A }, { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 300, - "type": 1 + "ttl": 227, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 227, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 227, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 227, + "type": GETDNS_RRTYPE_A } ], "answer_type": 800, "authority": [], - "canonical_name": , + "canonical_name": , "header": { + "aa": 0, + "ad": 0, + "ancount": 6, + "arcount": 0, + "cd": 0, "id": 0, + "nscount": 0, "opcode": 0, - "qr": 1 + "qdcount": 1, + "qr": 1, + "ra": 1, + "rcode": 0, + "rd": 1, + "tc": 0, + "z": 0 }, "question": { "qclass": 1, - "qname": , + "qname": , "qtype": 1 } + }, + { + "additional": [], + "answer": + [ + { + "class": 1, + "name": , + "rdata": + { + "ipv6_address": , + "rdata_raw": + }, + "ttl": 136, + "type": GETDNS_RRTYPE_AAAA + } + ], + "answer_type": 800, + "authority": [], + "canonical_name": , + "header": + { + "aa": 0, + "ad": 0, + "ancount": 1, + "arcount": 0, + "cd": 0, + "id": 0, + "nscount": 0, + "opcode": 0, + "qdcount": 1, + "qr": 1, + "ra": 1, + "rcode": 0, + "rd": 1, + "tc": 0, + "z": 0 + }, + "question": + { + "qclass": 1, + "qname": , + "qtype": 28 + } } ], "status": 900 diff --git a/src/test/tests_stub_sync.good b/src/test/tests_stub_sync.good index f736c265..1f7f69b0 100644 --- a/src/test/tests_stub_sync.good +++ b/src/test/tests_stub_sync.good @@ -1,15 +1,41 @@ The packet { "answer_type": 800, - "canonical_name": , + "canonical_name": , "just_address_answers": [ - , - , - + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + }, + { + "address_data": , + "address_type": + } ], "replies_full": [ - + , + ], "replies_tree": [ @@ -19,60 +45,149 @@ The packet { [ { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 264, - "type": 1 + "ttl": 300, + "type": GETDNS_RRTYPE_A }, { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 264, - "type": 1 + "ttl": 300, + "type": GETDNS_RRTYPE_A }, { "class": 1, - "name": , + "name": , "rdata": { - "ipv4_address": , - "rdata_raw": + "ipv4_address": , + "rdata_raw": }, - "ttl": 264, - "type": 1 + "ttl": 300, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 300, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 300, + "type": GETDNS_RRTYPE_A + }, + { + "class": 1, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 300, + "type": GETDNS_RRTYPE_A } ], "answer_type": 800, "authority": [], - "canonical_name": , + "canonical_name": , "header": { + "aa": 0, + "ad": 0, + "ancount": 6, + "arcount": 0, + "cd": 0, "id": 0, + "nscount": 0, "opcode": 0, - "qr": 1 + "qdcount": 1, + "qr": 1, + "ra": 1, + "rcode": 0, + "rd": 1, + "tc": 0, + "z": 0 }, "question": { "qclass": 1, - "qname": , + "qname": , "qtype": 1 } + }, + { + "additional": [], + "answer": + [ + { + "class": 1, + "name": , + "rdata": + { + "ipv6_address": , + "rdata_raw": + }, + "ttl": 300, + "type": GETDNS_RRTYPE_AAAA + } + ], + "answer_type": 800, + "authority": [], + "canonical_name": , + "header": + { + "aa": 0, + "ad": 0, + "ancount": 1, + "arcount": 0, + "cd": 0, + "id": 0, + "nscount": 0, + "opcode": 0, + "qdcount": 1, + "qr": 1, + "ra": 1, + "rcode": 0, + "rd": 1, + "tc": 0, + "z": 0 + }, + "question": + { + "qclass": 1, + "qname": , + "qtype": 28 + } } ], "status": 900 } The packet { "answer_type": 800, - "canonical_name": , + "canonical_name": , "just_address_answers": [], "replies_full": [ @@ -88,26 +203,44 @@ The packet { [ { "class": 1, - "name": , + "name": , "rdata": { - "rdata_raw": + "expire": 300, + "mname": , + "rdata_raw": , + "refresh": 1800, + "retry": 1209600, + "rname": , + "serial": 1546121 }, - "ttl": 40, - "type": 6 + "ttl": 60, + "type": GETDNS_RRTYPE_SOA } ], - "canonical_name": , + "canonical_name": , "header": { + "aa": 0, + "ad": 0, + "ancount": 0, + "arcount": 0, + "cd": 0, "id": 0, + "nscount": 1, "opcode": 0, - "qr": 1 + "qdcount": 1, + "qr": 1, + "ra": 1, + "rcode": 0, + "rd": 1, + "tc": 0, + "z": 0 }, "question": { "qclass": 1, - "qname": , + "qname": , "qtype": 33 } } diff --git a/src/test/testscript.sh b/src/test/testscript.sh index bfd7c5de..99f823f5 100755 --- a/src/test/testscript.sh +++ b/src/test/testscript.sh @@ -42,6 +42,12 @@ checkpacket () { diffit output2 output2.good } +echo "./check_getdns" +./check_getdns +if test $? -ne 0; then + echo " failed (unit test execution failed)" + exit 1 +fi checkoutput tests_dict checkoutput tests_list checkpacket tests_stub_async