mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[tests] Fix build errors
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -9,7 +9,7 @@ namespace regexp_test
|
|||||||
template <typename Fn>
|
template <typename Fn>
|
||||||
void ForEachMatched(std::string const & s, boost::regex const & regex, Fn && fn)
|
void ForEachMatched(std::string const & s, boost::regex const & regex, Fn && fn)
|
||||||
{
|
{
|
||||||
for (std::sregex_token_iterator cur(s.begin(), s.end(), regex), end; cur != end; ++cur)
|
for (boost::sregex_token_iterator cur(s.begin(), s.end(), regex), end; cur != end; ++cur)
|
||||||
fn(*cur);
|
fn(*cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
#include "base/logging.hpp"
|
#include "base/logging.hpp"
|
||||||
#include "base/std_serialization.hpp"
|
#include "base/std_serialization.hpp"
|
||||||
|
|
||||||
|
#include <boost/regex.hpp>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -395,7 +397,7 @@ void DeleteTempDownloadFiles()
|
|||||||
// Remove data from previously failed files.
|
// Remove data from previously failed files.
|
||||||
|
|
||||||
// Get regexp like this: (\.downloading3$|\.resume3$)
|
// Get regexp like this: (\.downloading3$|\.resume3$)
|
||||||
string const regexp = "(\\" RESUME_FILE_EXTENSION "$|\\" DOWNLOADING_FILE_EXTENSION "$)";
|
static boost::regex const regexp("(\\" RESUME_FILE_EXTENSION "$|\\" DOWNLOADING_FILE_EXTENSION "$)");
|
||||||
|
|
||||||
Platform::FilesList files;
|
Platform::FilesList files;
|
||||||
Platform::GetFilesByRegExp(".", regexp, files);
|
Platform::GetFilesByRegExp(".", regexp, files);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ UNIT_TEST(GetFilesInDir_Smoke)
|
|||||||
|
|
||||||
TEST(base::IsExist(files1, "minsk-pass.mwm"), ());
|
TEST(base::IsExist(files1, "minsk-pass.mwm"), ());
|
||||||
|
|
||||||
pl.GetFilesByRegExp(dir, boost::regex(".*\\" + DATA_FILE_EXTENSION + "$"), files2);
|
pl.GetFilesByRegExp(dir, boost::regex(std::string(".*\\") + DATA_FILE_EXTENSION + std::string("$")), files2);
|
||||||
TEST_EQUAL(files1, files2, ());
|
TEST_EQUAL(files1, files2, ());
|
||||||
|
|
||||||
files1.clear();
|
files1.clear();
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ void LoadDataSources(std::string const & pathToMWMFolder, std::vector<FrozenData
|
|||||||
CHECK(Platform::IsDirectory(pathToMWMFolder), (pathToMWMFolder, "must be a directory."));
|
CHECK(Platform::IsDirectory(pathToMWMFolder), (pathToMWMFolder, "must be a directory."));
|
||||||
|
|
||||||
Platform::FilesList files;
|
Platform::FilesList files;
|
||||||
Platform::GetFilesByRegExp(pathToMWMFolder, boost::regex(".*\\") + DATA_FILE_EXTENSION, files);
|
Platform::GetFilesByRegExp(pathToMWMFolder, boost::regex(std::string(".*\\") + DATA_FILE_EXTENSION), files);
|
||||||
|
|
||||||
CHECK(!files.empty(), (pathToMWMFolder, "Contains no .mwm files."));
|
CHECK(!files.empty(), (pathToMWMFolder, "Contains no .mwm files."));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user