@@ -52,3 +52,73 @@ TEST_CASE("Fixed::FRACTIONAL_MAX == Fixed::DECIMAL_MAX + (1 - Fixed::FRACTIONAL_
5252TEST_CASE (" Fixed::FRACTIONAL_MIN == Fixed::DECIMAL_MIN - (1 - Fixed::FRACTIONAL_STEP)" ) {
5353 STATIC_REQUIRE (Fixed::FRACTIONAL_MIN == Fixed::DECIMAL_MIN - (1.0 - Fixed::FRACTIONAL_STEP));
5454}
55+
56+ TEST_CASE (" typeof(Fixed + Fixed) == Fixed" ) {
57+ Fixed x = {}, y = {};
58+ STATIC_REQUIRE (std::is_same_v<decltype (x + y), Fixed>);
59+ }
60+
61+ TEST_CASE (" typeof(Fixed += Fixed) == Fixed&" ) {
62+ Fixed x = {}, y = {};
63+ STATIC_REQUIRE (std::is_same_v<decltype (x += y), Fixed&>);
64+ }
65+
66+ TEST_CASE (" typeof(Fixed - Fixed) == Fixed" ) {
67+ Fixed x = {}, y = {};
68+ STATIC_REQUIRE (std::is_same_v<decltype (x - y), Fixed>);
69+ }
70+
71+ TEST_CASE (" typeof(Fixed -= Fixed) == Fixed&" ) {
72+ Fixed x = {}, y = {};
73+ STATIC_REQUIRE (std::is_same_v<decltype (x -= y), Fixed&>);
74+ }
75+
76+ TEST_CASE (" typeof(Fixed * Fixed) == Fixed" ) {
77+ Fixed x = {}, y = {};
78+ STATIC_REQUIRE (std::is_same_v<decltype (x * y), Fixed>);
79+ }
80+
81+ TEST_CASE (" typeof(Fixed *= Fixed) == Fixed&" ) {
82+ Fixed x = {}, y = {};
83+ STATIC_REQUIRE (std::is_same_v<decltype (x *= y), Fixed&>);
84+ }
85+
86+ TEST_CASE (" typeof(Fixed * UnderlyingType) == Fixed" ) {
87+ Fixed x = {};
88+ Fixed::UnderlyingType y = {};
89+ STATIC_REQUIRE (std::is_same_v<decltype (x * y), Fixed>);
90+ }
91+
92+ TEST_CASE (" typeof(Fixed *= UnderlyingType) == Fixed&" ) {
93+ Fixed x = {};
94+ Fixed::UnderlyingType y = {};
95+ STATIC_REQUIRE (std::is_same_v<decltype (x *= y), Fixed&>);
96+ }
97+
98+ TEST_CASE (" typeof(UnderlyingType * Fixed) == Fixed" ) {
99+ Fixed::UnderlyingType x = {};
100+ Fixed y = {};
101+ STATIC_REQUIRE (std::is_same_v<decltype (x * y), Fixed>);
102+ }
103+
104+ TEST_CASE (" typeof(Fixed / Fixed) == Fixed" ) {
105+ Fixed x = {}, y = {};
106+ STATIC_REQUIRE (std::is_same_v<decltype (x / y), Fixed>);
107+ }
108+
109+ TEST_CASE (" typeof(Fixed /= Fixed) == Fixed&" ) {
110+ Fixed x = {}, y = {};
111+ STATIC_REQUIRE (std::is_same_v<decltype (x /= y), Fixed&>);
112+ }
113+
114+ TEST_CASE (" typeof(Fixed / UnderlyingType) == Fixed" ) {
115+ Fixed x = {};
116+ Fixed::UnderlyingType y = {};
117+ STATIC_REQUIRE (std::is_same_v<decltype (x / y), Fixed>);
118+ }
119+
120+ TEST_CASE (" typeof(Fixed /= UnderlyingType) == Fixed&" ) {
121+ Fixed x = {};
122+ Fixed::UnderlyingType y = {};
123+ STATIC_REQUIRE (std::is_same_v<decltype (x /= y), Fixed&>);
124+ }
0 commit comments