void test_volatile (void) { #if defined (__SDCC_ds390) || defined (__SDCC_mcs51) //fool the compact-results.py python script __prints("--- Summary: 0/1/1: 0 failed of 1 tests in 1 cases."); x; //this should end the simulation while (1); //let the "watchdog" bite #endif }
void test_snprintf (void) { unsigned char buf[32]; unsigned char i; memset (buf, 0xfe, sizeof buf); /* cookies all over */ for (i = 0; i < sizeof cases / sizeof cases[0]; i++) { sprintf (buf, cases[i].fmt, cases[i].arg); DEBUG (__prints ("Test")); DEBUG (__printn (i)); DEBUG (__prints (" should be: '")); DEBUG (__prints (cases[i].result)); DEBUG (__prints ("' is: '")); DEBUG (__prints (buf)); DEBUG (__prints ("'\n")); ASSERT (!strcmp (buf, cases[i].result)); } ASSERT (buf[sizeof buf - 10] == 0xfe); /* check for cookie */ }