Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
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
Christopher Schankula
2XB3FinalProject
Commits
1e1d7eb0
Commit
1e1d7eb0
authored
7 years ago
by
Lawrence Chung
Browse files
Options
Downloads
Patches
Plain Diff
CC test suite
parent
bdd53305
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/search/CCTest.java
+48
-0
48 additions, 0 deletions
src/search/CCTest.java
with
48 additions
and
0 deletions
src/search/CCTest.java
0 → 100644
+
48
−
0
View file @
1e1d7eb0
package
search
;
import
static
org
.
junit
.
Assert
.*;
import
org.junit.*
;
public
class
CCTest
{
@Before
public
void
setUp
()
throws
Exception
{
System
.
out
.
println
(
"Setting up...."
);
}
@Test
public
void
testId
(){
int
v
=
11
;
Graph
g
=
new
Graph
(
v
);
g
.
addEdge
(
1
,
3
);
g
.
addEdge
(
9
,
8
);
g
.
addEdge
(
3
,
8
);
g
.
addEdge
(
3
,
9
);
g
.
addEdge
(
7
,
4
);
g
.
addEdge
(
2
,
4
);
g
.
addEdge
(
4
,
6
);
g
.
addEdge
(
0
,
5
);
CC
cc
=
new
CC
(
g
);
assertEquals
(
cc
.
id
(
4
),
cc
.
id
(
6
));
assertNotEquals
(
cc
.
id
(
3
),
cc
.
id
(
4
));
}
@Test
public
void
TestConnected
(){
int
v
=
11
;
Graph
g
=
new
Graph
(
v
);
g
.
addEdge
(
1
,
3
);
g
.
addEdge
(
9
,
8
);
g
.
addEdge
(
3
,
8
);
g
.
addEdge
(
3
,
9
);
g
.
addEdge
(
7
,
4
);
g
.
addEdge
(
2
,
4
);
g
.
addEdge
(
4
,
6
);
g
.
addEdge
(
0
,
5
);
CC
cc
=
new
CC
(
g
);
assertEquals
(
cc
.
connected
(
0
,
1
),
false
);
assertEquals
(
cc
.
connected
(
8
,
9
),
true
);
assertNotEquals
(
cc
.
connected
(
0
,
10
),
true
);
assertEquals
(
cc
.
connected
(
2
,
7
),
true
);
}
}
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