[Libreoffice-commits] .: 3 commits - sal/inc sal/qa sal/workben

Thorsten Behrens thorsten at kemper.freedesktop.org
Thu Apr 14 03:48:35 PDT 2011


 sal/inc/osl/file.hxx         |    5 -----
 sal/qa/osl/file/osl_File.cxx |   38 +++++++++++++++++++-------------------
 sal/workben/testfile.cxx     |    6 +++---
 3 files changed, 22 insertions(+), 27 deletions(-)

New commits:
commit 0b943523249455c876fefdf19ba345d85f190a29
Author: Michael Lefevre <lefevre00 at yahoo.fr>
Date:   Wed Apr 13 22:43:55 2011 +0200

    Kill Pos_XXX in favour of osl_Pos_XXX

diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 555f70a..f42a965 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -3627,17 +3627,17 @@ namespace osl_File
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             //the file size is smaller than 100
-            nError1 = testFile.setPos( Pos_End,  -100 );
+            nError1 = testFile.setPos( osl_Pos_End,  -100 );
             CPPUNIT_ASSERT_MESSAGE( "should return error", ::osl::FileBase::E_INVAL == nError1 );
 
-             nError1 = testFile.setPos( Pos_End, -53 );
+             nError1 = testFile.setPos( osl_Pos_End, -53 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.read( buffer_read, 1, nCount_read );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.close( );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_End, set the position to end, test if the first char in file is correct",
+            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for osl_Pos_End, set the position to end, test if the first char in file is correct",
                                      buffer_read[0] == pBuffer_Char[0] );
         }
 
@@ -3759,7 +3759,7 @@ namespace osl_File
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-             nError1 = testFile.setPos( Pos_End, 0 );
+             nError1 = testFile.setPos( osl_Pos_End, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.isEndOfFile( pEOF );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -3859,7 +3859,7 @@ namespace osl_File
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
             //get the file size;
-             nError1 = testFile.setPos( Pos_End, 0 );
+             nError1 = testFile.setPos( osl_Pos_End, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
              nError1 = testFile.getPos( nFilePointer );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -3887,7 +3887,7 @@ namespace osl_File
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
             //get the file size;
-             nError1 = testFile.setPos( Pos_End, 0 );
+             nError1 = testFile.setPos( osl_Pos_End, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
              nError1 = testFile.getPos( nFilePointer );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -4241,7 +4241,7 @@ namespace osl_File
         //check if is the new file
         File newFile( aTmpName4 );
         newFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Read );
-        newFile.setPos( Pos_End, 0 );
+        newFile.setPos( osl_Pos_End, 0 );
         //		CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
         sal_uInt64     nFilePointer;
         nError1 = newFile.getPos( nFilePointer );
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index 309d669..16cdfdf 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -1197,7 +1197,7 @@ void FilePointerTest( void )
         rFile.setSize( 5000 );
 
         printf( "Set the FilePointer at the end of the file (5000)\n" );
-        rc=rFile.setPos( Pos_End,0 );
+        rc=rFile.setPos( osl_Pos_End,0 );
         print_error( rtl::OString( "SetPos" ), rc );
 
         rc=rFile.getPos( filepointer );
commit e66dee1df168c25deb94a5015b9f3ae1694a74ff
Author: Michael Lefevre <lefevre00 at yahoo.fr>
Date:   Wed Apr 13 22:43:54 2011 +0200

    Kill Pos_XXX in favour of osl_Pos_XXX

diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index ede89cb..555f70a 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -3608,14 +3608,14 @@ namespace osl_File
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
              nError1 = testFile.setPos( osl_Pos_Absolut, sizeof( pBuffer_Char ) - 2 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-             nError1 = testFile.setPos( Pos_Current, 0);
+             nError1 = testFile.setPos( osl_Pos_Current, 0);
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.read( buffer_read, 1, nCount_read );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.close( );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_Current, set the position to end, test if the ( end -1 ) char in file is correct",
+            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for osl_Pos_Current, set the position to end, test if the ( end -1 ) char in file is correct",
                                      buffer_read[0] == pBuffer_Char[sizeof( pBuffer_Char ) - 2] );
         }
 
@@ -3788,7 +3788,7 @@ namespace osl_File
             {
                 nError1 = testFile.isEndOfFile( pEOF );
                 CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-                nError1 = testFile.setPos( Pos_Current, 1 );
+                nError1 = testFile.setPos( osl_Pos_Current, 1 );
                 CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             }
              nError1 = testFile.getPos( nFilePointer );
commit 5aa740fc2acc8747e6dc3b3847d7aa0b5af03f9f
Author: Michael Lefevre <lefevre00 at yahoo.fr>
Date:   Wed Apr 13 22:28:58 2011 +0200

    Kill Pos_XXX in favour of osl_Pos_XXX

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 5ba8177..4be0d3d 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -1003,11 +1003,6 @@ public:
         return (RC) Error;
     }
 
-
-    #define Pos_Absolut osl_Pos_Absolut
-    #define Pos_Current osl_Pos_Current
-    #define Pos_End     osl_Pos_End
-
     /** Set the internal position pointer of an open file.
         
         @param uHow [in] 
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index abd47ae..ede89cb 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -3457,7 +3457,7 @@ namespace osl_File
 
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
             nError2 = testFile.write( buffer_write, 30, nCount_write );
-             ::osl::FileBase::RC nError4 = testFile.setPos( Pos_Absolut, 0 );
+             ::osl::FileBase::RC nError4 = testFile.setPos( osl_Pos_Absolut, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError4 );
             nError3 = testFile.read( buffer_read, 10, nCount_read );
 
@@ -3531,7 +3531,7 @@ namespace osl_File
 
             nError2 = testFile.close( );
 
-             nError3 = testFile.setPos( Pos_Absolut, 0 );
+             nError3 = testFile.setPos( osl_Pos_Absolut, 0 );
 
             CPPUNIT_ASSERT_MESSAGE( "test for close function: manipulate a file after it has been closed",
                                      ( ::osl::FileBase::E_None == nError2 ) &&
@@ -3588,14 +3588,14 @@ namespace osl_File
 
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-             nError1 = testFile.setPos( Pos_Absolut, 26 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, 26 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.read( buffer_read, 1, nCount_read );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.close( );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for Pos_Absolut, set the position to 26, test if the 26th char in file is correct",
+            CPPUNIT_ASSERT_MESSAGE( "test for setPos function: test for osl_Pos_Absolut, set the position to 26, test if the 26th char in file is correct",
                                      buffer_read[0] == pBuffer_Char[26] );
         }
 
@@ -3606,7 +3606,7 @@ namespace osl_File
 
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
-             nError1 = testFile.setPos( Pos_Absolut, sizeof( pBuffer_Char ) - 2 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, sizeof( pBuffer_Char ) - 2 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
              nError1 = testFile.setPos( Pos_Current, 0);
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -3695,7 +3695,7 @@ namespace osl_File
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-             nError1 = testFile.setPos( Pos_Absolut, 26 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, 26 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
              nError1 = testFile.getPos( nFilePointer );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -3781,7 +3781,7 @@ namespace osl_File
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-             nError1 = testFile.setPos( Pos_Absolut, 0 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             *pEOF = sal_False;
              while ( !( *pEOF ) )
@@ -3974,7 +3974,7 @@ namespace osl_File
             nError1 = testFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
 
-             nError1 = testFile.setPos( Pos_Absolut, 26 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, 26 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.read( buffer_read, 26, nCount_read );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
@@ -4034,7 +4034,7 @@ namespace osl_File
              nError1 = testFile.getPos( nFilePointer );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             //reset pointer to the begining;
-             nError1 = testFile.setPos( Pos_Absolut, 0 );
+             nError1 = testFile.setPos( osl_Pos_Absolut, 0 );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
             nError1 = testFile.read( buffer_read, 10, nCount_read );
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index 8c57e15..309d669 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -193,7 +193,7 @@ sal_Bool Initialize( void )
     uBytesRequested=aStatus.getFileSize();
 
     // read ini-File
-    rc=pFile->setPos( Pos_Absolut, 0 );
+    rc=pFile->setPos( osl_Pos_Absolut, 0 );
     pBuffer=(sal_Char*) rtl_allocateMemory( (sal_uInt32) (uBytesRequested+1)*sizeof(sal_Char) );
     rtl_zeroMemory( pBuffer, (sal_uInt32)(uBytesRequested+1)*sizeof(sal_Char) );
     
@@ -846,7 +846,7 @@ void FileWriteAndReadTest( void )
     // move the filepointer to the beginning
     //----------------------------------------------------
 
-    rc=pFile->setPos( Pos_Absolut , 0 );
+    rc=pFile->setPos( osl_Pos_Absolut , 0 );
     print_error( rtl::OString( "Set FilePointer to the beginning of the file" ), rc );
 
     printf( "\n" );


More information about the Libreoffice-commits mailing list