Got first real unit test passing
This commit is contained in:
@@ -6,17 +6,7 @@
|
||||
|
||||
// any other libraries
|
||||
#include <array>
|
||||
|
||||
unsigned int Factorial(unsigned int number) {
|
||||
return number <= 1 ? number : Factorial(number - 1) * number;
|
||||
}
|
||||
|
||||
TEST_CASE("Factorials are computed", "[factorial]") {
|
||||
REQUIRE(Factorial(1) == 1);
|
||||
REQUIRE(Factorial(2) == 2);
|
||||
REQUIRE(Factorial(3) == 6);
|
||||
REQUIRE(Factorial(10) == 3628800);
|
||||
}
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE("Matrix Addition", "Matrix::Add") {
|
||||
std::array<float, 4> arr1{1, 2, 3, 4};
|
||||
@@ -24,6 +14,10 @@ TEST_CASE("Matrix Addition", "Matrix::Add") {
|
||||
Matrix<2, 2> mat1{arr1};
|
||||
Matrix<2, 2> mat2{arr2};
|
||||
|
||||
std::string strBuf1 = "";
|
||||
mat1.ToString(strBuf1);
|
||||
std::cout << strBuf1 << std::endl;
|
||||
|
||||
Matrix<2, 2> mat3{};
|
||||
mat1.Add(mat2, mat3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user