mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-03-05 11:30:09 +00:00
Pull in full sqlite_modern_cpp repo for the license as it is not attached to source files
This commit is contained in:
27
common/sqlite_modern_cpp/tests/shared_connection.cc
Normal file
27
common/sqlite_modern_cpp/tests/shared_connection.cc
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <sqlite_modern_cpp.h>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
using namespace sqlite;
|
||||
using namespace std;
|
||||
|
||||
TEST_CASE("shared connections work fine", "[shared_connection]") {
|
||||
database db(":memory:");
|
||||
|
||||
{
|
||||
auto con = db.connection();
|
||||
|
||||
{
|
||||
database db2(con);
|
||||
int test = 0;
|
||||
db2 << "select 1" >> test;
|
||||
REQUIRE(test == 1);
|
||||
}
|
||||
|
||||
int test = 0;
|
||||
db << "select 1" >> test;
|
||||
REQUIRE(test == 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user