From c914d298604ef7ad3934c3c213d3f8822d6646d9 Mon Sep 17 00:00:00 2001 From: Guillaume Buisson <contact@guillaume.dev> Date: ćšć, 20 5æ 2021 13:50:43 +0800 Subject: [PATCH] Several fixes (#120) --- test/functional/date_test.cpp | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/test/functional/date_test.cpp b/test/functional/date_test.cpp index 15fbdd0..9638f1b 100644 --- a/test/functional/date_test.cpp +++ b/test/functional/date_test.cpp @@ -24,14 +24,14 @@ const string licLocation = generate_license("not_expired.lic", extraArgs); /* */ LicenseInfo license; - LicenseLocation licenseLocation; - licenseLocation.licenseFileLocation = licLocation.c_str(); - licenseLocation.licenseData = ""; - const EVENT_TYPE result = acquire_license(nullptr, &licenseLocation, &license); + LicenseLocation location = {LICENSE_PATH}; + std::copy(licLocation.begin(), licLocation.end(), location.licenseData); + + const LCC_EVENT_TYPE result = acquire_license(nullptr, &location, &license); BOOST_CHECK_EQUAL(result, LICENSE_OK); BOOST_CHECK_EQUAL(license.has_expiry, true); BOOST_CHECK_EQUAL(license.linked_to_pc, false); - BOOST_CHECK_GT(license.days_left, 0); + BOOST_CHECK_GT(license.days_left, (unsigned int)0); } BOOST_AUTO_TEST_CASE(license_expired) { @@ -41,11 +41,10 @@ const string licLocation = generate_license("expired", extraArgs); /* */ LicenseInfo license; - LicenseLocation licenseLocation; - licenseLocation.licenseFileLocation = licLocation.c_str(); - licenseLocation.licenseData = nullptr; + LicenseLocation location = {LICENSE_PATH}; + std::copy(licLocation.begin(), licLocation.end(), location.licenseData); BOOST_TEST_MESSAGE("before acquire license"); - const EVENT_TYPE result = acquire_license(nullptr, &licenseLocation, &license); + const LCC_EVENT_TYPE result = acquire_license(nullptr, &location, &license); BOOST_CHECK_EQUAL(result, PRODUCT_EXPIRED); BOOST_CHECK_EQUAL(license.has_expiry, true); BOOST_CHECK_EQUAL(license.linked_to_pc, false); -- Gitblit v1.9.1