Author: jgardou Date: Sat Jul 21 20:15:12 2012 New Revision: 56930
URL: http://svn.reactos.org/svn/reactos?rev=56930&view=rev Log: [APITESTS/CRT] - Test errno value on failure
Modified: trunk/rostests/apitests/crt/_vscprintf.c trunk/rostests/apitests/crt/_vscwprintf.c trunk/rostests/apitests/crt/_vsnprintf.c trunk/rostests/apitests/crt/_vsnwprintf.c
Modified: trunk/rostests/apitests/crt/_vscprintf.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vscprintf.c?... ============================================================================== --- trunk/rostests/apitests/crt/_vscprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vscprintf.c [iso-8859-1] Sat Jul 21 20:15:12 2012 @@ -7,6 +7,7 @@ #include <stdio.h> #include <wine/test.h> #include <tchar.h> +#include <errno.h>
static void call_varargs(int expected_ret, LPCSTR formatString, ...) { @@ -26,4 +27,5 @@ call_varargs(11, "%u cookies", 100); /* Test NULL argument */ call_varargs(-1, NULL); + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); }
Modified: trunk/rostests/apitests/crt/_vscwprintf.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vscwprintf.c... ============================================================================== --- trunk/rostests/apitests/crt/_vscwprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vscwprintf.c [iso-8859-1] Sat Jul 21 20:15:12 2012 @@ -7,6 +7,7 @@ #include <stdio.h> #include <wine/test.h> #include <tchar.h> +#include <errno.h>
static void call_varargs(int expected_ret, LPCWSTR formatString, ...) { @@ -27,4 +28,7 @@
/* Test NULL argument */ call_varargs(-1, NULL); +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#endif }
Modified: trunk/rostests/apitests/crt/_vsnprintf.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vsnprintf.c?... ============================================================================== --- trunk/rostests/apitests/crt/_vsnprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vsnprintf.c [iso-8859-1] Sat Jul 21 20:15:12 2012 @@ -41,6 +41,9 @@ #else EndSeh(STATUS_SUCCESS); #endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#endif /* This one is no better */ StartSeh() call_varargs(NULL, 0, -1, "%s it really work?", "does"); @@ -48,6 +51,9 @@ EndSeh(STATUS_ACCESS_VIOLATION); #else EndSeh(STATUS_SUCCESS); +#endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); #endif /* One more NULL checks */ StartSeh() @@ -57,4 +63,7 @@ #else EndSeh(STATUS_SUCCESS); #endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#endif }
Modified: trunk/rostests/apitests/crt/_vsnwprintf.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/_vsnwprintf.c... ============================================================================== --- trunk/rostests/apitests/crt/_vsnwprintf.c [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/_vsnwprintf.c [iso-8859-1] Sat Jul 21 20:15:12 2012 @@ -41,6 +41,9 @@ #else EndSeh(STATUS_SUCCESS); #endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#endif /* This one is no better */ StartSeh() call_varargs(NULL, 0, -1, L"%s it really work?", L"does"); @@ -48,6 +51,9 @@ EndSeh(STATUS_ACCESS_VIOLATION); #else EndSeh(STATUS_SUCCESS); +#endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); #endif /* One more NULL checks */ StartSeh() @@ -57,4 +63,7 @@ #else EndSeh(STATUS_SUCCESS); #endif +#if defined(TEST_MSVCRT) /* NTDLL doesn't use/set errno */ + ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno); +#endif }