blob: 06f0a17addab62d06190a202591b0a7102995e0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "gtest/gtest.h"
#include "type.h"
#include "operation.h"
class TypeAsValueTest : public ::testing::Test { };
TEST_F(TypeAsValueTest, Value) {
ASSERT_TRUE(( std::is_same<int, tav::Int<1>::value_type>::value ));
}
TEST_F(TypeAsValueTest, BasicMath) {
EXPECT_EQ(3, ( tav::add<tav::Int<1>, tav::Int<2>>::type::value ));
EXPECT_EQ(4, ( tav::substract<tav::Int<10>, tav::Int<6>>::type::value ));
EXPECT_EQ(42, ( tav::multiply<tav::Int<2>, tav::Int<21>>::type::value ));
EXPECT_EQ(5, ( tav::divide<tav::Int<10>, tav::Int<2>>::type::value ));
}
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
|