test: add testbench for macro namespace
This commit is contained in:
18
testbench/yycc/macro/ptr_size_detector.cpp
Normal file
18
testbench/yycc/macro/ptr_size_detector.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <yycc.hpp>
|
||||
#include <yycc/macro/ptr_size_detector.hpp>
|
||||
|
||||
#define PTR_SIZE ::yycc::macro::ptr_size
|
||||
|
||||
namespace yycctest::macro::ptr_size {
|
||||
|
||||
TEST(MacroPtrSize, Main) {
|
||||
auto rv = PTR_SIZE::get_ptr_size();
|
||||
#if defined(YYCC_PTRSIZE_32)
|
||||
EXPECT_EQ(rv, PTR_SIZE::PtrSizeKind::Bits32);
|
||||
#else
|
||||
EXPECT_EQ(rv, PTR_SIZE::PtrSizeKind::Bits64);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace yycctest::macro::ptr_size
|
Reference in New Issue
Block a user