Commit 6c59e4a1 by Victor Costan Committed by Commit Bot

Migrate from <tr1/tuple> to <tuple> types.

Bug: 829773 Change-Id: I9bfe3c7b585acb7c91303f59ee448ce2d2dc2786 Reviewed-on: https://chromium-review.googlesource.com/999181Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org>
parent 6816d843
...@@ -42,6 +42,7 @@ Google Inc. ...@@ -42,6 +42,7 @@ Google Inc.
Scott Graham Scott Graham
Corentin Wallez Corentin Wallez
Kai Ninomiya Kai Ninomiya
Victor Costan
Adobe Systems Inc. Adobe Systems Inc.
Alexandru Chiculita Alexandru Chiculita
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
#include <tuple>
#include "PreprocessorTest.h" #include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h" #include "compiler/preprocessor/Token.h"
...@@ -50,7 +52,7 @@ INSTANTIATE_TEST_CASE_P(A_Z, ...@@ -50,7 +52,7 @@ INSTANTIATE_TEST_CASE_P(A_Z,
SingleLetterIdentifierTest, SingleLetterIdentifierTest,
CLOSED_RANGE('A', 'Z')); CLOSED_RANGE('A', 'Z'));
typedef std::tr1::tuple<char, char> IdentifierParams; typedef std::tuple<char, char> IdentifierParams;
class DoubleLetterIdentifierTest : class DoubleLetterIdentifierTest :
public IdentifierTest, public IdentifierTest,
public testing::WithParamInterface<IdentifierParams> public testing::WithParamInterface<IdentifierParams>
...@@ -61,8 +63,8 @@ class DoubleLetterIdentifierTest : ...@@ -61,8 +63,8 @@ class DoubleLetterIdentifierTest :
TEST_P(DoubleLetterIdentifierTest, Identified) TEST_P(DoubleLetterIdentifierTest, Identified)
{ {
std::string str; std::string str;
str.push_back(std::tr1::get<0>(GetParam())); str.push_back(std::get<0>(GetParam()));
str.push_back(std::tr1::get<1>(GetParam())); str.push_back(std::get<1>(GetParam()));
expectIdentifier(str); expectIdentifier(str);
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
#include <tuple>
#include "PreprocessorTest.h" #include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h" #include "compiler/preprocessor/Token.h"
...@@ -31,15 +33,15 @@ INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest, ...@@ -31,15 +33,15 @@ INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest,
INSTANTIATE_TEST_CASE_P(InvalidFloats, InvalidNumberTest, INSTANTIATE_TEST_CASE_P(InvalidFloats, InvalidNumberTest,
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1")); testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
typedef std::tr1::tuple<const char*, char> IntegerParams; typedef std::tuple<const char*, char> IntegerParams;
class IntegerTest : public SimplePreprocessorTest, public testing::WithParamInterface<IntegerParams> class IntegerTest : public SimplePreprocessorTest, public testing::WithParamInterface<IntegerParams>
{ {
}; };
TEST_P(IntegerTest, Identified) TEST_P(IntegerTest, Identified)
{ {
std::string str(std::tr1::get<0>(GetParam())); // prefix. std::string str(std::get<0>(GetParam())); // prefix.
str.push_back(std::tr1::get<1>(GetParam())); // digit. str.push_back(std::get<1>(GetParam())); // digit.
const char* cstr = str.c_str(); const char* cstr = str.c_str();
pp::Token token; pp::Token token;
...@@ -87,7 +89,7 @@ class FloatTest : public SimplePreprocessorTest ...@@ -87,7 +89,7 @@ class FloatTest : public SimplePreprocessorTest
} }
}; };
typedef std::tr1::tuple<char, char, const char*, char> FloatScientificParams; typedef std::tuple<char, char, const char*, char> FloatScientificParams;
class FloatScientificTest : class FloatScientificTest :
public FloatTest, public FloatTest,
public testing::WithParamInterface<FloatScientificParams> public testing::WithParamInterface<FloatScientificParams>
...@@ -98,10 +100,10 @@ class FloatScientificTest : ...@@ -98,10 +100,10 @@ class FloatScientificTest :
TEST_P(FloatScientificTest, FloatIdentified) TEST_P(FloatScientificTest, FloatIdentified)
{ {
std::string str; std::string str;
str.push_back(std::tr1::get<0>(GetParam())); // significand [0-9]. str.push_back(std::get<0>(GetParam())); // significand [0-9].
str.push_back(std::tr1::get<1>(GetParam())); // separator [eE]. str.push_back(std::get<1>(GetParam())); // separator [eE].
str.append(std::tr1::get<2>(GetParam())); // sign [" " "+" "-"]. str.append(std::get<2>(GetParam())); // sign [" " "+" "-"].
str.push_back(std::tr1::get<3>(GetParam())); // exponent [0-9]. str.push_back(std::get<3>(GetParam())); // exponent [0-9].
SCOPED_TRACE("FloatScientificTest"); SCOPED_TRACE("FloatScientificTest");
expectFloat(str); expectFloat(str);
...@@ -114,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(FloatScientific, ...@@ -114,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(FloatScientific,
testing::Values("", "+", "-"), testing::Values("", "+", "-"),
CLOSED_RANGE('0', '9'))); CLOSED_RANGE('0', '9')));
typedef std::tr1::tuple<char, char> FloatFractionParams; typedef std::tuple<char, char> FloatFractionParams;
class FloatFractionTest : class FloatFractionTest :
public FloatTest, public FloatTest,
public testing::WithParamInterface<FloatFractionParams> public testing::WithParamInterface<FloatFractionParams>
...@@ -126,13 +128,13 @@ TEST_P(FloatFractionTest, FloatIdentified) ...@@ -126,13 +128,13 @@ TEST_P(FloatFractionTest, FloatIdentified)
{ {
std::string str; std::string str;
char significand = std::tr1::get<0>(GetParam()); char significand = std::get<0>(GetParam());
if (significand != '\0') if (significand != '\0')
str.push_back(significand); str.push_back(significand);
str.push_back('.'); str.push_back('.');
char fraction = std::tr1::get<1>(GetParam()); char fraction = std::get<1>(GetParam());
if (fraction != '\0') if (fraction != '\0')
str.push_back(fraction); str.push_back(fraction);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
#include <tuple>
#include "PreprocessorTest.h" #include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h" #include "compiler/preprocessor/Token.h"
...@@ -53,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(SingleSpaceChar, ...@@ -53,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(SingleSpaceChar,
// This test fixture tests the processing of a string containing consecutive // This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible // whitespace characters. All tests in this fixture are ran with all possible
// combinations of whitespace characters allowed in GLSL. // combinations of whitespace characters allowed in GLSL.
typedef std::tr1::tuple<char, char, char> SpaceStringParams; typedef std::tuple<char, char, char> SpaceStringParams;
class SpaceStringTest : public SpaceTest, class SpaceStringTest : public SpaceTest,
public testing::WithParamInterface<SpaceStringParams> public testing::WithParamInterface<SpaceStringParams>
{ {
...@@ -63,9 +65,9 @@ TEST_P(SpaceStringTest, SpaceIgnored) ...@@ -63,9 +65,9 @@ TEST_P(SpaceStringTest, SpaceIgnored)
{ {
// Construct test string with the whitespace char before "foo". // Construct test string with the whitespace char before "foo".
std::string str; std::string str;
str.push_back(std::tr1::get<0>(GetParam())); str.push_back(std::get<0>(GetParam()));
str.push_back(std::tr1::get<1>(GetParam())); str.push_back(std::get<1>(GetParam()));
str.push_back(std::tr1::get<2>(GetParam())); str.push_back(std::get<2>(GetParam()));
str.append("foo"); str.append("foo");
expectSpace(str); expectSpace(str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment