xmloff/qa/unit/tokenmap-test.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 60d4b7fe920649812e1b2c59f0b54c9c44df9be1 Author: Eike Rathke <er...@redhat.com> Date: Thu Aug 18 11:53:57 2016 +0200 xmloff tokenmap: do not assume anything did not fail Change-Id: If13feffe41631b45605511fbad07965e0d5cb8d5 diff --git a/xmloff/qa/unit/tokenmap-test.cxx b/xmloff/qa/unit/tokenmap-test.cxx index 74a04a0..ff482eb 100644 --- a/xmloff/qa/unit/tokenmap-test.cxx +++ b/xmloff/qa/unit/tokenmap-test.cxx @@ -40,10 +40,11 @@ void TokenmapTest::test_roundTrip() { // check that the getIdentifier <-> getToken roundtrip works Sequence< sal_Int8 > rUtf8Name = tokenMap.getUtf8TokenName(nToken); - sal_Int32 ret = token::TokenMap::getTokenFromUTF8( - reinterpret_cast< const char * >(rUtf8Name.getConstArray()), - rUtf8Name.getLength() ); - CPPUNIT_ASSERT_EQUAL(ret, nToken); + CPPUNIT_ASSERT_MESSAGE("Token name sequence should not be empty", rUtf8Name.getLength()); + const char* pChar = reinterpret_cast< const char * >(rUtf8Name.getConstArray()); + CPPUNIT_ASSERT_MESSAGE("Token name sequence array pointer failed", pChar); + sal_Int32 ret = token::TokenMap::getTokenFromUTF8( pChar, rUtf8Name.getLength() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE("No roundtrip for token", ret, nToken); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits