[APITESTS/CRT]

- Test errno value on failure

svn path=/trunk/; revision=56930
This commit is contained in:
Jérôme Gardou 2012-07-21 20:15:12 +00:00
parent 9c54cdba31
commit 5cc65e64c7
4 changed files with 24 additions and 0 deletions

View file

@ -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 @@ START_TEST(_vscprintf)
call_varargs(11, "%u cookies", 100);
/* Test NULL argument */
call_varargs(-1, NULL);
ok(errno == EINVAL, "Expected EINVAL, got %u\n", errno);
}

View file

@ -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 @@ START_TEST(_vscwprintf)
/* 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
}

View file

@ -40,6 +40,9 @@ START_TEST(_vsnprintf)
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
/* This one is no better */
StartSeh()
@ -48,6 +51,9 @@ START_TEST(_vsnprintf)
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 @@ START_TEST(_vsnprintf)
#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
}

View file

@ -40,6 +40,9 @@ START_TEST(_vsnwprintf)
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
/* This one is no better */
StartSeh()
@ -48,6 +51,9 @@ START_TEST(_vsnwprintf)
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 @@ START_TEST(_vsnwprintf)
#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
}