]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/file/filetest.cpp
moved non-interactive tests for wxDynamicLibrary, wxGet/SetEnv, wxTempFile, wxCopyFil...
[wxWidgets.git] / tests / file / filetest.cpp
index 33300577cb81ca286d25afd770847d0b668a8d18..85e70ab8e6bf73f8e7116a807677e77549654fa0 100644 (file)
@@ -37,6 +37,7 @@ private:
         CPPUNIT_TEST( RoundTripUTF8 );
         CPPUNIT_TEST( RoundTripUTF16 );
         CPPUNIT_TEST( RoundTripUTF32 );
+        CPPUNIT_TEST( TempFile );
     CPPUNIT_TEST_SUITE_END();
 
     void RoundTripUTF8() { DoRoundTripTest(wxConvUTF8); }
@@ -44,6 +45,7 @@ private:
     void RoundTripUTF32() { DoRoundTripTest(wxMBConvUTF32()); }
 
     void DoRoundTripTest(const wxMBConv& conv);
+    void TempFile();
 
     wxDECLARE_NO_COPY_CLASS(FileTestCase);
 };
@@ -92,4 +94,12 @@ void FileTestCase::DoRoundTripTest(const wxMBConv& conv)
     }
 }
 
+void FileTestCase::TempFile()
+{
+    wxTempFile tmpFile;
+    CPPUNIT_ASSERT( tmpFile.Open(wxT("test2")) && tmpFile.Write(wxT("the answer is 42")) );
+    CPPUNIT_ASSERT( tmpFile.Commit() );
+    CPPUNIT_ASSERT( wxRemoveFile(wxT("test2")) );
+}
+
 #endif // wxUSE_FILE