mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 14:37:45 +00:00
[ATL_APITEST] Update CImage apitest to be in line with the CSimpleArray / CSimpleMap tests. Patch from Katayama Hirofumi MZ. CORE-11946 #resolve #comment Thanks!
svn path=/trunk/; revision=72689
This commit is contained in:
parent
639a2c725d
commit
af4f582986
|
@ -14,17 +14,15 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
const char *g_file = NULL;
|
|
||||||
int g_line = 0;
|
|
||||||
int g_tests_executed = 0;
|
int g_tests_executed = 0;
|
||||||
int g_tests_failed = 0;
|
int g_tests_failed = 0;
|
||||||
void ok_func(BOOL value, const char *fmt, ...)
|
void ok_func(const char *file, int line, BOOL value, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
if (!value)
|
if (!value)
|
||||||
{
|
{
|
||||||
printf("%s (%d): ", g_file, g_line);
|
printf("%s (%d): ", file, line);
|
||||||
vprintf(fmt, va);
|
vprintf(fmt, va);
|
||||||
g_tests_failed++;
|
g_tests_failed++;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +30,7 @@
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
#undef ok
|
#undef ok
|
||||||
#define ok g_file = __FILE__; g_line = __LINE__; ok_func
|
#define ok(value, ...) ok_func(__FILE__, __LINE__, value, __VA_ARGS__)
|
||||||
#define START_TEST(x) int main(void)
|
#define START_TEST(x) int main(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -59,7 +57,7 @@ static void write_bitmap(HINSTANCE hInst, int id, TCHAR* file)
|
||||||
{
|
{
|
||||||
HRSRC rsrc;
|
HRSRC rsrc;
|
||||||
|
|
||||||
rsrc = FindResource(hInst, MAKEINTRESOURCE(id), MAKEINTRESOURCE(RT_BITMAP));
|
rsrc = FindResource(hInst, MAKEINTRESOURCE(id), RT_BITMAP);
|
||||||
ok(rsrc != NULL, "Expected to find an image resource\n");
|
ok(rsrc != NULL, "Expected to find an image resource\n");
|
||||||
if (rsrc)
|
if (rsrc)
|
||||||
{
|
{
|
||||||
|
@ -274,5 +272,6 @@ START_TEST(CImage)
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
printf("CImage: %i tests executed (0 marked as todo, %i failures), 0 skipped.\n", g_tests_executed, g_tests_failed);
|
printf("CImage: %i tests executed (0 marked as todo, %i failures), 0 skipped.\n", g_tests_executed, g_tests_failed);
|
||||||
|
return g_tests_failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue