Skip to content

test/helpers:h: fixed initialization order in givenACodeSampleToTokenize#5849

Merged
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
firewave:test-helpers-init
Jan 6, 2024
Merged

test/helpers:h: fixed initialization order in givenACodeSampleToTokenize#5849
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
firewave:test-helpers-init

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Jan 6, 2024

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Jan 6, 2024

Discovered while working on #5848.

I filed https://trac.cppcheck.net/ticket/12322 about detecting this.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Jan 6, 2024

It is detected by valgrind:

==128445== Conditional jump or move depends on uninitialised value(s)
==128445==    at 0x7FCB88: TokenList::TokenList(Settings const*) (tokenlist.cpp:53)
==128445==    by 0x2EE861: Tokenizer::Tokenizer(Settings const*, ErrorLogger*, Preprocessor const*) (tokenize.cpp:156)
==128445==    by 0x9E519D: givenACodeSampleToTokenize::givenACodeSampleToTokenize(char const*, bool, bool) (helpers.h:45)
==128445==    by 0x9F1CA0: TestLibrary::container() const (testlibrary.cpp:873)
==128445==    by 0x9E5A4C: TestLibrary::run() (testlibrary.cpp:70)
==128445==    by 0x856F00: TestFixture::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (fixture.cpp:339)
==128445==    by 0x8574BB: TestFixture::runTests(options const&) (fixture.cpp:376)
==128445==    by 0x85C99C: main (main.cpp:42)

But we do not run any tests in it which use this code so that step did not fail in the other build. We should enable more tests and only omit the really slow ones. I filed https://trac.cppcheck.net/ticket/12323 about it.

@chrchr-github chrchr-github merged commit e3b3048 into cppcheck-opensource:main Jan 6, 2024
@firewave firewave deleted the test-helpers-init branch January 6, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants