Index: third_party/WebKit/Source/platform/text/ICUErrorTest.cpp |
diff --git a/third_party/WebKit/Source/platform/text/ICUErrorTest.cpp b/third_party/WebKit/Source/platform/text/ICUErrorTest.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e429699cf4a353c190f7a227bbb058c975373c4 |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/text/ICUErrorTest.cpp |
@@ -0,0 +1,24 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "platform/text/ICUError.h" |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace blink { |
+ |
+const UErrorCode kTestErrorCode = U_INVALID_FORMAT_ERROR; |
+ |
+void causeICUError(UErrorCode& err) { |
+ err = kTestErrorCode; |
+} |
+ |
+TEST(ICUErrorTest, assignToAutomaticReference) { |
+ ICUError icuError; |
+ EXPECT_EQ(icuError, U_ZERO_ERROR); |
+ causeICUError(icuError); |
+ EXPECT_EQ(icuError, kTestErrorCode); |
+} |
+ |
+} // namespace blink |