Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Jan 6, 2024

No description provided.

@firewave
Copy link
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
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 danmar:main Jan 6, 2024
64 checks passed
@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