mirror of
https://github.com/reactos/reactos.git
synced 2026-06-04 10:20:48 +08:00
[ATL_APITEST] Add 'atltest.h' and use it (#1822)
- Add "atltest.h" header file for common use in atl_apitest. - Delete the duplicated and simplify.
This commit is contained in:
committed by
GitHub
parent
610b852451
commit
a800fa7bb2
@@ -8,27 +8,7 @@
|
||||
#ifdef HAVE_APITEST
|
||||
#include <apitest.h>
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
int g_tests_executed = 0;
|
||||
int g_tests_failed = 0;
|
||||
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): ", file, line);
|
||||
vprintf(fmt, va);
|
||||
g_tests_failed++;
|
||||
}
|
||||
g_tests_executed++;
|
||||
va_end(va);
|
||||
}
|
||||
#undef ok
|
||||
#define ok(value, ...) ok_func(__FILE__, __LINE__, value, __VA_ARGS__)
|
||||
#define START_TEST(x) int main(void)
|
||||
#include "atltest.h"
|
||||
#endif
|
||||
|
||||
#include <atlbase.h>
|
||||
@@ -178,9 +158,4 @@ START_TEST(CSimpleArray)
|
||||
}
|
||||
ok(!!array1.RemoveAt(0), "Expected RemoveAt(0) to succeed\n");
|
||||
ok(array1.GetSize() == 0, "Expected array1.GetSize() is 0, was: %d\n", array1.GetSize());
|
||||
|
||||
#ifndef HAVE_APITEST
|
||||
printf("CSimpleArray: %i tests executed (0 marked as todo, %i failures), 0 skipped.\n", g_tests_executed, g_tests_failed);
|
||||
return g_tests_failed;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user