2023-12-30 01:19:36 +08:00
|
|
|
#include "Database.h"
|
|
|
|
#include "BoostLog.h"
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
|
|
|
static constexpr auto path = "build/database.sqlite";
|
|
|
|
using namespace std::chrono;
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(DatabaseTest) {
|
|
|
|
Database database;
|
|
|
|
BOOST_TEST(database.open(path));
|
|
|
|
|
|
|
|
database.addTask(1234, "Hello");
|
|
|
|
|
2024-01-03 22:44:36 +08:00
|
|
|
database.addTask(1234, "这是一个测试","", true);
|
2023-12-30 01:19:36 +08:00
|
|
|
|
|
|
|
auto now = duration_cast<seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
|
|
|
|
database.setTaskFinished(1, true, now);
|
|
|
|
}
|