Files
YYCCommonplace/test/yycc/patch/ptr_pad.cpp
T

22 lines
439 B
C++
Raw Normal View History

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)
EXPECT_EQ(rv, u8"0x00000000");
2025-08-05 10:54:15 +08:00
#else
EXPECT_EQ(rv, u8"0x0000000000000000");
2025-08-05 10:54:15 +08:00
#endif
}
}