Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5950 closed defect (fixed)

One failed test when running 0ad/binaries/system/test on a mac

Reported by: Langbart Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Core engine Keywords: macOS
Cc: Patch: Phab:D3441

Description

Running tests (0ad/binaries/system/test) results in the following error message:

0ad/binaries/system/test ; exit;
Running cxxtest tests (350 tests)............................................................................................................................................................................................................................................................................................................................................
In TestPreprocessor::test_include_double:
/Users/paladin/0ad/source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.h:176: Error: Expected (result.output.Trim(PS_TRIM_BOTH) == "#line 1\n42\n#line 3\n#line 1\n42\n#line 4\n#line 1\n42\n#line 5"), found ("" != #line 1
42
#line 3
#line 1
42
#line 4
#line 1
42
#line 5)
.................
Failed 1 and Skipped 0 of 350 tests
Success rate: 99%

[Process completed]

The problem described above first occurs with changeset [24740], tested with macOS 10.15.7.

Judging from their exchange in irc 0ad-dev on 20/01/2021, Stan and Vladislav are already aware of the problem. (I just created a ticket so the bug won't be forgotten).

Change History (2)

comment:1 by wraitii, 3 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 24742:

Fix issue with rP24740

std::string_views are created pointing to vector-owned strings, but those strings can use Short String Optimisation (storing the data inline, i.e. in vector memory). When the vector is resized, the strings are moved and those string_views now point to invalid memory.

To fix it, use std::deque which does not invalidate pointers on push_back.

Fixes rP24740.

Reviewed By: vladislavbelov

Fixes #5950

Differential Revision: https://code.wildfiregames.com/D3441

comment:2 by Langbart, 3 years ago

Patch: Phab:D3441

adding D3441

Note: See TracTickets for help on using tickets.