@@ -19,17 +19,17 @@ struct tbl_functor {
19
19
int main () {
20
20
21
21
try {
22
- database db (" :memory:" );
23
- db << " CREATE TABLE tbl (id integer, name string);" ;
24
- db << " INSERT INTO tbl VALUES (?, ?);" << 1 << " hello" ;
25
- db << " INSERT INTO tbl VALUES (?, ?);" << 2 << " world" ;
22
+ database db (" :memory:" );
23
+ db << " CREATE TABLE tbl (id integer, name string);" ;
24
+ db << " INSERT INTO tbl VALUES (?, ?);" << 1 << " hello" ;
25
+ db << " INSERT INTO tbl VALUES (?, ?);" << 2 << " world" ;
26
26
27
27
vector<pair<int ,string> > vec;
28
28
db << " select id,name from tbl;" >> tbl_functor (vec);
29
29
30
30
if (vec.size () != 2 ) {
31
- cout << " Bad result on line " << __LINE__ << endl;
32
- exit (EXIT_FAILURE);
31
+ cout << " Bad result on line " << __LINE__ << endl;
32
+ exit (EXIT_FAILURE);
33
33
}
34
34
35
35
vec.clear ();
@@ -38,20 +38,20 @@ int main() {
38
38
db << " select id,name from tbl;" >> functor;
39
39
40
40
if (vec.size () != 2 || vec[0 ].first != 1 || vec[0 ].second != " hello" ) {
41
- cout << " Bad result on line " << __LINE__ << endl;
42
- exit (EXIT_FAILURE);
41
+ cout << " Bad result on line " << __LINE__ << endl;
42
+ exit (EXIT_FAILURE);
43
43
}
44
44
45
45
}
46
- catch (sqlite_exception e) {
47
- cout << " Unexpected error " << e.what () << endl;
48
- exit (EXIT_FAILURE);
49
- }
50
- catch (...) {
51
- cout << " Unknown error\n " ;
52
- exit (EXIT_FAILURE);
53
- }
54
-
55
- cout << " OK\n " ;
56
- exit (EXIT_SUCCESS);
46
+ catch (sqlite_exception e) {
47
+ cout << " Unexpected error " << e.what () << endl;
48
+ exit (EXIT_FAILURE);
49
+ }
50
+ catch (...) {
51
+ cout << " Unknown error\n " ;
52
+ exit (EXIT_FAILURE);
53
+ }
54
+
55
+ cout << " OK\n " ;
56
+ exit (EXIT_SUCCESS);
57
57
}
0 commit comments