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/iiiiii.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/iiiiii.c')
-rw-r--r-- | runtime/tests/maps/iiiiii.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/runtime/tests/maps/iiiiii.c b/runtime/tests/maps/iiiiii.c new file mode 100644 index 00000000..a5eeef70 --- /dev/null +++ b/runtime/tests/maps/iiiiii.c @@ -0,0 +1,36 @@ +#include "runtime.h" + +/* test of maps with 5 keys of int64 and value of int64 */ +#define VALUE_TYPE INT64 +#define KEY1_TYPE INT64 +#define KEY2_TYPE INT64 +#define KEY3_TYPE INT64 +#define KEY4_TYPE INT64 +#define KEY5_TYPE INT64 +#include "map-gen.c" + +#include "map.c" + +int main () +{ + struct map_node *ptr; + MAP map = _stp_map_new_iiiiii(4); + + _stp_map_set_iiiiii (map,1,2,3,4,5, 10); + _stp_map_set_iiiiii (map,10,20,30,40,50, 100); + _stp_map_set_iiiiii (map,-1,-2,-3,-4,-5, -10); + _stp_map_set_iiiiii (map,100,200,300,400,500, 1000); + + foreach (map, ptr) + printf ("map[%lld, %lld, %lld, %lld, %lld] = %lld\n", + _stp_key_get_int64(ptr,1), + _stp_key_get_int64(ptr,2), + _stp_key_get_int64(ptr,3), + _stp_key_get_int64(ptr,4), + _stp_key_get_int64(ptr,5), + _stp_get_int64(ptr)); + + _stp_map_print(map,"%1d - %2d - %3d - %4d - %5d *** %d"); + _stp_map_del (map); + return 0; +} |