@@ -329,7 +329,7 @@ TEST_F(RangeCoderOpsTest, InvalidCdfShape) {
329
329
{
330
330
const Status status = RunEncodeOp (10 , {data, cdf}, &unused);
331
331
EXPECT_FALSE (status.ok ());
332
- EXPECT_NE (status.error_message ().find (" `cdf` should have one more axis" ),
332
+ EXPECT_NE (status.ToString ().find (" `cdf` should have one more axis" ),
333
333
std::string::npos);
334
334
}
335
335
@@ -339,24 +339,22 @@ TEST_F(RangeCoderOpsTest, InvalidCdfShape) {
339
339
{
340
340
const Status status = RunDecodeOp (10 , {empty, shape, cdf}, &unused);
341
341
EXPECT_FALSE (status.ok ());
342
- EXPECT_NE (status.error_message ().find (" `cdf` should have one more axis" ),
342
+ EXPECT_NE (status.ToString ().find (" `cdf` should have one more axis" ),
343
343
std::string::npos);
344
344
}
345
345
346
346
cdf = Tensor{DT_INT32, {3 , 3 , 1 }};
347
347
{
348
348
const Status status = RunEncodeOp (10 , {data, cdf}, &unused);
349
349
EXPECT_FALSE (status.ok ());
350
- EXPECT_NE (
351
- status.error_message ().find (" last dimension of `cdf` should be > 1" ),
352
- std::string::npos);
350
+ EXPECT_NE (status.ToString ().find (" last dimension of `cdf` should be > 1" ),
351
+ std::string::npos);
353
352
}
354
353
{
355
354
const Status status = RunDecodeOp (10 , {empty, shape, cdf}, &unused);
356
355
EXPECT_FALSE (status.ok ());
357
- EXPECT_NE (
358
- status.error_message ().find (" last dimension of `cdf` should be > 1" ),
359
- std::string::npos);
356
+ EXPECT_NE (status.ToString ().find (" last dimension of `cdf` should be > 1" ),
357
+ std::string::npos);
360
358
}
361
359
}
362
360
@@ -405,7 +403,7 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
405
403
{
406
404
const Status status = RunEncodeOp (10 , {data, cdf}, &unused);
407
405
EXPECT_FALSE (status.ok ());
408
- EXPECT_NE (status.error_message ().find (" Cannot broadcast shape" ),
406
+ EXPECT_NE (status.ToString ().find (" Cannot broadcast shape" ),
409
407
std::string::npos);
410
408
}
411
409
@@ -417,7 +415,7 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
417
415
{
418
416
const Status status = RunDecodeOp (10 , {empty, shape, cdf}, &unused);
419
417
EXPECT_FALSE (status.ok ());
420
- EXPECT_NE (status.error_message ().find (" Cannot broadcast shape" ),
418
+ EXPECT_NE (status.ToString ().find (" Cannot broadcast shape" ),
421
419
std::string::npos);
422
420
}
423
421
@@ -427,8 +425,7 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
427
425
{
428
426
const Status status = RunEncodeOp (10 , {data, cdf}, &unused);
429
427
EXPECT_FALSE (status.ok ());
430
- EXPECT_NE (status.error_message ().find (" Irregular broadcast" ),
431
- std::string::npos);
428
+ EXPECT_NE (status.ToString ().find (" Irregular broadcast" ), std::string::npos);
432
429
}
433
430
434
431
shape = Tensor{DT_INT32, {static_cast <int64_t >(shape_vector.size ())}};
@@ -438,17 +435,16 @@ TEST_F(RangeCoderOpsTest, InvalidBroadcast) {
438
435
{
439
436
const Status status = RunDecodeOp (10 , {empty, shape, cdf}, &unused);
440
437
EXPECT_FALSE (status.ok ());
441
- EXPECT_NE (status.error_message ().find (" Irregular broadcast" ),
442
- std::string::npos);
438
+ EXPECT_NE (status.ToString ().find (" Irregular broadcast" ), std::string::npos);
443
439
}
444
440
}
445
441
446
- #define EXPECT_STATUS_SUBSTR (status_expr, message ) \
447
- { \
448
- auto status = (status_expr); \
449
- EXPECT_FALSE (status.ok ()); \
450
- EXPECT_NE (status.error_message ().find ((message)), std::string::npos) \
451
- << status.error_message (); \
442
+ #define EXPECT_STATUS_SUBSTR (status_expr, message ) \
443
+ { \
444
+ auto status = (status_expr); \
445
+ EXPECT_FALSE (status.ok ()); \
446
+ EXPECT_NE (status.ToString ().find ((message)), std::string::npos) \
447
+ << status.ToString (); \
452
448
}
453
449
454
450
TEST_F (RangeCoderOpsTest, EncoderDebug) {
0 commit comments