[FEAT] Add test and Tuplus object

This commit is contained in:
NADAL Jean-Baptiste
2024-01-29 18:43:18 +01:00
parent 425bf4689e
commit 2c4d63d622
9 changed files with 220 additions and 10 deletions

View File

@@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
*
* @Author: NADAL Jean-Baptiste
* @Date: 07/02/2021
*
@@ -30,10 +30,13 @@
#include <gtest/gtest.h>
// Demonstrate some basic assertions.
TEST(HelloTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
#include "tuple.h"
TEST(RaytracerTuple, CreateBasicTuple)
{
Raytracer::Tuple t(4.3, -4.2, 3.1, 1.0);
EXPECT_FLOAT_EQ(t.x(), 4.3);
EXPECT_FLOAT_EQ(t.y(), -4.2);
EXPECT_FLOAT_EQ(t.z(), 3.1);
EXPECT_FLOAT_EQ(t.w(), 1.0);
}