1-
21/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2+
33Licensed under the Apache License, Version 2.0 (the "License");
44you may not use this file except in compliance with the License.
55You may obtain a copy of the License at
6+
67 http://www.apache.org/licenses/LICENSE-2.0
8+
79Unless required by applicable law or agreed to in writing, software
810distributed under the License is distributed on an "AS IS" BASIS,
911WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,7 +39,7 @@ using ::testing::IsEmpty;
3739using ::testing::Pair;
3840
3941TEST (ToStringTest, PayloadsArePrinted) {
40- absl::Status status = errors::Aborted (" Aborted Error Message" );
42+ absl::Status status = absl::AbortedError (" Aborted Error Message" );
4143 status.SetPayload (" payload_key" , absl::Cord (absl::StrFormat (
4244 " payload_value %c%c%c" , 1 , 2 , 3 )));
4345
@@ -47,7 +49,7 @@ TEST(ToStringTest, PayloadsArePrinted) {
4749}
4850
4951TEST (ToStringTest, MatchesAbslStatus) {
50- absl::Status status = errors::Aborted (" Aborted Error Message" );
52+ absl::Status status = absl::AbortedError (" Aborted Error Message" );
5153 status.SetPayload (" payload_key" , absl::Cord (absl::StrFormat (
5254 " payload_value %c%c%c" , 1 , 2 , 3 )));
5355
@@ -60,7 +62,7 @@ TEST(ToStringTest, MatchesAbslStatus) {
6062}
6163
6264TEST (StackTrace, SerializeAndDeserializeCorrectly) {
63- absl::Status status = errors::Aborted (" Aborted Error Message" );
65+ absl::Status status = absl::AbortedError (" Aborted Error Message" );
6466 std::vector<StackFrame> stack_trace;
6567 stack_trace.push_back (StackFrame (" filename_1" , 33 , " func_name_1" ));
6668 stack_trace.push_back (StackFrame (" filename_2" , 66 , " func_name_2" ));
@@ -75,9 +77,9 @@ TEST(StackTrace, SerializeAndDeserializeCorrectly) {
7577}
7678
7779TEST (StatusGroupTest, DeterministicOrderWithoutPayloads) {
78- absl::Status status_a = errors::Aborted (" Status A" );
79- absl::Status status_b = errors::Aborted (" Status B" );
80- absl::Status status_c = errors::Aborted (" Status C" );
80+ absl::Status status_a = absl::AbortedError (" Status A" );
81+ absl::Status status_b = absl::AbortedError (" Status B" );
82+ absl::Status status_c = absl::AbortedError (" Status C" );
8183
8284 absl::Status combined =
8385 StatusGroup ({status_a, status_b, status_c}).as_summary_status ();
@@ -97,11 +99,11 @@ TEST(StatusGroupTest, DeterministicOrderWithoutPayloads) {
9799}
98100
99101TEST (StatusGroupTest, DeterministicOrderWithPayloads) {
100- absl::Status status_a = errors::Aborted (" Status A" );
102+ absl::Status status_a = absl::AbortedError (" Status A" );
101103 status_a.SetPayload (" payload_key" , absl::Cord (" payload_value_a" ));
102- absl::Status status_b = errors::Aborted (" Status B" );
104+ absl::Status status_b = absl::AbortedError (" Status B" );
103105 status_b.SetPayload (" payload_key" , absl::Cord (" payload_value_b" ));
104- absl::Status status_c = errors::Aborted (" Status C" );
106+ absl::Status status_c = absl::AbortedError (" Status C" );
105107 status_c.SetPayload (" payload_key" , absl::Cord (" payload_value_c" ));
106108
107109 absl::Status combined =
@@ -130,17 +132,17 @@ TEST(StatusGroupTest, DeterministicOrderWithPayloads) {
130132}
131133
132134TEST (StatusGroupTest, PayloadsMergedProperly) {
133- absl::Status status_a = errors::Aborted (" Status A" );
135+ absl::Status status_a = absl::AbortedError (" Status A" );
134136 status_a.SetPayload (" payload_key_a" ,
135137 absl::Cord (std::string (" payload_value_a" )));
136- absl::Status status_b = errors::Aborted (" Status B" );
138+ absl::Status status_b = absl::AbortedError (" Status B" );
137139 status_b.SetPayload (" payload_key_b" ,
138140 absl::Cord (std::string (" payload_value_b" )));
139- absl::Status status_c = errors::Aborted (" Status C" );
141+ absl::Status status_c = absl::AbortedError (" Status C" );
140142 status_c.SetPayload (" payload_key_c" ,
141143 absl::Cord (std::string (" payload_value_c" )));
142144 absl::Status derived_status_c =
143- StatusGroup::MakeDerived (errors::Aborted (" Status C" ));
145+ StatusGroup::MakeDerived (absl::AbortedError (" Status C" ));
144146 derived_status_c.SetPayload (
145147 " payload_key_c" , absl::Cord (std::string (" derived_payload_value_c" )));
146148
0 commit comments