added wxDynamicLibrary::GetSymbolAorW()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-07-29 22:27:13 +00:00
parent b7146cbec5
commit 93ed8ff770
4 changed files with 65 additions and 7 deletions

View File

@@ -53,7 +53,7 @@
#define TEST_CMDLINE
#define TEST_DATETIME
#define TEST_DIR
#define TEST_DLLLOADER
#define TEST_DYNLIB
#define TEST_ENVIRON
#define TEST_EXECUTE
#define TEST_FILE
@@ -85,7 +85,7 @@
#define TEST_WCHAR
#define TEST_ZIP
#else // #if TEST_ALL
#define TEST_STACKWALKER
#define TEST_DYNLIB
#endif
// some tests are interactive, define this to run them
@@ -372,7 +372,7 @@ static void TestDirExists()
// wxDllLoader
// ----------------------------------------------------------------------------
#ifdef TEST_DLLLOADER
#ifdef TEST_DYNLIB
#include "wx/dynlib.h"
@@ -398,7 +398,7 @@ static void TestDllLoad()
}
else
{
typedef int (*wxStrlenType)(const char *);
typedef int (wxSTDCALL *wxStrlenType)(const char *);
wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME);
if ( !pfnStrlen )
{
@@ -419,6 +419,26 @@ static void TestDllLoad()
wxPuts(_T("... ok"));
}
}
#ifdef __WXMSW__
static const wxChar *FUNC_NAME_AW = _T("lstrlen");
typedef int (wxSTDCALL *wxStrlenTypeAorW)(const wxChar *);
wxStrlenTypeAorW
pfnStrlenAorW = (wxStrlenTypeAorW)lib.GetSymbolAorW(FUNC_NAME_AW);
if ( !pfnStrlenAorW )
{
wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"),
FUNC_NAME_AW, LIB_NAME);
}
else
{
if ( pfnStrlenAorW(_T("foobar")) != 6 )
{
wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n"));
}
}
#endif // __WXMSW__
}
}
@@ -450,7 +470,7 @@ static void TestDllListLoaded()
#endif
#endif // TEST_DLLLOADER
#endif // TEST_DYNLIB
// ----------------------------------------------------------------------------
// wxGet/SetEnv
@@ -4119,10 +4139,10 @@ int main(int argc, char **argv)
TestDirTraverse();
#endif // TEST_DIR
#ifdef TEST_DLLLOADER
#ifdef TEST_DYNLIB
TestDllLoad();
TestDllListLoaded();
#endif // TEST_DLLLOADER
#endif // TEST_DYNLIB
#ifdef TEST_ENVIRON
TestEnvironment();