This allows us to make sure that when a config file is borked, we're not
suddenly creating invalid configs.
Details
Details
- Reviewers
graesslin - Group Reviewers
Plasma - Commits
- R104:2cc73bd0608a: add some tests for corrupt configs
tests pass
Diff Detail
Diff Detail
- Repository
- R104 KScreen
- Branch
- sebas/corruptautotests
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
more realistic corrupt config file
This simulates the config half-written, which it seems could happen
if we end up reading mid-write.
tests/kded/serializertest.cpp | ||
---|---|---|
230 | Shouldn't that config be empty? Or does does it continue using the config from the previous test? |
Comment Actions
I found the logic puzzling at first as well, but what the Serializer does it it takes a config object and tries to change it. (Not my idea, but it seems to work quite OK overall). Serializer::config() is a bit special then because it can do two things: return an invalid pointer or not change the config. This logic is not something I want to change, we have enough bugs in the code as-is, and the last thing I want to do is destabilize it, so I'd rather have it do some additional checking.