Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency

This commit is contained in:
Andreas Schiffler
2013-08-14 23:30:10 -07:00
parent 67367be019
commit 65728477af
47 changed files with 616 additions and 505 deletions

View File

@@ -35,30 +35,30 @@ TestTypes(SDL_bool verbose)
if (badsize(sizeof(Uint8), 1)) {
if (verbose)
printf("sizeof(Uint8) != 1, instead = %u\n",
SDL_Log("sizeof(Uint8) != 1, instead = %u\n",
(unsigned int)sizeof(Uint8));
++error;
}
if (badsize(sizeof(Uint16), 2)) {
if (verbose)
printf("sizeof(Uint16) != 2, instead = %u\n",
SDL_Log("sizeof(Uint16) != 2, instead = %u\n",
(unsigned int)sizeof(Uint16));
++error;
}
if (badsize(sizeof(Uint32), 4)) {
if (verbose)
printf("sizeof(Uint32) != 4, instead = %u\n",
SDL_Log("sizeof(Uint32) != 4, instead = %u\n",
(unsigned int)sizeof(Uint32));
++error;
}
if (badsize(sizeof(Uint64), 8)) {
if (verbose)
printf("sizeof(Uint64) != 8, instead = %u\n",
SDL_Log("sizeof(Uint64) != 8, instead = %u\n",
(unsigned int)sizeof(Uint64));
++error;
}
if (verbose && !error)
printf("All data types are the expected size.\n");
SDL_Log("All data types are the expected size.\n");
return (error ? 1 : 0);
}
@@ -83,7 +83,7 @@ TestEndian(SDL_bool verbose)
swapped64 |= 0xDEADBEEF;
if (verbose) {
printf("Detected a %s endian machine.\n",
SDL_Log("Detected a %s endian machine.\n",
(SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big");
}
if ((*((char *) &value) >> 4) == 0x1) {
@@ -93,44 +93,44 @@ TestEndian(SDL_bool verbose)
}
if (real_byteorder != SDL_BYTEORDER) {
if (verbose) {
printf("Actually a %s endian machine!\n",
SDL_Log("Actually a %s endian machine!\n",
(real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big");
}
++error;
}
if (verbose) {
printf("Value 16 = 0x%X, swapped = 0x%X\n", value16,
SDL_Log("Value 16 = 0x%X, swapped = 0x%X\n", value16,
SDL_Swap16(value16));
}
if (SDL_Swap16(value16) != swapped16) {
if (verbose) {
printf("16 bit value swapped incorrectly!\n");
SDL_Log("16 bit value swapped incorrectly!\n");
}
++error;
}
if (verbose) {
printf("Value 32 = 0x%X, swapped = 0x%X\n", value32,
SDL_Log("Value 32 = 0x%X, swapped = 0x%X\n", value32,
SDL_Swap32(value32));
}
if (SDL_Swap32(value32) != swapped32) {
if (verbose) {
printf("32 bit value swapped incorrectly!\n");
SDL_Log("32 bit value swapped incorrectly!\n");
}
++error;
}
if (verbose) {
#ifdef _MSC_VER
printf("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64,
SDL_Log("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64,
SDL_Swap64(value64));
#else
printf("Value 64 = 0x%llX, swapped = 0x%llX\n",
SDL_Log("Value 64 = 0x%llX, swapped = 0x%llX\n",
(unsigned long long) value64,
(unsigned long long) SDL_Swap64(value64));
#endif
}
if (SDL_Swap64(value64) != swapped64) {
if (verbose) {
printf("64 bit value swapped incorrectly!\n");
SDL_Log("64 bit value swapped incorrectly!\n");
}
++error;
}
@@ -142,17 +142,17 @@ int
TestCPUInfo(SDL_bool verbose)
{
if (verbose) {
printf("CPU count: %d\n", SDL_GetCPUCount());
printf("CPU cache line size: %d\n", SDL_GetCPUCacheLineSize());
printf("RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected");
printf("AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected");
printf("MMX %s\n", SDL_HasMMX()? "detected" : "not detected");
printf("3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected");
printf("SSE %s\n", SDL_HasSSE()? "detected" : "not detected");
printf("SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected");
printf("SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected");
printf("SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected");
printf("SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected");
SDL_Log("CPU count: %d\n", SDL_GetCPUCount());
SDL_Log("CPU cache line size: %d\n", SDL_GetCPUCacheLineSize());
SDL_Log("RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected");
SDL_Log("AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected");
SDL_Log("MMX %s\n", SDL_HasMMX()? "detected" : "not detected");
SDL_Log("3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected");
SDL_Log("SSE %s\n", SDL_HasSSE()? "detected" : "not detected");
SDL_Log("SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected");
SDL_Log("SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected");
SDL_Log("SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected");
SDL_Log("SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected");
}
return (0);
}
@@ -176,7 +176,7 @@ TestAssertions(SDL_bool verbose)
{
const SDL_assert_data *item = SDL_GetAssertionReport();
while (item) {
printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
SDL_Log("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
item->condition, item->function, item->filename,
item->linenum, item->trigger_count,
item->always_ignore ? "yes" : "no");
@@ -192,11 +192,14 @@ main(int argc, char *argv[])
SDL_bool verbose = SDL_TRUE;
int status = 0;
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
if (argv[1] && (SDL_strcmp(argv[1], "-q") == 0)) {
verbose = SDL_FALSE;
}
if (verbose) {
printf("This system is running %s\n", SDL_GetPlatform());
SDL_Log("This system is running %s\n", SDL_GetPlatform());
}
status += TestTypes(verbose);