[ATL_APITEST] Update CImage apitest to be in line with the CSimpleArray / CSimpleMap...
authorMark Jansen <mark.jansen@reactos.org>
Thu, 15 Sep 2016 19:42:45 +0000 (19:42 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 15 Sep 2016 19:42:45 +0000 (19:42 +0000)
svn path=/trunk/; revision=72689

rostests/apitests/atl/CImage.cpp

index d294aa2..bfa7c70 100644 (file)
     #include <stdlib.h>
     #include <stdio.h>
     #include <stdarg.h>
     #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;
     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)
         {
     {
         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++;
         }
             vprintf(fmt, va);
             g_tests_failed++;
         }
@@ -32,7 +30,7 @@
         va_end(va);
     }
     #undef ok
         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
 
     #define START_TEST(x)   int main(void)
 #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");
     if (rsrc)
     {
     ok(rsrc != NULL, "Expected to find an image resource\n");
     if (rsrc)
     {
@@ -274,5 +272,6 @@ START_TEST(CImage)
 
 #ifndef __REACTOS__
     printf("CImage: %i tests executed (0 marked as todo, %i failures), 0 skipped.\n", g_tests_executed, g_tests_failed);
 
 #ifndef __REACTOS__
     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
 }