ObjSQLite3  Check-in [bda6d49813]

Overview
Comment:Add initial tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bda6d49813371eee28256e1f609091ca4ff664bb1ddeefcf308998b844a3eb14
User & Date: js 2020-10-01 23:20:24
Context
2020-10-01
23:43
Add support for retrieving columns check-in: 727a6838a5 user: js tags: trunk
23:20
Add initial tests check-in: bda6d49813 user: js tags: trunk
23:13
SL3Connection: Add -[executeStatement:] check-in: 02992f86b3 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to .fossil-settings/ignore-glob.

14
15
16
17
18
19
20


autom4te.cache
buildsys.mk
config.log
config.status
configure
extra.mk
tests/tests









>
>
14
15
16
17
18
19
20
21
22
autom4te.cache
buildsys.mk
config.log
config.status
configure
extra.mk
tests/tests
tests/tests.db
tests/tests.exe

Changes to tests/Makefile.

37
38
39
40
41
42
43
44
45
	rm -f objsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR} objsqlite3.dll; \
	rm -f libobjsqlite3.${OBJSQLITE3_LIB_MAJOR}.dylib; \
	exit $$EXIT

${PROG_NOINST}: ${LIBOBJSQLITE3_DEP}

CPPFLAGS += -I../src
LIBS := ${OBJFW_LIBS} ${LIBS}
LD = ${OBJC}







|

37
38
39
40
41
42
43
44
45
	rm -f objsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR} objsqlite3.dll; \
	rm -f libobjsqlite3.${OBJSQLITE3_LIB_MAJOR}.dylib; \
	exit $$EXIT

${PROG_NOINST}: ${LIBOBJSQLITE3_DEP}

CPPFLAGS += -I../src
LIBS := -L../src -lobjsqlite3 ${OBJFW_LIBS} ${LIBS}
LD = ${OBJC}

Changes to tests/Tests.m.

29
30
31
32
33
34
35































36
37
38
@end

OF_APPLICATION_DELEGATE(Tests)

@implementation Tests
- (void)applicationDidFinishLaunching
{































	[OFApplication terminate];
}
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@end

OF_APPLICATION_DELEGATE(Tests)

@implementation Tests
- (void)applicationDidFinishLaunching
{
	OFFileManager *fileManager = [OFFileManager defaultManager];
	SL3Connection *conn;
	SL3PreparedStatement *stmt;

	if ([fileManager fileExistsAtPath: @"tests.db"])
	    [fileManager removeItemAtPath: @"tests.db"];

	conn = [SL3Connection connectionWithPath: @"tests.db"];

	[conn executeStatement: @"CREATE TABLE test (a INT, b TEXT, c BLOB)"];

	stmt = [conn prepareStatement:
	    @"INSERT INTO test (a, b, c) VALUES ($a, $b, $c)"];
	[stmt bindWithArray: [OFArray arrayWithObjects:
	    [OFNumber numberWithInt: 5],
	    @"String",
	    [OFData dataWithItems: "abc"
			    count: 3],
	    nil]];
	[stmt step];

	stmt = [conn prepareStatement:
	    @"INSERT INTO test (a, b, c) VALUES ($a, $b, $c)"];
	[stmt bindWithDictionary: [OFDictionary dictionaryWithKeysAndObjects:
	    @"$a", [OFNumber numberWithInt: 7],
	    @"$b", @"Test",
	    @"$c", [OFData dataWithItems: "xyz"
				   count: 3],
	    nil]];
	[stmt step];

	[OFApplication terminate];
}
@end