ENGINE-427: corrected test cases to match heuristic. All seems well. ENGINE-427
authorKrista Bennett <krista@pep-project.org>
Thu, 26 Jul 2018 18:41:34 +0200
branchENGINE-427
changeset 278383dafb06379c
parent 2782 5be6494a85ae
child 2784 dcb0d2263697
child 2785 6a785864898a
ENGINE-427: corrected test cases to match heuristic. All seems well.
test/src/engine_tests/GPGConfFixTests.cc
test/test_files/427_bad_gpg_conf_4
test/test_files/427_fixed_gpg_conf_0
test/test_files/427_fixed_gpg_conf_1
test/test_files/427_fixed_gpg_conf_2
test/test_files/427_fixed_gpg_conf_3
test/test_files/427_fixed_gpg_conf_4
test/test_files/427_fixed_gpg_conf_5
test/test_files/427_fixed_gpg_conf_6
     1.1 --- a/test/src/engine_tests/GPGConfFixTests.cc	Thu Jun 28 11:10:07 2018 +0200
     1.2 +++ b/test/src/engine_tests/GPGConfFixTests.cc	Thu Jul 26 18:41:34 2018 +0200
     1.3 @@ -43,15 +43,37 @@
     1.4      
     1.5      while (f1.get(c1)) {
     1.6          if (f2.get(c2)) {
     1.7 -            if (c1 != c2)
     1.8 +            if (c1 != c2) {
     1.9 +                if (c1 == '\n' && c2 == ' ') {
    1.10 +                    if (f2.get(c2)) {
    1.11 +                        if (c1 == c2)
    1.12 +                            continue;
    1.13 +                    }    
    1.14 +                }
    1.15 +                else if (c2 == '\n' && c1 == ' ') {
    1.16 +                    if (f1.get(c1)) {
    1.17 +                        if (c1 == c2)
    1.18 +                            continue;
    1.19 +                    }                        
    1.20 +                }
    1.21                  return false;
    1.22 +            }
    1.23          }
    1.24          else {
    1.25 -            return false;
    1.26 +            if (c1 == '\n' || c1 == ' ') {
    1.27 +                while (f1.get(c1)) {
    1.28 +                    if (c2 == '\n' || c2 == ' ')
    1.29 +                        continue;
    1.30 +                    return false;
    1.31 +                }
    1.32 +            }
    1.33          }        
    1.34      }
    1.35 -    if (f2.get(c2))
    1.36 +    while (f2.get(c2)) {
    1.37 +        if (c2 == '\n' || c2 == ' ')
    1.38 +            continue;
    1.39          return false;
    1.40 +    }
    1.41      
    1.42      return true;
    1.43      
     2.1 --- a/test/test_files/427_bad_gpg_conf_4	Thu Jun 28 11:10:07 2018 +0200
     2.2 +++ b/test/test_files/427_bad_gpg_conf_4	Thu Jul 26 18:41:34 2018 +0200
     2.3 @@ -1,4 +1,4 @@
     2.4 -comment No Commentallow-freeform-uiddefault-cache-ttl ignore-time-conflict-buttsallow-freeform-uid
     2.5 +comment No Commentallow-freeform-uidcert-digest-algo SHA256 ignore-time-conflict-buttsallow-freeform-uid
     2.6  keyid-format 0xlongignore-time-conflict 
     2.7  personal-cipher-preferences AES 
     2.8  ignore-time-conflict 
     3.1 --- a/test/test_files/427_fixed_gpg_conf_0	Thu Jun 28 11:10:07 2018 +0200
     3.2 +++ b/test/test_files/427_fixed_gpg_conf_0	Thu Jul 26 18:41:34 2018 +0200
     3.3 @@ -1,2 +1,8 @@
     3.4  personal-cipher-preferences AES 
     3.5  no-emit-version
     3.6 +keyserver hkp://keys.gnupg.net
     3.7 +cert-digest-algo SHA256
     3.8 +no-comments 
     3.9 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
    3.10 +ignore-time-conflict 
    3.11 +allow-freeform-uid 
     4.1 --- a/test/test_files/427_fixed_gpg_conf_1	Thu Jun 28 11:10:07 2018 +0200
     4.2 +++ b/test/test_files/427_fixed_gpg_conf_1	Thu Jul 26 18:41:34 2018 +0200
     4.3 @@ -1,5 +1,10 @@
     4.4  comment No Comment
     4.5  keyid-format 0xlong
     4.6 -ignore-time-conflict 
     4.7 -personal-cipher-preferences AES 
     4.8 +ignore-time-conflict
     4.9 +personal-cipher-preferences AES
    4.10  allow-freeform-uid
    4.11 +keyserver hkp://keys.gnupg.net
    4.12 +cert-digest-algo SHA256
    4.13 +no-emit-version
    4.14 +no-comments
    4.15 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
     5.1 --- a/test/test_files/427_fixed_gpg_conf_2	Thu Jun 28 11:10:07 2018 +0200
     5.2 +++ b/test/test_files/427_fixed_gpg_conf_2	Thu Jul 26 18:41:34 2018 +0200
     5.3 @@ -2,4 +2,9 @@
     5.4  allow-freeform-uid
     5.5  keyid-format 0xlong
     5.6  ignore-time-conflict 
     5.7 -personal-cipher-preferences AES 
     5.8 +personal-cipher-preferences AES
     5.9 +keyserver hkp://keys.gnupg.net
    5.10 +cert-digest-algo SHA256
    5.11 +no-emit-version
    5.12 +no-comments
    5.13 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
     6.1 --- a/test/test_files/427_fixed_gpg_conf_3	Thu Jun 28 11:10:07 2018 +0200
     6.2 +++ b/test/test_files/427_fixed_gpg_conf_3	Thu Jul 26 18:41:34 2018 +0200
     6.3 @@ -3,3 +3,9 @@
     6.4  keyid-format 0xlong
     6.5  ignore-time-conflict 
     6.6  personal-cipher-preferences AES 
     6.7 +keyserver hkp://keys.gnupg.net
     6.8 +cert-digest-algo SHA256
     6.9 +no-emit-version
    6.10 +no-comments
    6.11 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
    6.12 +                                           
    6.13 \ No newline at end of file
     7.1 --- a/test/test_files/427_fixed_gpg_conf_4	Thu Jun 28 11:10:07 2018 +0200
     7.2 +++ b/test/test_files/427_fixed_gpg_conf_4	Thu Jul 26 18:41:34 2018 +0200
     7.3 @@ -1,6 +1,10 @@
     7.4  comment No Comment
     7.5  allow-freeform-uid
     7.6 -default-cache-ttl ignore-time-conflict-butts
     7.7 +cert-digest-algo SHA256 ignore-time-conflict-butts
     7.8  keyid-format 0xlong
     7.9  ignore-time-conflict 
    7.10  personal-cipher-preferences AES 
    7.11 +keyserver hkp://keys.gnupg.net
    7.12 +no-emit-version
    7.13 +no-comments
    7.14 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
     8.1 --- a/test/test_files/427_fixed_gpg_conf_5	Thu Jun 28 11:10:07 2018 +0200
     8.2 +++ b/test/test_files/427_fixed_gpg_conf_5	Thu Jul 26 18:41:34 2018 +0200
     8.3 @@ -3,3 +3,8 @@
     8.4  keyid-format 0xlong
     8.5  ignore-time-conflict 
     8.6  personal-cipher-preferences AES 
     8.7 +keyserver hkp://keys.gnupg.net
     8.8 +cert-digest-algo SHA256
     8.9 +no-emit-version
    8.10 +no-comments
    8.11 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
     9.1 --- a/test/test_files/427_fixed_gpg_conf_6	Thu Jun 28 11:10:07 2018 +0200
     9.2 +++ b/test/test_files/427_fixed_gpg_conf_6	Thu Jul 26 18:41:34 2018 +0200
     9.3 @@ -1,1 +1,8 @@
     9.4  allow-freeform-uid
     9.5 +keyserver hkp://keys.gnupg.net
     9.6 +cert-digest-algo SHA256
     9.7 +no-emit-version
     9.8 +no-comments
     9.9 +personal-cipher-preferences AES AES256 AES192 CAST5
    9.10 +personal-digest-preferences SHA256 SHA512 SHA384 SHA224
    9.11 +ignore-time-conflict