Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
elixxir
client
Commits
88cbb390
Unverified
Commit
88cbb390
authored
4 years ago
by
Sydney Anne Erickson
Browse files
Options
Downloads
Patches
Plain Diff
Add params.go and status.go tests for Key
parent
b8fb49f4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
key/params_test.go
+25
-0
25 additions, 0 deletions
key/params_test.go
key/status_test.go
+21
-0
21 additions, 0 deletions
key/status_test.go
with
46 additions
and
0 deletions
key/params_test.go
0 → 100644
+
25
−
0
View file @
88cbb390
package
key
// Testing file for the params.go functions
import
"testing"
// Test that the GetDefaultParams function returns the right default data
func
Test_GetDefaultParams
(
t
*
testing
.
T
)
{
p
:=
GetDefaultParams
()
if
p
.
MinKeys
!=
minKeys
{
t
.
Errorf
(
"MinKeys mismatch
\r\t
Got: %d
\r\t
Expected: %d"
,
p
.
MinKeys
,
minKeys
)
}
if
p
.
MaxKeys
!=
maxKeys
{
t
.
Errorf
(
"MinKeys mismatch
\r\t
Got: %d
\r\t
Expected: %d"
,
p
.
MaxKeys
,
maxKeys
)
}
if
p
.
NumRekeys
!=
numReKeys
{
t
.
Errorf
(
"MinKeys mismatch
\r\t
Got: %d
\r\t
Expected: %d"
,
p
.
NumRekeys
,
numReKeys
)
}
if
p
.
TTLScalar
!=
ttlScalar
{
t
.
Errorf
(
"MinKeys mismatch
\r\t
Got: %d
\r\t
Expected: %d"
,
p
.
TTLScalar
,
ttlScalar
)
}
if
p
.
MinNumKeys
!=
threshold
{
t
.
Errorf
(
"MinKeys mismatch
\r\t
Got: %d
\r\t
Expected: %d"
,
p
.
MinNumKeys
,
threshold
)
}
}
This diff is collapsed.
Click to expand it.
key/status_test.go
0 → 100644
+
21
−
0
View file @
88cbb390
package
key
// Testing file for the status.go functions
import
"testing"
// Test that Status_String returns the right strings for a status
func
Test_Status_String
(
t
*
testing
.
T
)
{
if
Status
(
Active
)
.
String
()
!=
"Active"
{
t
.
Errorf
(
"Testing Active returned mismatch.
\r\t
Got: %s
\r\t
Expected: %s"
,
Status
(
Active
)
.
String
(),
"Active"
)
}
if
Status
(
RekeyNeeded
)
.
String
()
!=
"Rekey Needed"
{
t
.
Errorf
(
"Testing RekeyNeeded returned mismatch.
\r\t
Got: %s
\r\t
Expected: %s"
,
Status
(
RekeyNeeded
)
.
String
(),
"Rekey Needed"
)
}
if
Status
(
Empty
)
.
String
()
!=
"Empty"
{
t
.
Errorf
(
"Testing Empty returned mismatch.
\r\t
Got: %s
\r\t
Expected: %s"
,
Status
(
Empty
)
.
String
(),
"Empty"
)
}
if
Status
(
RekeyEmpty
)
.
String
()
!=
"Rekey Empty"
{
t
.
Errorf
(
"Testing RekeyEmpty returned mismatch.
\r\t
Got: %s
\r\t
Expected: %s"
,
Status
(
RekeyEmpty
)
.
String
(),
"Rekey Empty"
)
}
}
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