15 #if !defined( __SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14) // Lack of memory
19 sprintf (s
, "%d", 99);
20 ASSERT (0 == strcmp (s
, "99"));
21 sprintf (s
, "%d", 100);
22 ASSERT (0 == strcmp (s
, "100"));
23 sprintf (s
, "%d", 2004);
24 ASSERT (0 == strcmp (s
, "2004"));
25 sprintf (s
, "%ld", 2147483647L);
26 ASSERT (0 == strcmp (s
, "2147483647"));
28 //and from bug 1073386
29 sprintf (s
, "%04X", 0x8765u
);
30 ASSERT (0 == strcmp (s
, "8765"));
32 //and from bug 1193299
33 sprintf (s
, "%3.3s", "abcd");
34 ASSERT (0 == strcmp (s
, "abc"));
35 sprintf (s
, "%-3.3s", "abcd");
36 ASSERT (0 == strcmp (s
, "abc"));
37 sprintf (s
, "%3.3s", "ab");
38 ASSERT (0 == strcmp (s
, " ab"));
39 sprintf (s
, "%-3.3s", "ab");
40 ASSERT (0 == strcmp (s
, "ab "));
42 #if defined(__SDCC_ds390) || defined(PORT_HOST)
43 //and from bug 1358192
44 sprintf (s
, "%f", 10.1);
46 ASSERT (0 == strcmp (s
, "10.100000"));
48 //and from bug 1388703
49 sprintf (s
, "%4.1f", 1.36);
51 ASSERT (0 == strcmp (s
, " 1.4"));
52 sprintf (s
, "%4.1f", -1.37);
54 ASSERT (0 == strcmp (s
, "-1.4"));
57 ASSERT (s
[12] == 0x12);