diff options
author | hunt <hunt> | 2005-05-19 05:25:26 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-05-19 05:25:26 +0000 |
commit | 7edfd9e24568502f54175b08da4168f2af6642fe (patch) | |
tree | aa2d578a4d7d99fef111a179e51a90198be0f2c1 /runtime/tests/string/printf_A.c | |
parent | 752870c4bea5f43859ec4e10ae2579018908bbe3 (diff) | |
download | systemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.tar.gz systemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.tar.xz systemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.zip |
Add String test files.
Diffstat (limited to 'runtime/tests/string/printf_A.c')
-rw-r--r-- | runtime/tests/string/printf_A.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/runtime/tests/string/printf_A.c b/runtime/tests/string/printf_A.c new file mode 100644 index 00000000..e6c1a93f --- /dev/null +++ b/runtime/tests/string/printf_A.c @@ -0,0 +1,56 @@ +/* basic printf tests */ + +/* use very small buffer size for testing */ +#define STP_PRINT_BUF_LEN 20 +#include "runtime.h" + +int main () +{ + /* can we see output? */ + _stp_printf("ABCDE\n"); + _stp_print_flush(); + + + /* overflow */ + _stp_printf("1234567890123456789012345\n"); + _stp_printf("XYZZY\n"); + _stp_print_flush(); + + /* small string then overflow string */ + _stp_printf("XYZZY\n"); + _stp_printf("1234567890123456789012345"); + _stp_printf("\n"); + _stp_print_flush(); + + /* two small string that overflow */ + _stp_printf("abcdefghij"); + _stp_printf("1234567890"); + _stp_printf("\n"); + _stp_print_flush(); + + /* two small string that overflow */ + _stp_printf("abcdefghij"); + _stp_printf("1234567890X"); + _stp_printf("\n"); + _stp_print_flush(); + + _stp_printf("12345\n"); + _stp_printf("67890\n"); + _stp_printf("abcde\n"); + _stp_print_flush(); + _stp_print_flush(); + _stp_printf("12345"); + _stp_printf("67890"); + _stp_printf("abcde"); + _stp_printf("fghij"); + _stp_printf("\n"); + _stp_print_flush(); + + /* null string */ + _stp_printf(""); + _stp_print_flush(); + _stp_printf(""); + _stp_printf("Q\n"); + _stp_print_flush(); + return 0; +} |