Skip to content

test: minisketch_tests.cpp can fail when built with MSVC #26262

@hebasto

Description

@hebasto

To trigger the failure, consider the diff as follows:

--- a/src/test/minisketch_tests.cpp
+++ b/src/test/minisketch_tests.cpp
@@ -27,6 +27,11 @@ BOOST_AUTO_TEST_CASE(minisketch_test)
         uint32_t start_b = start_a + a_not_b;
         uint32_t end_b = start_b + both + b_not_a;
 
+#ifdef _MSC_VER
+        // FIXME
+        BOOST_TEST_MESSAGE("This message *breaks* this test when running with '-l test_suite'");
+#endif
+
         Minisketch sketch_a = MakeMinisketch32(10);
         for (uint32_t a = start_a; a < end_a; ++a) sketch_a.Add(a);
         Minisketch sketch_b = MakeMinisketch32(10);

The observing behavior:

>build_msvc\x64\Release\test_bitcoin.exe -t minisketch_tests
Running 1 test case...
unknown location(0): fatal error: in "minisketch_tests/minisketch_test": memory access violation occurred at address 0xffffffff, while attempting to  read inaccessible data
C:\Users\hebasto\bitcoin\src\test\minisketch_tests.cpp(18): last checkpoint: "minisketch_test" test entry

*** 1 failure is detected in the test module "Bitcoin Core Test Suite"

Assuming either MSVC bug or non-portable code?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions