Added cross-platform shared library tests

This commit is contained in:
Pijus Kamandulis
2025-11-27 00:17:24 +02:00
parent 46c446c273
commit cae6fda95c
6 changed files with 158 additions and 10 deletions

View File

@@ -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
{