ulib/tests/ulib/status_or_unittest.cpp
tqcq 1610953cd8
All checks were successful
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m9s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m11s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m9s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m19s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 1m35s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 1m41s
linux-x64-gcc / linux-gcc (push) Successful in 1m56s
feat add status and status_or (#4)
Co-authored-by: tqcq <99722391+tqcq@users.noreply.github.com>
Reviewed-on: #4
2024-01-12 06:05:03 +00:00

12 lines
203 B
C++

#include <gtest/gtest.h>
#include <ulib/status_or.h>
TEST(StatusOr, EmptyValue)
{
ulib::StatusOr<int> s;
EXPECT_FALSE(s.ok());
s = 1;
EXPECT_TRUE(s.ok());
EXPECT_EQ(s.value(), 1);
}