From 9366f631492f35a94d267aa45a0d64c9da24a64d Mon Sep 17 00:00:00 2001
From: Gabriele Contini <contini.mailing@gmail.com>
Date: 周日, 08 12月 2019 15:34:38 +0800
Subject: [PATCH] centos 7 update cmake

---
 test/functional/generate-license.cpp |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/test/functional/generate-license.cpp b/test/functional/generate-license.cpp
index b41ff66..c3e7edb 100644
--- a/test/functional/generate-license.cpp
+++ b/test/functional/generate-license.cpp
@@ -8,6 +8,7 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
 #include <sstream>
+#include <fstream>
 #include <iostream>
 
 #include <licensecc_properties_test.h>
@@ -28,8 +29,9 @@
 		BOOST_REQUIRE_MESSAGE(fs::create_directories(licenses_base), "test folders created " + licenses_base.string());
 	}
 
-	fs::path license_fname(licenses_base / (license_name + ".lic"));
-	remove(license_fname.c_str());
+	const fs::path license_fname(licenses_base / (license_name + ".lic"));
+	const string license_fname_s = license_fname.string();
+	remove(license_fname_s.c_str());
 
 	stringstream ss;
 	ss << LCC_EXE << " license issue";
@@ -60,21 +62,21 @@
 		BOOST_REQUIRE_MESSAGE(fs::create_directories(licenses_base), "test folders created " + licenses_base.string());
 	}
 
-	fs::path outputFile(fs::path(PROJECT_TEST_TEMP_DIR) / (test_name + ".tmp"));
-
-	remove(outputFile.c_str());
+	const fs::path outputFile(fs::path(PROJECT_TEST_TEMP_DIR) / (test_name + ".tmp"));
+	const string output_file_s = outputFile.string();
+	remove(output_file_s.c_str());
 
 	stringstream ss;
 	ss << LCC_EXE << " test sign";
 	ss << " --" PARAM_PRIMARY_KEY " " << LCC_PROJECT_PRIVATE_KEY;
 	ss << " -d " << data;
-	ss << " -o " << outputFile.string();
+	ss << " -o " << output_file_s;
 
 	cout << "executing :" << ss.str() << endl;
 	const int retCode = std::system(ss.str().c_str());
 	BOOST_CHECK_EQUAL(retCode, 0);
 	BOOST_ASSERT(fs::exists(outputFile));
-	std::ifstream ifs(outputFile.c_str());
+	std::ifstream ifs(output_file_s.c_str());
 	std::string content((std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>()));
 	return content;
 }

--
Gitblit v1.9.1