From 23a0d1ff82f7ff81a131dba812d908a7a44a5386 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 15 Sep 2015 13:22:03 +0200 Subject: Use CPPUNIT_ASSERT_EQUAL Change-Id: Id4305098e3139bb21711fefb350fa2574e3638cd --- unotest/source/cpp/filters-test.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx index 2bd61f268f68..384302eec0bd 100644 --- a/unotest/source/cpp/filters-test.cxx +++ b/unotest/source/cpp/filters-test.cxx @@ -30,25 +30,25 @@ void decode(const OUString& rIn, const OUString &rOut) rtlCipherError result = rtl_cipher_init(cipher, rtl_Cipher_DirectionDecode, aKey, SAL_N_ELEMENTS(aKey), 0, 0); - CPPUNIT_ASSERT_MESSAGE("cipher init failed", result == rtl_Cipher_E_None); + CPPUNIT_ASSERT_EQUAL_MESSAGE("cipher init failed", rtl_Cipher_E_None, result); osl::File aIn(rIn); - CPPUNIT_ASSERT(osl::FileBase::E_None == aIn.open(osl_File_OpenFlag_Read)); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aIn.open(osl_File_OpenFlag_Read)); osl::File aOut(rOut); - CPPUNIT_ASSERT(osl::FileBase::E_None == aOut.open(osl_File_OpenFlag_Write)); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aOut.open(osl_File_OpenFlag_Write)); sal_uInt8 in[8192]; sal_uInt8 out[8192]; sal_uInt64 nBytesRead, nBytesWritten; while(true) { - CPPUNIT_ASSERT(osl::FileBase::E_None == aIn.read(in, sizeof(in), nBytesRead)); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aIn.read(in, sizeof(in), nBytesRead)); if (!nBytesRead) break; - CPPUNIT_ASSERT(rtl_Cipher_E_None == rtl_cipher_decode(cipher, in, nBytesRead, out, sizeof(out))); - CPPUNIT_ASSERT(osl::FileBase::E_None == aOut.write(out, nBytesRead, nBytesWritten)); - CPPUNIT_ASSERT(nBytesRead == nBytesWritten); + CPPUNIT_ASSERT_EQUAL(rtl_Cipher_E_None, rtl_cipher_decode(cipher, in, nBytesRead, out, sizeof(out))); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aOut.write(out, nBytesRead, nBytesWritten)); + CPPUNIT_ASSERT_EQUAL(nBytesRead, nBytesWritten); } rtl_cipher_destroy(cipher); @@ -61,7 +61,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected, { osl::Directory aDir(rURL); - CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.open()); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aDir.open()); osl::DirectoryItem aItem; osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type); std::set dirs; @@ -111,7 +111,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected, OUString realUrl; if (bEncrypted) { - CPPUNIT_ASSERT(osl::FileBase::E_None == osl::FileBase::createTempFile(NULL, NULL, &sTmpFile)); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, osl::FileBase::createTempFile(NULL, NULL, &sTmpFile)); decode(sURL, sTmpFile); realUrl = sTmpFile; } @@ -141,9 +141,9 @@ void FiltersTest::recursiveScan(filterStatus nExpected, if (nExpected == test::indeterminate) continue; filterStatus nResult = bRes ? test::pass : test::fail; - CPPUNIT_ASSERT_MESSAGE(aRes.getStr(), nResult == nExpected); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aRes.getStr(), nExpected, nResult); } - CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.close()); + CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aDir.close()); } void FiltersTest::testDir(const OUString &rFilter, -- cgit