merging sync
authorVolker Birk <vb@pep-project.org>
Thu, 08 Aug 2019 17:04:16 +0200
branchsync
changeset 398047e4e9934fbe
parent 3979 a2f16611c82b
parent 3977 bc0d2abbf50a
child 3982 c4162e447585
child 3983 6cb4eabbccd6
merging
     1.1 --- a/src/pEpEngine.c	Thu Aug 08 17:04:03 2019 +0200
     1.2 +++ b/src/pEpEngine.c	Thu Aug 08 17:04:16 2019 +0200
     1.3 @@ -257,7 +257,7 @@
     1.4      "       flags = ?4, " 
     1.5      "       is_own = ?5, "
     1.6      "       pEp_version_major = ?6, "
     1.7 -    "       pEp_version_major = ?7 "    
     1.8 +    "       pEp_version_minor = ?7 "    
     1.9      "   where (case when (address = ?1) then (1)"
    1.10      "               when (lower(address) = lower(?1)) then (1)"
    1.11      "               when (replace(lower(address),'.','') = replace(lower(?1),'.','')) then (1) "
    1.12 @@ -931,7 +931,7 @@
    1.13      sqlite3_busy_timeout(_session->system_db, 1000);
    1.14  
    1.15  // increment this when patching DDL
    1.16 -#define _DDL_USER_VERSION "11"
    1.17 +#define _DDL_USER_VERSION "12"
    1.18  
    1.19      if (in_first) {
    1.20  
    1.21 @@ -1498,11 +1498,32 @@
    1.22                  // N.B. WE DEFINE PEP_VERSION - IF WE'RE AT 9-DIGIT MAJOR OR MINOR VERSIONS, ER, BAD.
    1.23                  char major_buf[10];
    1.24                  char minor_buf[10];
    1.25 -                if (sscanf(PEP_VERSION, "%s.%s", major_buf, minor_buf) != 2)
    1.26 -                    return PEP_UNKNOWN_ERROR; // DO BETTER
    1.27 -                size_t major_len = strlen(major_buf);
    1.28 -                size_t minor_len = strlen(minor_buf);
    1.29 -                    
    1.30 +                
    1.31 +                // Guess we were abusing sscanf here, so we'll do it this way:
    1.32 +                const char* cptr = PEP_VERSION;
    1.33 +                size_t major_len = 0;
    1.34 +                size_t minor_len = 0;
    1.35 +                
    1.36 +                char* bufptr = major_buf;
    1.37 +                while (*cptr != '.' && *cptr != '\0') {
    1.38 +                    *bufptr++ = *cptr++;
    1.39 +                    major_len++;
    1.40 +                }
    1.41 +                *bufptr = '\0';
    1.42 +                bufptr = minor_buf;
    1.43 +
    1.44 +                if (*cptr == '.') {
    1.45 +                    cptr++;
    1.46 +                    while (*cptr != '\0') {
    1.47 +                        *bufptr++ = *cptr++;
    1.48 +                        minor_len++;
    1.49 +                    }
    1.50 +                }
    1.51 +                else {
    1.52 +                    *bufptr++ = '0';
    1.53 +                }
    1.54 +                *bufptr = '\0';
    1.55 +                                    
    1.56                  const char* _ver_12_startstr =                     
    1.57                      "update identity\n"
    1.58                      "    set pEp_version_major = ";
     2.1 --- a/test/src/SuiteMaker.cc	Thu Aug 08 17:04:03 2019 +0200
     2.2 +++ b/test/src/SuiteMaker.cc	Thu Aug 08 17:04:16 2019 +0200
     2.3 @@ -17,6 +17,7 @@
     2.4  #include "OwnIdentitiesRetrieveTests.h"
     2.5  #include "ExpiredSubkeyTests.h"
     2.6  #include "VerifyTests.h"
     2.7 +#include "DDLUpgradeTests.h"
     2.8  #include "UserIdCollisionTests.h"
     2.9  #include "Engine463Tests.h"
    2.10  #include "IOS1664Tests.h"
    2.11 @@ -30,6 +31,7 @@
    2.12  #include "PgpBinaryTests.h"
    2.13  #include "SubkeyRatingEvalTests.h"
    2.14  #include "MessageNullFromTests.h"
    2.15 +#include "Engine587Tests.h"
    2.16  #include "ExportKeyTests.h"
    2.17  #include "LeastCommonDenomColorTests.h"
    2.18  #include "StringlistTests.h"
    2.19 @@ -86,6 +88,7 @@
    2.20      "OwnIdentitiesRetrieveTests",
    2.21      "ExpiredSubkeyTests",
    2.22      "VerifyTests",
    2.23 +    "DDLUpgradeTests",
    2.24      "UserIdCollisionTests",
    2.25      "Engine463Tests",
    2.26      "IOS1664Tests",
    2.27 @@ -99,6 +102,7 @@
    2.28      "PgpBinaryTests",
    2.29      "SubkeyRatingEvalTests",
    2.30      "MessageNullFromTests",
    2.31 +    "Engine587Tests",
    2.32      "ExportKeyTests",
    2.33      "LeastCommonDenomColorTests",
    2.34      "StringlistTests",
    2.35 @@ -150,7 +154,7 @@
    2.36  };
    2.37  
    2.38  // This file is generated, so magic constants are ok.
    2.39 -int SuiteMaker::num_suites = 66;
    2.40 +int SuiteMaker::num_suites = 68;
    2.41  
    2.42  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    2.43      if (strcmp(test_class_name, "URIAddressTests") == 0)
    2.44 @@ -163,6 +167,8 @@
    2.45          *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
    2.46      else if (strcmp(test_class_name, "VerifyTests") == 0)
    2.47          *test_suite = new VerifyTests(test_class_name, test_home);
    2.48 +    else if (strcmp(test_class_name, "DDLUpgradeTests") == 0)
    2.49 +        *test_suite = new DDLUpgradeTests(test_class_name, test_home);
    2.50      else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
    2.51          *test_suite = new UserIdCollisionTests(test_class_name, test_home);
    2.52      else if (strcmp(test_class_name, "Engine463Tests") == 0)
    2.53 @@ -189,6 +195,8 @@
    2.54          *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
    2.55      else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
    2.56          *test_suite = new MessageNullFromTests(test_class_name, test_home);
    2.57 +    else if (strcmp(test_class_name, "Engine587Tests") == 0)
    2.58 +        *test_suite = new Engine587Tests(test_class_name, test_home);
    2.59      else if (strcmp(test_class_name, "ExportKeyTests") == 0)
    2.60          *test_suite = new ExportKeyTests(test_class_name, test_home);
    2.61      else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)