summaryrefslogtreecommitdiff
path: root/internal/configfile/config_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-10-21 09:58:37 +0200
committerJakob Unterwurzacher2021-10-21 14:55:30 +0200
commitd583bdb79e6f05bce2451a7e220e553209da4c1d (patch)
tree9d2fa4671278b1bc9d0202a267598f669628d70c /internal/configfile/config_test.go
parentdc32710045f6f46913ae336b6fb77bf90b6bdb85 (diff)
configfile: add LongNameMax support
Feature flag + numeric paramater https://github.com/rfjakob/gocryptfs/issues/499
Diffstat (limited to 'internal/configfile/config_test.go')
-rw-r--r--internal/configfile/config_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go
index b8012d3..3407464 100644
--- a/internal/configfile/config_test.go
+++ b/internal/configfile/config_test.go
@@ -131,6 +131,30 @@ func TestCreateConfFileAESSIV(t *testing.T) {
}
}
+func TestCreateConfLongNameMax(t *testing.T) {
+ args := &CreateArgs{
+ Filename: "config_test/tmp.conf",
+ Password: testPw,
+ LogN: 10,
+ Creator: "test",
+ LongNameMax: 100,
+ }
+ err := Create(args)
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, c, err := LoadAndDecrypt("config_test/tmp.conf", testPw)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !c.IsFeatureFlagSet(FlagLongNameMax) {
+ t.Error("FlagLongNameMax should be set but is not")
+ }
+ if c.LongNameMax != args.LongNameMax {
+ t.Errorf("wrong LongNameMax value: want=%d have=%d", args.LongNameMax, c.LongNameMax)
+ }
+}
+
func TestIsFeatureFlagKnown(t *testing.T) {
// Test a few hardcoded values
testKnownFlags := []string{"DirIV", "PlaintextNames", "EMENames", "GCMIV128", "LongNames", "AESSIV"}