objfile_test.cpp 679 B

12345678910111213141516171819202122232425
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * OBJ File unit tests
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #include <objfile.h>
  10. #include <math.h>
  11. #include <gtest/gtest.h>
  12. TEST(OBJFileTest, Ignoring_unrecognised_lines)
  13. {
  14. const char gibberish[] = "There was a young lane named Bright\n"
  15. "who traveled much faster than light\n"
  16. "She set out one day\n"
  17. "in a relative way\n"
  18. "and came back the previous night.\n";
  19. OBJFile parser = OBJFile();
  20. parser.parseOBJFile(gibberish);
  21. ASSERT_EQ(parser.ignoredLines, 5);
  22. }