Repository navigation
test(items): the description language test switches the language with its own item table - #847
Merged
Conversation
… its own item table Run in one process after a test that loaded the item data, "A description is in the UI's language also when the item names stay English" crashed: the item data follows every UI language switch and refills ItemAttribute, which is null outside a ClientDataScope. CTest runs each test case in a process of its own, so CI never ran into it; a run of the whole test binary, as an IDE does it, crashed there. The test now switches the language inside a ClientDataScope. It turns "Translate item names" off through the item data handler, so the item names stay English also when the loaded item data follows the switch, and checks that they do. ClientDataScope's comment says that a test which switches the UI language needs one.
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Running the whole
test_item_database_filesbinary in one process crashed in "A description is in the UI's language also when the item names stay English" (from #813):ItemAttribute. In the test binary,ItemAttributeis null outside aClientDataScope, and this test switches the language outside one.doctest_discover_tests). Running the binary as a whole, as an IDE does, crashes every time. Two test cases are enough: "Loading item data fills ItemAttribute in the UI locale", then this one.The fix:
ClientDataScope, so it has an item table of its own.g_ItemDataHandler.SetTranslateItemNames(false). Before, it only set the item database's display locale to English. Once the item data was loaded, the handler overrode that on the language switch, so the item names weren't English any more and the test no longer tested what its name says. It now checks that the names stay English.ClientDataScope's comment says that a test which switches the UI language needs one.Only tests change.
Related issues
Follow-up to #813 (step 1 of #815).
Checklist
docs/CODING_RULES.md.docs/build/README.md).test_item_database_filespasses as a whole (160 test cases), also in three random orders (--order-by=rand). Withmain's version of the test, the same build crashes as above.