From 5cc815e99c389e66328be57986273c84f4a502c3 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Wed, 19 Aug 2026 22:45:42 +0200 Subject: [PATCH] Fix for paths test --- .../tests/source/service_paths_test.cpp | 10 +++++----- TactilityKernel/tests/source/paths_test.cpp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Modules/service-module/tests/source/service_paths_test.cpp b/Modules/service-module/tests/source/service_paths_test.cpp index ff197e9ee..ba19e006d 100644 --- a/Modules/service-module/tests/source/service_paths_test.cpp +++ b/Modules/service-module/tests/source/service_paths_test.cpp @@ -7,20 +7,20 @@ #include #include -TEST_CASE("paths_get_user_data_path returns a non-empty path") { +TEST_CASE("paths_get_data_path returns a non-empty path") { char buffer[192]; - CHECK_EQ(paths_get_user_data_path(buffer, sizeof(buffer)), ERROR_NONE); + CHECK_EQ(paths_get_data_path(buffer, sizeof(buffer)), ERROR_NONE); CHECK_GT(std::strlen(buffer), 0); } -TEST_CASE("paths_get_user_data_path reports overflow for a too-small buffer") { +TEST_CASE("paths_get_data_path reports overflow for a too-small buffer") { char buffer[1]; - CHECK_EQ(paths_get_user_data_path(buffer, sizeof(buffer)), ERROR_BUFFER_OVERFLOW); + CHECK_EQ(paths_get_data_path(buffer, sizeof(buffer)), ERROR_BUFFER_OVERFLOW); } TEST_CASE("service_paths_get_user_data_directory includes the service id") { char root[192]; - REQUIRE_EQ(paths_get_user_data_path(root, sizeof(root)), ERROR_NONE); + REQUIRE_EQ(paths_get_data_path(root, sizeof(root)), ERROR_NONE); char buffer[224]; CHECK_EQ(service_paths_get_user_data_directory("my-service", buffer, sizeof(buffer)), ERROR_NONE); diff --git a/TactilityKernel/tests/source/paths_test.cpp b/TactilityKernel/tests/source/paths_test.cpp index 7c83c70f5..e851dfe6e 100644 --- a/TactilityKernel/tests/source/paths_test.cpp +++ b/TactilityKernel/tests/source/paths_test.cpp @@ -4,28 +4,28 @@ #include -// The simulator target is never built with ESP_PLATFORM, so paths_get_user_data_path() +// The simulator target is never built with ESP_PLATFORM, so paths_get_data_path() // always takes the fixed "data" path branch here, guarded by a buffer-size check. -TEST_CASE("paths_get_user_data_path succeeds when the buffer exactly fits") { +TEST_CASE("paths_get_data_path succeeds when the buffer exactly fits") { char buffer[16] = { 0 }; - CHECK_EQ(paths_get_user_data_path(buffer, sizeof(buffer)), ERROR_NONE); + CHECK_EQ(paths_get_data_path(buffer, sizeof(buffer)), ERROR_NONE); CHECK_EQ(std::strcmp(buffer, "data"), 0); } -TEST_CASE("paths_get_user_data_path succeeds with a buffer sized to exactly fit the string and terminator") { +TEST_CASE("paths_get_data_path succeeds with a buffer sized to exactly fit the string and terminator") { char buffer[5] = { 0 }; // strlen("data") + 1 - CHECK_EQ(paths_get_user_data_path(buffer, sizeof(buffer)), ERROR_NONE); + CHECK_EQ(paths_get_data_path(buffer, sizeof(buffer)), ERROR_NONE); CHECK_EQ(std::strcmp(buffer, "data"), 0); } -TEST_CASE("paths_get_user_data_path reports a buffer overflow when the buffer is one byte too small") { +TEST_CASE("paths_get_data_path reports a buffer overflow when the buffer is one byte too small") { char buffer[4] = { 0 }; // strlen("data"), no room for the terminator - CHECK_EQ(paths_get_user_data_path(buffer, sizeof(buffer)), ERROR_BUFFER_OVERFLOW); + CHECK_EQ(paths_get_data_path(buffer, sizeof(buffer)), ERROR_BUFFER_OVERFLOW); } -TEST_CASE("paths_get_user_data_path reports a buffer overflow for a zero-size buffer") { +TEST_CASE("paths_get_data_path reports a buffer overflow for a zero-size buffer") { char buffer[1] = { 'x' }; - CHECK_EQ(paths_get_user_data_path(buffer, 0), ERROR_BUFFER_OVERFLOW); + CHECK_EQ(paths_get_data_path(buffer, 0), ERROR_BUFFER_OVERFLOW); CHECK_EQ(buffer[0], 'x'); // untouched }