Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
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
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
c1d24d05
Commit
c1d24d05
authored
10 years ago
by
akwizgran
Committed by
Abraham Kiggundu
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Skip platform-specific tests when testing on another platform.
parent
f0f5daf6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-tests/src/org/briarproject/system/LinuxSeedProviderTest.java
+15
-0
15 additions, 0 deletions
...ts/src/org/briarproject/system/LinuxSeedProviderTest.java
with
15 additions
and
0 deletions
briar-tests/src/org/briarproject/system/LinuxSeedProviderTest.java
+
15
−
0
View file @
c1d24d05
...
...
@@ -12,6 +12,7 @@ import java.util.Set;
import
org.briarproject.BriarTestCase
;
import
org.briarproject.TestUtils
;
import
org.briarproject.api.Bytes
;
import
org.briarproject.util.OsUtils
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -20,6 +21,7 @@ public class LinuxSeedProviderTest extends BriarTestCase {
private
final
File
testDir
=
TestUtils
.
getTestDirectory
();
@Override
@Before
public
void
setUp
()
{
testDir
.
mkdirs
();
...
...
@@ -27,6 +29,10 @@ public class LinuxSeedProviderTest extends BriarTestCase {
@Test
public
void
testSeedAppearsSane
()
{
if
(!(
OsUtils
.
isLinux
()))
{
System
.
err
.
println
(
"WARNING: Skipping test, can't run on this OS"
);
return
;
}
Set
<
Bytes
>
seeds
=
new
HashSet
<
Bytes
>();
LinuxSeedProvider
p
=
new
LinuxSeedProvider
();
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
...
...
@@ -38,6 +44,10 @@ public class LinuxSeedProviderTest extends BriarTestCase {
@Test
public
void
testEntropyIsWrittenToPool
()
throws
Exception
{
if
(!(
OsUtils
.
isLinux
()))
{
System
.
err
.
println
(
"WARNING: Skipping test, can't run on this OS"
);
return
;
}
// Redirect the provider's entropy to a file
File
urandom
=
new
File
(
testDir
,
"urandom"
);
urandom
.
delete
();
...
...
@@ -52,6 +62,10 @@ public class LinuxSeedProviderTest extends BriarTestCase {
@Test
public
void
testSeedIsReadFromPool
()
throws
Exception
{
if
(!(
OsUtils
.
isLinux
()))
{
System
.
err
.
println
(
"WARNING: Skipping test, can't run on this OS"
);
return
;
}
// Generate a seed
byte
[]
seed
=
new
byte
[
SEED_BYTES
];
new
Random
().
nextBytes
(
seed
);
...
...
@@ -70,6 +84,7 @@ public class LinuxSeedProviderTest extends BriarTestCase {
assertArrayEquals
(
seed
,
p
.
getSeed
());
}
@Override
@After
public
void
tearDown
()
{
TestUtils
.
deleteTestDirectory
(
testDir
);
...
...
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