Files
AnyPS5/core/libs/tests/GuestAudiodecNative.cpp
T
Yunus Shaikh bd97351d00 test(prx): check every stub the newly built Export.cpp files export
The build fix checks one export per library. Call the rest through
their headers and require std::runtime_error with "<name> not
implemented": 34 more in libSceAgcDriver, 14 more in libSceNgs2.native
plus libSceNgs2's six PendingExports.cpp stubs, 22 more in
libSceNpTrophy2 and 10 more in libSceNpUniversalDataSystem. The 14
libSceAudiodec.native and 2 libSceAvPlayer.native exports had no test,
so each gets a guest executable of its own.
2026-10-25 13:52:48 +00:00

47 lines
1.8 KiB
C++

#include "prx/libSceAudiodec.native/include/Api.hpp"
#include "SceTypes.hpp"
#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdio>
#include <stdexcept>
#include <string>
static bool ThrowsNotImplemented(int (APS5_VABI* function)(void), const char* name) {
try {
function();
} catch (const std::runtime_error& error) {
return std::string(error.what()) == std::string(name) + " not implemented";
}
return false;
}
int main() {
struct Export {
int (APS5_VABI* function)(void);
const char* name;
};
const Export exports[] = {
{sceAudiodecClearContextEx, "sceAudiodecClearContextEx"},
{sceAudiodecCreateDecoderEx, "sceAudiodecCreateDecoderEx"},
{sceAudiodecDecode2, "sceAudiodecDecode2"},
{sceAudiodecDecode2Ex, "sceAudiodecDecode2Ex"},
{sceAudiodecDecode2WithPriority, "sceAudiodecDecode2WithPriority"},
{sceAudiodecDecode2WithPriorityEx, "sceAudiodecDecode2WithPriorityEx"},
{sceAudiodecDecodeEx, "sceAudiodecDecodeEx"},
{sceAudiodecDecodeWithPriority, "sceAudiodecDecodeWithPriority"},
{sceAudiodecDecodeWithPriorityEx, "sceAudiodecDecodeWithPriorityEx"},
{sceAudiodecDeleteDecoderEx, "sceAudiodecDeleteDecoderEx"},
{sceAudiodecGetContext, "sceAudiodecGetContext"},
{sceAudiodecInitialize, "sceAudiodecInitialize"},
{sceAudiodecRegisterCodec, "sceAudiodecRegisterCodec"},
{sceAudiodecTerminate, "sceAudiodecTerminate"},
};
for (const auto& entry : exports) {
if (!ThrowsNotImplemented(entry.function, entry.name)) {
std::fprintf(stderr, "%s did not throw its not-implemented error\n", entry.name);
return 1;
}
}
std::puts("libSceAudiodec.native pending exports throw");
return 0;
}