From 052d76119736a4b1d90190e37f45439ca1e57393 Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 28 Oct 2005 19:20:28 +0000 Subject: 2005-10-28 Martin Hunt * maps/keys.c: New file. Tests specific to _stp_key_get_*(). * maps/iiss2.c (main): Add some comments to make clear expected results. * maps/is2.c (main): _stp_map_get_*s() now returns "" instead of NULL when lookup fails. _stp_map_set_*s() now deletes a node when setting to "" (as well as NULL). * maps/setadd.c (main): Ditto. * maps/map.test: update results. --- runtime/tests/maps/is2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/tests/maps/is2.c') diff --git a/runtime/tests/maps/is2.c b/runtime/tests/maps/is2.c index b6537f06..3008f702 100644 --- a/runtime/tests/maps/is2.c +++ b/runtime/tests/maps/is2.c @@ -41,15 +41,15 @@ int main () _stp_map_print(map,"map[%1d] = %s"); - /* check that unset values are 0 */ - if (_stp_map_get_is(map, 5)) - printf("ERROR: unset key has nonzero value\n"); + /* check that unset values are "" */ + if (*_stp_map_get_is(map, 5)) + printf("ERROR: unset key has nonempty value\n"); /* map[5] = "five" */ _stp_map_set_is (map, 5, "five"); _stp_map_print(map,"map[%1d] = %s"); - /* test empty string */ + /* test empty string (should delete)*/ _stp_map_set_is (map, 5, ""); _stp_map_print(map,"map[%1d] = %s"); -- cgit