test: add testbench for macro namespace
This commit is contained in:
18
testbench/yycc/macro/endian_detector.cpp
Normal file
18
testbench/yycc/macro/endian_detector.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <yycc.hpp>
|
||||
#include <yycc/macro/endian_detector.hpp>
|
||||
|
||||
#define ENDIAN ::yycc::macro::endian
|
||||
|
||||
namespace yycctest::macro::endian {
|
||||
|
||||
TEST(MacroEndian, Main) {
|
||||
auto rv = ENDIAN::get_endian();
|
||||
#if defined(YYCC_ENDIAN_LITTLE)
|
||||
EXPECT_EQ(rv, ENDIAN::EndianKind::Little);
|
||||
#else
|
||||
EXPECT_EQ(rv, ENDIAN::EndianKind::Big);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace yycctest::macro::endian
|
Reference in New Issue
Block a user