From bf76bcf6c991746ccb95f07bc3baa066bdab3025 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周日, 08 12月 2019 17:36:20 +0800 Subject: [PATCH] fix new tests --- test/functional/generate-license.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/functional/generate-license.cpp b/test/functional/generate-license.cpp index c3e7edb..3aa07f9 100644 --- a/test/functional/generate-license.cpp +++ b/test/functional/generate-license.cpp @@ -7,6 +7,7 @@ #include <boost/test/unit_test.hpp> #include <boost/filesystem.hpp> +#include <boost/algorithm/string.hpp> #include <sstream> #include <fstream> #include <iostream> @@ -28,8 +29,8 @@ if (!fs::exists(licenses_base)) { BOOST_REQUIRE_MESSAGE(fs::create_directories(licenses_base), "test folders created " + licenses_base.string()); } - - const fs::path license_fname(licenses_base / (license_name + ".lic")); + const string license_name_norm = boost::ends_with(license_name, ".lic") ? license_name : (license_name + ".lic"); + const fs::path license_fname(licenses_base / license_name_norm); const string license_fname_s = license_fname.string(); remove(license_fname_s.c_str()); -- Gitblit v1.9.1