Commit e115d5c7 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

ucrtbase/tests: Set invalid_parameter_handler once.

parent 792dc349
...@@ -376,9 +376,6 @@ static void test_fwprintf(void) ...@@ -376,9 +376,6 @@ static void test_fwprintf(void)
fclose(fp); fclose(fp);
unlink(file_name); unlink(file_name);
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
/* NULL format */ /* NULL format */
errno = 0xdeadbeef; errno = 0xdeadbeef;
SET_EXPECT(invalid_parameter_handler); SET_EXPECT(invalid_parameter_handler);
...@@ -398,9 +395,6 @@ static void test_fwprintf(void) ...@@ -398,9 +395,6 @@ static void test_fwprintf(void)
/* format using % with NULL arglist*/ /* format using % with NULL arglist*/
/* crashes on Windows */ /* crashes on Windows */
/* ret = __stdio_common_vfwprintf(0, fp, cont_fmt, NULL, NULL); */ /* ret = __stdio_common_vfwprintf(0, fp, cont_fmt, NULL, NULL); */
ok(_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler,
"Cannot reset invalid parameter handler\n");
} }
static int WINAPIV _vsnprintf_s_wrapper(char *str, size_t sizeOfBuffer, static int WINAPIV _vsnprintf_s_wrapper(char *str, size_t sizeOfBuffer,
...@@ -628,6 +622,9 @@ static void test_printf_natural_string(void) ...@@ -628,6 +622,9 @@ static void test_printf_natural_string(void)
START_TEST(printf) START_TEST(printf)
{ {
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
test_snprintf(); test_snprintf();
test_swprintf(); test_swprintf();
test_fprintf(); test_fprintf();
......
...@@ -150,9 +150,6 @@ static void test__memicmp(void) ...@@ -150,9 +150,6 @@ static void test__memicmp(void)
static const char *s2 = "aBd"; static const char *s2 = "aBd";
int ret; int ret;
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
ret = _memicmp(NULL, NULL, 0); ret = _memicmp(NULL, NULL, 0);
ok(!ret, "got %d\n", ret); ok(!ret, "got %d\n", ret);
...@@ -182,9 +179,6 @@ static void test__memicmp(void) ...@@ -182,9 +179,6 @@ static void test__memicmp(void)
ret = _memicmp(s1, s2, 3); ret = _memicmp(s1, s2, 3);
ok(ret == -1, "got %d\n", ret); ok(ret == -1, "got %d\n", ret);
ok(_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler,
"Cannot reset invalid parameter handler\n");
} }
static void test__memicmp_l(void) static void test__memicmp_l(void)
...@@ -193,9 +187,6 @@ static void test__memicmp_l(void) ...@@ -193,9 +187,6 @@ static void test__memicmp_l(void)
static const char *s2 = "aBd"; static const char *s2 = "aBd";
int ret; int ret;
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
ret = _memicmp_l(NULL, NULL, 0, NULL); ret = _memicmp_l(NULL, NULL, 0, NULL);
ok(!ret, "got %d\n", ret); ok(!ret, "got %d\n", ret);
...@@ -225,9 +216,6 @@ static void test__memicmp_l(void) ...@@ -225,9 +216,6 @@ static void test__memicmp_l(void)
ret = _memicmp_l(s1, s2, 3, NULL); ret = _memicmp_l(s1, s2, 3, NULL);
ok(ret == -1, "got %d\n", ret); ok(ret == -1, "got %d\n", ret);
ok(_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler,
"Cannot reset invalid parameter handler\n");
} }
...@@ -255,17 +243,11 @@ static void test___strncnt(void) ...@@ -255,17 +243,11 @@ static void test___strncnt(void)
ok(ret == strncnt_tests[i].ret, "%u: unexpected return value %u.\n", i, (int)ret); ok(ret == strncnt_tests[i].ret, "%u: unexpected return value %u.\n", i, (int)ret);
} }
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
if (0) /* crashes */ if (0) /* crashes */
{ {
ret = __strncnt(NULL, 0); ret = __strncnt(NULL, 0);
ret = __strncnt(NULL, 1); ret = __strncnt(NULL, 1);
} }
ok(_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler,
"Cannot reset invalid parameter handler\n");
} }
static void test_C_locale(void) static void test_C_locale(void)
...@@ -436,9 +418,6 @@ static void test__strnicmp(void) ...@@ -436,9 +418,6 @@ static void test__strnicmp(void)
static const char str2[] = "test"; static const char str2[] = "test";
int ret; int ret;
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
SET_EXPECT(invalid_parameter_handler); SET_EXPECT(invalid_parameter_handler);
errno = 0xdeadbeef; errno = 0xdeadbeef;
ret = _strnicmp(str1, str2, -1); ret = _strnicmp(str1, str2, -1);
...@@ -448,13 +427,13 @@ static void test__strnicmp(void) ...@@ -448,13 +427,13 @@ static void test__strnicmp(void)
ret = _strnicmp(str1, str2, 0x7fffffff); ret = _strnicmp(str1, str2, 0x7fffffff);
ok(!ret, "got %d.\n", ret); ok(!ret, "got %d.\n", ret);
ok(_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler,
"Cannot reset invalid parameter handler\n");
} }
START_TEST(string) START_TEST(string)
{ {
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
test_strtod(); test_strtod();
test__memicmp(); test__memicmp();
test__memicmp_l(); test__memicmp_l();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment