Gabriele Contini
2019-11-23 dabc496a2b86869b3e559a87efdd74af108a31f5
test/functional/volid_test.cpp
@@ -1,24 +1,28 @@
#define BOOST_TEST_MODULE standard_license_test
//#define BOOST_TEST_MAIN
//#undef BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE test_volid
#include <boost/test/unit_test.hpp>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <cstring>
#include "../../src/tools/license-generator/license-generator.h"
#include "../../src/library/api/license++.h"
#include <build_properties.h>
#include <boost/filesystem.hpp>
#include <licensecc_properties.h>
#include <licensecc_properties_test.h>
#include <licensecc/licensecc.h>
#include "../../src/library/ini/SimpleIni.h"
#include "generate-license.h"
#include "../../src/library/pc-identifiers.h"
#include "../../src/library/os/os.h"
#include "generate-license.h"
namespace fs = boost::filesystem;
using namespace license;
using namespace std;
namespace license {
namespace test {
BOOST_AUTO_TEST_CASE( default_volid_lic_file ) {
   const string licLocation(PROJECT_TEST_TEMP_DIR "/volid_license.lic");
   PcSignature identifier_out;
   const IDENTIFICATION_STRATEGY strategy = IDENTIFICATION_STRATEGY::ETHERNET;
@@ -32,14 +36,13 @@
   extraArgs.push_back("-s");
   extraArgs.push_back(identifier_out);
   BOOST_TEST_CHECKPOINT("Before generate license");
   generate_license(licLocation, extraArgs);
   const string licLocation = generate_license("volid_license", extraArgs);
   LicenseInfo license;
   LicenseLocation licenseLocation;
   licenseLocation.openFileNearModule = false;
   licenseLocation.licenseFileLocation = licLocation.c_str();
   licenseLocation.environmentVariableName = "";
   const EVENT_TYPE result = acquire_license("TEST", licenseLocation, &license);
   licenseLocation.licenseData = "";
   const EVENT_TYPE result = acquire_license(nullptr, &licenseLocation, &license);
   BOOST_CHECK_EQUAL(result, LICENSE_OK);
   BOOST_CHECK_EQUAL(license.has_expiry, false);
   BOOST_CHECK_EQUAL(license.linked_to_pc, true);
@@ -81,7 +84,7 @@
      strategies.push_back(ETHERNET);
   }
   int num_strategies = strategies.size();
   size_t num_strategies = strategies.size();
   if(num_strategies == 0) {
      //see issue #49 can't use default
      return;
@@ -138,3 +141,5 @@
   }
}
}  // namespace test
}  // namespace license