mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
msvcp90/tests: Add cout<< double test.
This commit is contained in:
parent
96e920e01f
commit
edb68e7b22
1 changed files with 42 additions and 0 deletions
|
@ -1951,6 +1951,46 @@ static void test_ostream_print_ushort(void)
|
|||
call_func1(p_basic_stringstream_wchar_vbase_dtor, &wss);
|
||||
}
|
||||
|
||||
static void test_ostream_print_double(void)
|
||||
{
|
||||
static const char double_str[] = "3.14159";
|
||||
|
||||
basic_stringstream_char ss;
|
||||
basic_string_char pstr;
|
||||
const char *str;
|
||||
double val;
|
||||
val = 3.14159;
|
||||
|
||||
call_func1(p_basic_stringstream_char_ctor, &ss);
|
||||
call_func2_ptr_dbl(p_basic_ostream_char_print_double, &ss.base.base2, val);
|
||||
call_func2(p_basic_stringstream_char_str_get, &ss, &pstr);
|
||||
str = call_func1(p_basic_string_char_cstr, &pstr);
|
||||
ok(!strcmp(double_str, str), "str = %s\n", str);
|
||||
|
||||
call_func1(p_basic_string_char_dtor, &pstr);
|
||||
call_func1(p_basic_stringstream_char_vbase_dtor, &ss);
|
||||
}
|
||||
|
||||
static void test_ostream_wchar_print_double(void)
|
||||
{
|
||||
static const wchar_t double_str[] = { '3', '.', '1', '4', '1', '5', '9', 0 };
|
||||
|
||||
basic_stringstream_wchar wss;
|
||||
basic_string_wchar pwstr;
|
||||
const wchar_t *wstr;
|
||||
double val;
|
||||
val = 3.14159;
|
||||
|
||||
call_func1(p_basic_stringstream_wchar_ctor, &wss);
|
||||
call_func2_ptr_dbl(p_basic_ostream_wchar_print_double, &wss.base.base2, val);
|
||||
|
||||
call_func2(p_basic_stringstream_wchar_str_get, &wss, &pwstr);
|
||||
wstr = call_func1(p_basic_string_wchar_cstr, &pwstr);
|
||||
|
||||
ok(!lstrcmpW(double_str, wstr), "wstr = %s\n", wine_dbgstr_w(wstr));
|
||||
call_func1(p_basic_string_wchar_dtor, &pwstr);
|
||||
call_func1(p_basic_stringstream_wchar_vbase_dtor, &wss);
|
||||
}
|
||||
|
||||
START_TEST(ios)
|
||||
{
|
||||
|
@ -1968,6 +2008,8 @@ START_TEST(ios)
|
|||
test_istream_tellg();
|
||||
test_istream_getline();
|
||||
test_ostream_print_ushort();
|
||||
test_ostream_print_double();
|
||||
test_ostream_wchar_print_double();
|
||||
|
||||
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue