Permalink
Browse files

dependencies fix; qrkernel tests finished; utils tests location fixed

  • Loading branch information...
1 parent 5c95cbb commit a5f7c81e67b74e7840ba9a0aa8cdefc0ebcefebd @vapolyakov vapolyakov committed Aug 24, 2012
View
@@ -48,6 +48,11 @@ infile(qrtest/unitTests/unittestDeclaration.cfg, UNIT_TEST, TRUE) {
qrxcTest.file = qrxc/qrxcTest.pro
qrguiTest.file = qrgui/qrguiTest.pro
- qrxcTest.depends = qrxc
- qrguiTest.depends = qrgui
+ qrxcTest.depends = \
+ qrxc \
+ thirdparty \
+
+ qrguiTest.depends = \
+ qrgui \
+ thirdparty \
}
View
@@ -11,5 +11,10 @@ qrtest.depends = \
qrxcTest.file = qrxc/qrxcTest.pro
qrguiTest.file = qrgui/qrguiTest.pro
-qrxcTest.depends = qrxc
-qrguiTest.depends = qrgui
+qrxcTest.depends = \
+ qrxc \
+ thirdparty \
+
+qrguiTest.depends = \
+ qrgui \
+ thirdparty \
@@ -7,9 +7,17 @@
using namespace qReal;
TEST(IdsTest, loadFromStringTest) {
+ ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+
EXPECT_DEATH_IF_SUPPORTED(Id::loadFromString("qrm:/editor/diagram/element/id/test")
, ".*path\\.count\\(\\) > 0 && path\\.count\\(\\) <= 5.*");
+ EXPECT_DEATH_IF_SUPPORTED(Id::loadFromString("qm:/editor/diagram/element/id")
+ , ".*path\\[0\\] == \"qrm:\".*");
+
+ EXPECT_DEATH_IF_SUPPORTED(Id::loadFromString("qrm:/editor//diagram")
+ , ".*string == result\\.toString\\(\\).*");
+
Id id = Id::loadFromString("qrm:/editor/diagram/element/id");
EXPECT_EQ(id, Id("editor", "diagram", "element", "id"));
@@ -26,6 +34,22 @@ TEST(IdsTest, loadFromStringTest) {
EXPECT_EQ(id, Id("", "", "", ""));
}
+TEST(IdsTest, checkIntegrityTest) {
+ ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+
+ EXPECT_DEATH_IF_SUPPORTED(Id id("editor", "diagram", "", "id")
+ , ".*checkIntegrity\\(\\).*");
+
+ EXPECT_DEATH_IF_SUPPORTED(Id id("editor", "", "element", "id")
+ , ".*checkIntegrity\\(\\).*");
+
+ EXPECT_DEATH_IF_SUPPORTED(Id id("", "diagram", "element", "id")
+ , ".*checkIntegrity\\(\\).*");
+
+ EXPECT_DEATH_IF_SUPPORTED(Id id("editor", "", "", "id")
+ , ".*checkIntegrity\\(\\).*");
+}
+
TEST(IdsTest, createElementIdTest) {
Id id = Id::createElementId("diagram", "editor", "element");
EXPECT_TRUE(id.id() != "");
@@ -37,6 +61,8 @@ TEST(IdsTest, rootIdTest) {
}
TEST(IdsTest, additonalConstructorTest) {
+ ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+
EXPECT_DEATH_IF_SUPPORTED(Id id(Id::loadFromString("qrm:/editor/diagram/element/id"), "test")
, ".*Can not add a part to Id, it will be too long.*");
@@ -31,3 +31,8 @@ TEST_F(SettingsManagerTest, saveDataTest) {
EXPECT_EQ(mSettingsManager->value("debugColor").toString(), "test color");
}
+
+TEST_F(SettingsManagerTest, defaultValueTest) {
+ QString const val = mSettingsManager->value("aabbccTestProperty", "default value").toString();
+ EXPECT_EQ(val, "default value");
+}
@@ -6,7 +6,7 @@ using namespace utils;
using namespace qrTest;
using ::testing::Exactly;
-using ::testing::_;
+using ::testing::_;
void ExpressionParserTest::SetUp() {
mParser = new ExpressionsParser(&mErrorReporter);
@@ -1,8 +1,8 @@
SOURCES += \
- qrutilsTests/expressionParserTest.cpp \
- qrutilsTests/numberTest.cpp \
- qrutilsTests/metamodelGeneratorSupportTest.cpp
+ qrutilsTests/expressionsParser/expressionParserTest.cpp \
+ qrutilsTests/expressionsParser/numberTest.cpp \
+ qrutilsTests/metamodelGeneratorSupportTest.cpp \
HEADERS += \
- qrutilsTests/expressionParserTest.h \
- qrutilsTests/metamodelGeneratorSupportTest.h
+ qrutilsTests/expressionsParser/expressionParserTest.h \
+ qrutilsTests/metamodelGeneratorSupportTest.h \

0 comments on commit a5f7c81

Please sign in to comment.