summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/catch/projects/Benchmark/StringificationBench.cpp
diff options
context:
space:
mode:
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);
+ }
+}