diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fce6e014..2df2eacf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -121,8 +121,8 @@ add_compile_definitions(HOST) add_compile_options(-Wall -Wextra -Wpedantic -Werror) add_compile_options(-Wno-cast-function-type) -set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "--coverage") -set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage -Wno-deprecated-copy") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -Wno-deprecated-copy") ########################################################################## diff --git a/test/src/String/test_characterAccessFunc.cpp b/test/src/String/test_characterAccessFunc.cpp index 329cca43..d0f02383 100644 --- a/test/src/String/test_characterAccessFunc.cpp +++ b/test/src/String/test_characterAccessFunc.cpp @@ -45,10 +45,11 @@ TEST_CASE ("Testing String::getBytes(unsigned char, unsigned int, unsigned int)" WHEN("Valid operation") { arduino::String str("Hello"); - unsigned char buf[2]; + unsigned char buf[3]; str.getBytes(buf, 5, 3); REQUIRE(buf[0] == 'l'); REQUIRE(buf[1] == 'o'); + REQUIRE(buf[2] == '\0'); } }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: