test(libc): match the immortal classic locale and run guest_locale in ctest

This commit is contained in:
Nahuel Genchi 2026-10-07 00:00:12 -03:00
parent 0c952fe574
commit 2b83a533b8
2 changed files with 8 additions and 1 deletions

View File

@ -286,6 +286,13 @@ target_include_directories(guest_locale_tests PRIVATE ${LIBS_INCLUDE_DIR})
set_target_properties(guest_locale_tests PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(guest_locale_tests PRIVATE libc)
configure_windows_unwind(guest_locale_tests)
if(BUILD_TESTING)
set_target_properties(guest_locale_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
add_test(NAME guest_locale COMMAND guest_locale_tests)
if(WIN32)
set_tests_properties(guest_locale PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
endif()
if(MINGW)
foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static)

View File

@ -57,7 +57,7 @@ static void CheckGuestCalls() {
Require(locale->base.references == initial + 1);
Require(release(&locale->base) == nullptr);
Require(locale->base.references == initial);
RequireException([&] { release(&locale->base); });
Require(release(&locale->base) == nullptr && locale->base.references == initial);
RequireException([&] { retain(nullptr); });
RequireException([&] { locale->base.vtable->deleteObject(&locale->base); });
Require(locale->base.references == initial);