mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 20:18:22 +08:00
26 lines
424 B
C++
26 lines
424 B
C++
|
#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);
|
|||
|
}
|
|||
|
}
|