Skip to content

Commit

Permalink
ci and compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed May 2, 2024
1 parent 63ff2b3 commit 68707a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ jobs:
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
if: runner.os != 'Windows'
run: sqnice_tests
run: ./sqnice_tests

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
if: runner.os == 'Windows'
run: sqnice_tests.exe
run: Release/sqnice_tests.exe
8 changes: 6 additions & 2 deletions include/sqnice/pool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define SQNICE_POOL_H

#include "sqnice/database.hh"
#include <condition_variable>
#include <functional>
#include <mutex>
#include <stack>
Expand Down Expand Up @@ -113,17 +114,20 @@ namespace sqnice {
/// (The pool can still re-open more databases on demand, up to its capacity.)
void close_unused();

#ifndef __GNUC__
private:
friend borrowed_database;
friend borrowed_writeable_database;
#endif
void operator() (database* _Nullable) noexcept; // deleter
void operator() (database const* _Nullable) noexcept; // deleter

private:
pool(pool&&) = delete;
pool& operator=(pool&&) = delete;
borrowed_database borrow(bool);
borrowed_writeable_database borrow_writeable(bool);
std::unique_ptr<database> new_db(bool writeable);
void operator() (database* _Nullable) noexcept; // deleter
void operator() (database const* _Nullable) noexcept; // deleter

using db_ptr = std::unique_ptr<const database>;

Expand Down
2 changes: 1 addition & 1 deletion test/testdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ TEST_CASE_METHOD(sqnice_test, "SQNice callbacks", "[sqnice]") {
}

TEST_CASE("SQNice pool", "[sqnice]") {
sqnice::pool p("/tmp/sqnice_test.sqlite3",
sqnice::pool p("sqnice_test.sqlite3",
sqnice::open_flags::delete_first | sqnice::open_flags::readwrite);
{
auto db = p.borrow_writeable();
Expand Down

0 comments on commit 68707a9

Please sign in to comment.