Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
6c8c8c13
Commit
6c8c8c13
authored
Nov 09, 2018
by
Daniel Le Berre
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New test case to make sure that the order is properly maintained. Thanks
STAMP.
parent
309b935d
Pipeline
#3333
passed with stages
in 47 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
org.sat4j.core/src/test/java/org/sat4j/minisat/core/HeapTest.java
...j.core/src/test/java/org/sat4j/minisat/core/HeapTest.java
+22
-11
No files found.
org.sat4j.core/src/test/java/org/sat4j/minisat/core/HeapTest.java
View file @
6c8c8c13
...
...
@@ -29,10 +29,10 @@
*******************************************************************************/
package
org.sat4j.minisat.core
;
import
junit.framework.TestCase
;
import
org.sat4j.minisat.orders.ActivityBasedVariableComparator
;
import
junit.framework.TestCase
;
public
class
HeapTest
extends
TestCase
{
/*
...
...
@@ -46,8 +46,8 @@ public class HeapTest extends TestCase {
* Test method for 'org.sat4j.minisat.core.Heap.inHeap(int)'
*/
public
void
testInHeap
()
{
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
3.0
,
9.0
,
2.0
}));
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
3.0
,
9.0
,
2.0
}));
heap
.
setBounds
(
5
);
assertFalse
(
heap
.
inHeap
(
1
));
assertFalse
(
heap
.
inHeap
(
2
));
...
...
@@ -83,15 +83,26 @@ public class HeapTest extends TestCase {
* Test method for 'org.sat4j.minisat.core.Heap.increase(int)'
*/
public
void
testIncrease
()
{
double
[]
activity
=
new
double
[]
{
0.0
,
3.0
,
6.0
,
9.0
};
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
activity
));
heap
.
setBounds
(
5
);
heap
.
insert
(
1
);
heap
.
insert
(
2
);
heap
.
insert
(
3
);
assertEquals
(
3
,
heap
.
getmin
());
assertFalse
(
heap
.
inHeap
(
3
));
heap
.
insert
(
3
);
activity
[
2
]
=
12.0
;
heap
.
increase
(
2
);
assertEquals
(
2
,
heap
.
getmin
());
}
/*
* Test method for 'org.sat4j.minisat.core.Heap.empty()'
*/
public
void
testEmpty
()
{
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{}));
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{}));
assertTrue
(
heap
.
empty
());
}
...
...
@@ -99,8 +110,8 @@ public class HeapTest extends TestCase {
* Test method for 'org.sat4j.minisat.core.Heap.insert(int)'
*/
public
void
testInsert
()
{
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
1.0
,
1.0
,
2.0
}));
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
1.0
,
1.0
,
2.0
}));
heap
.
setBounds
(
5
);
heap
.
insert
(
1
);
heap
.
insert
(
2
);
...
...
@@ -114,8 +125,8 @@ public class HeapTest extends TestCase {
* Test method for 'org.sat4j.minisat.core.Heap.getmin()'
*/
public
void
testGetmin
()
{
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
3.0
,
9.0
,
2.0
}));
Heap
heap
=
new
Heap
(
new
ActivityBasedVariableComparator
(
new
double
[]
{
0.0
,
3.0
,
9.0
,
2.0
}));
heap
.
setBounds
(
5
);
heap
.
insert
(
1
);
heap
.
insert
(
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment