diff options
| author | Phil Nash | 2017-06-27 11:48:55 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-06-27 11:48:55 +0100 |
| commit | df7c5622b9d6a1a8b8480d83bd557b30079acad1 (patch) | |
| tree | d3a1ec23910d76c0605da582b136a63e9e3b774f /test_package/MainTest.cpp | |
| parent | ee67ac6b7c3595251342671485c65cf81d725896 (diff) | |
| parent | 34918045981bfb1cfe95741512ba3a3a61e40cd3 (diff) | |
| download | catch3-df7c5622b9d6a1a8b8480d83bd557b30079acad1.tar.gz | |
Merge branch 'feature/conan' of https://github.com/uilianries/Catch
Diffstat (limited to 'test_package/MainTest.cpp')
| -rw-r--r-- | test_package/MainTest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test_package/MainTest.cpp b/test_package/MainTest.cpp new file mode 100644 index 00000000..b8ed744e --- /dev/null +++ b/test_package/MainTest.cpp @@ -0,0 +1,21 @@ +/* + * Created by Phil on 22/10/2010. + * Copyright 2010 Two Blue Cubes Ltd + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#define CATCH_CONFIG_MAIN +#include "catch.hpp" + +unsigned int Factorial( unsigned int number ) { + return number > 1 ? Factorial(number-1)*number : 1; +} + +TEST_CASE( "Factorials are computed", "[factorial]" ) { + REQUIRE( Factorial(0) == 1 ); + REQUIRE( Factorial(1) == 1 ); + REQUIRE( Factorial(2) == 2 ); + REQUIRE( Factorial(3) == 6 ); + REQUIRE( Factorial(10) == 3628800 ); +} |