mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Fix empty catalogue loaded state and compact Essence selection behavior
This commit is contained in:
parent
5657716d13
commit
a7222c92f9
1 changed files with 21 additions and 0 deletions
|
|
@ -65,6 +65,27 @@ TEST(CardDatabaseTest, LoadXml)
|
||||||
ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear";
|
ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(CardDatabaseTest, EmptyLoadedSnapshotIsReadyNotLoading)
|
||||||
|
{
|
||||||
|
NoopCardPreferenceProvider prefs;
|
||||||
|
TestCardDatabasePathProvider pathProvider;
|
||||||
|
NoopCardSetPriorityController controller;
|
||||||
|
CardDatabase db(nullptr, &prefs, &pathProvider, &controller);
|
||||||
|
|
||||||
|
EXPECT_EQ(NotLoaded, db.getLoadStatus());
|
||||||
|
|
||||||
|
// A newly bootstrapped Continuumatrice profile contains a valid, but empty,
|
||||||
|
// XML v4 catalogue. Successful swap must not trap the visual browser on
|
||||||
|
// "Loading database..." when there are zero cards.
|
||||||
|
CardDatabaseData emptySnapshot;
|
||||||
|
db.swapInDatabaseData(std::move(emptySnapshot));
|
||||||
|
EXPECT_TRUE(db.getCardList().isEmpty());
|
||||||
|
EXPECT_EQ(Ok, db.getLoadStatus());
|
||||||
|
|
||||||
|
db.clear();
|
||||||
|
EXPECT_EQ(NotLoaded, db.getLoadStatus());
|
||||||
|
}
|
||||||
|
|
||||||
TEST(CardDatabaseTest, LazyPropertiesHashStreamsBlobAccessors)
|
TEST(CardDatabaseTest, LazyPropertiesHashStreamsBlobAccessors)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> props;
|
QHash<QString, QString> props;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue