[Libreoffice-commits] .: sal/qa
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Feb 16 13:41:53 PST 2011
sal/qa/osl/file/osl_File.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 270c3ecf0ab512332cf5ae747f5dfc2c8d5a8c2b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Feb 16 21:41:14 2011 +0000
Suppress OSL_ASSERT about the deliberate error in the cppunit test.
We want to test for this, retain the OSL_ASSERT for the normal case, and not
get noise during the test itself.
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 3916678..d873425 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -5102,6 +5102,10 @@ namespace osl_DirectoryItem
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_DirectoryItem::getFileStatus, "osl_DirectoryItem" );
}// namespace osl_DirectoryItem
+//Use to deliberately silence warnings for a deliberate error
+extern "C" void SAL_CALL suppressOslDebugMessage( const sal_Char *, sal_Int32, const sal_Char * )
+{
+}
//------------------------------------------------------------------------
// Beginning of the test cases for Directory class
@@ -5582,7 +5586,10 @@ namespace osl_Directory
void getNextItem_002( )
{
::osl::Directory testDirectory( aTmpName3 ); //constructor
+ //deliberate error, suppress run-time warning
+ pfunc_osl_printDetailedDebugMessage pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &suppressOslDebugMessage );
nError1 = testDirectory.getNextItem( rItem );
+ osl_setDetailedDebugMessageFunc( pOldDebugMessageFunc );
CPPUNIT_ASSERT_MESSAGE( "test for getNextItem function: retrive an item in a directory which is not opened, also test for nHint's default value.",
( ::osl::FileBase::E_INVAL == nError1 ) );
More information about the Libreoffice-commits
mailing list