summaryrefslogtreecommitdiffstats
path: root/runtime/tests/maps/iiss.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-11-09 06:55:42 +0000
committerhunt <hunt>2005-11-09 06:55:42 +0000
commitdf27664107205cccec6eacb890d6800db7ee95cc (patch)
treef297ed4ad7011eeca4da1f58474d27cb151484f2 /runtime/tests/maps/iiss.c
parentfa3f3d4d2e3d173750685ff89a0f53f8c8a2310c (diff)
downloadsystemtap-steved-df27664107205cccec6eacb890d6800db7ee95cc.tar.gz
systemtap-steved-df27664107205cccec6eacb890d6800db7ee95cc.tar.xz
systemtap-steved-df27664107205cccec6eacb890d6800db7ee95cc.zip
2005-11-08 Martin Hunt <hunt@redhat.com>
* maps/map.test: Remove old map API tests. * maps/ii2.c: Renamed ii.c. * maps/iiss2.c: Renamed iiss.c. * maps/is2.c: Renamed is.c. * maps/issii2.c: Renamed issii.c. * maps/isx2.c: Renamed isx.c. * maps/map_format2.c: Renamed map_format.c. * maps/si2.c: Renamed si.c. * maps/keys.c: Deleted * maps/test_list_int64.c: Deleted. * maps/test_list_string.c: Deleted. * maps/sort.c: Update to use new map API.
Diffstat (limited to 'runtime/tests/maps/iiss.c')
-rw-r--r--runtime/tests/maps/iiss.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/runtime/tests/maps/iiss.c b/runtime/tests/maps/iiss.c
index 218a0806..96369d56 100644
--- a/runtime/tests/maps/iiss.c
+++ b/runtime/tests/maps/iiss.c
@@ -1,47 +1,43 @@
#include "runtime.h"
/* test of maps with keys of int64,int64,string and value of string */
-#define NEED_STRING_VALS
+#define VALUE_TYPE STRING
#define KEY1_TYPE INT64
#define KEY2_TYPE INT64
#define KEY3_TYPE STRING
-#include "map-keys.c"
+#include "map-gen.c"
#include "map.c"
int main ()
{
- MAP map = _stp_map_new_int64_int64_str(4, STRING);
+ MAP map = _stp_map_new_iiss(4);
map->wrap = 1;
- _stp_map_key_int64_int64_str (map, 1,2,"Ohio");
- _stp_map_set_str (map, "Columbus" );
- _stp_map_key_int64_int64_str (map, 3,4,"California");
- _stp_map_add_str (map, "Sacramento" );
- _stp_map_key_int64_int64_str (map, 5,6,"Washington");
- _stp_map_set_str (map, "Seattle" );
- _stp_map_key_int64_int64_str (map, 7,8,"Oregon");
- _stp_map_set_str (map, "Salem" );
+ _stp_map_set_iiss (map, 1,2,"Ohio", "Columbus" );
+ _stp_map_set_iiss (map, 3,4,"California", "Sacramento" );
+ _stp_map_set_iiss (map, 5,6,"Washington", "Seattle" );
+ _stp_map_set_iiss (map, 7,8,"Oregon", "Salem" );
+ _stp_map_print (map, "map[%1d, %2d, %3s] = %s");
+ _stp_map_set_iiss (map, -9,-10,"Nevada", "Carson City" );
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
- _stp_map_key_int64_int64_str (map, -9,-10,"Nevada");
- _stp_map_set_str (map, "Carson City" );
+ _stp_map_set_iiss (map, 5,6,"Washington", "Olymp" );
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
- _stp_map_key_int64_int64_str (map, 5,6,"Washington");
- _stp_map_set (map, "Olymp" );
+ _stp_map_add_iiss (map, 5,6,"Washington", "is" );
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
- _stp_map_add_str (map, "ia" );
+ _stp_map_set_iiss (map, 5,6,"Washington", "Olympia" );
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
- _stp_map_key_int64_int64_str (map, -9,-10,"Nevada");
- _stp_map_key_del (map);
+ /* delete */
+ _stp_map_set_iiss (map, -9,-10,"Nevada", 0);
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
- _stp_map_key_int64_int64_str (map, 0,0,"");
- _stp_map_set_str (map, "XX" );
+ /* should add nothing */
+ _stp_map_set_iiss(map, 0,0,"", "");
_stp_map_print (map, "map[%1d, %2d, %3s] = %s");
_stp_map_del (map);