From 1e40599f2490eb11cf273a84a490420824425adc Mon Sep 17 00:00:00 2001 From: Romans Pokrovskis Date: Sun, 11 Oct 2026 19:17:25 +0300 Subject: [PATCH] test(libkernel): verify app info missing metadata errors --- core/libs/tests/GuestAppInfo.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/libs/tests/GuestAppInfo.cpp b/core/libs/tests/GuestAppInfo.cpp index e39662613..534995aa2 100644 --- a/core/libs/tests/GuestAppInfo.cpp +++ b/core/libs/tests/GuestAppInfo.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -35,8 +36,11 @@ int main(int argc, char** argv) { if (argc == 3 && std::string_view(argv[1]) == "--without-param-json") { std::filesystem::current_path(argv[2]); AppInfo info{}; - sceKernelGetAppInfo(getpid_nid_postfix(), &info); - return 0; + try { sceKernelGetAppInfo(getpid_nid_postfix(), &info); } + catch (const std::runtime_error& error) { + return std::string_view(error.what()) == "param.json not found" ? 0 : 1; + } + return 1; } const auto previous = std::filesystem::current_path(); const auto root = EnterTemporaryRoot("guest_app_info_"); @@ -63,6 +67,6 @@ int main(int argc, char** argv) { #else const std::string command = arguments; #endif - Require(std::system(command.c_str()) != 0); + Require(std::system(command.c_str()) == 0); std::filesystem::remove_all(empty); }