refactor: rename testbench to test.
- rename testbench to test. - add benchmark for future development.
This commit is contained in:
19
test/yycc/num/op.cpp
Normal file
19
test/yycc/num/op.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#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));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user