From 270c3ecf0ab512332cf5ae747f5dfc2c8d5a8c2b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 16 Feb 2011 21:41:14 +0000 Subject: 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. --- sal/qa/osl/file/osl_File.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sal/qa/osl/file') diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 39166784d..d87342524 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 ) ); -- cgit v1.2.3