summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-07 21:55:19 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-07 22:25:04 +0300
commit668755ce388787d1f4eae5bd72e38fb12921079c (patch)
tree3bb50793ba65fb3d455f51293cbb0b181b37f27f
parent30468a1847860a93ea449b57867394a17248c901 (diff)
downloadqtlocation-mapboxgl-upstream/tmpsantos-gtest_bump.tar.gz
[test] Rename deprecated gtest methodupstream/tmpsantos-gtest_bump
The old name was marked as deprecated and failing to build with clang.
-rw-r--r--test/style/expression/expression.test.cpp47
-rw-r--r--test/style/style_parser.test.cpp39
2 files changed, 44 insertions, 42 deletions
diff --git a/test/style/expression/expression.test.cpp b/test/style/expression/expression.test.cpp
index b137df769a..07f6cf173a 100644
--- a/test/style/expression/expression.test.cpp
+++ b/test/style/expression/expression.test.cpp
@@ -79,28 +79,29 @@ TEST_P(ExpressionEqualityTest, ExpressionEquality) {
EXPECT_TRUE(*expression_a1 != *expression_b);
}
-INSTANTIATE_TEST_CASE_P(Expression, ExpressionEqualityTest, ::testing::ValuesIn([] {
- std::vector<std::string> names;
- const std::string ending = ".a.json";
-
- const std::string style_directory = "test/fixtures/expression_equality";
- DIR *dir = opendir(style_directory.c_str());
- if (dir != nullptr) {
- for (dirent *dp = nullptr; (dp = readdir(dir)) != nullptr;) {
- const std::string name = dp->d_name;
+INSTANTIATE_TEST_SUITE_P(Expression, ExpressionEqualityTest, ::testing::ValuesIn([] {
+ std::vector<std::string> names;
+ const std::string ending = ".a.json";
+
+ const std::string style_directory = "test/fixtures/expression_equality";
+ DIR* dir = opendir(style_directory.c_str());
+ if (dir != nullptr) {
+ for (dirent* dp = nullptr; (dp = readdir(dir)) != nullptr;) {
+ const std::string name = dp->d_name;
#if ANDROID
- // Android unit test uses number-format stub implementation so skip the tests
- if (name.find("number-format") != std::string::npos) {
- continue;
- }
+ // Android unit test uses number-format stub implementation so skip the tests
+ if (name.find("number-format") != std::string::npos) {
+ continue;
+ }
#endif
- if (name.length() >= ending.length() && name.compare(name.length() - ending.length(), ending.length(), ending) == 0) {
- names.push_back(name.substr(0, name.length() - ending.length()));
- }
- }
- closedir(dir);
- }
-
- EXPECT_GT(names.size(), 0u);
- return names;
-}()));
+ if (name.length() >= ending.length() &&
+ name.compare(name.length() - ending.length(), ending.length(), ending) == 0) {
+ names.push_back(name.substr(0, name.length() - ending.length()));
+ }
+ }
+ closedir(dir);
+ }
+
+ EXPECT_GT(names.size(), 0u);
+ return names;
+ }()));
diff --git a/test/style/style_parser.test.cpp b/test/style/style_parser.test.cpp
index a18a9bbf57..7607dbd077 100644
--- a/test/style/style_parser.test.cpp
+++ b/test/style/style_parser.test.cpp
@@ -74,25 +74,26 @@ TEST_P(StyleParserTest, ParseStyle) {
}
}
-INSTANTIATE_TEST_CASE_P(StyleParser, StyleParserTest, ::testing::ValuesIn([] {
- std::vector<std::string> names;
- const std::string ending = ".info.json";
-
- const std::string style_directory = "test/fixtures/style_parser";
- DIR *dir = opendir(style_directory.c_str());
- if (dir != nullptr) {
- for (dirent *dp = nullptr; (dp = readdir(dir)) != nullptr;) {
- const std::string name = dp->d_name;
- if (name.length() >= ending.length() && name.compare(name.length() - ending.length(), ending.length(), ending) == 0) {
- names.push_back(name.substr(0, name.length() - ending.length()));
- }
- }
- closedir(dir);
- }
-
- EXPECT_GT(names.size(), 0u);
- return names;
-}()));
+INSTANTIATE_TEST_SUITE_P(StyleParser, StyleParserTest, ::testing::ValuesIn([] {
+ std::vector<std::string> names;
+ const std::string ending = ".info.json";
+
+ const std::string style_directory = "test/fixtures/style_parser";
+ DIR *dir = opendir(style_directory.c_str());
+ if (dir != nullptr) {
+ for (dirent *dp = nullptr; (dp = readdir(dir)) != nullptr;) {
+ const std::string name = dp->d_name;
+ if (name.length() >= ending.length() &&
+ name.compare(name.length() - ending.length(), ending.length(), ending) == 0) {
+ names.push_back(name.substr(0, name.length() - ending.length()));
+ }
+ }
+ closedir(dir);
+ }
+
+ EXPECT_GT(names.size(), 0u);
+ return names;
+ }()));
TEST(StyleParser, FontStacks) {
style::Parser parser;