Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Added benchmark for previous commit, added iterations to failure bench.

Commit
83f4b39680784e7ac6d8fd71ac8bc9541541385f
Author
Martin Hořeňovský ·
Parents
3b98a0166f7b

Files · Download .tar.gz

Changes

 include/internal/catch_common.hpp                                   | 6 ++----
 projects/Benchmark/StringificationBench.cpp                         | 2 +-
 ...7-01-15T09-35-14-3b98a0166f7b7196eba2ad518174d1a77165166d.result | 3 +++
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/internal/catch_common.hpp b/include/internal/catch_common.hpp
index f4006c72..2af51a12 100644
--- a/include/internal/catch_common.hpp
+++ b/include/internal/catch_common.hpp
@@ -10,21 +10,19 @@
 
 #include "catch_common.h"
 
-#include <algorithm>
-
 namespace Catch {
 
     bool startsWith( std::string const& s, std::string const& prefix ) {
         return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
     }
     bool startsWith( std::string const& s, char prefix ) {
-        return !s.empty() && s.front() == prefix;
+        return !s.empty() && s[0] == prefix;
     }
     bool endsWith( std::string const& s, std::string const& suffix ) {
         return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
     }
     bool endsWith( std::string const& s, char suffix ) {
-        return !s.empty() && s.back() == suffix;
+        return !s.empty() && s[s.size()-1] == suffix;
     }
     bool contains( std::string const& s, std::string const& infix ) {
         return s.find( infix ) != std::string::npos;
diff --git a/projects/Benchmark/StringificationBench.cpp b/projects/Benchmark/StringificationBench.cpp
index 67f36685..4c81a577 100644
--- a/projects/Benchmark/StringificationBench.cpp
+++ b/projects/Benchmark/StringificationBench.cpp
@@ -28,7 +28,7 @@ TEST_CASE("Successful tests -- CHECK", "[Success]") {
 
 ///////////////////////////////////////////////////////////////////////////////
 TEST_CASE("Unsuccessful tests -- CHECK", "[Failure]") {
-    const size_t sz = 128 * 1024;
+    const size_t sz = 1024 * 1024;
 
 
     std::vector<size_t> vec; vec.reserve(sz);
diff --git a/projects/Benchmark/results/2017-01-15T09-35-14-3b98a0166f7b7196eba2ad518174d1a77165166d.result b/projects/Benchmark/results/2017-01-15T09-35-14-3b98a0166f7b7196eba2ad518174d1a77165166d.result
new file mode 100644
index 00000000..fe6366b8
--- /dev/null
+++ b/projects/Benchmark/results/2017-01-15T09-35-14-3b98a0166f7b7196eba2ad518174d1a77165166d.result
@@ -0,0 +1,3 @@
+Successful tests -- CHECK: median: 1.2982 (s), stddev: 0.019540648829214084 (s)
+Successful tests -- REQUIRE: median: 1.30102 (s), stddev: 0.014758430547392974 (s)
+Unsuccessful tests -- CHECK: median: 15.520199999999999 (s), stddev: 0.09536359426485094 (s)