tqcq
a846570ebb
All checks were successful
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m4s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m6s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m16s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m16s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 1m21s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 1m24s
linux-x64-gcc / linux-gcc (push) Successful in 1m32s
17 lines
306 B
C++
17 lines
306 B
C++
#include <gtest/gtest.h>
|
|
#include <lazy.h>
|
|
|
|
TEST(Lazy, Base)
|
|
{
|
|
bool flag = false;
|
|
int cnt = 0;
|
|
auto lazy = ulib::Lazy<int>([&]() {
|
|
flag = true;
|
|
++cnt;
|
|
return std::make_tuple(cnt);
|
|
});
|
|
EXPECT_EQ(flag, false);
|
|
EXPECT_EQ(*lazy, 1);
|
|
EXPECT_EQ(flag, true);
|
|
}
|