[PATCH v2 0/1] MR11085: webservices/tests: Improve double tests.
The [test pattern page](https://test.winehq.org/data/patterns.html#webservices:writer) shows since yesterday failures for the linux 32-bit tests. In my debugging the `digit` variable holds a value of 10, therefore the `*(p++) = '0' + digit;` results in the wrong colon in `<t>:E-3</t>`. I could not reproduce the working state at my system of the previous commit round, therefore could not start a git bisect. What makes me wonder is, my [asan gitlab CI runs](https://gitlab.winehq.org/bernhardu/wine/-/jobs/229031#L4063) with llvm-mingw/clang started to show this issue already at 2026-02-13. Could probably the patch 508a30f0d3, "configure: Add -msse2 to default i386_EXTRACFLAGS.", made this issue to surface in the various test runs? However, this patch makes the failing tests succeed. Unfortunately I found some new values, which have rounding issues in 64 and 32 bits. [Testbot run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=163276). -- v2: webservices/tests: Improve double tests. https://gitlab.winehq.org/wine/wine/-/merge_requests/11085
From: Bernhard Übelacker <bernhardu@mailbox.org> Co-authored-by: Hans Leidekker <hans@codeweavers.com> --- dlls/webservices/tests/writer.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/webservices/tests/writer.c b/dlls/webservices/tests/writer.c index 8e83707c3cf..f814dbdea5a 100644 --- a/dlls/webservices/tests/writer.c +++ b/dlls/webservices/tests/writer.c @@ -2222,14 +2222,13 @@ static void test_text_types(void) static void test_double(void) { - static const BOOL is_win64 = sizeof(void*) > sizeof(int); WS_XML_STRING localname = {1, (BYTE *)"t"}, ns = {0, NULL}; unsigned int fpword, fpword_orig; static const struct { double val; const char *result; - BOOL todo64; + BOOL todo; } tests[] = { @@ -2241,11 +2240,15 @@ static void test_double(void) {1.0000000000000003, "<t>1.0000000000000002</t>"}, {1.0000000000000004, "<t>1.0000000000000004</t>"}, {100000000000000, "<t>100000000000000</t>"}, + {-100000000000000, "<t>-100000000000000</t>", TRUE}, {1000000000000000, "<t>1E+15</t>"}, + {-1000000000000000, "<t>-1E+15</t>"}, {0.1, "<t>0.1</t>", TRUE}, - {0.01, "<t>1E-2</t>", TRUE}, {-0.1, "<t>-0.1</t>", TRUE}, + {0.01, "<t>1E-2</t>", TRUE}, {-0.01, "<t>-1E-2</t>", TRUE}, + {9.9, "<t>9.9</t>", TRUE}, + {-9.9, "<t>-9.9</t>", TRUE}, {1.7976931348623158e308, "<t>1.7976931348623157E+308</t>", TRUE}, {-1.7976931348623158e308, "<t>-1.7976931348623157E+308</t>", TRUE}, }; @@ -2260,6 +2263,7 @@ static void test_double(void) text.text.textType = WS_XML_TEXT_TYPE_DOUBLE; for (i = 0; i < ARRAY_SIZE( tests ); i++) { + winetest_push_context("i=%ld expected=%s", i, tests[i].result); hr = set_output( writer ); ok( hr == S_OK, "got %#lx\n", hr ); hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); @@ -2271,7 +2275,7 @@ static void test_double(void) hr = WsWriteEndElement( writer, NULL ); ok( hr == S_OK, "%lu: got %#lx\n", i, hr ); - if (tests[i].todo64 && is_win64) + if (tests[i].todo) { WS_BYTES bytes; ULONG size = sizeof(bytes); @@ -2281,12 +2285,13 @@ static void test_double(void) memset( &bytes, 0, sizeof(bytes) ); hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, size, NULL ); ok( hr == S_OK, "%lu: got %#lx\n", i, hr ); - todo_wine + todo_wine_if( bytes.length != len || memcmp( bytes.bytes, tests[i].result, len ) ) ok( bytes.length == len && !memcmp( bytes.bytes, tests[i].result, len ), "%lu: got %lu %s expected %d %s\n", i, bytes.length, debugstr_bytes(bytes.bytes, bytes.length), len, tests[i].result ); } else check_output( writer, tests[i].result, __LINE__ ); + winetest_pop_context(); } hr = set_output( writer ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11085
v2: [Testbot run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=163287) - Drop changes of implementation. - Test modified to use a todo_wine_if. - Added Co-authored-by. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11085#note_142439
On Mon Jun 8 18:19:54 2026 +0000, Hans Leidekker wrote:
So this also depends on the compiler. What about this patch? Now we just need to remember to remove todo from this test when Wine is fixed ;-) [webservices_tests.diff](/uploads/35aab79ebc61a902adbcb7600596452e/webservices_tests.diff) That's elegant, thanks.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11085#note_142440
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11085
participants (3)
-
Bernhard Übelacker -
Bernhard Übelacker (@bernhardu) -
Hans Leidekker (@hans)