diff options
author | hunt <hunt> | 2005-05-17 06:58:05 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-05-17 06:58:05 +0000 |
commit | ca7d122b7b3fb57d6cabdbdc5da9c1ecc60de5d8 (patch) | |
tree | 7272af5f7bfb67412fbdbfa2a9cc7f63e8fa09c3 /runtime/tests/maps/iiss.c | |
parent | e96dd1fa4e4ba81198e92f7abd340124ba126258 (diff) | |
download | systemtap-steved-ca7d122b7b3fb57d6cabdbdc5da9c1ecc60de5d8.tar.gz systemtap-steved-ca7d122b7b3fb57d6cabdbdc5da9c1ecc60de5d8.tar.xz systemtap-steved-ca7d122b7b3fb57d6cabdbdc5da9c1ecc60de5d8.zip |
Restructuring of tests. New tests for new maps.
Diffstat (limited to 'runtime/tests/maps/iiss.c')
-rw-r--r-- | runtime/tests/maps/iiss.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/runtime/tests/maps/iiss.c b/runtime/tests/maps/iiss.c new file mode 100644 index 00000000..e1ec2407 --- /dev/null +++ b/runtime/tests/maps/iiss.c @@ -0,0 +1,51 @@ +#include "runtime.h" + +/* test of maps with keys of int64,int64,string and value of string */ + +#define KEY1_TYPE INT64 +#define KEY2_TYPE INT64 +#define KEY3_TYPE STRING +#include "map-keys.c" + +#define VALUE_TYPE STRING +#include "map-values.c" + +#include "map.c" + +int main () +{ + MAP map = _stp_map_new_int64_int64_str(4, STRING); + + _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_print (map, "map"); + + _stp_map_key_int64_int64_str (map, -9,-10,"Nevada"); + _stp_map_set_str (map, "Carson City" ); + _stp_map_print (map, "map"); + + _stp_map_key_int64_int64_str (map, 5,6,"Washington"); + _stp_map_set (map, "Olymp" ); + _stp_map_print (map, "map"); + + _stp_map_add_str (map, "ia" ); + _stp_map_print (map, "map"); + + _stp_map_key_int64_int64_str (map, -9,-10,"Nevada"); + _stp_map_key_del (map); + _stp_map_print (map, "map"); + + _stp_map_key_int64_int64_str (map, 0,0,""); + _stp_map_set_str (map, "XX" ); + _stp_map_print (map, "map"); + + _stp_map_del (map); + return 0; +} |