The configId is the file name under which the config is stored. When it
changes or is not deterministic, we will not be able to restore the user
settings. The hashing must be stable (and seems to be), but since there
were reports lately that e.g. rotation is not correctly stored/loaded,
it makes sense to test that this is not the cause.
Details
Diff Detail
- Repository
- R104 KScreen
- Branch
- arcpatch-D14364
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 1224 Build 1238: arc lint + arc unit
tests/kded/serializertest.cpp | ||
---|---|---|
127 | How did you find this config id and the one below out? Pls add a comment how these magic numbers relate to the json files and how you obtained them from the json files. |
tests/kded/serializertest.cpp | ||
---|---|---|
163 | Below we do some tests in regards to the current config id value. These tests are unrelated to any changes of the config id value over time. Therefore it should not reference the magic config id value. Replace the above two lines with: auto configId = Serializer::configId(config); // check that this config id value is unchanged from previous versions of this software QCOMPARE(configId, QLatin1String("8684e883209d7644eb76feea2081c431"); Rest below unchanged in this function. Same in additions to function testRotatedScreenConfig. |
tests/kded/serializertest.cpp | ||
---|---|---|
163 | I was hoping the comment above is enough, repeated explanations are not that sensible either in my opinion. I need the constant configId to compare against it later, the point is to confirm that the configId is independent of the order of outputs in the hash for example. |
tests/kded/serializertest.cpp | ||
---|---|---|
163 | You can leave the comment out if you want to. My core "complain" is this: In your code the line 163 QCOMPARE(Serializer::configId(config), configId); checks, that the config file names stay the same. For that it compares the config id value at the time the test is run to a static one, which you have fixated at an arbitrary point in time (which was when you wrote this change). This test is to make sure, that config id value stays the same over time. Below you have in line 172 again a comparison. But this time it makes sure that on changes to output ids the config id stays the same. This is not dependent on how the static value was at the time you wrote the patch but only on the value of the current one when the test is run. For example the current value when the test is run could become different to the fixated one. But the current value should (and could) still be constant over output id changes. Of course this does not influence the result of the test, because it fails already above in this case. But in theory it makes more sense to compare config ids on output id changes in regards to a variable holding the config id value when the test is run instead of comparing it with the fixated one. |