Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
dac983f7
Commit
dac983f7
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
for Windows, EXPECT_EXIT muts be replaced by EXPECT_DEATH
parent
1384560b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/UnitTests/Core/Basics/TestAssert.cpp
+1
-7
1 addition, 7 deletions
Tests/UnitTests/Core/Basics/TestAssert.cpp
Tests/UnitTests/GUI/TestSessionItem.cpp
+8
-8
8 additions, 8 deletions
Tests/UnitTests/GUI/TestSessionItem.cpp
with
9 additions
and
15 deletions
Tests/UnitTests/Core/Basics/TestAssert.cpp
+
1
−
7
View file @
dac983f7
...
@@ -8,11 +8,5 @@ class TestAssert : public ::testing::Test
...
@@ -8,11 +8,5 @@ class TestAssert : public ::testing::Test
TEST_F
(
TestAssert
,
Assert
)
TEST_F
(
TestAssert
,
Assert
)
{
{
EXPECT_NO_THROW
(
ASSERT
(
1
));
EXPECT_NO_THROW
(
ASSERT
(
1
));
#ifndef _WIN32 // no clue about argument 2 of EXPECT_EXIT under Windows
EXPECT_DEATH
(
ASSERT
(
0
),
"Assertion .* failed .*"
);
#ifdef QT_MESSAGELOGCONTEXT
EXPECT_EXIT
(
ASSERT
(
0
),
::
testing
::
KilledBySignal
(
6
),
"Assertion .* failed .*"
);
#else
EXPECT_EXIT
(
ASSERT
(
0
),
::
testing
::
KilledBySignal
(
6
),
"Assertion .* failed"
);
#endif
#endif
}
}
This diff is collapsed.
Click to expand it.
Tests/UnitTests/GUI/TestSessionItem.cpp
+
8
−
8
View file @
dac983f7
...
@@ -26,7 +26,7 @@ TEST_F(TestSessionItem, defaultTag)
...
@@ -26,7 +26,7 @@ TEST_F(TestSessionItem, defaultTag)
// insertion without tag is forbidden
// insertion without tag is forbidden
SessionItem
*
child
=
new
SessionItem
(
modelType
);
SessionItem
*
child
=
new
SessionItem
(
modelType
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
),
".*"
);
delete
child
;
delete
child
;
EXPECT_EQ
(
item
->
numberOfChildren
(),
0
);
EXPECT_EQ
(
item
->
numberOfChildren
(),
0
);
}
}
...
@@ -56,7 +56,7 @@ TEST_F(TestSessionItem, singleTagAndItems)
...
@@ -56,7 +56,7 @@ TEST_F(TestSessionItem, singleTagAndItems)
SessionItem
*
child
=
new
SessionItem
(
modelType
);
SessionItem
*
child
=
new
SessionItem
(
modelType
);
EXPECT_TRUE
(
item
->
insertItem
(
0
,
child
,
tag1
));
EXPECT_TRUE
(
item
->
insertItem
(
0
,
child
,
tag1
));
// double insertion is forbidden
// double insertion is forbidden
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
tag1
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
tag1
),
".*"
);
EXPECT_TRUE
(
child
->
parent
()
==
item
.
get
());
EXPECT_TRUE
(
child
->
parent
()
==
item
.
get
());
EXPECT_EQ
(
item
->
numberOfChildren
(),
1
);
EXPECT_EQ
(
item
->
numberOfChildren
(),
1
);
...
@@ -136,7 +136,7 @@ TEST_F(TestSessionItem, tagWithLimits)
...
@@ -136,7 +136,7 @@ TEST_F(TestSessionItem, tagWithLimits)
EXPECT_TRUE
(
item
->
insertItem
(
-
1
,
child
,
tag1
));
EXPECT_TRUE
(
item
->
insertItem
(
-
1
,
child
,
tag1
));
}
}
auto
extra
=
new
SessionItem
(
modelType
);
auto
extra
=
new
SessionItem
(
modelType
);
EXPECT_
EXIT
(
item
->
insertItem
(
-
1
,
extra
,
tag1
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
-
1
,
extra
,
tag1
),
".*"
);
}
}
TEST_F
(
TestSessionItem
,
tagsAndModelTypes
)
TEST_F
(
TestSessionItem
,
tagsAndModelTypes
)
...
@@ -251,25 +251,25 @@ TEST_F(TestSessionItem, modelTypes)
...
@@ -251,25 +251,25 @@ TEST_F(TestSessionItem, modelTypes)
EXPECT_TRUE
(
item
->
insertItem
(
0
,
new
SessionItem
(
model2
),
"Tag1"
));
EXPECT_TRUE
(
item
->
insertItem
(
0
,
new
SessionItem
(
model2
),
"Tag1"
));
auto
child
=
new
SessionItem
(
model3
);
auto
child
=
new
SessionItem
(
model3
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
".*"
);
delete
child
;
delete
child
;
child
=
new
SessionItem
(
model4
);
child
=
new
SessionItem
(
model4
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
".*"
);
delete
child
;
delete
child
;
child
=
new
SessionItem
(
model5
);
child
=
new
SessionItem
(
model5
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
"Tag1"
),
".*"
);
delete
child
;
delete
child
;
EXPECT_TRUE
(
item
->
registerTag
(
"Tag2"
,
0
,
-
1
,
QStringList
()
<<
model3
<<
model4
<<
model5
));
EXPECT_TRUE
(
item
->
registerTag
(
"Tag2"
,
0
,
-
1
,
QStringList
()
<<
model3
<<
model4
<<
model5
));
child
=
new
SessionItem
(
model1
);
child
=
new
SessionItem
(
model1
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
"Tag2"
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
"Tag2"
),
".*"
);
delete
child
;
delete
child
;
child
=
new
SessionItem
(
model2
);
child
=
new
SessionItem
(
model2
);
EXPECT_
EXIT
(
item
->
insertItem
(
0
,
child
,
"Tag2"
),
::
testing
::
KilledBySignal
(
6
),
".*"
);
EXPECT_
DEATH
(
item
->
insertItem
(
0
,
child
,
"Tag2"
),
".*"
);
delete
child
;
delete
child
;
EXPECT_TRUE
(
item
->
insertItem
(
0
,
new
SessionItem
(
model3
),
"Tag2"
));
EXPECT_TRUE
(
item
->
insertItem
(
0
,
new
SessionItem
(
model3
),
"Tag2"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment