Browse code

repaired cpp unit test framework

sherman5 authored on 22/09/2017 19:42:54
Showing9 changed files

... ...
@@ -34,7 +34,7 @@ Imports:
34 34
 Suggests:
35 35
     testthat,
36 36
     lintr
37
-LinkingTo: Rcpp, BH, RcppArmadillo, testthat
37
+LinkingTo: Rcpp, BH, RcppArmadillo
38 38
 License: GPL (==2)
39 39
 biocViews: GeneExpression, Transcription, GeneSetEnrichment,
40 40
     DifferentialExpression, Bayesian, Clustering, TimeCourse, RNASeq, Microarray,
... ...
@@ -1,19 +1,23 @@
1
-# This file was generated by Rcpp::compileAttributes
1
+# Generated by using Rcpp::compileAttributes() -> do not edit by hand
2 2
 # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
3 3
 
4 4
 cogapsMap <- function(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed = -1L, messages = FALSE) {
5
-    .Call('CoGAPS_cogapsMap', PACKAGE = 'CoGAPS', DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages)
5
+    .Call('_CoGAPS_cogapsMap', PACKAGE = 'CoGAPS', DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages)
6 6
 }
7 7
 
8 8
 cogapsMapTest <- function(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed = -1L) {
9
-    .Call('CoGAPS_cogapsMapTest', PACKAGE = 'CoGAPS', DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed)
9
+    .Call('_CoGAPS_cogapsMapTest', PACKAGE = 'CoGAPS', DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed)
10 10
 }
11 11
 
12 12
 cogaps <- function(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed = -1L, messages = FALSE) {
13
-    .Call('CoGAPS_cogaps', PACKAGE = 'CoGAPS', DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages)
13
+    .Call('_CoGAPS_cogaps', PACKAGE = 'CoGAPS', DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages)
14 14
 }
15 15
 
16 16
 cogapsTest <- function(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed = -1L) {
17
-    .Call('CoGAPS_cogapsTest', PACKAGE = 'CoGAPS', DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed)
17
+    .Call('_CoGAPS_cogapsTest', PACKAGE = 'CoGAPS', DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed)
18
+}
19
+
20
+run_catch_unit_tests <- function() {
21
+    .Call('_CoGAPS_run_catch_unit_tests', PACKAGE = 'CoGAPS')
18 22
 }
19 23
 
... ...
@@ -1,4 +1,4 @@
1
-PKG_CPPFLAGS = -std=c++11
1
+PKG_CPPFLAGS =
2 2
 OBJECTS =   AtomicSupport.o \
3 3
             cogapsmapR.o \
4 4
             cogapsmaptestR.o \
... ...
@@ -14,5 +14,5 @@ OBJECTS =   AtomicSupport.o \
14 14
             randgen.o \
15 15
             RcppExports.o \
16 16
             sub_func.o \
17
-            cpp_tests/test-runner.o \
17
+            test-runner.o \
18 18
             cpp_tests/testMatrix.o
19 19
\ No newline at end of file
... ...
@@ -1,4 +1,4 @@
1
-// This file was generated by Rcpp::compileAttributes
1
+// Generated by using Rcpp::compileAttributes() -> do not edit by hand
2 2
 // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
3 3
 
4 4
 #include <RcppArmadillo.h>
... ...
@@ -7,90 +7,98 @@
7 7
 using namespace Rcpp;
8 8
 
9 9
 // cogapsMap
10
-Rcpp::List cogapsMap(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame FixedPatt, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed = -1, bool messages = false);
11
-RcppExport SEXP CoGAPS_cogapsMap(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP FixedPattSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP, SEXP messagesSEXP) {
10
+Rcpp::List cogapsMap(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame FixedPatt, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed, bool messages);
11
+RcppExport SEXP _CoGAPS_cogapsMap(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP FixedPattSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP, SEXP messagesSEXP) {
12 12
 BEGIN_RCPP
13
-    SEXP __sexp_result;
14
-    {
15
-        Rcpp::RNGScope __rngScope;
16
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP );
17
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP );
18
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type FixedPatt(FixedPattSEXP );
19
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP );
20
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP );
21
-        Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP );
22
-        Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP );
23
-        Rcpp::traits::input_parameter< int >::type seed(seedSEXP );
24
-        Rcpp::traits::input_parameter< bool >::type messages(messagesSEXP );
25
-        Rcpp::List __result = cogapsMap(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages);
26
-        PROTECT(__sexp_result = Rcpp::wrap(__result));
27
-    }
28
-    UNPROTECT(1);
29
-    return __sexp_result;
13
+    Rcpp::RObject rcpp_result_gen;
14
+    Rcpp::RNGScope rcpp_rngScope_gen;
15
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP);
16
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP);
17
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type FixedPatt(FixedPattSEXP);
18
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP);
19
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP);
20
+    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP);
21
+    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP);
22
+    Rcpp::traits::input_parameter< int >::type seed(seedSEXP);
23
+    Rcpp::traits::input_parameter< bool >::type messages(messagesSEXP);
24
+    rcpp_result_gen = Rcpp::wrap(cogapsMap(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages));
25
+    return rcpp_result_gen;
30 26
 END_RCPP
31 27
 }
32 28
 // cogapsMapTest
33
-Rcpp::List cogapsMapTest(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame FixedPatt, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed = -1);
34
-RcppExport SEXP CoGAPS_cogapsMapTest(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP FixedPattSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP) {
29
+Rcpp::List cogapsMapTest(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame FixedPatt, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed);
30
+RcppExport SEXP _CoGAPS_cogapsMapTest(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP FixedPattSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP) {
35 31
 BEGIN_RCPP
36
-    SEXP __sexp_result;
37
-    {
38
-        Rcpp::RNGScope __rngScope;
39
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP );
40
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP );
41
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type FixedPatt(FixedPattSEXP );
42
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP );
43
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP );
44
-        Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP );
45
-        Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP );
46
-        Rcpp::traits::input_parameter< int >::type seed(seedSEXP );
47
-        Rcpp::List __result = cogapsMapTest(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed);
48
-        PROTECT(__sexp_result = Rcpp::wrap(__result));
49
-    }
50
-    UNPROTECT(1);
51
-    return __sexp_result;
32
+    Rcpp::RObject rcpp_result_gen;
33
+    Rcpp::RNGScope rcpp_rngScope_gen;
34
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP);
35
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP);
36
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type FixedPatt(FixedPattSEXP);
37
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP);
38
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP);
39
+    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP);
40
+    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP);
41
+    Rcpp::traits::input_parameter< int >::type seed(seedSEXP);
42
+    rcpp_result_gen = Rcpp::wrap(cogapsMapTest(DFrame, SFrame, FixedPatt, ABinsFrame, PBinsFrame, Config, ConfigNums, seed));
43
+    return rcpp_result_gen;
52 44
 END_RCPP
53 45
 }
54 46
 // cogaps
55
-Rcpp::List cogaps(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed = -1, bool messages = false);
56
-RcppExport SEXP CoGAPS_cogaps(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP, SEXP messagesSEXP) {
47
+Rcpp::List cogaps(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed, bool messages);
48
+RcppExport SEXP _CoGAPS_cogaps(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP, SEXP messagesSEXP) {
57 49
 BEGIN_RCPP
58
-    SEXP __sexp_result;
59
-    {
60
-        Rcpp::RNGScope __rngScope;
61
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP );
62
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP );
63
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP );
64
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP );
65
-        Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP );
66
-        Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP );
67
-        Rcpp::traits::input_parameter< int >::type seed(seedSEXP );
68
-        Rcpp::traits::input_parameter< bool >::type messages(messagesSEXP );
69
-        Rcpp::List __result = cogaps(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages);
70
-        PROTECT(__sexp_result = Rcpp::wrap(__result));
71
-    }
72
-    UNPROTECT(1);
73
-    return __sexp_result;
50
+    Rcpp::RObject rcpp_result_gen;
51
+    Rcpp::RNGScope rcpp_rngScope_gen;
52
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP);
53
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP);
54
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP);
55
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP);
56
+    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP);
57
+    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP);
58
+    Rcpp::traits::input_parameter< int >::type seed(seedSEXP);
59
+    Rcpp::traits::input_parameter< bool >::type messages(messagesSEXP);
60
+    rcpp_result_gen = Rcpp::wrap(cogaps(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed, messages));
61
+    return rcpp_result_gen;
74 62
 END_RCPP
75 63
 }
76 64
 // cogapsTest
77
-Rcpp::List cogapsTest(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed = -1);
78
-RcppExport SEXP CoGAPS_cogapsTest(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP) {
65
+Rcpp::List cogapsTest(Rcpp::DataFrame DFrame, Rcpp::DataFrame SFrame, Rcpp::DataFrame ABinsFrame, Rcpp::DataFrame PBinsFrame, Rcpp::CharacterVector Config, Rcpp::NumericVector ConfigNums, int seed);
66
+RcppExport SEXP _CoGAPS_cogapsTest(SEXP DFrameSEXP, SEXP SFrameSEXP, SEXP ABinsFrameSEXP, SEXP PBinsFrameSEXP, SEXP ConfigSEXP, SEXP ConfigNumsSEXP, SEXP seedSEXP) {
79 67
 BEGIN_RCPP
80
-    SEXP __sexp_result;
81
-    {
82
-        Rcpp::RNGScope __rngScope;
83
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP );
84
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP );
85
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP );
86
-        Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP );
87
-        Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP );
88
-        Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP );
89
-        Rcpp::traits::input_parameter< int >::type seed(seedSEXP );
90
-        Rcpp::List __result = cogapsTest(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed);
91
-        PROTECT(__sexp_result = Rcpp::wrap(__result));
92
-    }
93
-    UNPROTECT(1);
94
-    return __sexp_result;
68
+    Rcpp::RObject rcpp_result_gen;
69
+    Rcpp::RNGScope rcpp_rngScope_gen;
70
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type DFrame(DFrameSEXP);
71
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type SFrame(SFrameSEXP);
72
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type ABinsFrame(ABinsFrameSEXP);
73
+    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type PBinsFrame(PBinsFrameSEXP);
74
+    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type Config(ConfigSEXP);
75
+    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ConfigNums(ConfigNumsSEXP);
76
+    Rcpp::traits::input_parameter< int >::type seed(seedSEXP);
77
+    rcpp_result_gen = Rcpp::wrap(cogapsTest(DFrame, SFrame, ABinsFrame, PBinsFrame, Config, ConfigNums, seed));
78
+    return rcpp_result_gen;
95 79
 END_RCPP
96 80
 }
81
+// run_catch_unit_tests
82
+int run_catch_unit_tests();
83
+RcppExport SEXP _CoGAPS_run_catch_unit_tests() {
84
+BEGIN_RCPP
85
+    Rcpp::RObject rcpp_result_gen;
86
+    Rcpp::RNGScope rcpp_rngScope_gen;
87
+    rcpp_result_gen = Rcpp::wrap(run_catch_unit_tests());
88
+    return rcpp_result_gen;
89
+END_RCPP
90
+}
91
+
92
+static const R_CallMethodDef CallEntries[] = {
93
+    {"_CoGAPS_cogapsMap", (DL_FUNC) &_CoGAPS_cogapsMap, 9},
94
+    {"_CoGAPS_cogapsMapTest", (DL_FUNC) &_CoGAPS_cogapsMapTest, 8},
95
+    {"_CoGAPS_cogaps", (DL_FUNC) &_CoGAPS_cogaps, 8},
96
+    {"_CoGAPS_cogapsTest", (DL_FUNC) &_CoGAPS_cogapsTest, 7},
97
+    {"_CoGAPS_run_catch_unit_tests", (DL_FUNC) &_CoGAPS_run_catch_unit_tests, 0},
98
+    {NULL, NULL, 0}
99
+};
100
+
101
+RcppExport void R_init_CoGAPS(DllInfo *dll) {
102
+    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
103
+    R_useDynamicSymbols(dll, FALSE);
104
+}
97 105
new file mode 100644
... ...
@@ -0,0 +1,11605 @@
1
+/*
2
+ *  Catch v1.10.0
3
+ *  Generated: 2017-08-26 15:16:46.676990
4
+ *  ----------------------------------------------------------
5
+ *  This file has been merged from multiple headers. Please don't edit it directly
6
+ *  Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
7
+ *
8
+ *  Distributed under the Boost Software License, Version 1.0. (See accompanying
9
+ *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10
+ */
11
+#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
12
+#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
13
+
14
+#define TWOBLUECUBES_CATCH_HPP_INCLUDED
15
+
16
+#ifdef __clang__
17
+#    pragma clang system_header
18
+#elif defined __GNUC__
19
+#    pragma GCC system_header
20
+#endif
21
+
22
+// #included from: internal/catch_suppress_warnings.h
23
+
24
+#ifdef __clang__
25
+#   ifdef __ICC // icpc defines the __clang__ macro
26
+#       pragma warning(push)
27
+#       pragma warning(disable: 161 1682)
28
+#   else // __ICC
29
+#       pragma clang diagnostic ignored "-Wglobal-constructors"
30
+#       pragma clang diagnostic ignored "-Wvariadic-macros"
31
+#       pragma clang diagnostic ignored "-Wc99-extensions"
32
+#       pragma clang diagnostic ignored "-Wunused-variable"
33
+#       pragma clang diagnostic push
34
+#       pragma clang diagnostic ignored "-Wpadded"
35
+#       pragma clang diagnostic ignored "-Wc++98-compat"
36
+#       pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
37
+#       pragma clang diagnostic ignored "-Wswitch-enum"
38
+#       pragma clang diagnostic ignored "-Wcovered-switch-default"
39
+#    endif
40
+#elif defined __GNUC__
41
+#    pragma GCC diagnostic ignored "-Wvariadic-macros"
42
+#    pragma GCC diagnostic ignored "-Wunused-variable"
43
+#    pragma GCC diagnostic ignored "-Wparentheses"
44
+
45
+#    pragma GCC diagnostic push
46
+#    pragma GCC diagnostic ignored "-Wpadded"
47
+#endif
48
+#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
49
+#  define CATCH_IMPL
50
+#endif
51
+
52
+#ifdef CATCH_IMPL
53
+#  ifndef CLARA_CONFIG_MAIN
54
+#    define CLARA_CONFIG_MAIN_NOT_DEFINED
55
+#    define CLARA_CONFIG_MAIN
56
+#  endif
57
+#endif
58
+
59
+// #included from: internal/catch_notimplemented_exception.h
60
+#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
61
+
62
+// #included from: catch_common.h
63
+#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
64
+
65
+// #included from: catch_compiler_capabilities.h
66
+#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
67
+
68
+// Detect a number of compiler features - mostly C++11/14 conformance - by compiler
69
+// The following features are defined:
70
+//
71
+// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported?
72
+// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
73
+// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
74
+// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported?
75
+// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported
76
+// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported?
77
+// CATCH_CONFIG_CPP11_OVERRIDE : is override supported?
78
+// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr)
79
+// CATCH_CONFIG_CPP11_SHUFFLE : is std::shuffle supported?
80
+// CATCH_CONFIG_CPP11_TYPE_TRAITS : are type_traits and enable_if supported?
81
+
82
+// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
83
+
84
+// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
85
+// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
86
+// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
87
+// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
88
+// ****************
89
+// Note to maintainers: if new toggles are added please document them
90
+// in configuration.md, too
91
+// ****************
92
+
93
+// In general each macro has a _NO_<feature name> form
94
+// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature.
95
+// Many features, at point of detection, define an _INTERNAL_ macro, so they
96
+// can be combined, en-mass, with the _NO_ forms later.
97
+
98
+// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11
99
+
100
+#ifdef __cplusplus
101
+
102
+#  if __cplusplus >= 201103L
103
+#    define CATCH_CPP11_OR_GREATER
104
+#  endif
105
+
106
+#  if __cplusplus >= 201402L
107
+#    define CATCH_CPP14_OR_GREATER
108
+#  endif
109
+
110
+#endif
111
+
112
+#ifdef __clang__
113
+
114
+#  if __has_feature(cxx_nullptr)
115
+#    define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
116
+#  endif
117
+
118
+#  if __has_feature(cxx_noexcept)
119
+#    define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
120
+#  endif
121
+
122
+#   if defined(CATCH_CPP11_OR_GREATER)
123
+#       define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
124
+            _Pragma( "clang diagnostic push" ) \
125
+            _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" )
126
+#       define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
127
+            _Pragma( "clang diagnostic pop" )
128
+
129
+#       define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
130
+            _Pragma( "clang diagnostic push" ) \
131
+            _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
132
+#       define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
133
+            _Pragma( "clang diagnostic pop" )
134
+#   endif
135
+
136
+#endif // __clang__
137
+
138
+////////////////////////////////////////////////////////////////////////////////
139
+// We know some environments not to support full POSIX signals
140
+#if defined(__CYGWIN__) || defined(__QNX__)
141
+
142
+#   if !defined(CATCH_CONFIG_POSIX_SIGNALS)
143
+#       define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
144
+#   endif
145
+
146
+#endif
147
+
148
+#ifdef __OS400__
149
+#       define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
150
+#       define CATCH_CONFIG_COLOUR_NONE
151
+#endif
152
+
153
+////////////////////////////////////////////////////////////////////////////////
154
+// Cygwin
155
+#ifdef __CYGWIN__
156
+
157
+// Required for some versions of Cygwin to declare gettimeofday
158
+// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
159
+#   define _BSD_SOURCE
160
+
161
+#endif // __CYGWIN__
162
+
163
+////////////////////////////////////////////////////////////////////////////////
164
+// Borland
165
+#ifdef __BORLANDC__
166
+
167
+#endif // __BORLANDC__
168
+
169
+////////////////////////////////////////////////////////////////////////////////
170
+// EDG
171
+#ifdef __EDG_VERSION__
172
+
173
+#endif // __EDG_VERSION__
174
+
175
+////////////////////////////////////////////////////////////////////////////////
176
+// Digital Mars
177
+#ifdef __DMC__
178
+
179
+#endif // __DMC__
180
+
181
+////////////////////////////////////////////////////////////////////////////////
182
+// GCC
183
+#ifdef __GNUC__
184
+
185
+#   if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
186
+#       define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
187
+#   endif
188
+
189
+// - otherwise more recent versions define __cplusplus >= 201103L
190
+// and will get picked up below
191
+
192
+#endif // __GNUC__
193
+
194
+////////////////////////////////////////////////////////////////////////////////
195
+// Visual C++
196
+#ifdef _MSC_VER
197
+
198
+#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
199
+
200
+#if (_MSC_VER >= 1600)
201
+#   define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
202
+#   define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
203
+#endif
204
+
205
+#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
206
+#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
207
+#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
208
+#define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
209
+#define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS
210
+#endif
211
+
212
+#endif // _MSC_VER
213
+
214
+////////////////////////////////////////////////////////////////////////////////
215
+
216
+// Use variadic macros if the compiler supports them
217
+#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \
218
+    ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \
219
+    ( defined __GNUC__ && __GNUC__ >= 3 ) || \
220
+    ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L )
221
+
222
+#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
223
+
224
+#endif
225
+
226
+// Use __COUNTER__ if the compiler supports it
227
+#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \
228
+    ( defined __GNUC__  && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \
229
+    ( defined __clang__ && __clang_major__ >= 3 )
230
+
231
+#define CATCH_INTERNAL_CONFIG_COUNTER
232
+
233
+#endif
234
+
235
+////////////////////////////////////////////////////////////////////////////////
236
+// C++ language feature support
237
+
238
+// catch all support for C++11
239
+#if defined(CATCH_CPP11_OR_GREATER)
240
+
241
+#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR)
242
+#    define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
243
+#  endif
244
+
245
+#  ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
246
+#    define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
247
+#  endif
248
+
249
+#  ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
250
+#    define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
251
+#  endif
252
+
253
+#  ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
254
+#    define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
255
+#  endif
256
+
257
+#  ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE
258
+#    define CATCH_INTERNAL_CONFIG_CPP11_TUPLE
259
+#  endif
260
+
261
+#  ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
262
+#    define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
263
+#  endif
264
+
265
+#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG)
266
+#    define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG
267
+#  endif
268
+
269
+#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE)
270
+#    define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE
271
+#  endif
272
+#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
273
+#    define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
274
+#  endif
275
+# if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE)
276
+#   define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
277
+#  endif
278
+# if !defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS)
279
+#  define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS
280
+# endif
281
+
282
+#endif // __cplusplus >= 201103L
283
+
284
+// Now set the actual defines based on the above + anything the user has configured
285
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11)
286
+#   define CATCH_CONFIG_CPP11_NULLPTR
287
+#endif
288
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11)
289
+#   define CATCH_CONFIG_CPP11_NOEXCEPT
290
+#endif
291
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11)
292
+#   define CATCH_CONFIG_CPP11_GENERATED_METHODS
293
+#endif
294
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11)
295
+#   define CATCH_CONFIG_CPP11_IS_ENUM
296
+#endif
297
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11)
298
+#   define CATCH_CONFIG_CPP11_TUPLE
299
+#endif
300
+#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS)
301
+#   define CATCH_CONFIG_VARIADIC_MACROS
302
+#endif
303
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11)
304
+#   define CATCH_CONFIG_CPP11_LONG_LONG
305
+#endif
306
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11)
307
+#   define CATCH_CONFIG_CPP11_OVERRIDE
308
+#endif
309
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
310
+#   define CATCH_CONFIG_CPP11_UNIQUE_PTR
311
+#endif
312
+// Use of __COUNTER__ is suppressed if __JETBRAINS_IDE__ is #defined (meaning we're being parsed by a JetBrains IDE for
313
+// analytics) because, at time of writing, __COUNTER__ is not properly handled by it.
314
+// This does not affect compilation
315
+#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) && !defined(__JETBRAINS_IDE__)
316
+#   define CATCH_CONFIG_COUNTER
317
+#endif
318
+#if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11)
319
+#   define CATCH_CONFIG_CPP11_SHUFFLE
320
+#endif
321
+# if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11)
322
+#  define CATCH_CONFIG_CPP11_TYPE_TRAITS
323
+# endif
324
+#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH)
325
+#   define CATCH_CONFIG_WINDOWS_SEH
326
+#endif
327
+// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
328
+#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
329
+#   define CATCH_CONFIG_POSIX_SIGNALS
330
+#endif
331
+
332
+#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
333
+#   define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
334
+#   define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS
335
+#endif
336
+#if !defined(CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS)
337
+#   define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS
338
+#   define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
339
+#endif
340
+
341
+// noexcept support:
342
+#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
343
+#  define CATCH_NOEXCEPT noexcept
344
+#  define CATCH_NOEXCEPT_IS(x) noexcept(x)
345
+#else
346
+#  define CATCH_NOEXCEPT throw()
347
+#  define CATCH_NOEXCEPT_IS(x)
348
+#endif
349
+
350
+// nullptr support
351
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
352
+#   define CATCH_NULL nullptr
353
+#else
354
+#   define CATCH_NULL NULL
355
+#endif
356
+
357
+// override support
358
+#ifdef CATCH_CONFIG_CPP11_OVERRIDE
359
+#   define CATCH_OVERRIDE override
360
+#else
361
+#   define CATCH_OVERRIDE
362
+#endif
363
+
364
+// unique_ptr support
365
+#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR
366
+#   define CATCH_AUTO_PTR( T ) std::unique_ptr<T>
367
+#else
368
+#   define CATCH_AUTO_PTR( T ) std::auto_ptr<T>
369
+#endif
370
+
371
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
372
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
373
+#ifdef CATCH_CONFIG_COUNTER
374
+#  define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
375
+#else
376
+#  define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
377
+#endif
378
+
379
+#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
380
+#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
381
+
382
+#include <sstream>
383
+#include <algorithm>
384
+
385
+namespace Catch {
386
+
387
+    struct IConfig;
388
+
389
+    struct CaseSensitive { enum Choice {
390
+        Yes,
391
+        No
392
+    }; };
393
+
394
+    class NonCopyable {
395
+#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
396
+        NonCopyable( NonCopyable const& )              = delete;
397
+        NonCopyable( NonCopyable && )                  = delete;
398
+        NonCopyable& operator = ( NonCopyable const& ) = delete;
399
+        NonCopyable& operator = ( NonCopyable && )     = delete;
400
+#else
401
+        NonCopyable( NonCopyable const& info );
402
+        NonCopyable& operator = ( NonCopyable const& );
403
+#endif
404
+
405
+    protected:
406
+        NonCopyable() {}
407
+        virtual ~NonCopyable();
408
+    };
409
+
410
+    class SafeBool {
411
+    public:
412
+        typedef void (SafeBool::*type)() const;
413
+
414
+        static type makeSafe( bool value ) {
415
+            return value ? &SafeBool::trueValue : 0;
416
+        }
417
+    private:
418
+        void trueValue() const {}
419
+    };
420
+
421
+    template<typename ContainerT>
422
+    void deleteAll( ContainerT& container ) {
423
+        typename ContainerT::const_iterator it = container.begin();
424
+        typename ContainerT::const_iterator itEnd = container.end();
425
+        for(; it != itEnd; ++it )
426
+            delete *it;
427
+    }
428
+    template<typename AssociativeContainerT>
429
+    void deleteAllValues( AssociativeContainerT& container ) {
430
+        typename AssociativeContainerT::const_iterator it = container.begin();
431
+        typename AssociativeContainerT::const_iterator itEnd = container.end();
432
+        for(; it != itEnd; ++it )
433
+            delete it->second;
434
+    }
435
+
436
+    bool startsWith( std::string const& s, std::string const& prefix );
437
+    bool startsWith( std::string const& s, char prefix );
438
+    bool endsWith( std::string const& s, std::string const& suffix );
439
+    bool endsWith( std::string const& s, char suffix );
440
+    bool contains( std::string const& s, std::string const& infix );
441
+    void toLowerInPlace( std::string& s );
442
+    std::string toLower( std::string const& s );
443
+    std::string trim( std::string const& str );
444
+    bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
445
+
446
+    struct pluralise {
447
+        pluralise( std::size_t count, std::string const& label );
448
+
449
+        friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
450
+
451
+        std::size_t m_count;
452
+        std::string m_label;
453
+    };
454
+
455
+    struct SourceLineInfo {
456
+
457
+        SourceLineInfo();
458
+        SourceLineInfo( char const* _file, std::size_t _line );
459
+#  ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
460
+        SourceLineInfo(SourceLineInfo const& other)          = default;
461
+        SourceLineInfo( SourceLineInfo && )                  = default;
462
+        SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
463
+        SourceLineInfo& operator = ( SourceLineInfo && )     = default;
464
+#  endif
465
+        bool empty() const;
466
+        bool operator == ( SourceLineInfo const& other ) const;
467
+        bool operator < ( SourceLineInfo const& other ) const;
468
+
469
+        char const* file;
470
+        std::size_t line;
471
+    };
472
+
473
+    std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
474
+
475
+    // This is just here to avoid compiler warnings with macro constants and boolean literals
476
+    inline bool isTrue( bool value ){ return value; }
477
+    inline bool alwaysTrue() { return true; }
478
+    inline bool alwaysFalse() { return false; }
479
+
480
+    void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
481
+
482
+    void seedRng( IConfig const& config );
483
+    unsigned int rngSeed();
484
+
485
+    // Use this in variadic streaming macros to allow
486
+    //    >> +StreamEndStop
487
+    // as well as
488
+    //    >> stuff +StreamEndStop
489
+    struct StreamEndStop {
490
+        std::string operator+() {
491
+            return std::string();
492
+        }
493
+    };
494
+    template<typename T>
495
+    T const& operator + ( T const& value, StreamEndStop ) {
496
+        return value;
497
+    }
498
+}
499
+
500
+#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
501
+#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
502
+
503
+namespace Catch {
504
+
505
+    class NotImplementedException : public std::exception
506
+    {
507
+    public:
508
+        NotImplementedException( SourceLineInfo const& lineInfo );
509
+
510
+        virtual ~NotImplementedException() CATCH_NOEXCEPT {}
511
+
512
+        virtual const char* what() const CATCH_NOEXCEPT;
513
+
514
+    private:
515
+        std::string m_what;
516
+        SourceLineInfo m_lineInfo;
517
+    };
518
+
519
+} // end namespace Catch
520
+
521
+///////////////////////////////////////////////////////////////////////////////
522
+#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
523
+
524
+// #included from: internal/catch_context.h
525
+#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
526
+
527
+// #included from: catch_interfaces_generators.h
528
+#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
529
+
530
+#include <string>
531
+
532
+namespace Catch {
533
+
534
+    struct IGeneratorInfo {
535
+        virtual ~IGeneratorInfo();
536
+        virtual bool moveNext() = 0;
537
+        virtual std::size_t getCurrentIndex() const = 0;
538
+    };
539
+
540
+    struct IGeneratorsForTest {
541
+        virtual ~IGeneratorsForTest();
542
+
543
+        virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0;
544
+        virtual bool moveNext() = 0;
545
+    };
546
+
547
+    IGeneratorsForTest* createGeneratorsForTest();
548
+
549
+} // end namespace Catch
550
+
551
+// #included from: catch_ptr.hpp
552
+#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED
553
+
554
+#ifdef __clang__
555
+#pragma clang diagnostic push
556
+#pragma clang diagnostic ignored "-Wpadded"
557
+#endif
558
+
559
+namespace Catch {
560
+
561
+    // An intrusive reference counting smart pointer.
562
+    // T must implement addRef() and release() methods
563
+    // typically implementing the IShared interface
564
+    template<typename T>
565
+    class Ptr {
566
+    public:
567
+        Ptr() : m_p( CATCH_NULL ){}
568
+        Ptr( T* p ) : m_p( p ){
569
+            if( m_p )
570
+                m_p->addRef();
571
+        }
572
+        Ptr( Ptr const& other ) : m_p( other.m_p ){
573
+            if( m_p )
574
+                m_p->addRef();
575
+        }
576
+        ~Ptr(){
577
+            if( m_p )
578
+                m_p->release();
579
+        }
580
+        void reset() {
581
+            if( m_p )
582
+                m_p->release();
583
+            m_p = CATCH_NULL;
584
+        }
585
+        Ptr& operator = ( T* p ){
586
+            Ptr temp( p );
587
+            swap( temp );
588
+            return *this;
589
+        }
590
+        Ptr& operator = ( Ptr const& other ){
591
+            Ptr temp( other );
592
+            swap( temp );
593
+            return *this;
594
+        }
595
+        void swap( Ptr& other ) { std::swap( m_p, other.m_p ); }
596
+        T* get() const{ return m_p; }
597
+        T& operator*() const { return *m_p; }
598
+        T* operator->() const { return m_p; }
599
+        bool operator !() const { return m_p == CATCH_NULL; }
600
+        operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); }
601
+
602
+    private:
603
+        T* m_p;
604
+    };
605
+
606
+    struct IShared : NonCopyable {
607
+        virtual ~IShared();
608
+        virtual void addRef() const = 0;
609
+        virtual void release() const = 0;
610
+    };
611
+
612
+    template<typename T = IShared>
613
+    struct SharedImpl : T {
614
+
615
+        SharedImpl() : m_rc( 0 ){}
616
+
617
+        virtual void addRef() const {
618
+            ++m_rc;
619
+        }
620
+        virtual void release() const {
621
+            if( --m_rc == 0 )
622
+                delete this;
623
+        }
624
+
625
+        mutable unsigned int m_rc;
626
+    };
627
+
628
+} // end namespace Catch
629
+
630
+#ifdef __clang__
631
+#pragma clang diagnostic pop
632
+#endif
633
+
634
+namespace Catch {
635
+
636
+    class TestCase;
637
+    class Stream;
638
+    struct IResultCapture;
639
+    struct IRunner;
640
+    struct IGeneratorsForTest;
641
+    struct IConfig;
642
+
643
+    struct IContext
644
+    {
645
+        virtual ~IContext();
646
+
647
+        virtual IResultCapture* getResultCapture() = 0;
648
+        virtual IRunner* getRunner() = 0;
649
+        virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0;
650
+        virtual bool advanceGeneratorsForCurrentTest() = 0;
651
+        virtual Ptr<IConfig const> getConfig() const = 0;
652
+    };
653
+
654
+    struct IMutableContext : IContext
655
+    {
656
+        virtual ~IMutableContext();
657
+        virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
658
+        virtual void setRunner( IRunner* runner ) = 0;
659
+        virtual void setConfig( Ptr<IConfig const> const& config ) = 0;
660
+    };
661
+
662
+    IContext& getCurrentContext();
663
+    IMutableContext& getCurrentMutableContext();
664
+    void cleanUpContext();
665
+    Stream createStream( std::string const& streamName );
666
+
667
+}
668
+
669
+// #included from: internal/catch_test_registry.hpp
670
+#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
671
+
672
+// #included from: catch_interfaces_testcase.h
673
+#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
674
+
675
+#include <vector>
676
+
677
+namespace Catch {
678
+
679
+    class TestSpec;
680
+
681
+    struct ITestCase : IShared {
682
+        virtual void invoke () const = 0;
683
+    protected:
684
+        virtual ~ITestCase();
685
+    };
686
+
687
+    class TestCase;
688
+    struct IConfig;
689
+
690
+    struct ITestCaseRegistry {
691
+        virtual ~ITestCaseRegistry();
692
+        virtual std::vector<TestCase> const& getAllTests() const = 0;
693
+        virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
694
+    };
695
+
696
+    bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
697
+    std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
698
+    std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
699
+
700
+}
701
+
702
+namespace Catch {
703
+
704
+template<typename C>
705
+class MethodTestCase : public SharedImpl<ITestCase> {
706
+
707
+public:
708
+    MethodTestCase( void (C::*method)() ) : m_method( method ) {}
709
+
710
+    virtual void invoke() const {
711
+        C obj;
712
+        (obj.*m_method)();
713
+    }
714
+
715
+private:
716
+    virtual ~MethodTestCase() {}
717
+
718
+    void (C::*m_method)();
719
+};
720
+
721
+typedef void(*TestFunction)();
722
+
723
+struct NameAndDesc {
724
+    NameAndDesc( const char* _name = "", const char* _description= "" )
725
+    : name( _name ), description( _description )
726
+    {}
727
+
728
+    const char* name;
729
+    const char* description;
730
+};
731
+
732
+void registerTestCase
733
+    (   ITestCase* testCase,
734
+        char const* className,
735
+        NameAndDesc const& nameAndDesc,
736
+        SourceLineInfo const& lineInfo );
737
+
738
+struct AutoReg {
739
+
740
+    AutoReg
741
+        (   TestFunction function,
742
+            SourceLineInfo const& lineInfo,
743
+            NameAndDesc const& nameAndDesc );
744
+
745
+    template<typename C>
746
+    AutoReg
747
+        (   void (C::*method)(),
748
+            char const* className,
749
+            NameAndDesc const& nameAndDesc,
750
+            SourceLineInfo const& lineInfo ) {
751
+
752
+        registerTestCase
753
+            (   new MethodTestCase<C>( method ),
754
+                className,
755
+                nameAndDesc,
756
+                lineInfo );
757
+    }
758
+
759
+    ~AutoReg();
760
+
761
+private:
762
+    AutoReg( AutoReg const& );
763
+    void operator= ( AutoReg const& );
764
+};
765
+
766
+void registerTestCaseFunction
767
+    (   TestFunction function,
768
+        SourceLineInfo const& lineInfo,
769
+        NameAndDesc const& nameAndDesc );
770
+
771
+} // end namespace Catch
772
+
773
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
774
+    ///////////////////////////////////////////////////////////////////////////////
775
+    #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
776
+        static void TestName(); \
777
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
778
+        namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); } /* NOLINT */ \
779
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
780
+        static void TestName()
781
+    #define INTERNAL_CATCH_TESTCASE( ... ) \
782
+        INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
783
+
784
+    ///////////////////////////////////////////////////////////////////////////////
785
+    #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
786
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
787
+        namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } /* NOLINT */ \
788
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
789
+
790
+    ///////////////////////////////////////////////////////////////////////////////
791
+    #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
792
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
793
+        namespace{ \
794
+            struct TestName : ClassName{ \
795
+                void test(); \
796
+            }; \
797
+            Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); /* NOLINT */ \
798
+        } \
799
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
800
+        void TestName::test()
801
+    #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
802
+        INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
803
+
804
+    ///////////////////////////////////////////////////////////////////////////////
805
+    #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
806
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
807
+        Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); /* NOLINT */ \
808
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
809
+
810
+#else
811
+    ///////////////////////////////////////////////////////////////////////////////
812
+    #define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \
813
+        static void TestName(); \
814
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
815
+        namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); } /* NOLINT */ \
816
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
817
+        static void TestName()
818
+    #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \
819
+        INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc )
820
+
821
+    ///////////////////////////////////////////////////////////////////////////////
822
+    #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \
823
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
824
+        namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } /* NOLINT */ \
825
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
826
+
827
+    ///////////////////////////////////////////////////////////////////////////////
828
+    #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\
829
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
830
+        namespace{ \
831
+            struct TestCaseName : ClassName{ \
832
+                void test(); \
833
+            }; \
834
+            Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); /* NOLINT */ \
835
+        } \
836
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
837
+        void TestCaseName::test()
838
+    #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\
839
+        INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc )
840
+
841
+    ///////////////////////////////////////////////////////////////////////////////
842
+    #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \
843
+        CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
844
+        Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); /* NOLINT */ \
845
+        CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
846
+
847
+#endif
848
+
849
+// #included from: internal/catch_capture.hpp
850
+#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
851
+
852
+// #included from: catch_result_builder.h
853
+#define TWOBLUECUBES_CATCH_RESULT_BUILDER_H_INCLUDED
854
+
855
+// #included from: catch_result_type.h
856
+#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
857
+
858
+namespace Catch {
859
+
860
+    // ResultWas::OfType enum
861
+    struct ResultWas { enum OfType {
862
+        Unknown = -1,
863
+        Ok = 0,
864
+        Info = 1,
865
+        Warning = 2,
866
+
867
+        FailureBit = 0x10,
868
+
869
+        ExpressionFailed = FailureBit | 1,
870
+        ExplicitFailure = FailureBit | 2,
871
+
872
+        Exception = 0x100 | FailureBit,
873
+
874
+        ThrewException = Exception | 1,
875
+        DidntThrowException = Exception | 2,
876
+
877
+        FatalErrorCondition = 0x200 | FailureBit
878
+
879
+    }; };
880
+
881
+    inline bool isOk( ResultWas::OfType resultType ) {
882
+        return ( resultType & ResultWas::FailureBit ) == 0;
883
+    }
884
+    inline bool isJustInfo( int flags ) {
885
+        return flags == ResultWas::Info;
886
+    }
887
+
888
+    // ResultDisposition::Flags enum
889
+    struct ResultDisposition { enum Flags {
890
+        Normal = 0x01,
891
+
892
+        ContinueOnFailure = 0x02,   // Failures fail test, but execution continues
893
+        FalseTest = 0x04,           // Prefix expression with !
894
+        SuppressFail = 0x08         // Failures are reported but do not fail the test
895
+    }; };
896
+
897
+    inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
898
+        return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
899
+    }
900
+
901
+    inline bool shouldContinueOnFailure( int flags )    { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
902
+    inline bool isFalseTest( int flags )                { return ( flags & ResultDisposition::FalseTest ) != 0; }
903
+    inline bool shouldSuppressFailure( int flags )      { return ( flags & ResultDisposition::SuppressFail ) != 0; }
904
+
905
+} // end namespace Catch
906
+
907
+// #included from: catch_assertionresult.h
908
+#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
909
+
910
+#include <string>
911
+
912
+namespace Catch {
913
+
914
+    struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
915
+
916
+    struct DecomposedExpression
917
+    {
918
+        virtual ~DecomposedExpression() {}
919
+        virtual bool isBinaryExpression() const {
920
+            return false;
921
+        }
922
+        virtual void reconstructExpression( std::string& dest ) const = 0;
923
+
924
+        // Only simple binary comparisons can be decomposed.
925
+        // If more complex check is required then wrap sub-expressions in parentheses.
926
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( T const& );
927
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( T const& );
928
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( T const& );
929
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( T const& );
930
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator % ( T const& );
931
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( T const& );
932
+        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( T const& );
933
+
934
+    private:
935
+        DecomposedExpression& operator = (DecomposedExpression const&);
936
+    };
937
+
938
+    struct AssertionInfo
939
+    {
940
+        AssertionInfo();
941
+        AssertionInfo(  char const * _macroName,
942
+                        SourceLineInfo const& _lineInfo,
943
+                        char const * _capturedExpression,
944
+                        ResultDisposition::Flags _resultDisposition,
945
+                        char const * _secondArg = "");
946
+
947
+        char const * macroName;
948
+        SourceLineInfo lineInfo;
949
+        char const * capturedExpression;
950
+        ResultDisposition::Flags resultDisposition;
951
+        char const * secondArg;
952
+    };
953
+
954
+    struct AssertionResultData
955
+    {
956
+        AssertionResultData() : decomposedExpression( CATCH_NULL )
957
+                              , resultType( ResultWas::Unknown )
958
+                              , negated( false )
959
+                              , parenthesized( false ) {}
960
+
961
+        void negate( bool parenthesize ) {
962
+            negated = !negated;
963
+            parenthesized = parenthesize;
964
+            if( resultType == ResultWas::Ok )
965
+                resultType = ResultWas::ExpressionFailed;
966
+            else if( resultType == ResultWas::ExpressionFailed )
967
+                resultType = ResultWas::Ok;
968
+        }
969
+
970
+        std::string const& reconstructExpression() const {
971
+            if( decomposedExpression != CATCH_NULL ) {
972
+                decomposedExpression->reconstructExpression( reconstructedExpression );
973
+                if( parenthesized ) {
974
+                    reconstructedExpression.insert( 0, 1, '(' );
975
+                    reconstructedExpression.append( 1, ')' );
976
+                }
977
+                if( negated ) {
978
+                    reconstructedExpression.insert( 0, 1, '!' );
979
+                }
980
+                decomposedExpression = CATCH_NULL;
981
+            }
982
+            return reconstructedExpression;
983
+        }
984
+
985
+        mutable DecomposedExpression const* decomposedExpression;
986
+        mutable std::string reconstructedExpression;
987
+        std::string message;
988
+        ResultWas::OfType resultType;
989
+        bool negated;
990
+        bool parenthesized;
991
+    };
992
+
993
+    class AssertionResult {
994
+    public:
995
+        AssertionResult();
996
+        AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
997
+        ~AssertionResult();
998
+#  ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
999
+         AssertionResult( AssertionResult const& )              = default;
1000
+         AssertionResult( AssertionResult && )                  = default;
1001
+         AssertionResult& operator = ( AssertionResult const& ) = default;
1002
+         AssertionResult& operator = ( AssertionResult && )     = default;
1003
+#  endif
1004
+
1005
+        bool isOk() const;
1006
+        bool succeeded() const;
1007
+        ResultWas::OfType getResultType() const;
1008
+        bool hasExpression() const;
1009
+        bool hasMessage() const;
1010
+        std::string getExpression() const;
1011
+        std::string getExpressionInMacro() const;
1012
+        bool hasExpandedExpression() const;
1013
+        std::string getExpandedExpression() const;
1014
+        std::string getMessage() const;
1015
+        SourceLineInfo getSourceInfo() const;
1016
+        std::string getTestMacroName() const;
1017
+        void discardDecomposedExpression() const;
1018
+        void expandDecomposedExpression() const;
1019
+
1020
+    protected:
1021
+        AssertionInfo m_info;
1022
+        AssertionResultData m_resultData;
1023
+    };
1024
+
1025
+} // end namespace Catch
1026
+
1027
+// #included from: catch_matchers.hpp
1028
+#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
1029
+
1030
+namespace Catch {
1031
+namespace Matchers {
1032
+    namespace Impl {
1033
+
1034
+        template<typename ArgT> struct MatchAllOf;
1035
+        template<typename ArgT> struct MatchAnyOf;
1036
+        template<typename ArgT> struct MatchNotOf;
1037
+
1038
+        class MatcherUntypedBase {
1039
+        public:
1040
+            std::string toString() const {
1041
+                if( m_cachedToString.empty() )
1042
+                    m_cachedToString = describe();
1043
+                return m_cachedToString;
1044
+            }
1045
+
1046
+        protected:
1047
+            virtual ~MatcherUntypedBase();
1048
+            virtual std::string describe() const = 0;
1049
+            mutable std::string m_cachedToString;
1050
+        private:
1051
+            MatcherUntypedBase& operator = ( MatcherUntypedBase const& );
1052
+        };
1053
+
1054
+        template<typename ObjectT>
1055
+        struct MatcherMethod {
1056
+            virtual bool match( ObjectT const& arg ) const = 0;
1057
+        };
1058
+        template<typename PtrT>
1059
+        struct MatcherMethod<PtrT*> {
1060
+            virtual bool match( PtrT* arg ) const = 0;
1061
+        };
1062
+
1063
+        template<typename ObjectT, typename ComparatorT = ObjectT>
1064
+        struct MatcherBase : MatcherUntypedBase, MatcherMethod<ObjectT> {
1065
+
1066
+            MatchAllOf<ComparatorT> operator && ( MatcherBase const& other ) const;
1067
+            MatchAnyOf<ComparatorT> operator || ( MatcherBase const& other ) const;
1068
+            MatchNotOf<ComparatorT> operator ! () const;
1069
+        };
1070
+
1071
+        template<typename ArgT>
1072
+        struct MatchAllOf : MatcherBase<ArgT> {
1073
+            virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE {
1074
+                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
1075
+                    if (!m_matchers[i]->match(arg))
1076
+                        return false;
1077
+                }
1078
+                return true;
1079
+            }
1080
+            virtual std::string describe() const CATCH_OVERRIDE {
1081
+                std::string description;
1082
+                description.reserve( 4 + m_matchers.size()*32 );
1083
+                description += "( ";
1084
+                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
1085
+                    if( i != 0 )
1086
+                        description += " and ";
1087
+                    description += m_matchers[i]->toString();
1088
+                }
1089
+                description += " )";
1090
+                return description;
1091
+            }
1092
+
1093
+            MatchAllOf<ArgT>& operator && ( MatcherBase<ArgT> const& other ) {
1094
+                m_matchers.push_back( &other );
1095
+                return *this;
1096
+            }
1097
+
1098
+            std::vector<MatcherBase<ArgT> const*> m_matchers;
1099
+        };
1100
+        template<typename ArgT>
1101
+        struct MatchAnyOf : MatcherBase<ArgT> {
1102
+
1103
+            virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE {
1104
+                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
1105
+                    if (m_matchers[i]->match(arg))
1106
+                        return true;
1107
+                }
1108
+                return false;
1109
+            }
1110
+            virtual std::string describe() const CATCH_OVERRIDE {
1111
+                std::string description;
1112
+                description.reserve( 4 + m_matchers.size()*32 );
1113
+                description += "( ";
1114
+                for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
1115
+                    if( i != 0 )
1116
+                        description += " or ";
1117
+                    description += m_matchers[i]->toString();
1118
+                }
1119
+                description += " )";
1120
+                return description;
1121
+            }
1122
+
1123
+            MatchAnyOf<ArgT>& operator || ( MatcherBase<ArgT> const& other ) {
1124
+                m_matchers.push_back( &other );
1125
+                return *this;
1126
+            }
1127
+
1128
+            std::vector<MatcherBase<ArgT> const*> m_matchers;
1129
+        };
1130
+
1131
+        template<typename ArgT>
1132
+        struct MatchNotOf : MatcherBase<ArgT> {
1133
+
1134
+            MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ) : m_underlyingMatcher( underlyingMatcher ) {}
1135
+
1136
+            virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE {
1137
+                return !m_underlyingMatcher.match( arg );
1138
+            }
1139
+
1140
+            virtual std::string describe() const CATCH_OVERRIDE {
1141
+                return "not " + m_underlyingMatcher.toString();
1142
+            }
1143
+            MatcherBase<ArgT> const& m_underlyingMatcher;
1144
+        };
1145
+
1146
+        template<typename ObjectT, typename ComparatorT>
1147
+        MatchAllOf<ComparatorT> MatcherBase<ObjectT, ComparatorT>::operator && ( MatcherBase const& other ) const {
1148
+            return MatchAllOf<ComparatorT>() && *this && other;
1149
+        }
1150
+        template<typename ObjectT, typename ComparatorT>
1151
+        MatchAnyOf<ComparatorT> MatcherBase<ObjectT, ComparatorT>::operator || ( MatcherBase const& other ) const {
1152
+            return MatchAnyOf<ComparatorT>() || *this || other;
1153
+        }
1154
+        template<typename ObjectT, typename ComparatorT>
1155
+        MatchNotOf<ComparatorT> MatcherBase<ObjectT, ComparatorT>::operator ! () const {
1156
+            return MatchNotOf<ComparatorT>( *this );
1157
+        }
1158
+
1159
+    } // namespace Impl
1160
+
1161
+    // The following functions create the actual matcher objects.
1162
+    // This allows the types to be inferred
1163
+    // - deprecated: prefer ||, && and !
1164
+    template<typename T>
1165
+    Impl::MatchNotOf<T> Not( Impl::MatcherBase<T> const& underlyingMatcher ) {
1166
+        return Impl::MatchNotOf<T>( underlyingMatcher );
1167
+    }
1168
+    template<typename T>
1169
+    Impl::MatchAllOf<T> AllOf( Impl::MatcherBase<T> const& m1, Impl::MatcherBase<T> const& m2 ) {
1170
+        return Impl::MatchAllOf<T>() && m1 && m2;
1171
+    }
1172
+    template<typename T>
1173
+    Impl::MatchAllOf<T> AllOf( Impl::MatcherBase<T> const& m1, Impl::MatcherBase<T> const& m2, Impl::MatcherBase<T> const& m3 ) {
1174
+        return Impl::MatchAllOf<T>() && m1 && m2 && m3;
1175
+    }
1176
+    template<typename T>
1177
+    Impl::MatchAnyOf<T> AnyOf( Impl::MatcherBase<T> const& m1, Impl::MatcherBase<T> const& m2 ) {
1178
+        return Impl::MatchAnyOf<T>() || m1 || m2;
1179
+    }
1180
+    template<typename T>
1181
+    Impl::MatchAnyOf<T> AnyOf( Impl::MatcherBase<T> const& m1, Impl::MatcherBase<T> const& m2, Impl::MatcherBase<T> const& m3 ) {
1182
+        return Impl::MatchAnyOf<T>() || m1 || m2 || m3;
1183
+    }
1184
+
1185
+} // namespace Matchers
1186
+
1187
+using namespace Matchers;
1188
+using Matchers::Impl::MatcherBase;
1189
+
1190
+} // namespace Catch
1191
+
1192
+namespace Catch {
1193
+
1194
+    struct TestFailureException{};
1195
+
1196
+    template<typename T> class ExpressionLhs;
1197
+
1198
+    struct CopyableStream {
1199
+        CopyableStream() {}
1200
+        CopyableStream( CopyableStream const& other ) {
1201
+            oss << other.oss.str();
1202
+        }
1203
+        CopyableStream& operator=( CopyableStream const& other ) {
1204
+            oss.str(std::string());
1205
+            oss << other.oss.str();
1206
+            return *this;
1207
+        }
1208
+        std::ostringstream oss;
1209
+    };
1210
+
1211
+    class ResultBuilder : public DecomposedExpression {
1212
+    public:
1213
+        ResultBuilder(  char const* macroName,
1214
+                        SourceLineInfo const& lineInfo,
1215
+                        char const* capturedExpression,
1216
+                        ResultDisposition::Flags resultDisposition,
1217
+                        char const* secondArg = "" );
1218
+        ~ResultBuilder();
1219
+
1220
+        template<typename T>
1221
+        ExpressionLhs<T const&> operator <= ( T const& operand );
1222
+        ExpressionLhs<bool> operator <= ( bool value );
1223
+
1224
+        template<typename T>
1225
+        ResultBuilder& operator << ( T const& value ) {
1226
+            stream().oss << value;
1227
+            return *this;
1228
+        }
1229
+
1230
+        ResultBuilder& setResultType( ResultWas::OfType result );
1231
+        ResultBuilder& setResultType( bool result );
1232
+
1233
+        void endExpression( DecomposedExpression const& expr );
1234
+
1235
+        virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE;
1236
+
1237
+        AssertionResult build() const;
1238
+        AssertionResult build( DecomposedExpression const& expr ) const;
1239
+
1240
+        void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
1241
+        void captureResult( ResultWas::OfType resultType );
1242
+        void captureExpression();
1243
+        void captureExpectedException( std::string const& expectedMessage );
1244
+        void captureExpectedException( Matchers::Impl::MatcherBase<std::string> const& matcher );
1245
+        void handleResult( AssertionResult const& result );
1246
+        void react();
1247
+        bool shouldDebugBreak() const;
1248
+        bool allowThrows() const;
1249
+
1250
+        template<typename ArgT, typename MatcherT>
1251
+        void captureMatch( ArgT const& arg, MatcherT const& matcher, char const* matcherString );
1252
+
1253
+        void setExceptionGuard();
1254
+        void unsetExceptionGuard();
1255
+
1256
+    private:
1257
+        AssertionInfo m_assertionInfo;
1258
+        AssertionResultData m_data;
1259
+
1260
+        CopyableStream &stream()
1261
+        {
1262
+            if(!m_usedStream)
1263
+            {
1264
+                m_usedStream = true;
1265
+                m_stream().oss.str("");
1266
+            }
1267
+            return m_stream();
1268
+        }
1269
+
1270
+        static CopyableStream &m_stream()
1271
+        {
1272
+            static CopyableStream s;
1273
+            return s;
1274
+        }
1275
+
1276
+        bool m_shouldDebugBreak;
1277
+        bool m_shouldThrow;
1278
+        bool m_guardException;
1279
+        bool m_usedStream;
1280
+    };
1281
+
1282
+} // namespace Catch
1283
+
1284
+// Include after due to circular dependency:
1285
+// #included from: catch_expression_lhs.hpp
1286
+#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
1287
+
1288
+// #included from: catch_evaluate.hpp
1289
+#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
1290
+
1291
+#ifdef _MSC_VER
1292
+#pragma warning(push)
1293
+#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
1294
+#pragma warning(disable:4018) // more "signed/unsigned mismatch"
1295
+#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
1296
+#endif
1297
+
1298
+#include <cstddef>
1299
+
1300
+namespace Catch {
1301
+namespace Internal {
1302
+
1303
+    enum Operator {
1304
+        IsEqualTo,
1305
+        IsNotEqualTo,
1306
+        IsLessThan,
1307
+        IsGreaterThan,
1308
+        IsLessThanOrEqualTo,
1309
+        IsGreaterThanOrEqualTo
1310
+    };
1311
+
1312
+    template<Operator Op> struct OperatorTraits             { static const char* getName(){ return "*error*"; } };
1313
+    template<> struct OperatorTraits<IsEqualTo>             { static const char* getName(){ return "=="; } };
1314
+    template<> struct OperatorTraits<IsNotEqualTo>          { static const char* getName(){ return "!="; } };
1315
+    template<> struct OperatorTraits<IsLessThan>            { static const char* getName(){ return "<"; } };
1316
+    template<> struct OperatorTraits<IsGreaterThan>         { static const char* getName(){ return ">"; } };
1317
+    template<> struct OperatorTraits<IsLessThanOrEqualTo>   { static const char* getName(){ return "<="; } };
1318
+    template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
1319
+
1320
+    template<typename T>
1321
+    T& removeConst(T const &t) { return const_cast<T&>(t); }
1322
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
1323
+    inline std::nullptr_t removeConst(std::nullptr_t) { return nullptr; }
1324
+#endif
1325
+
1326
+    // So the compare overloads can be operator agnostic we convey the operator as a template
1327
+    // enum, which is used to specialise an Evaluator for doing the comparison.
1328
+    template<typename T1, typename T2, Operator Op>
1329
+    struct Evaluator{};
1330
+
1331
+    template<typename T1, typename T2>
1332
+    struct Evaluator<T1, T2, IsEqualTo> {
1333
+        static bool evaluate( T1 const& lhs, T2 const& rhs) {
1334
+            return bool(removeConst(lhs) == removeConst(rhs) );
1335
+        }
1336
+    };
1337
+    template<typename T1, typename T2>
1338
+    struct Evaluator<T1, T2, IsNotEqualTo> {
1339
+        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
1340
+            return bool(removeConst(lhs) != removeConst(rhs) );
1341
+        }
1342
+    };
1343
+    template<typename T1, typename T2>
1344
+    struct Evaluator<T1, T2, IsLessThan> {
1345
+        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
1346
+            return bool(removeConst(lhs) < removeConst(rhs) );
1347
+        }
1348
+    };
1349
+    template<typename T1, typename T2>
1350
+    struct Evaluator<T1, T2, IsGreaterThan> {
1351
+        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
1352
+            return bool(removeConst(lhs) > removeConst(rhs) );
1353
+        }
1354
+    };
1355
+    template<typename T1, typename T2>
1356
+    struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
1357
+        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
1358
+            return bool(removeConst(lhs) >= removeConst(rhs) );
1359
+        }
1360
+    };
1361
+    template<typename T1, typename T2>
1362
+    struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
1363
+        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
1364
+            return bool(removeConst(lhs) <= removeConst(rhs) );
1365
+        }
1366
+    };
1367
+
1368
+    // Special case for comparing a pointer to an int (deduced for p==0)
1369
+    template<typename T>
1370
+    struct Evaluator<int const&, T* const&, IsEqualTo> {
1371
+        static bool evaluate( int lhs, T* rhs) {
1372
+            return reinterpret_cast<void const*>( lhs ) ==  rhs;
1373
+        }
1374
+    };
1375
+    template<typename T>
1376
+    struct Evaluator<T* const&, int const&, IsEqualTo> {
1377
+        static bool evaluate( T* lhs, int rhs) {
1378
+            return lhs == reinterpret_cast<void const*>( rhs );
1379
+        }
1380
+    };
1381
+    template<typename T>
1382
+    struct Evaluator<int const&, T* const&, IsNotEqualTo> {
1383
+        static bool evaluate( int lhs, T* rhs) {
1384
+            return reinterpret_cast<void const*>( lhs ) !=  rhs;
1385
+        }
1386
+    };
1387
+    template<typename T>
1388
+    struct Evaluator<T* const&, int const&, IsNotEqualTo> {
1389
+        static bool evaluate( T* lhs, int rhs) {
1390
+            return lhs != reinterpret_cast<void const*>( rhs );
1391
+        }
1392
+    };
1393
+
1394
+    template<typename T>
1395
+    struct Evaluator<long const&, T* const&, IsEqualTo> {
1396
+        static bool evaluate( long lhs, T* rhs) {
1397
+            return reinterpret_cast<void const*>( lhs ) ==  rhs;
1398
+        }
1399
+    };
1400
+    template<typename T>
1401
+    struct Evaluator<T* const&, long const&, IsEqualTo> {
1402
+        static bool evaluate( T* lhs, long rhs) {
1403
+            return lhs == reinterpret_cast<void const*>( rhs );
1404
+        }
1405
+    };
1406
+    template<typename T>
1407
+    struct Evaluator<long const&, T* const&, IsNotEqualTo> {
1408
+        static bool evaluate( long lhs, T* rhs) {
1409
+            return reinterpret_cast<void const*>( lhs ) !=  rhs;
1410
+        }
1411
+    };
1412
+    template<typename T>
1413
+    struct Evaluator<T* const&, long const&, IsNotEqualTo> {
1414
+        static bool evaluate( T* lhs, long rhs) {
1415
+            return lhs != reinterpret_cast<void const*>( rhs );
1416
+        }
1417
+    };
1418
+
1419
+} // end of namespace Internal
1420
+} // end of namespace Catch
1421
+
1422
+#ifdef _MSC_VER
1423
+#pragma warning(pop)
1424
+#endif
1425
+
1426
+// #included from: catch_tostring.h
1427
+#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
1428
+
1429
+#include <sstream>
1430
+#include <iomanip>
1431
+#include <limits>
1432
+#include <vector>
1433
+#include <cstddef>
1434
+
1435
+#ifdef __OBJC__
1436
+// #included from: catch_objc_arc.hpp
1437
+#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
1438
+
1439
+#import <Foundation/Foundation.h>
1440
+
1441
+#ifdef __has_feature
1442
+#define CATCH_ARC_ENABLED __has_feature(objc_arc)
1443
+#else
1444
+#define CATCH_ARC_ENABLED 0
1445
+#endif
1446
+
1447
+void arcSafeRelease( NSObject* obj );
1448
+id performOptionalSelector( id obj, SEL sel );
1449
+
1450
+#if !CATCH_ARC_ENABLED
1451
+inline void arcSafeRelease( NSObject* obj ) {
1452
+    [obj release];
1453
+}
1454
+inline id performOptionalSelector( id obj, SEL sel ) {
1455
+    if( [obj respondsToSelector: sel] )
1456
+        return [obj performSelector: sel];
1457
+    return nil;
1458
+}
1459
+#define CATCH_UNSAFE_UNRETAINED
1460
+#define CATCH_ARC_STRONG
1461
+#else
1462
+inline void arcSafeRelease( NSObject* ){}
1463
+inline id performOptionalSelector( id obj, SEL sel ) {
1464
+#ifdef __clang__
1465
+#pragma clang diagnostic push
1466
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
1467
+#endif
1468
+    if( [obj respondsToSelector: sel] )
1469
+        return [obj performSelector: sel];
1470
+#ifdef __clang__
1471
+#pragma clang diagnostic pop
1472
+#endif
1473
+    return nil;
1474
+}
1475
+#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
1476
+#define CATCH_ARC_STRONG __strong
1477
+#endif
1478
+
1479
+#endif
1480
+
1481
+#ifdef CATCH_CONFIG_CPP11_TUPLE
1482
+#include <tuple>
1483
+#endif
1484
+
1485
+#ifdef CATCH_CONFIG_CPP11_IS_ENUM
1486
+#include <type_traits>
1487
+#endif
1488
+
1489
+namespace Catch {
1490
+
1491
+// Why we're here.
1492
+template<typename T>
1493
+std::string toString( T const& value );
1494
+
1495
+// Built in overloads
1496
+
1497
+std::string toString( std::string const& value );
1498
+std::string toString( std::wstring const& value );
1499
+std::string toString( const char* const value );
1500
+std::string toString( char* const value );
1501
+std::string toString( const wchar_t* const value );
1502
+std::string toString( wchar_t* const value );
1503
+std::string toString( int value );
1504
+std::string toString( unsigned long value );
1505
+std::string toString( unsigned int value );
1506
+std::string toString( const double value );
1507
+std::string toString( const float value );
1508
+std::string toString( bool value );
1509
+std::string toString( char value );
1510
+std::string toString( signed char value );
1511
+std::string toString( unsigned char value );
1512
+
1513
+#ifdef CATCH_CONFIG_CPP11_LONG_LONG
1514
+std::string toString( long long value );
1515
+std::string toString( unsigned long long value );
1516
+#endif
1517
+
1518
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
1519
+std::string toString( std::nullptr_t );
1520
+#endif
1521
+
1522
+#ifdef __OBJC__
1523
+    std::string toString( NSString const * const& nsstring );
1524
+    std::string toString( NSString * CATCH_ARC_STRONG & nsstring );
1525
+    std::string toString( NSObject* const& nsObject );
1526
+#endif
1527
+
1528
+namespace Detail {
1529
+
1530
+    extern const std::string unprintableString;
1531
+
1532
+ #if !defined(CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK)
1533
+    struct BorgType {
1534
+        template<typename T> BorgType( T const& );
1535
+    };
1536
+
1537
+    struct TrueType { char sizer[1]; };
1538
+    struct FalseType { char sizer[2]; };
1539
+
1540
+    TrueType& testStreamable( std::ostream& );
1541
+    FalseType testStreamable( FalseType );
1542
+
1543
+    FalseType operator<<( std::ostream const&, BorgType const& );
1544
+
1545
+    template<typename T>
1546
+    struct IsStreamInsertable {
1547
+        static std::ostream &s;
1548
+        static T  const&t;
1549
+        enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) };
1550
+    };
1551
+#else
1552
+    template<typename T>
1553
+    class IsStreamInsertable {
1554
+        template<typename SS, typename TT>
1555
+        static auto test(int)
1556
+        -> decltype( std::declval<SS&>() << std::declval<TT>(), std::true_type() );
1557
+
1558
+        template<typename, typename>
1559
+        static auto test(...) -> std::false_type;
1560
+
1561
+    public:
1562
+        static const bool value = decltype(test<std::ostream,const T&>(0))::value;
1563
+    };
1564
+#endif
1565
+
1566
+#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
1567
+    template<typename T,
1568
+             bool IsEnum = std::is_enum<T>::value
1569
+             >
1570
+    struct EnumStringMaker
1571
+    {
1572
+        static std::string convert( T const& ) { return unprintableString; }
1573
+    };
1574
+
1575
+    template<typename T>
1576
+    struct EnumStringMaker<T,true>
1577
+    {
1578
+        static std::string convert( T const& v )
1579
+        {
1580
+            return ::Catch::toString(
1581
+                static_cast<typename std::underlying_type<T>::type>(v)
1582
+                );
1583
+        }
1584
+    };
1585
+#endif
1586
+    template<bool C>
1587
+    struct StringMakerBase {
1588
+#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
1589
+        template<typename T>
1590
+        static std::string convert( T const& v )
1591
+        {
1592
+            return EnumStringMaker<T>::convert( v );
1593
+        }
1594
+#else
1595
+        template<typename T>
1596
+        static std::string convert( T const& ) { return unprintableString; }
1597
+#endif
1598
+    };
1599
+
1600
+    template<>
1601
+    struct StringMakerBase<true> {
1602
+        template<typename T>
1603
+        static std::string convert( T const& _value ) {
1604
+            std::ostringstream oss;
1605
+            oss << _value;
1606
+            return oss.str();
1607
+        }
1608
+    };
1609
+
1610
+    std::string rawMemoryToString( const void *object, std::size_t size );
1611
+
1612
+    template<typename T>
1613
+    std::string rawMemoryToString( const T& object ) {
1614
+      return rawMemoryToString( &object, sizeof(object) );
1615
+    }
1616
+
1617
+} // end namespace Detail
1618
+
1619
+template<typename T>
1620
+struct StringMaker :
1621
+    Detail::StringMakerBase<Detail::IsStreamInsertable<T>::value> {};
1622
+
1623
+template<typename T>
1624
+struct StringMaker<T*> {
1625
+    template<typename U>
1626
+    static std::string convert( U* p ) {
1627
+        if( !p )
1628
+            return "NULL";
1629
+        else
1630
+            return Detail::rawMemoryToString( p );
1631
+    }
1632
+};
1633
+
1634
+template<typename R, typename C>
1635
+struct StringMaker<R C::*> {
1636
+    static std::string convert( R C::* p ) {
1637
+        if( !p )
1638
+            return "NULL";
1639
+        else
1640
+            return Detail::rawMemoryToString( p );
1641
+    }
1642
+};
1643
+
1644
+namespace Detail {
1645
+    template<typename InputIterator>
1646
+    std::string rangeToString( InputIterator first, InputIterator last );
1647
+}
1648
+
1649
+//template<typename T, typename Allocator>
1650
+//struct StringMaker<std::vector<T, Allocator> > {
1651
+//    static std::string convert( std::vector<T,Allocator> const& v ) {
1652
+//        return Detail::rangeToString( v.begin(), v.end() );
1653
+//    }
1654
+//};
1655
+
1656
+template<typename T, typename Allocator>
1657
+std::string toString( std::vector<T,Allocator> const& v ) {
1658
+    return Detail::rangeToString( v.begin(), v.end() );
1659
+}
1660
+
1661
+#ifdef CATCH_CONFIG_CPP11_TUPLE
1662
+
1663
+// toString for tuples
1664
+namespace TupleDetail {
1665
+  template<
1666
+      typename Tuple,
1667
+      std::size_t N = 0,
1668
+      bool = (N < std::tuple_size<Tuple>::value)
1669
+      >
1670
+  struct ElementPrinter {
1671
+      static void print( const Tuple& tuple, std::ostream& os )
1672
+      {
1673
+          os << ( N ? ", " : " " )
1674
+             << Catch::toString(std::get<N>(tuple));
1675
+          ElementPrinter<Tuple,N+1>::print(tuple,os);
1676
+      }
1677
+  };
1678
+
1679
+  template<
1680
+      typename Tuple,
1681
+      std::size_t N
1682
+      >
1683
+  struct ElementPrinter<Tuple,N,false> {
1684
+      static void print( const Tuple&, std::ostream& ) {}
1685
+  };
1686
+
1687
+}
1688
+
1689
+template<typename ...Types>
1690
+struct StringMaker<std::tuple<Types...>> {
1691
+
1692
+    static std::string convert( const std::tuple<Types...>& tuple )
1693
+    {
1694
+        std::ostringstream os;
1695
+        os << '{';
1696
+        TupleDetail::ElementPrinter<std::tuple<Types...>>::print( tuple, os );
1697
+        os << " }";
1698
+        return os.str();
1699
+    }
1700
+};
1701
+#endif // CATCH_CONFIG_CPP11_TUPLE
1702
+
1703
+namespace Detail {
1704
+    template<typename T>
1705
+    std::string makeString( T const& value ) {
1706
+        return StringMaker<T>::convert( value );
1707
+    }
1708
+} // end namespace Detail
1709
+
1710
+/// \brief converts any type to a string
1711
+///
1712
+/// The default template forwards on to ostringstream - except when an
1713
+/// ostringstream overload does not exist - in which case it attempts to detect
1714
+/// that and writes {?}.
1715
+/// Overload (not specialise) this template for custom typs that you don't want
1716
+/// to provide an ostream overload for.