/* The original file was tiformat.c and it has been changed for long long tests\
. */ typedefstruct
{ int line; longlongint value; constchar *result; constchar *format_string;
} sprint_int_type;
int
main (void)
{ int errcount = 0; int testcount = 0; #define BSIZE 1024 char buffer[BSIZE];
sprint_int_type *iptr; for (iptr = sprint_ints; iptr->line; iptr++)
{
snprintf (buffer, sizeof(buffer), iptr->format_string, iptr->value); if (strcmp (buffer, iptr->result) != 0)
{
++errcount;
printf ("\
Error in line %d using \"%s\". Result is \"%s\"; should be: \"%s\".\n",
iptr->line, iptr->format_string, buffer, iptr->result);
}
++testcount;
}
if (errcount == 0)
{
printf ("Encountered no errors in %d tests.\n", testcount); return 0;
} else
{
printf ("Encountered %d errors in %d tests.\n",
errcount, testcount); return 1;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.