diff options
author | hunt <hunt> | 2005-10-26 18:05:59 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-10-26 18:05:59 +0000 |
commit | 52c8dd37544c24ab5fa7ec79040595d3f5f41454 (patch) | |
tree | 5c262f38e45219851039c97d9d205127ce652064 /runtime/tests/maps/ssssss.c | |
parent | 09457c514acf2fb00dbe5015362695dee8270a04 (diff) | |
download | systemtap-steved-52c8dd37544c24ab5fa7ec79040595d3f5f41454.tar.gz systemtap-steved-52c8dd37544c24ab5fa7ec79040595d3f5f41454.tar.xz systemtap-steved-52c8dd37544c24ab5fa7ec79040595d3f5f41454.zip |
2005-10-26 Martin Hunt <hunt@redhat.com>
* maps/map.test: Add results for iiiiii and ssssss.
* maps/iiiiii.c: New file.
* maps/ssssss.c: New file.
Diffstat (limited to 'runtime/tests/maps/ssssss.c')
-rw-r--r-- | runtime/tests/maps/ssssss.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/runtime/tests/maps/ssssss.c b/runtime/tests/maps/ssssss.c new file mode 100644 index 00000000..1cc020b7 --- /dev/null +++ b/runtime/tests/maps/ssssss.c @@ -0,0 +1,37 @@ +#include "runtime.h" + +/* test of maps with keys 5 strings and values of string */ +#define VALUE_TYPE STRING +#define KEY1_TYPE STRING +#define KEY2_TYPE STRING +#define KEY3_TYPE STRING +#define KEY4_TYPE STRING +#define KEY5_TYPE STRING +#include "map-gen.c" + +#include "map.c" + +int main () +{ + struct map_node *ptr; + MAP map = _stp_map_new_ssssss(4); + + _stp_map_set_ssssss (map, "1ABC", "2ABC", "3ABC", "4ABC", "5ABC", "666"); + _stp_map_set_ssssss (map, "1QRS", "2QRS", "3QRS", "4QRS", "5QRS", "777"); + _stp_map_set_ssssss (map, "1abc", "2abc", "3abc", "4abc", "5abc", "888"); + _stp_map_set_ssssss (map, "1XYZ", "2XYZ", "3XYZ", "4XYZ", "5XYZ", "999"); + + foreach (map, ptr) + printf ("map[%s, %s, %s, %s, %s] = %s\n", + _stp_key_get_str(ptr,1), + _stp_key_get_str(ptr,2), + _stp_key_get_str(ptr,3), + _stp_key_get_str(ptr,4), + _stp_key_get_str(ptr,5), + _stp_get_str(ptr)); + + + _stp_map_print(map,"%1s and %2s and %3s and %4s and %5s ---> %s"); + _stp_map_del (map); + return 0; +} |