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.
Scott Graham
Corentin Wallez
Kai Ninomiya
Victor Costan
Adobe Systems Inc.
Alexandru Chiculita
......
......@@ -4,6 +4,8 @@
// found in the LICENSE file.
//
#include <tuple>
#include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"
......@@ -50,7 +52,7 @@ INSTANTIATE_TEST_CASE_P(A_Z,
SingleLetterIdentifierTest,
CLOSED_RANGE('A', 'Z'));
typedef std::tr1::tuple<char, char> IdentifierParams;
typedef std::tuple<char, char> IdentifierParams;
class DoubleLetterIdentifierTest :
public IdentifierTest,
public testing::WithParamInterface<IdentifierParams>
......@@ -61,8 +63,8 @@ class DoubleLetterIdentifierTest :
TEST_P(DoubleLetterIdentifierTest, Identified)
{
std::string str;
str.push_back(std::tr1::get<0>(GetParam()));
str.push_back(std::tr1::get<1>(GetParam()));
str.push_back(std::get<0>(GetParam()));
str.push_back(std::get<1>(GetParam()));
expectIdentifier(str);
}
......
......@@ -4,6 +4,8 @@
// found in the LICENSE file.
//
#include <tuple>
#include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"
......@@ -31,15 +33,15 @@ INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest,
INSTANTIATE_TEST_CASE_P(InvalidFloats, InvalidNumberTest,
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>
{
};
TEST_P(IntegerTest, Identified)
{
std::string str(std::tr1::get<0>(GetParam())); // prefix.
str.push_back(std::tr1::get<1>(GetParam())); // digit.
std::string str(std::get<0>(GetParam())); // prefix.
str.push_back(std::get<1>(GetParam())); // digit.
const char* cstr = str.c_str();
pp::Token token;
......@@ -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 :
public FloatTest,
public testing::WithParamInterface<FloatScientificParams>
......@@ -98,10 +100,10 @@ class FloatScientificTest :
TEST_P(FloatScientificTest, FloatIdentified)
{
std::string str;
str.push_back(std::tr1::get<0>(GetParam())); // significand [0-9].
str.push_back(std::tr1::get<1>(GetParam())); // separator [eE].
str.append(std::tr1::get<2>(GetParam())); // sign [" " "+" "-"].
str.push_back(std::tr1::get<3>(GetParam())); // exponent [0-9].
str.push_back(std::get<0>(GetParam())); // significand [0-9].
str.push_back(std::get<1>(GetParam())); // separator [eE].
str.append(std::get<2>(GetParam())); // sign [" " "+" "-"].
str.push_back(std::get<3>(GetParam())); // exponent [0-9].
SCOPED_TRACE("FloatScientificTest");
expectFloat(str);
......@@ -114,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(FloatScientific,
testing::Values("", "+", "-"),
CLOSED_RANGE('0', '9')));
typedef std::tr1::tuple<char, char> FloatFractionParams;
typedef std::tuple<char, char> FloatFractionParams;
class FloatFractionTest :
public FloatTest,
public testing::WithParamInterface<FloatFractionParams>
......@@ -126,13 +128,13 @@ TEST_P(FloatFractionTest, FloatIdentified)
{
std::string str;
char significand = std::tr1::get<0>(GetParam());
char significand = std::get<0>(GetParam());
if (significand != '\0')
str.push_back(significand);
str.push_back('.');
char fraction = std::tr1::get<1>(GetParam());
char fraction = std::get<1>(GetParam());
if (fraction != '\0')
str.push_back(fraction);
......
......@@ -4,6 +4,8 @@
// found in the LICENSE file.
//
#include <tuple>
#include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"
......@@ -53,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(SingleSpaceChar,
// This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible
// 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,
public testing::WithParamInterface<SpaceStringParams>
{
......@@ -63,9 +65,9 @@ TEST_P(SpaceStringTest, SpaceIgnored)
{
// Construct test string with the whitespace char before "foo".
std::string str;
str.push_back(std::tr1::get<0>(GetParam()));
str.push_back(std::tr1::get<1>(GetParam()));
str.push_back(std::tr1::get<2>(GetParam()));
str.push_back(std::get<0>(GetParam()));
str.push_back(std::get<1>(GetParam()));
str.push_back(std::get<2>(GetParam()));
str.append("foo");
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