@@ -168,7 +168,7 @@ TEST(Statement, executeStep)
168168 const int64_t id = query.getColumn (0 );
169169 const std::string msg = query.getColumn (1 );
170170 const int integer = query.getColumn (2 );
171- const long integer2= query.getColumn (2 );
171+ const int64_t integer2= query.getColumn (2 );
172172 const double real = query.getColumn (3 );
173173 EXPECT_EQ (1 , id);
174174 EXPECT_EQ (" first" , msg);
@@ -221,7 +221,7 @@ TEST(Statement, tryExecuteStep)
221221 const int64_t id = query.getColumn (0 );
222222 const std::string msg = query.getColumn (1 );
223223 const int integer = query.getColumn (2 );
224- const long integer2= query.getColumn (2 );
224+ const int64_t integer2= query.getColumn (2 );
225225 const double real = query.getColumn (3 );
226226 EXPECT_EQ (1 , id);
227227 EXPECT_EQ (" first" , msg);
@@ -371,15 +371,10 @@ TEST(Statement, bindings)
371371 // reset() without clearbindings()
372372 insert.reset ();
373373
374- // Sixth row with uint32_t unsigned value and a long value (which is either a 32b int or a 64b long long )
374+ // Sixth row with uint32_t unsigned value and a long value (which is either a 32b int or a 64b int64_t )
375375 {
376376 const uint32_t uint32 = 4294967295U ;
377- // preprocessor define to force not use long and use instead uint
378- #if NON_AMBIGOUS_OVERLOAD
379- const int integer = -123 ;
380- #else
381- const long integer = -123 ;
382- #endif
377+ const int64_t integer = -123 ;
383378 insert.bind (2 , uint32);
384379 insert.bind (3 , integer);
385380 EXPECT_EQ (1 , insert.exec ());
@@ -461,11 +456,11 @@ TEST(Statement, bindByName)
461456 EXPECT_EQ (SQLite::OK, db.getErrorCode ());
462457
463458 // Create a new table
464- EXPECT_EQ (0 , db.exec (" CREATE TABLE test (id INTEGER PRIMARY KEY, msg TEXT, int INTEGER, double REAL, long INTEGER )" ));
459+ EXPECT_EQ (0 , db.exec (" CREATE TABLE test (id INTEGER PRIMARY KEY, msg TEXT, int INTEGER, long INTEGER, double REAL )" ));
465460 EXPECT_EQ (SQLite::OK, db.getErrorCode ());
466461
467462 // Insertion with bindable parameters
468- SQLite::Statement insert (db, " INSERT INTO test VALUES (NULL, @msg, @int, @double , @long )" );
463+ SQLite::Statement insert (db, " INSERT INTO test VALUES (NULL, @msg, @int, @long , @double )" );
469464
470465 // First row with text/int/double
471466 insert.bind (" @msg" , " first" );
@@ -487,8 +482,8 @@ TEST(Statement, bindByName)
487482 EXPECT_EQ (1 , query.getColumn (0 ).getInt64 ());
488483 EXPECT_STREQ (" first" , query.getColumn (1 ).getText ());
489484 EXPECT_EQ (123 , query.getColumn (2 ).getInt ());
490- EXPECT_EQ (0. 123 , query.getColumn (3 ).getDouble ());
491- EXPECT_EQ (- 123 , query.getColumn (4 ).getInt ());
485+ EXPECT_EQ (- 123 , query.getColumn (3 ).getInt ());
486+ EXPECT_EQ (0. 123 , query.getColumn (4 ).getDouble ());
492487
493488 // reset() with clearbindings() and new bindings
494489 insert.reset ();
@@ -497,17 +492,13 @@ TEST(Statement, bindByName)
497492 // Second row with string/int64/float
498493 {
499494 const std::string second (" second" );
495+ const int32_t int32 = -123 ;
500496 const int64_t int64 = 12345678900000LL ;
501- #if NON_AMBIGOUS_OVERLOAD
502- const int integer = -123 ;
503- #else
504- const long integer = -123 ;
505- #endif
506497 const float float32 = 0 .234f ;
507498 insert.bind (" @msg" , second);
508- insert.bind (" @int" , int64);
499+ insert.bind (" @int" , int32);
500+ insert.bind (" @long" , int64);
509501 insert.bind (" @double" , float32);
510- insert.bind (" @long" , integer);
511502 EXPECT_EQ (1 , insert.exec ());
512503 EXPECT_EQ (SQLITE_DONE, db.getErrorCode ());
513504
@@ -517,9 +508,9 @@ TEST(Statement, bindByName)
517508 EXPECT_FALSE (query.isDone ());
518509 EXPECT_EQ (2 , query.getColumn (0 ).getInt64 ());
519510 EXPECT_EQ (second, query.getColumn (1 ).getText ());
520- EXPECT_EQ (12345678900000LL , query.getColumn (2 ).getInt64 ());
521- EXPECT_EQ (0 . 234f , query.getColumn (3 ).getDouble ());
522- EXPECT_EQ (- 123 , query.getColumn (4 ).getInt ());
511+ EXPECT_EQ (- 123 , query.getColumn (2 ).getInt ());
512+ EXPECT_EQ (12345678900000LL , query.getColumn (3 ).getInt64 ());
513+ EXPECT_EQ (0 . 234f , query.getColumn (4 ).getDouble ());
523514 }
524515
525516 // reset() without clearbindings()
@@ -540,7 +531,7 @@ TEST(Statement, bindByName)
540531 EXPECT_STREQ (buffer, query.getColumn (1 ).getText ());
541532 EXPECT_TRUE (query.isColumnNull (2 ));
542533 EXPECT_EQ (0 , query.getColumn (2 ).getInt ());
543- EXPECT_EQ (0 .234f , query.getColumn (3 ).getDouble ());
534+ EXPECT_EQ (0 .234f , query.getColumn (4 ).getDouble ());
544535 }
545536
546537 // reset() without clearbindings()
@@ -561,7 +552,7 @@ TEST(Statement, bindByName)
561552 EXPECT_FALSE (query.isDone ());
562553 EXPECT_EQ (4 , query.getColumn (0 ).getInt64 ());
563554 EXPECT_EQ (4294967295U , query.getColumn (2 ).getUInt ());
564- EXPECT_EQ (12345678900000LL , query.getColumn (4 ).getInt64 ());
555+ EXPECT_EQ (12345678900000LL , query.getColumn (3 ).getInt64 ());
565556 }
566557}
567558
@@ -615,11 +606,7 @@ TEST(Statement, bindByNameString)
615606 {
616607 const std::string second (" second" );
617608 const int64_t int64 = 12345678900000LL ;
618- #if NON_AMBIGOUS_OVERLOAD
619- const int integer = -123 ;
620- #else
621- const long integer = -123 ;
622- #endif
609+ const int64_t integer = -123 ;
623610 const float float32 = 0 .234f ;
624611 insert.bind (amsg, second);
625612 insert.bind (aint, int64);
@@ -1024,21 +1011,6 @@ TEST(Statement, getColumns)
10241011}
10251012#endif
10261013
1027- #if (LONG_MAX > INT_MAX) // sizeof(long)==8 means the data model of the system is LP64 (64bits Linux)
1028- TEST (Statement, bind64bitsLong)
1029- {
1030- // Create a new database
1031- SQLite::Database db (" :memory:" , SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
1032- EXPECT_EQ (SQLite::OK, db.getErrorCode ());
1033- EXPECT_EQ (SQLite::OK, db.getExtendedErrorCode ());
1034-
1035- SQLite::Statement query (db, " SELECT ?" );
1036- query.bind (1 , 4294967297L );
1037- query.executeStep ();
1038- EXPECT_EQ (4294967297L , query.getColumn (0 ).getInt64 ());
1039- }
1040- #endif
1041-
10421014TEST (Statement, getBindParameterCount)
10431015{
10441016 // Create a new database
0 commit comments