/
UCS
/
sqlite_orm
Обзор
Документация
Войти
/
UCS
/
sqlite_orm
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/static_tests/functional/same_or_void.cpp
34 строки
2 KB
klaus triendl
Updated to Catch2 v3
15 янв 2023, 22:59
15 янв 2023, 22:59
3154d24
Код
Авторство
О чём код?
#include <sqlite_orm/sqlite_orm.h> #include <catch2/catch_all.hpp> #include <type_traits> // std::is_same #include <string> // std::string using namespace sqlite_orm; TEST_CASE("same_or_void") { using internal::same_or_void; // one argument STATIC_REQUIRE(std::is_same<same_or_void<int>::type, int>::value); STATIC_REQUIRE(std::is_same<same_or_void<std::string>::type, std::string>::value); STATIC_REQUIRE(std::is_same<same_or_void<long>::type, long>::value); // two arguments STATIC_REQUIRE(std::is_same<same_or_void<int, int>::type, int>::value); STATIC_REQUIRE(std::is_same<same_or_void<int, long>::type, void>::value); STATIC_REQUIRE(std::is_same<same_or_void<std::string, std::string>::type, std::string>::value); STATIC_REQUIRE(std::is_same<same_or_void<std::string, short>::type, void>::value); // three arguments STATIC_REQUIRE(std::is_same<same_or_void<int, int, int>::type, int>::value); STATIC_REQUIRE(std::is_same<same_or_void<long, long, long>::type, long>::value); STATIC_REQUIRE(std::is_same<same_or_void<int, int, long>::type, void>::value); STATIC_REQUIRE(std::is_same<same_or_void<long, int, int>::type, void>::value); STATIC_REQUIRE(std::is_same<same_or_void<long, int, long>::type, void>::value); // four arguments STATIC_REQUIRE(std::is_same<same_or_void<int, int, int, int>::type, int>::value); STATIC_REQUIRE(std::is_same<same_or_void<long, long, long, long>::type, long>::value); STATIC_REQUIRE(std::is_same<same_or_void<int, int, int, long>::type, void>::value); }