mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
Added test file
This commit is contained in:
parent
e6b381e02d
commit
e85e81ce85
2 changed files with 67 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ cockatrice_add_test(
|
|||
)
|
||||
|
||||
# ------------------------
|
||||
# Filter String Test
|
||||
# Filter String and Tree Test
|
||||
# (guard must match the condition for libcockatrice_filters in the root CMakeLists.txt)
|
||||
# ------------------------
|
||||
if(WITH_ORACLE OR WITH_CLIENT)
|
||||
|
|
@ -35,6 +35,16 @@ if(WITH_ORACLE OR WITH_CLIENT)
|
|||
LIBS
|
||||
libcockatrice_filters
|
||||
)
|
||||
cockatrice_add_test(
|
||||
NAME
|
||||
filter_tree_test
|
||||
SOURCES
|
||||
${VERSION_STRING_CPP}
|
||||
filter_tree_test.cpp
|
||||
mocks.cpp
|
||||
LIBS
|
||||
libcockatrice_filters
|
||||
)
|
||||
endif()
|
||||
|
||||
# ------------------------
|
||||
|
|
|
|||
56
tests/carddatabase/filter_tree_test.cpp
Normal file
56
tests/carddatabase/filter_tree_test.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#include "libcockatrice/card/card_localization.h"
|
||||
#include "libcockatrice/card/database/card_database.h"
|
||||
#include "libcockatrice/card/database/card_database_querier.h"
|
||||
#include "libcockatrice/card/set/card_set.h"
|
||||
#include "test_card_database_path_provider.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include <QDate>
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
#include <QPair>
|
||||
#include <QSharedPointer>
|
||||
#include <QString>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/card/printing/printing_info.h>
|
||||
#include <libcockatrice/filters/filter_string.h>
|
||||
#include <libcockatrice/interfaces/noop_card_preference_provider.h>
|
||||
#include <libcockatrice/interfaces/noop_card_set_priority_controller.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class FilterTreeTest : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
void SetUp() override
|
||||
{
|
||||
CardDatabase *db = new CardDatabase(nullptr, new NoopCardPreferenceProvider(),
|
||||
new TestCardDatabasePathProvider(), new NoopCardSetPriorityController());
|
||||
db->loadCardDatabases();
|
||||
|
||||
cat = db->query()->getCardBySimpleName("Cat");
|
||||
notDeadAfterAll = db->query()->getCardBySimpleName("Not Dead");
|
||||
truth = db->query()->getCardBySimpleName("Truth");
|
||||
doctor = db->query()->getCardBySimpleName("Doctor");
|
||||
}
|
||||
// void TearDown() override {}
|
||||
|
||||
CardData cat;
|
||||
CardData notDeadAfterAll;
|
||||
CardData truth;
|
||||
CardData doctor;
|
||||
};
|
||||
|
||||
TEST_F(FilterTreeTest, TestOne)
|
||||
{
|
||||
ASSERT_TRUE(true);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue