2024-12-19 23:21:45 +02:00
|
|
|
#include "shared.h"
|
|
|
|
|
2024-12-20 20:25:32 +02:00
|
|
|
int test_CreateServerInstance()
|
2024-12-19 23:21:45 +02:00
|
|
|
{
|
|
|
|
typedef int (*CreateServerInstanceFn)(char *, char *);
|
|
|
|
CreateServerInstanceFn CreateServerInstance = (CreateServerInstanceFn)load_function("CreateServerInstance");
|
|
|
|
|
|
|
|
if (!CreateServerInstance)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Failed to find CreateServerInstance function\n");
|
2024-12-20 20:25:32 +02:00
|
|
|
return 0;
|
2024-12-19 23:21:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
char *serverName = "TestServer";
|
|
|
|
char *configJSON = "{\"host\":\"localhost\",\"port\":8080}";
|
|
|
|
|
|
|
|
int result = CreateServerInstance(serverName, configJSON);
|
|
|
|
if (result == 0)
|
|
|
|
{
|
|
|
|
printf("CreateServerInstance: SUCCESS\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printf("CreateServerInstance: FAILED (result = %d)\n", result);
|
2024-12-20 20:25:32 +02:00
|
|
|
return 0;
|
2024-12-19 23:21:45 +02:00
|
|
|
}
|
2024-12-20 20:25:32 +02:00
|
|
|
|
|
|
|
return 1;
|
2024-12-19 23:21:45 +02:00
|
|
|
}
|