Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ttc18
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stgroup
ttc18
Commits
26fcc753
Commit
26fcc753
authored
6 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Always check for empty solution in tests.
parent
0c4e491f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jastadd-mquat-solver/src/test/java/de/tudresden/inf/st/mquat/solving/HandwrittenTestSuite.java
+5
-2
5 additions, 2 deletions
.../tudresden/inf/st/mquat/solving/HandwrittenTestSuite.java
with
5 additions
and
2 deletions
jastadd-mquat-solver/src/test/java/de/tudresden/inf/st/mquat/solving/HandwrittenTestSuite.java
+
5
−
2
View file @
26fcc753
...
@@ -91,6 +91,9 @@ public abstract class HandwrittenTestSuite {
...
@@ -91,6 +91,9 @@ public abstract class HandwrittenTestSuite {
private
void
assertValidSolution
(
Tuple
<
Root
,
Solution
>
modelAndSolution
)
{
private
void
assertValidSolution
(
Tuple
<
Root
,
Solution
>
modelAndSolution
)
{
// Assert.assertTrue("Solution is not valid", modelAndSolution.getSecondElement().isValid());
// Assert.assertTrue("Solution is not valid", modelAndSolution.getSecondElement().isValid());
if
(
modelAndSolution
.
getSecondElement
().
getNumAssignment
()
==
0
)
{
logger
.
warn
(
"Solution is empty"
);
}
collector
.
checkThat
(
"Solution is not valid"
,
true
,
collector
.
checkThat
(
"Solution is not valid"
,
true
,
equalTo
(
modelAndSolution
.
getSecondElement
().
isValid
()));
equalTo
(
modelAndSolution
.
getSecondElement
().
isValid
()));
}
}
...
@@ -98,19 +101,19 @@ public abstract class HandwrittenTestSuite {
...
@@ -98,19 +101,19 @@ public abstract class HandwrittenTestSuite {
@Test
@Test
public
void
test_01
()
throws
IOException
,
Parser
.
Exception
,
SolvingException
{
public
void
test_01
()
throws
IOException
,
Parser
.
Exception
,
SolvingException
{
Tuple
<
Root
,
Solution
>
modelAndSolution
=
loadAndSolve
(
"test_01.txt"
);
Tuple
<
Root
,
Solution
>
modelAndSolution
=
loadAndSolve
(
"test_01.txt"
);
assertValidSolution
(
modelAndSolution
);
Assignment
config_0i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_0i0m0"
,
"r0"
);
Assignment
config_0i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_0i0m0"
,
"r0"
);
Assignment
config_1i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_1i0m0"
,
"r1"
);
Assignment
config_1i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_1i0m0"
,
"r1"
);
assertComponentRequirement
(
config_0i0m0
,
"other"
,
config_1i0m0
);
assertComponentRequirement
(
config_0i0m0
,
"other"
,
config_1i0m0
);
assertValidSolution
(
modelAndSolution
);
}
}
@Test
@Test
public
void
test_02
()
throws
IOException
,
Parser
.
Exception
,
SolvingException
{
public
void
test_02
()
throws
IOException
,
Parser
.
Exception
,
SolvingException
{
Tuple
<
Root
,
Solution
>
modelAndSolution
=
loadAndSolve
(
"test_02.txt"
);
Tuple
<
Root
,
Solution
>
modelAndSolution
=
loadAndSolve
(
"test_02.txt"
);
assertValidSolution
(
modelAndSolution
);
Assignment
config_0i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_0i0m0"
,
"r0"
);
Assignment
config_0i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_0i0m0"
,
"r0"
);
Assignment
config_1i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_1i0m0"
,
"r1"
);
Assignment
config_1i0m0
=
assertAssignment
(
modelAndSolution
,
0
,
"config_1i0m0"
,
"r1"
);
assertComponentRequirement
(
config_0i0m0
,
"other"
,
config_1i0m0
);
assertComponentRequirement
(
config_0i0m0
,
"other"
,
config_1i0m0
);
assertValidSolution
(
modelAndSolution
);
}
}
@Test
@Test
...
...
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