Skip to content

Commit b4d6e6a

Browse files
fix on ubuntu
1 parent 1d4f6c3 commit b4d6e6a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

cppparser/test/app/cppparsertest.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <boost/program_options.hpp>
1515
#include <boost/system/config.hpp>
1616

17-
1817
#include <filesystem>
1918

2019
namespace fs = std::filesystem;
@@ -24,8 +23,8 @@ namespace bpo = boost::program_options;
2423
//////////////////////////////////////////////////////////////////////////
2524

2625
static bool parseAndEmitFormatted(cppparser::CppParser& parser,
27-
const fs::path& inputFilePath,
28-
const fs::path& outputFilePath,
26+
const fs::path& inputFilePath,
27+
const fs::path& outputFilePath,
2928
const cppcodegen::CppWriter& cppWriter)
3029
{
3130
auto progUnit = parser.parseFile(inputFilePath.string().c_str());
@@ -61,17 +60,17 @@ static std::pair<size_t, size_t> performTest(cppparser::CppParser& parser, const
6160
++dirItr)
6261
{
6362
cppcodegen::CppWriter cppWriter;
64-
fs::path file = *dirItr;
63+
fs::path file = *dirItr;
6564
if (fs::is_regular_file(file))
6665
{
6766
++numInputFiles;
6867
std::cout << "CppParserTest: Parsing " << file.string() << " ...\n";
69-
auto fileRelPath = file.string().substr(inputPathLen);
70-
fs::path outfile = params.outputPath / fileRelPath;
68+
const auto fileRelPath = file.string().substr(inputPathLen + 1);
69+
fs::path outfile = params.outputPath / fileRelPath;
7170
fs::remove(outfile);
7271
if (parseAndEmitFormatted(parser, file, outfile, cppWriter) && fs::exists(outfile))
7372
{
74-
fs::path masfile = params.masterPath / fileRelPath;
73+
fs::path masfile = params.masterPath / fileRelPath;
7574
std::pair<int, int> diffStartInfo;
7675
auto rez = compareFiles(outfile, masfile, diffStartInfo);
7776
if (rez == kSameFiles)

0 commit comments

Comments
 (0)