Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6c59e4a

Browse files
pwnallCommit Bot
authored andcommitted
Migrate from <tr1/tuple> to <tuple> types.
Bug: 829773 Change-Id: I9bfe3c7b585acb7c91303f59ee448ce2d2dc2786 Reviewed-on: https://chromium-review.googlesource.com/999181 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org>
1 parent 6816d84 commit 6c59e4a

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Google Inc.
4242
Scott Graham
4343
Corentin Wallez
4444
Kai Ninomiya
45+
Victor Costan
4546

4647
Adobe Systems Inc.
4748
Alexandru Chiculita

src/tests/preprocessor_tests/identifier_test.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// found in the LICENSE file.
55
//
66

7+
#include <tuple>
8+
79
#include "PreprocessorTest.h"
810
#include "compiler/preprocessor/Token.h"
911

@@ -50,7 +52,7 @@ INSTANTIATE_TEST_CASE_P(A_Z,
5052
SingleLetterIdentifierTest,
5153
CLOSED_RANGE('A', 'Z'));
5254

53-
typedef std::tr1::tuple<char, char> IdentifierParams;
55+
typedef std::tuple<char, char> IdentifierParams;
5456
class DoubleLetterIdentifierTest :
5557
public IdentifierTest,
5658
public testing::WithParamInterface<IdentifierParams>
@@ -61,8 +63,8 @@ class DoubleLetterIdentifierTest :
6163
TEST_P(DoubleLetterIdentifierTest, Identified)
6264
{
6365
std::string str;
64-
str.push_back(std::tr1::get<0>(GetParam()));
65-
str.push_back(std::tr1::get<1>(GetParam()));
66+
str.push_back(std::get<0>(GetParam()));
67+
str.push_back(std::get<1>(GetParam()));
6668

6769
expectIdentifier(str);
6870
}

src/tests/preprocessor_tests/number_test.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// found in the LICENSE file.
55
//
66

7+
#include <tuple>
8+
79
#include "PreprocessorTest.h"
810
#include "compiler/preprocessor/Token.h"
911

@@ -31,15 +33,15 @@ INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest,
3133
INSTANTIATE_TEST_CASE_P(InvalidFloats, InvalidNumberTest,
3234
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
3335

34-
typedef std::tr1::tuple<const char*, char> IntegerParams;
36+
typedef std::tuple<const char*, char> IntegerParams;
3537
class IntegerTest : public SimplePreprocessorTest, public testing::WithParamInterface<IntegerParams>
3638
{
3739
};
3840

3941
TEST_P(IntegerTest, Identified)
4042
{
41-
std::string str(std::tr1::get<0>(GetParam())); // prefix.
42-
str.push_back(std::tr1::get<1>(GetParam())); // digit.
43+
std::string str(std::get<0>(GetParam())); // prefix.
44+
str.push_back(std::get<1>(GetParam())); // digit.
4345
const char* cstr = str.c_str();
4446

4547
pp::Token token;
@@ -87,7 +89,7 @@ class FloatTest : public SimplePreprocessorTest
8789
}
8890
};
8991

90-
typedef std::tr1::tuple<char, char, const char*, char> FloatScientificParams;
92+
typedef std::tuple<char, char, const char*, char> FloatScientificParams;
9193
class FloatScientificTest :
9294
public FloatTest,
9395
public testing::WithParamInterface<FloatScientificParams>
@@ -98,10 +100,10 @@ class FloatScientificTest :
98100
TEST_P(FloatScientificTest, FloatIdentified)
99101
{
100102
std::string str;
101-
str.push_back(std::tr1::get<0>(GetParam())); // significand [0-9].
102-
str.push_back(std::tr1::get<1>(GetParam())); // separator [eE].
103-
str.append(std::tr1::get<2>(GetParam())); // sign [" " "+" "-"].
104-
str.push_back(std::tr1::get<3>(GetParam())); // exponent [0-9].
103+
str.push_back(std::get<0>(GetParam())); // significand [0-9].
104+
str.push_back(std::get<1>(GetParam())); // separator [eE].
105+
str.append(std::get<2>(GetParam())); // sign [" " "+" "-"].
106+
str.push_back(std::get<3>(GetParam())); // exponent [0-9].
105107

106108
SCOPED_TRACE("FloatScientificTest");
107109
expectFloat(str);
@@ -114,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(FloatScientific,
114116
testing::Values("", "+", "-"),
115117
CLOSED_RANGE('0', '9')));
116118

117-
typedef std::tr1::tuple<char, char> FloatFractionParams;
119+
typedef std::tuple<char, char> FloatFractionParams;
118120
class FloatFractionTest :
119121
public FloatTest,
120122
public testing::WithParamInterface<FloatFractionParams>
@@ -126,13 +128,13 @@ TEST_P(FloatFractionTest, FloatIdentified)
126128
{
127129
std::string str;
128130

129-
char significand = std::tr1::get<0>(GetParam());
131+
char significand = std::get<0>(GetParam());
130132
if (significand != '\0')
131133
str.push_back(significand);
132134

133135
str.push_back('.');
134136

135-
char fraction = std::tr1::get<1>(GetParam());
137+
char fraction = std::get<1>(GetParam());
136138
if (fraction != '\0')
137139
str.push_back(fraction);
138140

src/tests/preprocessor_tests/space_test.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// found in the LICENSE file.
55
//
66

7+
#include <tuple>
8+
79
#include "PreprocessorTest.h"
810
#include "compiler/preprocessor/Token.h"
911

@@ -53,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(SingleSpaceChar,
5355
// This test fixture tests the processing of a string containing consecutive
5456
// whitespace characters. All tests in this fixture are ran with all possible
5557
// combinations of whitespace characters allowed in GLSL.
56-
typedef std::tr1::tuple<char, char, char> SpaceStringParams;
58+
typedef std::tuple<char, char, char> SpaceStringParams;
5759
class SpaceStringTest : public SpaceTest,
5860
public testing::WithParamInterface<SpaceStringParams>
5961
{
@@ -63,9 +65,9 @@ TEST_P(SpaceStringTest, SpaceIgnored)
6365
{
6466
// Construct test string with the whitespace char before "foo".
6567
std::string str;
66-
str.push_back(std::tr1::get<0>(GetParam()));
67-
str.push_back(std::tr1::get<1>(GetParam()));
68-
str.push_back(std::tr1::get<2>(GetParam()));
68+
str.push_back(std::get<0>(GetParam()));
69+
str.push_back(std::get<1>(GetParam()));
70+
str.push_back(std::get<2>(GetParam()));
6971
str.append("foo");
7072

7173
expectSpace(str);

0 commit comments

Comments
 (0)