Compare commits
No commits in common. "97e444c91ce0dfe1396d621d3afd64e61047ad9e" and "5e5ba3b31f444b8fab43a4d0b019ead6effac0c9" have entirely different histories.
97e444c91c
...
5e5ba3b31f
6 changed files with 8 additions and 34 deletions
|
@ -17,7 +17,5 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
|
@ -19,13 +19,3 @@ void Database::exec(const std::string& sql)
|
||||||
throw std::runtime_error("Error in SQL execution.");
|
throw std::runtime_error("Error in SQL execution.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::beginTransaction()
|
|
||||||
{
|
|
||||||
exec("BEGIN TRANSACTION");
|
|
||||||
}
|
|
||||||
|
|
||||||
void Database::endTransaction()
|
|
||||||
{
|
|
||||||
exec("END TRANSACTION");
|
|
||||||
}
|
|
|
@ -15,8 +15,6 @@ public:
|
||||||
void exec(const std::string& sql);
|
void exec(const std::string& sql);
|
||||||
private:
|
private:
|
||||||
sqlite3 *db;
|
sqlite3 *db;
|
||||||
void beginTransaction();
|
|
||||||
void endTransaction();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATABASE_H
|
#endif // DATABASE_H
|
|
@ -1,9 +1,8 @@
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
find_package(Boost COMPONENTS filesystem unit_test_framework REQUIRED)
|
find_package(Boost COMPONENTS filesystem unit_test_framework REQUIRED)
|
||||||
|
|
||||||
add_executable(sellertest test_seller.cpp)
|
set(TEST_SOURCES test_seller.cpp)
|
||||||
target_link_libraries(sellertest core Boost::boost Boost::filesystem Boost::unit_test_framework)
|
|
||||||
add_test(Seller ${CMAKE_BINARY_DIR}/bin/sellertest)
|
|
||||||
|
|
||||||
add_executable(databasetest test_database.cpp)
|
add_executable(testsuite ${TEST_SOURCES})
|
||||||
target_link_libraries(databasetest core Boost::boost Boost::filesystem Boost::unit_test_framework)
|
target_link_libraries(testsuite core Boost::boost Boost::filesystem Boost::unit_test_framework)
|
||||||
add_test(Database ${CMAKE_BINARY_DIR}/bin/databasetest)
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#define BOOST_TEST_MODULE database
|
|
||||||
|
|
||||||
#include "../src/core/database.h"
|
|
||||||
|
|
||||||
#include <boost/test/included/unit_test.hpp>
|
|
||||||
|
|
||||||
//using namespace boost::unit_test;
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( create_database ) {
|
|
||||||
Database db("test.db");
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
#define BOOST_TEST_MODULE seller
|
|
||||||
|
|
||||||
#include "../src/core/seller.h"
|
#include "../src/core/seller.h"
|
||||||
|
|
||||||
|
#define BOOST_TEST_MODULE seller
|
||||||
|
|
||||||
#include <boost/test/included/unit_test.hpp>
|
#include <boost/test/included/unit_test.hpp>
|
||||||
|
|
||||||
using namespace boost::unit_test;
|
using namespace boost::unit_test;
|
||||||
|
|
Loading…
Reference in a new issue