mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 09:20:11 +00:00
Added some tests for sharedlibrary
This commit is contained in:
24
sharedlibrary/tests/test_stop.c
Normal file
24
sharedlibrary/tests/test_stop.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "shared.h"
|
||||
|
||||
void test_StopServerInstance()
|
||||
{
|
||||
typedef int (*StopServerInstanceFn)(char *);
|
||||
StopServerInstanceFn StopServerInstance = (StopServerInstanceFn)load_function("StopServerInstance");
|
||||
|
||||
if (!StopServerInstance)
|
||||
{
|
||||
fprintf(stderr, "Failed to find StopServerInstance function\n");
|
||||
return;
|
||||
}
|
||||
|
||||
char *serverName = "TestServer";
|
||||
int result = StopServerInstance(serverName);
|
||||
if (result == 0)
|
||||
{
|
||||
printf("StopServerInstance: SUCCESS\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("StopServerInstance: FAILED (result = %d)\n", result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user