Blame view

test/DD_Client/CSlimFixtures/ScriptTableExample.c 954 Bytes
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "CSlim/Fixtures.h"
#include "CSlim/SlimList.h"

typedef struct ConnectToDDServer2
{
	int count;
	char *user;
	char *passwd;
	char result[32];
} ConnectToDDServer2;

void* ConnectToDDServer2_Create(StatementExecutor* errorHandler, SlimList* args)
{
	ConnectToDDServer2* self = (ConnectToDDServer2*)malloc(sizeof(ConnectToDDServer2));
	memset(self, 0, sizeof(ConnectToDDServer2));
	return self;
}

void ConnectToDDServer2_Destroy(void* self)
{
	free(self);
}

static char* login(void* void_self, SlimList* args) {
	ConnectToDDServer2* self = (ConnectToDDServer2*)void_self;
	self->count++;
	return "";
}

static char* simpleTest(void* void_self, SlimList* args) {
	ConnectToDDServer2* self = (ConnectToDDServer2*)void_self;
	snprintf(self->result, 32, "%d", 0);
	return self->result;
}


SLIM_CREATE_FIXTURE(ConnectToDDServer2)
	SLIM_FUNCTION(login)
	SLIM_FUNCTION(simpleTest)
SLIM_END