summaryrefslogtreecommitdiff
path: root/internal/configfile/config_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-21 14:01:58 +0200
committerJakob Unterwurzacher2021-08-21 14:01:58 +0200
commit4b93525249e7dca3b76a4a2be924c4d57a4d81e1 (patch)
treec0636cec1911f70476444152a8435505449b5e29 /internal/configfile/config_test.go
parent2da0e13b1da4c903023200d6271b90f49077e8de (diff)
configfile: pass struct to Create 1/2
The argument list got too long. Part 1: Replace with Create2
Diffstat (limited to 'internal/configfile/config_test.go')
-rw-r--r--internal/configfile/config_test.go27
1 files changed, 23 insertions, 4 deletions
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go
index 17ca80c..659ddd9 100644
--- a/internal/configfile/config_test.go
+++ b/internal/configfile/config_test.go
@@ -62,7 +62,11 @@ func TestLoadV2StrangeFeature(t *testing.T) {
}
func TestCreateConfDefault(t *testing.T) {
- err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, false, nil, nil, false)
+ err := Create2(&CreateArgs{
+ Filename: "config_test/tmp.conf",
+ Password: testPw,
+ LogN: 10,
+ Creator: "test"})
if err != nil {
t.Fatal(err)
}
@@ -83,14 +87,24 @@ func TestCreateConfDefault(t *testing.T) {
}
func TestCreateConfDevRandom(t *testing.T) {
- err := Create("config_test/tmp.conf", testPw, false, 10, "test", false, true, nil, nil, false)
+ err := Create2(&CreateArgs{
+ Filename: "config_test/tmp.conf",
+ Password: testPw,
+ LogN: 10,
+ Creator: "test",
+ Devrandom: true})
if err != nil {
t.Fatal(err)
}
}
func TestCreateConfPlaintextnames(t *testing.T) {
- err := Create("config_test/tmp.conf", testPw, true, 10, "test", false, false, nil, nil, false)
+ err := Create2(&CreateArgs{
+ Filename: "config_test/tmp.conf",
+ Password: testPw,
+ PlaintextNames: true,
+ LogN: 10,
+ Creator: "test"})
if err != nil {
t.Fatal(err)
}
@@ -111,7 +125,12 @@ func TestCreateConfPlaintextnames(t *testing.T) {
// Reverse mode uses AESSIV
func TestCreateConfFileAESSIV(t *testing.T) {
- err := Create("config_test/tmp.conf", testPw, false, 10, "test", true, false, nil, nil, false)
+ err := Create2(&CreateArgs{
+ Filename: "config_test/tmp.conf",
+ Password: testPw,
+ LogN: 10,
+ Creator: "test",
+ AESSIV: true})
if err != nil {
t.Fatal(err)
}