awtk/tests/basic_test.cc

26 lines
424 B
C++
Raw Normal View History

2018-10-16 16:30:26 +08:00
#include "base/types_def.h"
#include "gtest/gtest.h"
TEST(Basic, round) {
uint32_t n = 4;
uint32_t i = 0;
for (i = 1; i < n; i++) {
ASSERT_EQ(TK_ROUND_TO(i, n), n);
}
n = 8;
for (i = 1; i < n; i++) {
ASSERT_EQ(TK_ROUND_TO(i, n), n);
}
n = 16;
for (i = 1; i < n; i++) {
ASSERT_EQ(TK_ROUND_TO(i, n), n);
}
n = 32;
for (i = 1; i < n; i++) {
ASSERT_EQ(TK_ROUND_TO(i, n), n);
}
}