summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/catch/projects/Benchmark/StringificationBench.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2017-02-05 15:45:26 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2017-02-05 15:46:07 +0100
commit02c97cd0f7c4d630f1a90f9f2626746e47a28c09 (patch)
tree2b48d051a55f2b65525824546cd9fcf9e05907cf /3rdparty/catch/projects/Benchmark/StringificationBench.cpp
parentd20b4ba6864b45d0c068d98d43e63c8bc5014a3b (diff)
Updated Catch to latest (nw)
Diffstat (limited to '3rdparty/catch/projects/Benchmark/StringificationBench.cpp')
-rw-r--r--3rdparty/catch/projects/Benchmark/StringificationBench.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/3rdparty/catch/projects/Benchmark/StringificationBench.cpp b/3rdparty/catch/projects/Benchmark/StringificationBench.cpp
new file mode 100644
index 00000000000..1c14939b407
--- /dev/null
+++ b/3rdparty/catch/projects/Benchmark/StringificationBench.cpp
@@ -0,0 +1,46 @@
+/*
+ * Created by Martin on 16/01/2017.
+ *
+ * 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)
+ */
+
+#include "catch.hpp"
+
+#include <vector>
+
+///////////////////////////////////////////////////////////////////////////////
+TEST_CASE("Successful tests -- REQUIRE", "[Success]") {
+ const size_t sz = 1 * 1024 * 1024;
+
+
+ std::vector<size_t> vec; vec.reserve(sz);
+ for (size_t i = 0; i < sz; ++i){
+ vec.push_back(i);
+ REQUIRE(vec.back() == i);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+TEST_CASE("Successful tests -- CHECK", "[Success]") {
+ const size_t sz = 1 * 1024 * 1024;
+
+
+ std::vector<size_t> vec; vec.reserve(sz);
+ for (size_t i = 0; i < sz; ++i){
+ vec.push_back(i);
+ CHECK(vec.back() == i);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+TEST_CASE("Unsuccessful tests -- CHECK", "[Failure]") {
+ const size_t sz = 1024 * 1024;
+
+
+ std::vector<size_t> vec; vec.reserve(sz);
+ for (size_t i = 0; i < sz; ++i){
+ vec.push_back(i);
+ CHECK(vec.size() == i);
+ }
+}