1
0
Files
YYCCommonplace/test/yycc/num/op.cpp
yyc12345 e7a05b3488 refactor: rename testbench to test.
- rename testbench to test.
- add benchmark for future development.
2025-09-29 13:34:02 +08:00

20 lines
420 B
C++

#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/num/op.hpp>
#include <yycc/rust/prelude.hpp>
#define OP ::yycc::num::op
namespace yycctest::num::op {
TEST(NumOp, DivCeil) {
// Normal case
EXPECT_EQ(OP::div_ceil<u32>(8, 4), UINT32_C(2));
EXPECT_EQ(OP::div_ceil<u32>(7, 4), UINT32_C(2));
// Limit case
EXPECT_EQ(OP::div_ceil<u8>(255, 2), UINT8_C(128));
}
}