Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/test_package/MainTest.cpp
diff options
context:
space:
mode:
authorUilian Ries2017-06-23 11:06:49 -0300
committerUilian Ries2017-06-23 16:03:36 -0300
commit34918045981bfb1cfe95741512ba3a3a61e40cd3 (patch)
treee85419a5d9303cce29e5a9cbcf07a2d13a836232 /test_package/MainTest.cpp
parent6234e3d54d05982d4e01f2c77099a94a46921aa4 (diff)
downloadcatch3-34918045981bfb1cfe95741512ba3a3a61e40cd3.tar.gz
#926 Update Conan version by release
- Update release scripts to increment Conan version Signed-off-by: Uilian Ries <uilianries@gmail.com>
Diffstat (limited to 'test_package/MainTest.cpp')
-rw-r--r--test_package/MainTest.cpp21
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 );
+}