aboutsummaryrefslogtreecommitdiff
path: root/instance_test.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-25 12:09:12 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-25 12:09:12 +0100
commit2391eaeb19c810df86af7591af1575a6d6eb5d4b (patch)
tree1b5787d285694e75f33ad0e7623da2d7fbc706c1 /instance_test.go
parent71260fceaf883051461bd2c5016713e303903f6b (diff)
added get-entries request parsing test
Diffstat (limited to 'instance_test.go')
-rw-r--r--instance_test.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/instance_test.go b/instance_test.go
index 6ce31a9..40a0c57 100644
--- a/instance_test.go
+++ b/instance_test.go
@@ -11,7 +11,13 @@ import (
)
var (
- testHashLen = 31
+ testHashLen = 31
+ testMaxRange = int64(3)
+ testMaxChain = int64(3)
+ testTreeId = int64(0)
+ testPrefix = "/test"
+ testHashType = crypto.SHA256
+ testExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageAny}
)
func makeTestLogParameters(t *testing.T, signer crypto.Signer) *LogParameters {
@@ -23,15 +29,15 @@ func makeTestLogParameters(t *testing.T, signer crypto.Signer) *LogParameters {
t.Fatalf("must have %d trust anchor(s), got %d", want, got)
}
return &LogParameters{
- LogId: make([]byte, 32),
- TreeId: 0,
- Prefix: "/test",
- MaxRange: 3,
- MaxChain: 3,
+ LogId: testLogId,
+ TreeId: testTreeId,
+ Prefix: testPrefix,
+ MaxRange: testMaxRange,
+ MaxChain: testMaxChain,
AnchorPool: x509util.NewCertPool(anchorList),
AnchorList: anchorList,
- KeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
+ KeyUsage: testExtKeyUsage,
Signer: signer,
- HashType: crypto.SHA256,
+ HashType: testHashType,
}
}