Started working on parsing OBJ Files.

Why string manipulation is so tedious in C/++ :(
This commit is contained in:
Godzil
2020-03-05 17:46:40 +00:00
parent 6bef6a1b77
commit c17bfadc76
8 changed files with 256 additions and 6 deletions

25
tests/objfile_test.cpp Normal file
View File

@@ -0,0 +1,25 @@
/*
* DoRayMe - a quick and dirty Raytracer
* OBJ File unit tests
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#include <objfile.h>
#include <math.h>
#include <gtest/gtest.h>
TEST(OBJFileTest, Ignoring_unrecognised_lines)
{
const char gibberish[] = "There was a young lane named Bright\n"
"who traveled much faster than light\n"
"She set out one day\n"
"in a relative way\n"
"and came back the previous night.\n";
OBJFile parser = OBJFile();
parser.parseOBJFile(gibberish);
ASSERT_EQ(parser.ignoredLines, 5);
}