summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-21 08:56:15 +0100
committerLaurent Montel <[email protected]>2018-02-21 08:56:15 +0100
commit2487429de8ef698e97c0c65266bddece17d3e38e (patch)
treefb84ab822ab5425472915299a272db34705a3cac
parentc7e577c94c3a72e33168afdb8b0a2de9bf98899d (diff)
Add more autotest
-rw-r--r--autotests/categorytypecomboboxtest.cpp16
-rw-r--r--autotests/categorytypecomboboxtest.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/autotests/categorytypecomboboxtest.cpp b/autotests/categorytypecomboboxtest.cpp
index a6b23f1..035fa57 100644
--- a/autotests/categorytypecomboboxtest.cpp
+++ b/autotests/categorytypecomboboxtest.cpp
@@ -38,6 +38,7 @@ void CategoryTypeComboBoxTest::shouldHaveDefaultValue()
CategoryTypeComboBox w2(false);
QCOMPARE(w2.count(), 6);
+
}
void CategoryTypeComboBoxTest::shouldSetType_data()
@@ -79,4 +80,19 @@ void CategoryTypeComboBoxTest::shouldVerifyItNotDefault()
QVERIFY(w.loggingCategoryIsNotDefault());
}
+void CategoryTypeComboBoxTest::shouldChangeDefaultCategory()
+{
+ CategoryTypeComboBox w(true);
+ w.setDefaultCategories(LoggingCategory::All);
+ w.setType(LoggingCategory::All);
+ QVERIFY(!w.loggingCategoryIsNotDefault());
+
+ w.setDefaultCategories(LoggingCategory::Critical);
+ w.setType(LoggingCategory::Critical);
+ QVERIFY(!w.loggingCategoryIsNotDefault());
+
+ w.setType(LoggingCategory::Debug);
+ QVERIFY(w.loggingCategoryIsNotDefault());
+}
+
QTEST_MAIN(CategoryTypeComboBoxTest)
diff --git a/autotests/categorytypecomboboxtest.h b/autotests/categorytypecomboboxtest.h
index 6237606..748eab5 100644
--- a/autotests/categorytypecomboboxtest.h
+++ b/autotests/categorytypecomboboxtest.h
@@ -35,6 +35,7 @@ private Q_SLOTS:
void shouldSetType();
void shouldVerifyItNotDefault();
+ void shouldChangeDefaultCategory();
};
#endif // CATEGORYTYPECOMBOBOXTEST_H