diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..80a73c9 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,16 @@ +[requires] +libzip/1.5.1@bincrafters/stable +libcurl/7.61.1@bincrafters/stable +boost/1.69.0@conan/stable +cryptopp/7.0.0@bincrafters/stable + +[generators] +visual_studio + +[options] +libzip:shared=False +libcurl:shared=False +libcurl:with_openssl=False +libcurl:with_winssl=True +boost:shared=False +cryptopp:shared=False \ No newline at end of file diff --git a/libLicenseClient.vcxproj b/libLicenseClient.vcxproj index 7842e96..df5b0f0 100644 --- a/libLicenseClient.vcxproj +++ b/libLicenseClient.vcxproj @@ -43,6 +43,7 @@ + diff --git a/non-debugable.props b/non-debugable.props new file mode 100644 index 0000000..2e86c09 --- /dev/null +++ b/non-debugable.props @@ -0,0 +1,29 @@ + + + + + + false + + + + %(AdditionalIncludeDirectories) + BOOST_EXCEPTION_DISABLE;%(PreprocessorDefinitions) + %(AdditionalOptions) + false + None + + + %(AdditionalDependencies) + %(AdditionalOptions) + true + false + YES + false + + false + UseLinkTimeCodeGeneration + + + + \ No newline at end of file diff --git a/project-common.props b/project-common.props index 7b012c7..733f478 100644 --- a/project-common.props +++ b/project-common.props @@ -1,11 +1,7 @@ - - - - - + diff --git a/src/LicenseClient.cpp b/src/LicenseClient.cpp index 8e21020..ce4855f 100644 --- a/src/LicenseClient.cpp +++ b/src/LicenseClient.cpp @@ -333,11 +333,15 @@ bool LicenseClient::tryPreactivate(HTTPClient &httpClient) bool LicenseClient::activate(HTTPClient &httpClient, const std::string & licenseNumber) { - std::string jsonReq; - + auto validLicenseKey = validateLicenseKey(licenseNumber); + if (!validLicenseKey) + { + return false; + } + std::ostringstream ss1; - ActivationRequest req{ productId, m_systemParams, licenseNumber }; + ActivationRequest req{ productId, m_systemParams, validLicenseKey.value() }; serialize(ss1, req); std::stringstream ss2; diff --git a/test/conanfile.txt b/test/conanfile.txt new file mode 100644 index 0000000..6d1bbcc --- /dev/null +++ b/test/conanfile.txt @@ -0,0 +1,10 @@ +[requires] +boost/1.69.0@conan/stable +gtest/1.8.1@bincrafters/stable + +[generators] +visual_studio + +[options] +boost:shared=False +gtest:build_gmock=True diff --git a/test/libLicenseClientTest.vcxproj b/test/libLicenseClientTest.vcxproj index 3b5e91a..9a4f8df 100644 --- a/test/libLicenseClientTest.vcxproj +++ b/test/libLicenseClientTest.vcxproj @@ -9,14 +9,6 @@ Release Win32 - - Debug - x64 - - - Release - x64 - 15.0 @@ -39,19 +31,6 @@ true MultiByte - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - @@ -59,35 +38,19 @@ - - - + - - - - - - - - - + true - - true - false - - false - NotUsing @@ -102,22 +65,7 @@ Console true - - - - - NotUsing - Level3 - Disabled - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)..\api;%(AdditionalIncludeDirectories) - - - - Console - true + gmock_maind.lib;%(AdditionalDependencies) @@ -138,26 +86,7 @@ true true true - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(ProjectDir)..\api;%(AdditionalIncludeDirectories) - - - - Console - true - true - true + gmock_main.lib;%(AdditionalDependencies)