summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/osl/detail/file.h3
-rw-r--r--sal/osl/unx/file.cxx12
-rw-r--r--sal/qa/osl/file/osl_File.cxx29
-rw-r--r--sal/util/sal.map1
4 files changed, 5 insertions, 40 deletions
diff --git a/include/osl/detail/file.h b/include/osl/detail/file.h
index b9ddabafd8ff..a3cfc732c5aa 100644
--- a/include/osl/detail/file.h
+++ b/include/osl/detail/file.h
@@ -43,9 +43,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle(
oslFileHandle Handle,
sal_IntPtr *piFileHandle );
-/* for unit testing. */
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle );
-
#if defined __cplusplus
}
#endif
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 792345da0882..99fee40c956d 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -780,10 +780,12 @@ static bool osl_file_queryLocking (sal_uInt32 uFlags)
return false;
}
-#ifdef UNX
+#if defined ANDROID
+
+namespace {
static oslFileError
-osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const char *path )
+openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const char *path )
{
oslFileError eRet;
FileHandle_Impl * pImpl = new FileHandle_Impl (-1, FileHandle_Impl::KIND_MEM, path);
@@ -805,10 +807,6 @@ osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const
return osl_File_E_None;
}
-oslFileError
-SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle )
-{
- return osl_openMemoryAsFile( address, size, pHandle, "<anon>" );
}
#endif
@@ -848,7 +846,7 @@ SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_u
errno = ENOENT;
return osl_File_E_NOENT;
}
- return osl_openMemoryAsFile(address, size, pHandle, cpFilePath);
+ return openMemoryAsFile(address, size, pHandle, cpFilePath);
}
#endif
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index a403d339a9b3..0a387e8803d3 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -2942,38 +2942,9 @@ namespace osl_File
*pEOF &&
( 0 == strncmp( ( const char * )aSequence.getArray(), &pBuffer_Char[26], 26 ) ) );
}
-#ifdef UNX
- void readLine_android()
- {
- static const char buffer[] =
- "Hello\n\r\n\a\n"
- "Fun=Badness\n"
- "Some=Somethingelse\n\r";
- sal_Int32 aHash = rtl_str_hashCode( buffer );
- for (size_t i = 0; i < sizeof (buffer); i += 7)
- {
- oslFileHandle pFile( 0 );
- CPPUNIT_ASSERT( osl_openMemoryAsFile( (void *)buffer,
- sizeof( buffer ) - i, &pFile )
- == osl_File_E_None );
- for (;;)
- {
- sal_Sequence *pSequence( 0 );
- if (osl_readLine( pFile, &pSequence ) != osl_File_E_None)
- break;
- rtl_byte_sequence_release (pSequence);
- }
- CPPUNIT_ASSERT( osl_closeFile( pFile ) == osl_File_E_None );
- }
- CPPUNIT_ASSERT( aHash == rtl_str_hashCode( buffer ) );
- }
-#endif
CPPUNIT_TEST_SUITE( readLine );
CPPUNIT_TEST( readLine_001 );
CPPUNIT_TEST( readLine_002 );
-#ifdef UNX
- CPPUNIT_TEST( readLine_android );
-#endif
CPPUNIT_TEST_SUITE_END();
};// class readLine
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 900d07760d36..8380e7e4786b 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -709,7 +709,6 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
PRIVATE_file.1 { # LibreOffice 3.6
global:
osl_getFileOSHandle;
- osl_openMemoryAsFile;
};
# Unique libstdc++ symbols: