summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-20 07:50:18 +0100
committerLaurent Montel <[email protected]>2018-02-20 07:50:18 +0100
commit8af7c87f010c41e4501dad4168b8d738a825c5d4 (patch)
tree86eef7630c3f026c7579ac9f2db5d41e526c5a6e
parentbb3f2ccc939c214a40c929526c69ccb9309949af (diff)
Add autotest
-rw-r--r--autotests/categorytypecomboboxtest.cpp19
-rw-r--r--autotests/categorytypecomboboxtest.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/autotests/categorytypecomboboxtest.cpp b/autotests/categorytypecomboboxtest.cpp
index 6975694..f1620af 100644
--- a/autotests/categorytypecomboboxtest.cpp
+++ b/autotests/categorytypecomboboxtest.cpp
@@ -62,4 +62,23 @@ void CategoryTypeComboBoxTest::shouldSetType()
QCOMPARE(w.type(), input);
}
+void CategoryTypeComboBoxTest::shouldVerifyItNotDefault()
+{
+ CategoryTypeComboBox w(true);
+ w.setType(LoggingCategory::All);
+ QVERIFY(w.loggingCategoryIsNotDefault());
+
+ w.setType(LoggingCategory::Info);
+ QVERIFY(!w.loggingCategoryIsNotDefault());
+
+ w.setType(LoggingCategory::Warning);
+ QVERIFY(w.loggingCategoryIsNotDefault());
+
+ w.setType(LoggingCategory::Debug);
+ QVERIFY(w.loggingCategoryIsNotDefault());
+
+ w.setType(LoggingCategory::Critical);
+ QVERIFY(w.loggingCategoryIsNotDefault());
+}
+
QTEST_MAIN(CategoryTypeComboBoxTest)
diff --git a/autotests/categorytypecomboboxtest.h b/autotests/categorytypecomboboxtest.h
index 2277182..6237606 100644
--- a/autotests/categorytypecomboboxtest.h
+++ b/autotests/categorytypecomboboxtest.h
@@ -33,6 +33,8 @@ private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldSetType_data();
void shouldSetType();
+
+ void shouldVerifyItNotDefault();
};
#endif // CATEGORYTYPECOMBOBOXTEST_H