Skip to content

Commit 808e777

Browse files
committed
Tests: Remove databse before running test.
1 parent 38b7ac5 commit 808e777

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/service/UserService.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ oatpp::Object<UserDto> UserService::createUser(const oatpp::Object<UserDto>& dto
88

99
auto userId = oatpp::sqlite::Utils::getLastInsertRowId(dbResult->getConnection());
1010

11-
OATPP_LOGD("AAA", "new userId=%d", userId);
12-
1311
return getUserById((v_int32) userId);
1412

1513
}

test/UserControllerTest.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
#include "app/TestClient.hpp"
99
#include "app/TestComponent.hpp"
1010

11+
#include <cstdio>
12+
1113
void UserControllerTest::onRun() {
14+
15+
/* Remove test database file before running the test */
16+
OATPP_LOGI(TAG, "DB-File='%s'", TESTDATABASE_FILE);
17+
std::remove(TESTDATABASE_FILE);
18+
1219
/* Register test components */
1320
TestComponent component;
1421

0 commit comments

Comments
 (0)