Changeset 452 for trunk/src/cutest_zAVLTree.c
- Timestamp:
- Jun 26, 2014, 8:01:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cutest_zAVLTree.c
r366 r452 37 37 int result; 38 38 int counter = 0; 39 40 char * str; 39 41 40 42 struct ztest z1 = { "abc" , 1 }; … … 483 485 CuAssertTrue (tc, iz8.iname == 0); 484 486 487 ztest_tree = NULL; 488 str = strdup("foo"); 489 result = zAVL_string_set(&ztest_tree, str); 490 CuAssertTrue(tc, 0 == result); 491 CuAssertPtrNotNull(tc, ztest_tree); 492 CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 493 494 str = strdup("bar"); 495 result = zAVL_string_set(&ztest_tree, str); 496 CuAssertTrue(tc, 0 == result); 497 CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 498 CuAssertStrEquals(tc, "bar", zAVL_string_get(ztest_tree, "bar")); 499 500 str = strdup("balloon"); 501 result = zAVL_string_set(&ztest_tree, str); 502 CuAssertTrue(tc, 0 == result); 503 CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 504 CuAssertStrEquals(tc, "bar", zAVL_string_get(ztest_tree, "bar")); 505 CuAssertStrEquals(tc, "balloon", zAVL_string_get(ztest_tree, "balloon")); 506 507 str = zAVL_string_get(ztest_tree, "foobar"); 508 CuAssertTrue(tc, str == NULL); 509 str = zAVL_string_get(ztest_tree, ""); 510 CuAssertTrue(tc, str == NULL); 511 str = zAVL_string_get(ztest_tree, NULL); 512 CuAssertTrue(tc, str == NULL); 513 514 zAVL_string_reset(ztest_tree); 515 str = zAVL_string_get(ztest_tree, "foo"); 516 CuAssertTrue(tc, str == NULL); 517 str = zAVL_string_get(ztest_tree, "bar"); 518 CuAssertTrue(tc, str == NULL); 519 str = zAVL_string_get(ztest_tree, "balloon"); 520 CuAssertTrue(tc, str == NULL); 485 521 486 522 }
Note:
See TracChangeset
for help on using the changeset viewer.