From a9a6de272b531fd63818f2334d4f58f244589103 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 18 Sep 2024 18:36:47 -0700 Subject: [PATCH] Simplify assertion --- icu4c/source/test/intltest/messageformat2test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/icu4c/source/test/intltest/messageformat2test.cpp b/icu4c/source/test/intltest/messageformat2test.cpp index d7da158e0e0e..5b0c04697b33 100644 --- a/icu4c/source/test/intltest/messageformat2test.cpp +++ b/icu4c/source/test/intltest/messageformat2test.cpp @@ -276,8 +276,7 @@ void TestMessageFormat2::testHighLoneSurrogate() { .setPattern(loneSurrogate, pe, errorCode) .build(errorCode); UnicodeString result = msgfmt1.formatToString({}, errorCode); - assertEquals("testHighLoneSurrogate", U_MF_SYNTAX_ERROR, errorCode); - errorCode.reset(); + errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testHighLoneSurrogate"); } // ICU-22890 lone surrogate cause infinity loop @@ -291,8 +290,7 @@ void TestMessageFormat2::testLowLoneSurrogate() { .setPattern(loneSurrogate, pe, errorCode) .build(errorCode); UnicodeString result = msgfmt2.formatToString({}, errorCode); - assertEquals("testLowLoneSurrogate", U_MF_SYNTAX_ERROR, errorCode); - errorCode.reset(); + errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testLowLoneSurrogate"); } void TestMessageFormat2::dataDrivenTests() {