diff options
author | David Smith <dsmith@redhat.com> | 2010-01-25 15:04:55 -0600 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2010-01-25 15:04:55 -0600 |
commit | 9f49a9853caff67bcc5de7dfe2c52ab1ae7f3738 (patch) | |
tree | a05d5fbfa56c4f35ff7d9fa4353bade8995b458b /testsuite/systemtap.base/array_string.exp | |
parent | b515db67ec9fff58d6c789e6e27c8e18ed01d6ce (diff) | |
download | systemtap-steved-9f49a9853caff67bcc5de7dfe2c52ab1ae7f3738.tar.gz systemtap-steved-9f49a9853caff67bcc5de7dfe2c52ab1ae7f3738.tar.xz systemtap-steved-9f49a9853caff67bcc5de7dfe2c52ab1ae7f3738.zip |
Fixed PR 11220 by setting MAP_STRING_LENGTH to MAXSTRINGLEN.
* runtime/map.h: Set MAP_STRING_LENGTH to MAXSTRINGLEN so that large
strings can be stored in arrays.
* testsuite/systemtap.base/array_string.exp: New testcase.
Diffstat (limited to 'testsuite/systemtap.base/array_string.exp')
-rw-r--r-- | testsuite/systemtap.base/array_string.exp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/array_string.exp b/testsuite/systemtap.base/array_string.exp new file mode 100644 index 00000000..92df1149 --- /dev/null +++ b/testsuite/systemtap.base/array_string.exp @@ -0,0 +1,45 @@ +# PR 11220. Make sure we can store large strings in arrays. + +if {![installtest_p]} { untested $test; return } + +set test "ARRAY_STRING" + +set test_script { + global str + global str_array[1] + + probe begin { + str = " 0:123456789+123456789+123456789+123456789+123456789+123456789 1:123456789+123456789+123456789+123456789+123456789+123456789 2:123456789+123456789+123456789+123456789+123456789+123456789 3:123456789+123456789+123456789+123456789+123456789+123456789 4:123456789+123456789+123456789+123456789+123456789+123456789 5:123456789+123456789+123456789+123456789+123456789+123456789 6:123456789+123456789+123456789+123456789+123456789+123456789 7:123456789+123456789+123456789+123456789+123456789+123456789" + str_array[0] = str + printf("systemtap starting probe\n") + } + + probe end { + printf("systemtap ending probe\n") + if (strlen(str) < 500) { + printf("string str is too short: %d\n", strlen(str)) + printf("%s\n", str) + } + if (strlen(str) == strlen(str_array[0])) { + printf("string lengths match\n") + } + else { + printf("string lengths *don't* match\n") + printf("str: %d\n", strlen(str)) + printf("str_array[0]: %d\n", strlen(str_array[0])) + } + if (str_array[0] == str) { + printf("strings match\n") + } + else { + printf("strings *don't* match!\n") + printf("str: %s\n", str) + printf("str_array[0]: %s\n", str_array[0]) + } + } +} + +set output "string lengths match\r\nstrings match\r\n" + +# Set MAXSTRINGLEN to 512 to be sure we're testing what we intend. +stap_run $test no_load $output -DMAXSTRINGLEN=512 -e $test_script |