Fix sense of test (.analyzerinfo files get placed in wrong directory) (#4486)
* Fix sense of test (.analyzerinfo files get placed in wrong directory) * Update testanalyzerinformation.cpp style (tabs -> spaces)
This commit is contained in:
parent
3b07661fd3
commit
f27fbdd8ab
|
@ -120,7 +120,7 @@ std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir
|
||||||
|
|
||||||
const std::string::size_type pos = sourcefile.rfind('/');
|
const std::string::size_type pos = sourcefile.rfind('/');
|
||||||
std::string filename;
|
std::string filename;
|
||||||
if (pos != std::string::npos)
|
if (pos == std::string::npos)
|
||||||
filename = sourcefile;
|
filename = sourcefile;
|
||||||
else
|
else
|
||||||
filename = sourcefile.substr(pos + 1);
|
filename = sourcefile.substr(pos + 1);
|
||||||
|
|
|
@ -38,6 +38,8 @@ private:
|
||||||
ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f1, "file1.c", ""));
|
ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f1, "file1.c", ""));
|
||||||
std::istringstream f2(filesTxt);
|
std::istringstream f2(filesTxt);
|
||||||
ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f2, "./file1.c", ""));
|
ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f2, "./file1.c", ""));
|
||||||
|
ASSERT_EQUALS("builddir/file1.c.analyzerinfo", AnalyzerInformation::getAnalyzerInfoFile("builddir", "file1.c", ""));
|
||||||
|
ASSERT_EQUALS("builddir/file1.c.analyzerinfo", AnalyzerInformation::getAnalyzerInfoFile("builddir", "some/path/file1.c", ""));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue