mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 00:58:14 +08:00
#5657 Fix SerialKey construction in unit tests
This commit is contained in:
@@ -181,7 +181,7 @@ SerialKey::email() const
|
||||
}
|
||||
|
||||
std::string
|
||||
SerialKey::decode(const std::string& serial) const
|
||||
SerialKey::decode(const std::string& serial)
|
||||
{
|
||||
static const char* const lut = "0123456789ABCDEF";
|
||||
string output;
|
||||
@@ -215,6 +215,8 @@ SerialKey::parse(std::string plainSerial)
|
||||
string parityStart = plainSerial.substr(0, 1);
|
||||
string parityEnd = plainSerial.substr(plainSerial.length() - 1, 1);
|
||||
|
||||
m_valid = false;
|
||||
|
||||
// check for parity chars { and }, record parity result, then remove them.
|
||||
if (parityStart == "{" && parityEnd == "}") {
|
||||
plainSerial = plainSerial.substr(1, plainSerial.length() - 2);
|
||||
|
||||
@@ -40,10 +40,11 @@ public:
|
||||
Edition edition() const;
|
||||
std::string toString() const;
|
||||
|
||||
static std::string decode(const std::string& serial);
|
||||
static Edition parseEdition(const std::string& editionStr);
|
||||
|
||||
private:
|
||||
std::string decode(const std::string& serial) const;
|
||||
void parse(std::string plainSerial);
|
||||
Edition parseEdition(const std::string& editionStr);
|
||||
std::string editionString() const;
|
||||
|
||||
#ifdef TEST_ENV
|
||||
|
||||
Reference in New Issue
Block a user