From 80225b08cdda44cf1a764361131eef122f8c9451 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 4 Mar 2011 15:13:12 -0800 Subject: Added unit test 1306 so tests 558 & 559 are now fully replaced --- tests/data/Makefile.am | 2 +- tests/data/test1305 | 6 +++++- tests/data/test1306 | 30 ++++++++++++++++++++++++++++++ tests/unit/unit1305.c | 23 +++++++++++++---------- 4 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 tests/data/test1306 (limited to 'tests') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 2967e7cf6..c925d0ee0 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -70,7 +70,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \ test313 test1115 test578 test579 test1116 test1200 test1201 test1202 \ test1203 test1117 test1118 test1119 test1120 test1300 test1301 test1302 \ test1303 test320 test321 test322 test323 test324 test1121 test581 test580 \ - test1304 test1305 + test1304 test1305 test1306 filecheck: @mkdir test-place; \ diff --git a/tests/data/test1305 b/tests/data/test1305 index 4efe321e1..91149b3ad 100644 --- a/tests/data/test1305 +++ b/tests/data/test1305 @@ -1,4 +1,5 @@ + unittest @@ -16,11 +17,14 @@ none unittest -internal hash create/add/destroy testing +internal hash create/destroy testing unit1305 + +1305 + diff --git a/tests/data/test1306 b/tests/data/test1306 new file mode 100644 index 000000000..b490efb51 --- /dev/null +++ b/tests/data/test1306 @@ -0,0 +1,30 @@ + + + + +unittest +hash + + + +# +# Client-side + + +none + + +unittest + + +internal hash create/add/destroy testing + + +unit1305 + + +1306 + + + + diff --git a/tests/unit/unit1305.c b/tests/unit/unit1305.c index bcf7c43ff..ab41a7dc5 100644 --- a/tests/unit/unit1305.c +++ b/tests/unit/unit1305.c @@ -117,15 +117,18 @@ UNITTEST_START struct Curl_dns_entry *nodep; size_t key_len; - CURLcode rc = create_node(); - abort_unless(rc == CURLE_OK, "data node creation failed"); - key_len = strlen(data_key); - - nodep = Curl_hash_add(hp, data_key, key_len+1, data_node); - abort_unless(nodep, "insertion into hash failed"); - /* Freeing will now be done by Curl_hash_destroy */ - data_node = NULL; - - /* To do: test retrieval, deletion, edge conditions */ + /* Test 1305 exits without adding anything to the hash */ + if (strcmp(arg, "1305") != 0) { + CURLcode rc = create_node(); + abort_unless(rc == CURLE_OK, "data node creation failed"); + key_len = strlen(data_key); + + nodep = Curl_hash_add(hp, data_key, key_len+1, data_node); + abort_unless(nodep, "insertion into hash failed"); + /* Freeing will now be done by Curl_hash_destroy */ + data_node = NULL; + + /* To do: test retrieval, deletion, edge conditions */ + } UNITTEST_STOP -- cgit v1.2.3