mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Implement Database move constructors for MSVC #190
Added checks to proper _MSC_VER 1600 (VS2010)
This commit is contained in:
parent
cb6c16aadb
commit
678562e727
@ -127,4 +127,8 @@ Version 2.3.0 - March 3 2019
|
|||||||
- Added tests for all MSVC compilers available on AppVeyor (2013, 2015, 2017) #169
|
- Added tests for all MSVC compilers available on AppVeyor (2013, 2015, 2017) #169
|
||||||
- Update VariadicBind.h #172
|
- Update VariadicBind.h #172
|
||||||
- Better CMake compatibility #170
|
- Better CMake compatibility #170
|
||||||
- Add implicit cast operator to char and short types #179 #180
|
- Add implicit cast operator to char and short types #179 #180
|
||||||
|
|
||||||
|
Version ?
|
||||||
|
- #191 CMake Warning line 299
|
||||||
|
- #190 Implement move constructors
|
||||||
|
@ -120,7 +120,7 @@ public:
|
|||||||
const int aBusyTimeoutMs = 0,
|
const int aBusyTimeoutMs = 0,
|
||||||
const std::string& aVfs = "");
|
const std::string& aVfs = "");
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||||
/**
|
/**
|
||||||
* @brief Move an SQLite database connection.
|
* @brief Move an SQLite database connection.
|
||||||
*
|
*
|
||||||
|
@ -63,6 +63,23 @@ TEST(Database, ctorExecCreateDropExist) {
|
|||||||
remove("test.db3");
|
remove("test.db3");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||||
|
TEST(Database, moveConstructor) {
|
||||||
|
remove("test.db3");
|
||||||
|
{
|
||||||
|
// Create a new database
|
||||||
|
SQLite::Database db("test.db3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
|
||||||
|
EXPECT_FALSE(db.tableExists("test"));
|
||||||
|
EXPECT_TRUE(db.getHandle() != NULL);
|
||||||
|
SQLite::Database moved = std::move(db);
|
||||||
|
EXPECT_TRUE(db.getHandle() == NULL);
|
||||||
|
EXPECT_TRUE(moved.getHandle() != NULL);
|
||||||
|
EXPECT_FALSE(moved.tableExists("test"));
|
||||||
|
} // Close DB test.db3
|
||||||
|
remove("test.db3");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(Database, createCloseReopen) {
|
TEST(Database, createCloseReopen) {
|
||||||
remove("test.db3");
|
remove("test.db3");
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user