-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.h
43 lines (34 loc) · 1.16 KB
/
tests.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* DO NOT MODIFY!
* Test File for the FileReader
* A final version will be relased close to the deadline with mroe detailed tests.
*/
#pragma once
#include <string>
#include "../FileReader.h"
//#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#define DOCTEST_CONFIG_IMPLEMENT
#include "doctest.h"
TEST_CASE( "STD 1: Creating a FileReader object" ) {
FileReader reader = FileReader();
CHECK(reader.getCount() == 0);
}
TEST_CASE("STD 2: Modifying Additional Values" ) {
FileReader reader = FileReader();
reader.resetCounter();
reader.increase(0);
REQUIRE(reader.getCount() == 0);
reader.increase(1);
reader.increase(2);
CHECK(reader.getCount() == 3 );
reader.resetCounter();
CHECK(reader.getCount() == 0);
}
TEST_CASE("ADV 1: Opening and Reading a simple PLY File") {
FileReader reader = FileReader();
REQUIRE(reader.getLastText().empty());
CHECK(reader.addText("some"));
REQUIRE(reader.getLastText().compare("some")); // https://www.cplusplus.com/reference/string/string/compare/
CHECK(reader.addText("text"));
REQUIRE(reader.addText("text") == false);
}