diff --git a/tests/kded/serializertest.cpp b/tests/kded/serializertest.cpp --- a/tests/kded/serializertest.cpp +++ b/tests/kded/serializertest.cpp @@ -124,6 +124,10 @@ auto screen = config->screen(); QCOMPARE(screen->currentSize(), QSize(1920, 1280)); + // The id is what is used as file name (hash of the attached output's properties) + // if it changes, it means we will not be loading the right files again, + // so if this test fails, either migration is needed or we accept breakage (and update the hash here and below). + QCOMPARE(Serializer::configId(config), QLatin1String("229fa9e8a378cb151d7302df42666774")); } void TestSerializer::testTwoScreenConfig() @@ -154,6 +158,18 @@ auto screen = config->screen(); QCOMPARE(screen->currentSize(), QSize(3200, 1280)); + + auto configId = QLatin1String("8684e883209d7644eb76feea2081c431"); + QCOMPARE(Serializer::configId(config), configId); + + // Make sure output IDs do not influence configId, we should end up loading/saving + // under the same filename independent of initialization order. + OutputList reversed; + reversed[4] = config->output(2); + config->output(2)->setId(4); + reversed[2] = config->output(1); + config->setOutputs(reversed); + QCOMPARE(Serializer::configId(config), configId); } void TestSerializer::testRotatedScreenConfig() @@ -184,6 +200,13 @@ auto screen = config->screen(); QCOMPARE(screen->currentSize(), QSize(2944, 1280)); + + auto configId = QLatin1String("8684e883209d7644eb76feea2081c431"); + QCOMPARE(Serializer::configId(config), configId); + config->connectedOutputs().last()->setRotation(KScreen::Output::Right); + QCOMPARE(config->connectedOutputs().last()->rotation(), KScreen::Output::Right); + // Rotating a screen should be saved, but not influence the ID which determines the file name. + QCOMPARE(Serializer::configId(config), configId); } void TestSerializer::testDisabledScreenConfig()