Author: mjansen
Date: Thu Sep 15 19:42:45 2016
New Revision: 72689
URL:
http://svn.reactos.org/svn/reactos?rev=72689&view=rev
Log:
[ATL_APITEST] Update CImage apitest to be in line with the CSimpleArray / CSimpleMap
tests. Patch from Katayama Hirofumi MZ. CORE-11946 #resolve #comment Thanks!
Modified:
trunk/rostests/apitests/atl/CImage.cpp
Modified: trunk/rostests/apitests/atl/CImage.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/atl/CImage.cpp?r…
==============================================================================
--- trunk/rostests/apitests/atl/CImage.cpp [iso-8859-1] (original)
+++ trunk/rostests/apitests/atl/CImage.cpp [iso-8859-1] Thu Sep 15 19:42:45 2016
@@ -14,17 +14,15 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
- const char *g_file = NULL;
- int g_line = 0;
int g_tests_executed = 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_start(va, fmt);
if (!value)
{
- printf("%s (%d): ", g_file, g_line);
+ printf("%s (%d): ", file, line);
vprintf(fmt, va);
g_tests_failed++;
}
@@ -32,7 +30,7 @@
va_end(va);
}
#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)
#endif
@@ -59,7 +57,7 @@
{
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");
if (rsrc)
{
@@ -274,5 +272,6 @@
#ifndef __REACTOS__
printf("CImage: %i tests executed (0 marked as todo, %i failures), 0
skipped.\n", g_tests_executed, g_tests_failed);
-#endif
-}
+ return g_tests_failed;
+#endif
+}