2025-08-05 10:54:15 +08:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <yycc.hpp>
|
|
|
|
#include <yycc/string/op.hpp>
|
|
|
|
#include <yycc/patch/ptr_pad.hpp>
|
|
|
|
#include <cinttypes>
|
|
|
|
|
|
|
|
#define OP ::yycc::string::op
|
|
|
|
|
|
|
|
namespace yycctest::patch::ptr_pad {
|
|
|
|
|
|
|
|
TEST(PatchPtrPad, Normal) {
|
|
|
|
auto rv = OP::printf(u8"0x%" PRIXPTR_LPAD PRIXPTR, nullptr);
|
|
|
|
|
|
|
|
#if defined(YYCC_PTRSIZE_32)
|
2025-09-22 22:14:36 +08:00
|
|
|
EXPECT_EQ(rv, u8"0x00000000");
|
2025-08-05 10:54:15 +08:00
|
|
|
#else
|
2025-09-22 22:14:36 +08:00
|
|
|
EXPECT_EQ(rv, u8"0x0000000000000000");
|
2025-08-05 10:54:15 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|