mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-16 14:11:28 +07:00
cast_to
This commit is contained in:
26
untests/vmath_ext_tests.cpp
Normal file
26
untests/vmath_ext_tests.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/vmath.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2020, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#include <vmath.hpp/vmath_ext.hpp>
|
||||
|
||||
#define CATCH_CONFIG_FAST_COMPILE
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "vmath_tests.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace vmath_hpp;
|
||||
using namespace vmath_tests;
|
||||
}
|
||||
|
||||
TEST_CASE("vmath/ext") {
|
||||
SECTION("cast_to") {
|
||||
constexpr auto i = cast_to<int>(1.5f);
|
||||
STATIC_REQUIRE(i == 1);
|
||||
STATIC_REQUIRE(std::is_same_v<decltype(i), const int>);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user