summaryrefslogtreecommitdiff
path: root/sal/qa/osl/file
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-02-16 21:41:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-02-16 21:41:14 +0000
commit270c3ecf0ab512332cf5ae747f5dfc2c8d5a8c2b (patch)
treee50a83d978c8818e058673888d7e9fd07462f26b /sal/qa/osl/file
parente32eea1336e1a4af5c44e9019064e2aba4b2a298 (diff)
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.
Diffstat (limited to 'sal/qa/osl/file')
-rw-r--r--sal/qa/osl/file/osl_File.cxx7
1 files changed, 7 insertions, 0 deletions
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 ) );