Files
AnyPS5/core/libs/tests/GuestAudiodecNative.cpp
T
Yunus Shaikh 60baf80572 test(prx): look up each pending export by name in the built library
Release builds fold a declared function's address compared with nullptr
to false, so the tables' loops compiled away together with the tables'
references to the exports, and the checks passed without the library
exporting anything. Each test now gets its library's built file from its
add_test line, opens it, looks up every name in its table, and requires
one name the library doesn't export not to resolve. The table entries
are read through a volatile copy, so the test binaries keep importing
them.
2026-10-28 10:25:40 -07:00

32 lines
1.4 KiB
C++

#include "prx/libSceAudiodec.native/include/Api.hpp"
#include "SceTypes.hpp"
#include "prx/libc/include/general/VabiMacros.hpp"
#include "tests/ExportLookup.hpp"
#include <cstdio>
int main(int argc, char** argv) {
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"},
};
if (!ExportsResolveByName(argc > 1 ? argv[1] : nullptr, exports, "sceAudiodecNotExported")) return 1;
std::puts("libSceAudiodec.native pending exports are exported");
return 0;
}