Skip to content

Commit a9a6de2

Browse files
committed
Simplify assertion
1 parent 135a911 commit a9a6de2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

icu4c/source/test/intltest/messageformat2test.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ void TestMessageFormat2::testHighLoneSurrogate() {
276276
.setPattern(loneSurrogate, pe, errorCode)
277277
.build(errorCode);
278278
UnicodeString result = msgfmt1.formatToString({}, errorCode);
279-
assertEquals("testHighLoneSurrogate", U_MF_SYNTAX_ERROR, errorCode);
280-
errorCode.reset();
279+
errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testHighLoneSurrogate");
281280
}
282281

283282
// ICU-22890 lone surrogate cause infinity loop
@@ -291,8 +290,7 @@ void TestMessageFormat2::testLowLoneSurrogate() {
291290
.setPattern(loneSurrogate, pe, errorCode)
292291
.build(errorCode);
293292
UnicodeString result = msgfmt2.formatToString({}, errorCode);
294-
assertEquals("testLowLoneSurrogate", U_MF_SYNTAX_ERROR, errorCode);
295-
errorCode.reset();
293+
errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testLowLoneSurrogate");
296294
}
297295

298296
void TestMessageFormat2::dataDrivenTests() {

0 commit comments

Comments
 (0)