]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/misc/dynamiclib.cpp
Basque translations update from Xabier Aramendi.
[wxWidgets.git] / tests / misc / dynamiclib.cpp
index acd16c4e47a5767d38c5ec7c8ad253b19c47f1b5..af9ca06a00bc7b16510d6c40c09c0808e1cd3915 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Test wxDynamicLibrary
 // Author:      Francesco Montorsi (extracted from console sample)
 // Created:     2010-06-13
 // Purpose:     Test wxDynamicLibrary
 // Author:      Francesco Montorsi (extracted from console sample)
 // Created:     2010-06-13
-// RCS-ID:      $Id$
 // Copyright:   (c) 2010 wxWidgets team
 ///////////////////////////////////////////////////////////////////////////////
 
 // Copyright:   (c) 2010 wxWidgets team
 ///////////////////////////////////////////////////////////////////////////////
 
 
 #include "wx/dynlib.h"
 
 
 #include "wx/dynlib.h"
 
+#ifdef __UNIX__
+    #include "wx/filename.h"
+    #include "wx/log.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // test class
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // test class
 // ----------------------------------------------------------------------------
@@ -57,6 +61,13 @@ void DynamicLibraryTestCase::Load()
     static const wxChar *LIB_NAME = wxT("/lib/libc.so.6");
 #endif
     static const wxChar *FUNC_NAME = wxT("strlen");
     static const wxChar *LIB_NAME = wxT("/lib/libc.so.6");
 #endif
     static const wxChar *FUNC_NAME = wxT("strlen");
+
+    if ( !wxFileName::Exists(LIB_NAME) )
+    {
+        wxLogWarning("Shared library \"%s\" doesn't exist, "
+                     "skipping DynamicLibraryTestCase::Load() test.");
+        return;
+    }
 #else
     #error "don't know how to test wxDllLoader on this platform"
 #endif
 #else
     #error "don't know how to test wxDllLoader on this platform"
 #endif