ucrtbase/tests: Set invalid_parameter_handler once.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-03-26 11:42:00 +01:00 committed by Alexandre Julliard
parent 792dc34978
commit e115d5c718
2 changed files with 6 additions and 30 deletions

View File

@ -376,9 +376,6 @@ static void test_fwprintf(void)
fclose(fp);
unlink(file_name);
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
/* NULL format */
errno = 0xdeadbeef;
SET_EXPECT(invalid_parameter_handler);
@ -398,9 +395,6 @@ static void test_fwprintf(void)
/* format using % with NULL arglist*/
/* crashes on Windows */
/* 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,
@ -628,6 +622,9 @@ static void test_printf_natural_string(void)
START_TEST(printf)
{
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
test_snprintf();
test_swprintf();
test_fprintf();

View File

@ -150,9 +150,6 @@ static void test__memicmp(void)
static const char *s2 = "aBd";
int ret;
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
ret = _memicmp(NULL, NULL, 0);
ok(!ret, "got %d\n", ret);
@ -182,9 +179,6 @@ static void test__memicmp(void)
ret = _memicmp(s1, s2, 3);
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)
@ -193,9 +187,6 @@ static void test__memicmp_l(void)
static const char *s2 = "aBd";
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);
ok(!ret, "got %d\n", ret);
@ -225,9 +216,6 @@ static void test__memicmp_l(void)
ret = _memicmp_l(s1, s2, 3, NULL);
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)
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 */
{
ret = __strncnt(NULL, 0);
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)
@ -436,9 +418,6 @@ static void test__strnicmp(void)
static const char str2[] = "test";
int ret;
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
SET_EXPECT(invalid_parameter_handler);
errno = 0xdeadbeef;
ret = _strnicmp(str1, str2, -1);
@ -448,13 +427,13 @@ static void test__strnicmp(void)
ret = _strnicmp(str1, str2, 0x7fffffff);
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)
{
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
"Invalid parameter handler was already set\n");
test_strtod();
test__memicmp();
test__memicmp_l();