blob: 2de0f5929d9f59702983c4a2e08a81d9f98312b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/* test of _stp_print_cstr() */
/* use very small buffer size for testing */
#define STP_PRINT_BUF_LEN 20
#include "runtime.h"
int main ()
{
/* can we see output? */
_stp_print_cstr("ABCDE\n");
_stp_print_flush();
/* overflow */
_stp_print_cstr("1234567890123456789012345\n");
_stp_print_cstr("XYZZY\n");
_stp_print_flush();
/* small string then overflow string */
_stp_print_cstr("XYZZY\n");
_stp_print_cstr("1234567890123456789012345");
_stp_print_cstr("\n");
_stp_print_flush();
/* two small string that overflow */
_stp_print_cstr("abcdefghij");
_stp_print_cstr("1234567890");
_stp_print_cstr("\n");
_stp_print_flush();
/* two small string that overflow */
_stp_print_cstr("abcdefghij");
_stp_print_cstr("1234567890X");
_stp_print_cstr("\n");
_stp_print_flush();
_stp_print_cstr("12345\n");
_stp_print_cstr("67890\n");
_stp_print_cstr("abcde\n");
_stp_print_flush();
_stp_print_flush();
_stp_print_cstr("12345");
_stp_print_cstr("67890");
_stp_print_cstr("abcde");
_stp_print_cstr("fghij");
_stp_print_cstr("\n");
_stp_print_flush();
/* null string */
_stp_print_cstr("");
_stp_print_flush();
_stp_print_cstr("");
_stp_print_cstr("Q\n");
_stp_print_flush();
return 0;
}
|