mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 01:10:44 +00:00
Added cross-platform shared library tests
This commit is contained in:
@@ -2,6 +2,16 @@
|
||||
|
||||
int test_Databases()
|
||||
{
|
||||
/* Load FreeMemory function - must use this to free memory allocated by the DLL
|
||||
because the DLL may use a different C runtime heap than the test loader */
|
||||
typedef void (*FreeMemoryFn)(char *);
|
||||
FreeMemoryFn FreeMemory = (FreeMemoryFn)load_function("FreeMemory");
|
||||
if (!FreeMemory)
|
||||
{
|
||||
fprintf(stderr, "Failed to find FreeMemory function\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef int (*CreateDatabaseFn)(char *, char *);
|
||||
CreateDatabaseFn CreateDatabase = (CreateDatabaseFn)load_function("CreateDatabase");
|
||||
if (!CreateDatabase)
|
||||
@@ -36,6 +46,7 @@ int test_Databases()
|
||||
if (database)
|
||||
{
|
||||
printf("GetDatabase: SUCCESS (database = %s)\n", database);
|
||||
FreeMemory(database);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user