summaryrefslogtreecommitdiffstats
path: root/runtime/tests/maps/is2.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-10-28 19:20:28 +0000
committerhunt <hunt>2005-10-28 19:20:28 +0000
commit052d76119736a4b1d90190e37f45439ca1e57393 (patch)
treeff427926fa9d833f264ef0b7c4a8eca9543b6753 /runtime/tests/maps/is2.c
parent0a44d98ee3df2e6c4153208ea4c5227e78d258ea (diff)
downloadsystemtap-steved-052d76119736a4b1d90190e37f45439ca1e57393.tar.gz
systemtap-steved-052d76119736a4b1d90190e37f45439ca1e57393.tar.xz
systemtap-steved-052d76119736a4b1d90190e37f45439ca1e57393.zip
2005-10-28 Martin Hunt <hunt@redhat.com>
* 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.
Diffstat (limited to 'runtime/tests/maps/is2.c')
-rw-r--r--runtime/tests/maps/is2.c8
1 files changed, 4 insertions, 4 deletions
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");