Skip to content

Commit 49c8b0a

Browse files
Googlercopybara-github
authored andcommitted
Qualify uses of std::string.
PiperOrigin-RevId: 301633709 Change-Id: I95e8555f3aa8a14e1a74ed896d34226228517e29
1 parent f09afc8 commit 49c8b0a

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

tensorflow_compression/cc/kernels/range_coding_kernels_test.cc

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ TEST_F(RangeCoderOpsTest, InvalidCdfShape) {
329329
const Status status = RunEncodeOp(10, {data, cdf}, &unused);
330330
EXPECT_FALSE(status.ok());
331331
EXPECT_NE(status.error_message().find("`cdf` should have one more axis"),
332-
string::npos);
332+
std::string::npos);
333333
}
334334

335335
Tensor empty{DT_STRING, {}};
@@ -339,7 +339,7 @@ TEST_F(RangeCoderOpsTest, InvalidCdfShape) {
339339
const Status status = RunDecodeOp(10, {empty, shape, cdf}, &unused);
340340
EXPECT_FALSE(status.ok());
341341
EXPECT_NE(status.error_message().find("`cdf` should have one more axis"),
342-
string::npos);
342+
std::string::npos);
343343
}
344344

345345
cdf = Tensor{DT_INT32, {3, 3, 1}};
@@ -348,14 +348,14 @@ TEST_F(RangeCoderOpsTest, InvalidCdfShape) {
348348
EXPECT_FALSE(status.ok());
349349
EXPECT_NE(
350350
status.error_message().find("last dimension of `cdf` should be > 1"),
351-
string::npos);
351+
std::string::npos);
352352
}
353353
{
354354
const Status status = RunDecodeOp(10, {empty, shape, cdf}, &unused);
355355
EXPECT_FALSE(status.ok());
356356
EXPECT_NE(
357357
status.error_message().find("last dimension of `cdf` should be > 1"),
358-
string::npos);
358+
std::string::npos);
359359
}
360360
}
361361

@@ -405,7 +405,7 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
405405
const Status status = RunEncodeOp(10, {data, cdf}, &unused);
406406
EXPECT_FALSE(status.ok());
407407
EXPECT_NE(status.error_message().find("Cannot broadcast shape"),
408-
string::npos);
408+
std::string::npos);
409409
}
410410

411411
data = Tensor{DT_INT16, {3, 1}};
@@ -417,7 +417,7 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
417417
const Status status = RunDecodeOp(10, {empty, shape, cdf}, &unused);
418418
EXPECT_FALSE(status.ok());
419419
EXPECT_NE(status.error_message().find("Cannot broadcast shape"),
420-
string::npos);
420+
std::string::npos);
421421
}
422422

423423
std::vector<int64> shape_vector = {2, 2, 2, 2, 2, 2, 2, 2, 2};
@@ -426,7 +426,8 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
426426
{
427427
const Status status = RunEncodeOp(10, {data, cdf}, &unused);
428428
EXPECT_FALSE(status.ok());
429-
EXPECT_NE(status.error_message().find("Irregular broadcast"), string::npos);
429+
EXPECT_NE(status.error_message().find("Irregular broadcast"),
430+
std::string::npos);
430431
}
431432

432433
shape = Tensor{DT_INT32, {static_cast<int64>(shape_vector.size())}};
@@ -436,16 +437,17 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
436437
{
437438
const Status status = RunDecodeOp(10, {empty, shape, cdf}, &unused);
438439
EXPECT_FALSE(status.ok());
439-
EXPECT_NE(status.error_message().find("Irregular broadcast"), string::npos);
440+
EXPECT_NE(status.error_message().find("Irregular broadcast"),
441+
std::string::npos);
440442
}
441443
}
442444

443-
#define EXPECT_STATUS_SUBSTR(status_expr, message) \
444-
{ \
445-
auto status = (status_expr); \
446-
EXPECT_FALSE(status.ok()); \
447-
EXPECT_NE(status.error_message().find((message)), string::npos) \
448-
<< status.error_message(); \
445+
#define EXPECT_STATUS_SUBSTR(status_expr, message) \
446+
{ \
447+
auto status = (status_expr); \
448+
EXPECT_FALSE(status.ok()); \
449+
EXPECT_NE(status.error_message().find((message)), std::string::npos) \
450+
<< status.error_message(); \
449451
}
450452

451453
TEST_F(RangeCoderOpsTest, EncoderDebug) {

0 commit comments

Comments
 (0)