Skip to content

Commit 2d53af6

Browse files
committed
Update slick_queue; Add CharArrayLogging test case; Fix test build
1 parent 7c537eb commit 2d53af6

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

CHANGELOG

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# v1.0.0.6 - 10-14-2025
2+
- Update slick_queue to v1.1.0.0
3+
14
# v1.0.0.5 - 10-03-2025
2-
- Support char* logging argument to avoid build error.
5+
- Support char* logging argument to avoid build error.
36

47
# v1.0.0.4 - 10-02-2025
58
- Fix critical DailyFileSink bug: prevent file overwrites on program restart

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.20)
22

3-
set(BUILD_VERSION 1.0.0.5)
3+
set(BUILD_VERSION 1.0.0.6)
44
project(slick_logger VERSION ${BUILD_VERSION} LANGUAGES CXX)
55

66
set(CMAKE_CXX_STANDARD 20)
@@ -13,7 +13,7 @@ set(BUILD_SLICK_QUEUE_TESTS OFF CACHE BOOL "" FORCE)
1313
FetchContent_Declare(
1414
slick_queue
1515
GIT_REPOSITORY https://github.com/SlickQuant/slick_queue.git
16-
GIT_TAG v1.0.2.1
16+
GIT_TAG v1.1.0.0
1717
)
1818
FetchContent_MakeAvailable(slick_queue)
1919

tests/test_logger.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,36 @@ TEST_F(SlickLoggerTest, SingleStringLogging) {
317317
EXPECT_TRUE(file_contents.find("string_view message") != std::string::npos);
318318
}
319319

320+
TEST_F(SlickLoggerTest, CharArrayLogging) {
321+
struct Msg {
322+
char msg_[32];
323+
};
324+
325+
Msg msg;
326+
sprintf(msg.msg_, "test char array");
327+
328+
std::filesystem::remove("test_char_array.log");
329+
330+
slick_logger::Logger::instance().init("test_char_array.log", 1024);
331+
332+
LOG_INFO("Log char array: {}", msg.msg_);
333+
334+
slick_logger::Logger::instance().shutdown();
335+
336+
ASSERT_TRUE(std::filesystem::exists("test_char_array.log"));
337+
338+
std::ifstream log_file("test_char_array.log");
339+
std::string file_contents;
340+
std::string line;
341+
std::getline(log_file, line); // first line is the logger's version
342+
while (std::getline(log_file, line)) {
343+
file_contents += line + "\n";
344+
}
345+
346+
// Check valid formats work
347+
EXPECT_TRUE(file_contents.find("Log char array: test char array") != std::string::npos);
348+
}
349+
320350
int main(int argc, char **argv) {
321351
testing::InitGoogleTest(&argc, argv);
322352
return RUN_ALL_TESTS();

tests/test_sinks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ TEST_F(SinkTest, DailyFileSinkRotation) {
182182
}
183183

184184
// Override to return our controlled test date
185-
std::string get_date_string() override {
185+
std::string get_date_string() const override {
186186
return test_date_;
187187
}
188188

0 commit comments

Comments
 (0)