gcontini
2020-10-13 cbb11cd88d985db033c744b59291a2cf03fd16be
test/functional/generate-license.cpp
@@ -13,6 +13,7 @@
#include <iostream>
#include <licensecc_properties_test.h>
#include <licensecc_properties.h>
#include "../../src/library/base/base.h"
#include "../../src/library/ini/SimpleIni.h"
@@ -20,8 +21,10 @@
namespace fs = boost::filesystem;
using namespace std;
namespace license {
namespace test {
string generate_license(const string& license_name, const vector<string>& other_args) {
   fs::path lcc_exe(LCC_EXE);
   BOOST_REQUIRE_MESSAGE(fs::is_regular_file(lcc_exe), "License generator not found: " LCC_EXE);
@@ -40,17 +43,17 @@
   ss << " --" PARAM_LICENSE_OUTPUT " " << license_fname_s;
   ss << " --" PARAM_PROJECT_FOLDER " " << LCC_TEST_LICENSES_PROJECT;
   for (int i = 0; i < other_args.size(); i++) {
   for (size_t i = 0; i < other_args.size(); i++) {
      ss << " " << other_args[i];
   }
   cout << "executing :" << ss.str() << endl;
   const int retCode = std::system(ss.str().c_str());
   BOOST_CHECK_EQUAL(retCode, 0);
   BOOST_ASSERT(fs::exists(license_fname));
   BOOST_ASSERT_MSG(fs::exists(license_fname), "license exists");
   CSimpleIniA ini;
   const SI_Error rc = ini.LoadFile(license_fname.c_str());
   BOOST_CHECK_GE(rc, 0);
   const int sectionSize = ini.GetSectionSize("DEFAULT");
   const int sectionSize = ini.GetSectionSize(LCC_PROJECT_NAME);
   BOOST_CHECK_GT(sectionSize, 0);
   return license_fname.string();
}