@@ -167,7 +167,7 @@ TEST(Statement, executeStep)
167167 const int64_t id = query.getColumn (0 );
168168 const std::string msg = query.getColumn (1 );
169169 const int integer = query.getColumn (2 );
170- const long integer2= query.getColumn (2 );
170+ const int64_t integer2= query.getColumn (2 );
171171 const double real = query.getColumn (3 );
172172 EXPECT_EQ (1 , id);
173173 EXPECT_EQ (" first" , msg);
@@ -220,7 +220,7 @@ TEST(Statement, tryExecuteStep)
220220 const int64_t id = query.getColumn (0 );
221221 const std::string msg = query.getColumn (1 );
222222 const int integer = query.getColumn (2 );
223- const long integer2= query.getColumn (2 );
223+ const int64_t integer2= query.getColumn (2 );
224224 const double real = query.getColumn (3 );
225225 EXPECT_EQ (1 , id);
226226 EXPECT_EQ (" first" , msg);
@@ -327,7 +327,7 @@ TEST(Statement, bindings)
327327 // Fourth row with string/int64/float
328328 {
329329 const std::string fourth (" fourth" );
330- const long long int64 = 12345678900000LL ;
330+ const int64_t int64 = 12345678900000LL ;
331331 const float float32 = 0 .234f ;
332332 insert.bind (1 , fourth);
333333 insert.bind (2 , int64);
@@ -370,10 +370,10 @@ TEST(Statement, bindings)
370370 // reset() without clearbindings()
371371 insert.reset ();
372372
373- // Sixth row with uint32_t unsigned value and a long value (which is either a 32b int or a 64b long long )
373+ // Sixth row with uint32_t unsigned value and a long value (which is either a 32b int or a 64b int64_t )
374374 {
375375 const uint32_t uint32 = 4294967295U ;
376- const long integer = -123 ;
376+ const int64_t integer = -123 ;
377377 insert.bind (2 , uint32);
378378 insert.bind (3 , integer);
379379 EXPECT_EQ (1 , insert.exec ());
@@ -455,11 +455,11 @@ TEST(Statement, bindByName)
455455 EXPECT_EQ (SQLite::OK, db.getErrorCode ());
456456
457457 // Create a new table
458- EXPECT_EQ (0 , db.exec (" CREATE TABLE test (id INTEGER PRIMARY KEY, msg TEXT, int INTEGER, double REAL, long INTEGER )" ));
458+ EXPECT_EQ (0 , db.exec (" CREATE TABLE test (id INTEGER PRIMARY KEY, msg TEXT, int INTEGER, long INTEGER, double REAL )" ));
459459 EXPECT_EQ (SQLite::OK, db.getErrorCode ());
460460
461461 // Insertion with bindable parameters
462- SQLite::Statement insert (db, " INSERT INTO test VALUES (NULL, @msg, @int, @double , @long )" );
462+ SQLite::Statement insert (db, " INSERT INTO test VALUES (NULL, @msg, @int, @long , @double )" );
463463
464464 // First row with text/int/double
465465 insert.bind (" @msg" , " first" );
@@ -481,8 +481,8 @@ TEST(Statement, bindByName)
481481 EXPECT_EQ (1 , query.getColumn (0 ).getInt64 ());
482482 EXPECT_STREQ (" first" , query.getColumn (1 ).getText ());
483483 EXPECT_EQ (123 , query.getColumn (2 ).getInt ());
484- EXPECT_EQ (0. 123 , query.getColumn (3 ).getDouble ());
485- EXPECT_EQ (- 123 , query.getColumn (4 ).getInt ());
484+ EXPECT_EQ (- 123 , query.getColumn (3 ).getInt ());
485+ EXPECT_EQ (0. 123 , query.getColumn (4 ).getDouble ());
486486
487487 // reset() with clearbindings() and new bindings
488488 insert.reset ();
@@ -491,13 +491,13 @@ TEST(Statement, bindByName)
491491 // Second row with string/int64/float
492492 {
493493 const std::string second (" second" );
494- const long long int64 = 12345678900000LL ;
495- const long integer = - 123 ;
494+ const int32_t int32 = - 123 ;
495+ const int64_t int64 = 12345678900000LL ;
496496 const float float32 = 0 .234f ;
497497 insert.bind (" @msg" , second);
498- insert.bind (" @int" , int64);
498+ insert.bind (" @int" , int32);
499+ insert.bind (" @long" , int64);
499500 insert.bind (" @double" , float32);
500- insert.bind (" @long" , integer);
501501 EXPECT_EQ (1 , insert.exec ());
502502 EXPECT_EQ (SQLITE_DONE, db.getErrorCode ());
503503
@@ -507,9 +507,9 @@ TEST(Statement, bindByName)
507507 EXPECT_FALSE (query.isDone ());
508508 EXPECT_EQ (2 , query.getColumn (0 ).getInt64 ());
509509 EXPECT_EQ (second, query.getColumn (1 ).getText ());
510- EXPECT_EQ (12345678900000LL , query.getColumn (2 ).getInt64 ());
511- EXPECT_EQ (0 . 234f , query.getColumn (3 ).getDouble ());
512- EXPECT_EQ (- 123 , query.getColumn (4 ).getInt ());
510+ EXPECT_EQ (- 123 , query.getColumn (2 ).getInt ());
511+ EXPECT_EQ (12345678900000LL , query.getColumn (3 ).getInt64 ());
512+ EXPECT_EQ (0 . 234f , query.getColumn (4 ).getDouble ());
513513 }
514514
515515 // reset() without clearbindings()
@@ -530,7 +530,7 @@ TEST(Statement, bindByName)
530530 EXPECT_STREQ (buffer, query.getColumn (1 ).getText ());
531531 EXPECT_TRUE (query.isColumnNull (2 ));
532532 EXPECT_EQ (0 , query.getColumn (2 ).getInt ());
533- EXPECT_EQ (0 .234f , query.getColumn (3 ).getDouble ());
533+ EXPECT_EQ (0 .234f , query.getColumn (4 ).getDouble ());
534534 }
535535
536536 // reset() without clearbindings()
@@ -551,7 +551,7 @@ TEST(Statement, bindByName)
551551 EXPECT_FALSE (query.isDone ());
552552 EXPECT_EQ (4 , query.getColumn (0 ).getInt64 ());
553553 EXPECT_EQ (4294967295U , query.getColumn (2 ).getUInt ());
554- EXPECT_EQ (12345678900000LL , query.getColumn (4 ).getInt64 ());
554+ EXPECT_EQ (12345678900000LL , query.getColumn (3 ).getInt64 ());
555555 }
556556}
557557
@@ -604,8 +604,8 @@ TEST(Statement, bindByNameString)
604604 // Second row with string/int64/float
605605 {
606606 const std::string second (" second" );
607- const long long int64 = 12345678900000LL ;
608- const long integer = -123 ;
607+ const int64_t int64 = 12345678900000LL ;
608+ const int64_t integer = -123 ;
609609 const float float32 = 0 .234f ;
610610 insert.bind (amsg, second);
611611 insert.bind (aint, int64);
@@ -1010,21 +1010,6 @@ TEST(Statement, getColumns)
10101010}
10111011#endif
10121012
1013- #if (LONG_MAX > INT_MAX) // sizeof(long)==8 means the data model of the system is LP64 (64bits Linux)
1014- TEST (Statement, bind64bitsLong)
1015- {
1016- // Create a new database
1017- SQLite::Database db (" :memory:" , SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
1018- EXPECT_EQ (SQLite::OK, db.getErrorCode ());
1019- EXPECT_EQ (SQLite::OK, db.getExtendedErrorCode ());
1020-
1021- SQLite::Statement query (db, " SELECT ?" );
1022- query.bind (1 , 4294967297L );
1023- query.executeStep ();
1024- EXPECT_EQ (4294967297L , query.getColumn (0 ).getInt64 ());
1025- }
1026- #endif
1027-
10281013TEST (Statement, getBindParameterCount)
10291014{
10301015 // Create a new database
0 commit comments