1 /** Null character in string tests.
3 storage: data, xdata, code,
8 #pragma disable_warning 147 //no warning about excess elements in array of chars initializer
11 {storage} char string1[] = "";
12 {storage} char string2[] = "a\0b\0c";
13 {storage} char string3[5] = "a\0b\0c";
16 testStringArray (void)
18 /* Make sure the strings are the correct size */
19 /* and have the terminating null character */
20 ASSERT (sizeof (string1) == 1);
21 ASSERT (sizeof (string2) == 6);
22 ASSERT (sizeof (string3) == 5);
23 ASSERT (string1[0] == 0);
24 ASSERT (string2[5] == 0);
26 ASSERT (string2[0]== 'a');
27 ASSERT (string2[2]== 'b');
28 ASSERT (string2[4]== 'c');
35 char * constStr1 = "";
36 char * constStr2 = "a\0b\0c";
38 ASSERT (constStr1[0] == 0);
39 ASSERT (constStr2[5] == 0);