• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1402 (tree)
Zeit2020-01-22 21:53:10
Autorsrz_zumix

Log Message

Merge pull request #367 from srz-zumix/develop

v1.17.0.4
git@fa0d54311291a0fc488b69104138b27ab0774cb3
https://github.com/srz-zumix/iutest/commit/fa0d54311291a0fc488b69104138b27ab0774cb3

Ändern Zusammenfassung

Diff

--- trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1401)
+++ trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -30,12 +30,19 @@
3030 # ifndef _VARIADIC_MAX
3131 # define _VARIADIC_MAX 10
3232 # endif
33+#endif
3334
35+#if defined(_MSC_VER) && _MSC_VER >= 1700
36+// old googletest using std::tr1::tuple
3437 #include <tuple>
3538 namespace std {
3639 namespace tr1
3740 {
38- using ::std::tuple;
41+using ::std::tuple;
42+using ::std::tuple_size;
43+using ::std::tuple_element;
44+using ::std::make_tuple;
45+using ::std::get;
3946 }
4047 }
4148 #endif
@@ -51,6 +58,15 @@
5158 //======================================================================
5259 // include
5360 #include "../iutest_ver.hpp"
61+
62+// gtest 1.5 or less compatible
63+#if !IUTEST_HAS_CONCEPTS
64+#include <gtest/internal/gtest-internal.h>
65+#define GTestStreamToHelper GTestStreamToHelperForCompatible
66+template <typename T>
67+void GTestStreamToHelper(std::ostream* os, const T& val);
68+#endif
69+
5470 #include <gtest/gtest.h>
5571 #if defined(IUTEST_USE_GMOCK)
5672 #include <gmock/gmock.h>
@@ -180,7 +196,11 @@
180196 #endif
181197 #define IUTEST_HAS_TESTNAME_ALIAS 0
182198 #define IUTEST_HAS_TESTNAME_ALIAS_JP 0
183-#define IUTEST_HAS_STREAM_RESULT 1
199+#if GTEST_VER < 0x01060000
200+# define IUTEST_HAS_STREAM_RESULT 0
201+#else
202+# define IUTEST_HAS_STREAM_RESULT 1
203+#endif
184204
185205 #define IUTEST_HAS_STREAM_BUFFER 0
186206
@@ -196,6 +216,10 @@
196216 #define IUTEST_HAS_SEH GTEST_HAS_SEH
197217 #define IUTEST_HAS_LONG_DOUBLE 0
198218
219+#if GTEST_VER < 0x01080000
220+# define IUTEST_NO_ENV_XML_OUTPUT_FILE
221+#endif
222+
199223 #if GTEST_VER < 0x01070000
200224 # define IUTEST_NO_RECORDPROPERTY_OUTSIDE_TESTMETHOD_LIFESPAN
201225 # define IUTEST_NO_UNITEST_AD_HOC_TEST_RESULT_ACCESSOR
@@ -202,22 +226,14 @@
202226 # define IUTEST_NO_TESTCASE_AD_HOC_TEST_RESULT_ACCESSOR
203227 #endif
204228
229+#if GTEST_VER < 0x01060000
230+# define IUTEST_NO_AD_HOC_TEST_RESULT
231+#endif
232+
205233 #include "../internal/iutest_compiler.hpp"
206234 #include "../internal/iutest_type_traits.hpp"
207235 #include "../internal/iutest_compatible_defs.hpp"
208236
209-#if GTEST_VER < 0x01100000
210-
211-namespace iutest_type_traits
212-{
213-
214-template<bool b, typename T = type_defined_void>
215-struct enable_if;
216-
217-}
218-
219-#endif
220-
221237 #include "switch/iutest_switch_port.hpp"
222238 #include "switch/iutest_switch_core.hpp"
223239
@@ -384,7 +400,7 @@
384400 // ostream
385401 typedef ::std::ostream iu_ostream;
386402
387-/* gtest 1.5 or less compatible...
403+// gtest 1.5 or less compatible...
388404 #if !IUTEST_HAS_PRINT_TO
389405 namespace internal
390406 {
@@ -411,60 +427,46 @@
411427 }
412428 os << ">";
413429 }
414-}
415430
416-namespace print_internal
417-{
418- template<typename T>
419- iu_ostream& operator << (iu_ostream& os, const T& value)
420- {
421- const unsigned char* buf = const_cast<const unsigned char*>(
422- reinterpret_cast<const volatile unsigned char*>(&value));
423- const size_t size = sizeof(T);
424- internal::PrintBytesInObjectTo(buf, size, os);
425- return os;
426- }
427-}
431+#if IUTEST_HAS_CONCEPTS
428432
429-namespace internal
430-{
431-
432-#if IUTEST_HAS_NULLPTR
433-// template<>
434-// String StreamableToString<::std::nullptr_t>(const ::std::nullptr_t&)
435-// {
436-// return (Message() << "nullptr").GetString();
437-// }
438-#endif
439-
440-#if IUTEST_HAS_DECLTYPE
441-
442433 template<typename T>
443-char is_ostreamable(const T&);
444-template<typename T>
445-auto is_ostreamable(const T& val) -> decltype((StrStream() << val), int());
434+concept printable = requires (T x) { ::std::cout << x; }; // NOLINT
446435
447436 template<typename T>
448-String StreamableToString(const T& val, typename std::enable_if<std::is_same<decltype(is_ostreamable(val)), char>::value>::type*& = iutest_type_traits::enabler::value)
437+ requires (!printable<T>)
438+String StreamableToString(const T& val)
449439 {
450- using namespace print_internal;
451440 StrStream ss_;
452- ss_ << val;
441+ const unsigned char* buf = const_cast<const unsigned char*>(
442+ reinterpret_cast<const volatile unsigned char*>(&val));
443+ const size_t size = sizeof(T);
444+ internal::PrintBytesInObjectTo(buf, size, ss_);
453445 return StrStreamToString(&ss_);
454446 }
455447
456-template<typename T, typename std::enable_if<std::is_same<T, ::std::nullptr_t>::value>::type* = nullptr>
457-String StreamableToString(const T&)
448+#else
449+
450+namespace printer_internal
458451 {
459- return (Message() << "nullptr").GetString();
452+
453+template<typename T>
454+iu_ostream& operator << (iu_ostream& os, const T& val)
455+{
456+ const unsigned char* buf = const_cast<const unsigned char*>(
457+ reinterpret_cast<const volatile unsigned char*>(&val));
458+ const size_t size = sizeof(T);
459+ internal::PrintBytesInObjectTo(buf, size, os);
460+ return os;
460461 }
461462
463+} // namespace printer_internal
464+
462465 #endif
463466
464-}
467+} // end of namespace internal
465468
466469 #endif
467-*/
468470
469471 #if GTEST_VER < 0x01060000
470472
@@ -486,10 +488,73 @@
486488 using dummy_printer::PrintToString;
487489 #endif
488490
489-#endif
491+template<typename T>
492+class WithParamInterface
493+{
494+public:
495+ typedef T ParamType;
496+ const ParamType& GetParam() const { return *parameter_; }
490497
498+private:
499+ static void SetParam(const ParamType *parameter) { parameter_ = parameter; }
500+ static const ParamType *parameter_;
501+ template <class TestClass>
502+ friend class internal::ParameterizedTestFactory;
503+};
504+
505+template<typename T>
506+const T* WithParamInterface<T>::parameter_ = NULL;
507+
508+#endif // #if GTEST_VER < 0x01060000
509+
491510 } // end of namespace testing
492511
512+// gtest 1.5 or less compatible...
513+#if !IUTEST_HAS_CONCEPTS
514+#if IUTEST_HAS_PRINT_TO
515+
516+template <typename T>
517+inline void GTestStreamToHelperForCompatible(std::ostream* os, const T& val) {
518+ *os << val;
519+}
520+
521+#else
522+namespace testing
523+{
524+namespace printer_internal2
525+{
526+
527+template<typename T>
528+void GTestStreamTo(std::ostream* os, const T& val)
529+{
530+ using namespace ::testing::internal::printer_internal; // NOLINT
531+ *os << val;
532+}
533+inline void GTestStreamTo(std::ostream* os, const ::std::string& val)
534+{
535+ *os << val;
536+}
537+inline void GTestStreamTo(std::ostream* os, const char* const val)
538+{
539+ *os << val;
540+}
541+inline void GTestStreamTo(std::ostream* os, const char val)
542+{
543+ *os << val;
544+}
545+
546+} // end of namespace printer_internal2
547+} // end of namespace testing
548+
549+
550+template <typename T>
551+inline void GTestStreamToHelperForCompatible(std::ostream* os, const T& val) {
552+ ::testing::printer_internal2::GTestStreamTo(os, val);
553+}
554+
555+#endif
556+#endif // #if GTEST_VER < 0x01060000
557+
493558 #if defined(INCG_IRIS_IUTEST_HPP_)
494559 // すでに iutest namespace が存在するので、define で対応
495560 # define iutest testing
--- trunk/include/gtest/switch/iutest_switch_assertion_return.hpp (revision 1401)
+++ trunk/include/gtest/switch/iutest_switch_assertion_return.hpp (revision 1402)
@@ -25,14 +25,19 @@
2525 # undef IUTEST_HAS_ASSERTION_RETURN
2626 #endif
2727
28-#ifdef GTEST_MESSAGE_AT_
29-# undef GTEST_MESSAGE_AT_
30-#endif
31-
3228 //======================================================================
3329 // define
3430 #define IUTEST_HAS_ASSERTION_RETURN 1
3531
32+#if defined(GTEST_MESSAGE_AT_)
33+# undef GTEST_MESSAGE_AT_
34+#else
35+# if defined(GTEST_MESSAGE_)
36+# undef GTEST_MESSAGE_
37+# define GTEST_MESSAGE_(message, result_type) GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
38+# endif
39+#endif
40+
3641 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
3742 ::testing::internal::AssertHelperEx(result_type, file, line, message) \
3843 = ::testing::AssertionMessage()
--- trunk/include/gtest/switch/iutest_switch_gmock.hpp (revision 1401)
+++ trunk/include/gtest/switch/iutest_switch_gmock.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -37,6 +37,9 @@
3737 #undef IUTEST_HAS_MATCHER_ELEMENTSAREARRAYFORWARD
3838 #undef IUTEST_HAS_MATCHER_REGEX
3939 #undef IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR
40+#undef IUTEST_HAS_MATCHER_EACH
41+#undef IUTEST_HAS_MATCHER_POINTWISE
42+#undef IUTEST_HAS_MATCHER_VARIADIC
4043
4144 #endif
4245
@@ -55,6 +58,18 @@
5558 #else
5659 # define IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR 0
5760 #endif
61+#if GMOCK_VER > 0x01050000
62+# define IUTEST_HAS_MATCHER_EACH 1
63+# define IUTEST_HAS_MATCHER_POINTWISE 1
64+#else
65+# define IUTEST_HAS_MATCHER_EACH 0
66+# define IUTEST_HAS_MATCHER_POINTWISE 0
67+#endif
68+#if defined(GTEST_LANG_CXX11) && GTEST_LANG_CXX11
69+# define IUTEST_HAS_MATCHER_VARIADIC 1
70+#else
71+# define IUTEST_HAS_MATCHER_VARIADIC 0
72+#endif
5873
5974 #define IUTEST_ASSERT_THAT ASSERT_THAT
6075 #define IUTEST_EXPECT_THAT EXPECT_THAT
@@ -68,11 +83,14 @@
6883 #else
6984
7085 #define IUTEST_HAS_MATCHERS 0
86+#define IUTEST_HAS_MATCHER_VARIADIC 0
7187 #define IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF 0
7288 #define IUTEST_HAS_MATCHER_ELEMENTSARE 0
7389 #define IUTEST_HAS_MATCHER_ELEMENTSAREARRAYFORWARD 0
7490 #define IUTEST_HAS_MATCHER_REGEX 0
7591 #define IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR 0
92+#define IUTEST_HAS_MATCHER_EACH 0
93+#define IUTEST_HAS_MATCHER_POINTWISE 0
7694
7795 #endif
7896
@@ -80,7 +98,125 @@
8098 // using
8199 #if defined(IUTEST_USE_GMOCK)
82100
83-namespace testing {
101+namespace testing
102+{
103+
104+#if IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF && (GMOCK_VER <= 0x01050000)
105+
106+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6>
107+inline internal::BothOfMatcher<M1,
108+ internal::BothOfMatcher<M2,
109+ internal::BothOfMatcher<M3,
110+ internal::BothOfMatcher<M4,
111+ internal::BothOfMatcher<M5, M6> > > > >
112+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
113+ return AllOf(m1, AllOf(m2, m3, m4, m5, m6));
114+}
115+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7>
116+inline internal::BothOfMatcher<M1,
117+ internal::BothOfMatcher<M2,
118+ internal::BothOfMatcher<M3,
119+ internal::BothOfMatcher<M4,
120+ internal::BothOfMatcher<M5,
121+ internal::BothOfMatcher<M6, M7> > > > > >
122+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
123+ return AllOf(m1, AllOf(m2, m3, m4, m5, m6, m7));
124+}
125+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8>
126+inline internal::BothOfMatcher<M1,
127+ internal::BothOfMatcher<M2,
128+ internal::BothOfMatcher<M3,
129+ internal::BothOfMatcher<M4,
130+ internal::BothOfMatcher<M5,
131+ internal::BothOfMatcher<M6,
132+ internal::BothOfMatcher<M7, M8> > > > > > >
133+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
134+ return AllOf(m1, AllOf(m2, m3, m4, m5, m6, m7, m8));
135+}
136+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8, typename M9>
137+inline internal::BothOfMatcher<M1,
138+ internal::BothOfMatcher<M2,
139+ internal::BothOfMatcher<M3,
140+ internal::BothOfMatcher<M4,
141+ internal::BothOfMatcher<M5,
142+ internal::BothOfMatcher<M6,
143+ internal::BothOfMatcher<M7,
144+ internal::BothOfMatcher<M8, M9> > > > > > > >
145+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
146+ return AllOf(m1, AllOf(m2, m3, m4, m5, m6, m7, m8, m9));
147+}
148+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8, typename M9, typename M10>
149+inline internal::BothOfMatcher<M1,
150+ internal::BothOfMatcher<M2,
151+ internal::BothOfMatcher<M3,
152+ internal::BothOfMatcher<M4,
153+ internal::BothOfMatcher<M5,
154+ internal::BothOfMatcher<M6,
155+ internal::BothOfMatcher<M7,
156+ internal::BothOfMatcher<M8,
157+ internal::BothOfMatcher<M9, M10> > > > > > > > >
158+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
159+ return AllOf(m1, AllOf(m2, m3, m4, m5, m6, m7, m8, m9, m10));
160+}
161+
162+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6>
163+inline internal::EitherOfMatcher<M1,
164+ internal::EitherOfMatcher<M2,
165+ internal::EitherOfMatcher<M3,
166+ internal::EitherOfMatcher<M4,
167+ internal::EitherOfMatcher<M5, M6> > > > >
168+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
169+ return AnyOf(m1, AnyOf(m2, m3, m4, m5, m6));
170+}
171+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7>
172+inline internal::EitherOfMatcher<M1,
173+ internal::EitherOfMatcher<M2,
174+ internal::EitherOfMatcher<M3,
175+ internal::EitherOfMatcher<M4,
176+ internal::EitherOfMatcher<M5,
177+ internal::EitherOfMatcher<M6, M7> > > > > >
178+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
179+ return AnyOf(m1, AnyOf(m2, m3, m4, m5, m6, m7));
180+}
181+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8>
182+inline internal::EitherOfMatcher<M1,
183+ internal::EitherOfMatcher<M2,
184+ internal::EitherOfMatcher<M3,
185+ internal::EitherOfMatcher<M4,
186+ internal::EitherOfMatcher<M5,
187+ internal::EitherOfMatcher<M6,
188+ internal::EitherOfMatcher<M7, M8> > > > > > >
189+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
190+ return AnyOf(m1, AnyOf(m2, m3, m4, m5, m6, m7, m8));
191+}
192+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8, typename M9>
193+inline internal::EitherOfMatcher<M1,
194+ internal::EitherOfMatcher<M2,
195+ internal::EitherOfMatcher<M3,
196+ internal::EitherOfMatcher<M4,
197+ internal::EitherOfMatcher<M5,
198+ internal::EitherOfMatcher<M6,
199+ internal::EitherOfMatcher<M7,
200+ internal::EitherOfMatcher<M8, M9> > > > > > > >
201+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
202+ return AnyOf(m1, AnyOf(m2, m3, m4, m5, m6, m7, m8, m9));
203+}
204+template <typename M1, typename M2, typename M3, typename M4, typename M5, typename M6, typename M7, typename M8, typename M9, typename M10>
205+inline internal::EitherOfMatcher<M1,
206+ internal::EitherOfMatcher<M2,
207+ internal::EitherOfMatcher<M3,
208+ internal::EitherOfMatcher<M4,
209+ internal::EitherOfMatcher<M5,
210+ internal::EitherOfMatcher<M6,
211+ internal::EitherOfMatcher<M7,
212+ internal::EitherOfMatcher<M8,
213+ internal::EitherOfMatcher<M9, M10> > > > > > > > >
214+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
215+ return AnyOf(m1, AnyOf(m2, m3, m4, m5, m6, m7, m8, m9, m10));
216+}
217+
218+#endif
219+
84220 namespace matchers
85221 {
86222
@@ -116,8 +252,10 @@
116252
117253 using ::testing::Contains;
118254 using ::testing::ContainerEq;
119-#if GMOCK_VER > 0x01050000
255+#if IUTEST_HAS_MATCHER_EACH
120256 using ::testing::Each;
257+#endif
258+#if IUTEST_HAS_MATCHER_POINTWISE
121259 using ::testing::Pointwise;
122260 #endif
123261 using ::testing::Key;
@@ -165,7 +303,7 @@
165303 }
166304
167305 #if GMOCK_VER >= 0x01070000
168- // gmock 1.7 later
306+ // gmock 1.7 or later
169307 using ::testing::IsEmpty;
170308 using ::testing::SizeIs;
171309 #endif
--- trunk/include/gtest/switch/iutest_switch_peep.hpp (revision 1401)
+++ trunk/include/gtest/switch/iutest_switch_peep.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -45,10 +45,12 @@
4545
4646 using ::iutest::detail::peep_tag;
4747
48+namespace peep
49+{
50+using ::iutest::detail::peep::Peep;
51+}
52+
4853 } // end of namespace detail
49-
50-using ::iutest::Peep;
51-
5254 } // end of namespace testing
5355
5456 #endif
--- trunk/include/internal/iutest_compiler.hpp (revision 1401)
+++ trunk/include/internal/iutest_compiler.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -98,7 +98,19 @@
9898 #endif
9999
100100
101+// c++20 features
102+#if !defined(IUTEST_HAS_CONCEPTS)
103+# if defined(__cpp_concepts) && __cpp_concepts >= 201907
104+# define IUTEST_HAS_CONCEPTS 1
105+# elif IUTEST_HAS_CXX2A && defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 192328105
106+# define IUTEST_HAS_CONCEPTS 1
107+# endif
108+#endif
101109
110+#if !defined(IUTEST_HAS_CONCEPTS)
111+# define IUTEST_HAS_CONCEPTS 0
112+#endif
113+
102114 // c++17 features
103115
104116 //! inline variable
--- trunk/include/internal/iutest_option_message.hpp (revision 1401)
+++ trunk/include/internal/iutest_option_message.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -123,9 +123,12 @@
123123 m (IUTEST_HAS_LIB); \
124124 m (IUTEST_HAS_MATCHERS); \
125125 m (IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF); \
126+ m (IUTEST_HAS_MATCHER_EACH); \
126127 m (IUTEST_HAS_MATCHER_ELEMENTSARE); \
127128 m (IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR); \
129+ m (IUTEST_HAS_MATCHER_POINTWISE); \
128130 m (IUTEST_HAS_MATCHER_REGEX); \
131+ m (IUTEST_HAS_MATCHER_VARIADIC); \
129132 m (IUTEST_HAS_MINIDUMP); \
130133 m (IUTEST_HAS_PACKAGE); \
131134 m (IUTEST_HAS_PAIRWISE); \
@@ -180,6 +183,7 @@
180183 IIUT_SHOW_MACRO(IUTEST_HAS_CHAR16_T);
181184 IIUT_SHOW_MACRO(IUTEST_HAS_CHAR32_T);
182185 IIUT_SHOW_MACRO(IUTEST_HAS_CLOCK);
186+ IIUT_SHOW_MACRO(IUTEST_HAS_CONCEPTS);
183187 IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR);
184188 IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR_IF);
185189 IIUT_SHOW_MACRO(IUTEST_HAS_COUNTER_MACRO);
--- trunk/include/internal/iutest_type_traits.hpp (revision 1401)
+++ trunk/include/internal/iutest_type_traits.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -62,6 +62,9 @@
6262 /**
6363 * @brief enable_if
6464 */
65+template<bool b, typename T = type_defined_void>
66+struct enable_if;
67+
6568 #if !defined(IUTEST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
6669
6770 template<bool B, typename T>
@@ -90,7 +93,7 @@
9093
9194 } // end of namespace helper
9295
93-template<bool B, typename T = type_defined_void>
96+template<bool B, typename T>
9497 struct enable_if : public helper::enable_if_impl_<B>::template inner<T>
9598 {
9699 };
--- trunk/include/iutest_config.hpp (revision 1401)
+++ trunk/include/iutest_config.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -270,6 +270,11 @@
270270 # endif
271271 #endif
272272
273+#if !defined(IUTEST_HAS_MATCHER_VARIADIC)
274+//! matchers が variadic template に対応しているかどうか
275+# define IUTEST_HAS_MATCHER_VARIADIC IUTEST_HAS_VARIADIC_TEMPLATES
276+#endif
277+
273278 #if !defined(IUTEST_HAS_MATCHER_REGEX)
274279 //! ::iutest::matchers::MatchesRegex, ::iutest::matchers::ContainsRegex matcher が使用可能かどうか
275280 # if IUTEST_HAS_CXX_HDR_REGEX && IUTEST_HAS_REGEX
@@ -293,6 +298,16 @@
293298 # define IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR 1
294299 #endif
295300
301+#if !defined(IUTEST_HAS_MATCHER_EACH)
302+//! Wether ::iutest::matchers::Each is available
303+# define IUTEST_HAS_MATCHER_EACH 1
304+#endif
305+
306+#if !defined(IUTEST_HAS_MATCHER_POINTWISE)
307+//! Wether ::iutest::matchers::Pointwise is available
308+# define IUTEST_HAS_MATCHER_POINTWISE 1
309+#endif
310+
296311 #if !defined(IUTEST_USE_THROW_ON_ASSERTION_FAILURE)
297312 /**
298313 * @brief 失敗時に例外を throw します。
--- trunk/include/iutest_matcher.hpp (revision 1401)
+++ trunk/include/iutest_matcher.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -645,6 +645,8 @@
645645 T m_expected;
646646 };
647647
648+#if IUTEST_HAS_MATCHER_EACH
649+
648650 /**
649651 * @brief Each matcher
650652 */
@@ -691,6 +693,8 @@
691693 T m_expected;
692694 };
693695
696+#endif
697+
694698 /**
695699 * @brief ContainerEq matcher
696700 */
@@ -755,6 +759,8 @@
755759 };
756760
757761
762+#if IUTEST_HAS_MATCHER_POINTWISE
763+
758764 /**
759765 * @brief Pointwise matcher
760766 */
@@ -819,6 +825,8 @@
819825 ::std::string m_whichIs;
820826 };
821827
828+#endif
829+
822830 /**
823831 * @brief IsEmpty matcher
824832 */
@@ -1082,7 +1090,7 @@
10821090 }
10831091 };
10841092
1085-#if IUTEST_HAS_VARIADIC_TEMPLATES
1093+#if IUTEST_HAS_MATCHER_VARIADIC
10861094
10871095 /**
10881096 * @brief ElementsAre matcher
@@ -1605,7 +1613,7 @@
16051613 }
16061614 };
16071615
1608-#if IUTEST_HAS_VARIADIC_TEMPLATES
1616+#if IUTEST_HAS_MATCHER_VARIADIC
16091617
16101618 /**
16111619 * @brief AllOf matcher
@@ -1732,7 +1740,7 @@
17321740 }
17331741 };
17341742
1735-#if IUTEST_HAS_VARIADIC_TEMPLATES
1743+#if IUTEST_HAS_MATCHER_VARIADIC
17361744
17371745 /**
17381746 * @brief AnyOf matcher
@@ -2227,6 +2235,8 @@
22272235 return detail::ContainsMatcher<T>(expected);
22282236 }
22292237
2238+#if IUTEST_HAS_MATCHER_EACH
2239+
22302240 /**
22312241 * @brief Make Each matcher
22322242 * @details argument はすべての要素が expected にマッチする
@@ -2237,6 +2247,8 @@
22372247 return detail::EachMatcher<T>(expected);
22382248 }
22392249
2250+#endif
2251+
22402252 /**
22412253 * @brief Make ContainerEq matcher
22422254 * @details argument コンテナは expected コンテナにマッチする
@@ -2247,6 +2259,8 @@
22472259 return detail::ContainerEqMatcher<T>(expected);
22482260 }
22492261
2262+#if IUTEST_HAS_MATCHER_POINTWISE
2263+
22502264 /**
22512265 * @brief Make Pointwise matcher
22522266 * @details argument コンテナは expected コンテナの各要素と matcher にマッチする
@@ -2257,6 +2271,8 @@
22572271 return detail::PointwiseMatcher<M, T>(matcher, expected);
22582272 }
22592273
2274+#endif
2275+
22602276 /**
22612277 * @brief Make IsEmpty matcher
22622278 * @details argument.empty()
@@ -2389,7 +2405,7 @@
23892405
23902406 #if IUTEST_HAS_MATCHER_ELEMENTSARE
23912407
2392-#if IUTEST_HAS_VARIADIC_TEMPLATES
2408+#if IUTEST_HAS_MATCHER_VARIADIC
23932409
23942410 /**
23952411 * @brief Make ElementsAre matcher
@@ -2533,7 +2549,7 @@
25332549
25342550 #if IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF
25352551
2536-#if IUTEST_HAS_VARIADIC_TEMPLATES
2552+#if IUTEST_HAS_MATCHER_VARIADIC
25372553
25382554 /**
25392555 * @brief Make AllOf matcher
--- trunk/include/iutest_prod.hpp (revision 1401)
+++ trunk/include/iutest_prod.hpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -87,7 +87,7 @@
8787 * @param member_name = メンバー名
8888 */
8989 #define IUTEST_PEEP(class_name, member_name) \
90- ::iutest::Peep< class_name, IIUT_PEEP_TAG_NAME_(class_name, member_name)<class_name> >::type
90+ ::iutest::detail::peep::Peep< class_name, IIUT_PEEP_TAG_NAME_(class_name, member_name)<class_name> >::type
9191
9292 #endif
9393
@@ -122,7 +122,7 @@
122122 namespace iutest {
123123
124124 //======================================================================
125-// struct
125+// class
126126 namespace detail
127127 {
128128
@@ -137,10 +137,11 @@
137137 template<typename Tag>
138138 typename Tag::type peep_tag<Tag>::value;
139139
140-} // end of namespace detail
141-
142140 #if IUTEST_HAS_PEEP_CLASS
143141
142+namespace peep
143+{
144+
144145 /**
145146 * @brief private メンバーアクセスオブジェクト
146147 */
@@ -292,8 +293,11 @@
292293 , type_traits::is_member_pointer<peep_type>::value >::type type;
293294 };
294295
296+} // end of namespace peep
297+
295298 #endif
296299
300+} // end of namespace detail
297301 } // end of namespace iutest
298302
299303 #endif // INCG_IRIS_IUTEST_PROD_HPP_7A316C18_042D_4E48_BC31_E6AE8B6C2E28_
--- trunk/include/iutest_ver.hpp (revision 1401)
+++ trunk/include/iutest_ver.hpp (revision 1402)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01170003u //!< iutest version 1.17.0.3
20+#define IUTEST_VER 0x01170004u //!< iutest version 1.17.0.4
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x17u //!< Minor Version
2323 #define IUTEST_MICROVER 0x00u //!< Micro Version
24-#define IUTEST_REVISION 0x03u //!< Revision
24+#define IUTEST_REVISION 0x04u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
--- trunk/sider.yml (revision 1401)
+++ trunk/sider.yml (revision 1402)
@@ -6,7 +6,14 @@
66 goodcheck:
77 config: ./.ci/goodcheck.yml
88 cpplint:
9- filter: "-whitespace/parens,-whitespace/braces"
9+ filter: "-readability/braces\
10+ ,-whitespace/braces\
11+ ,-whitespace/comments\
12+ ,-whitespace/indent\
13+ ,-whitespace/newline\
14+ ,-whitespace/operators\
15+ ,-whitespace/parens\
16+ "
1017 linelength: 150
1118 extensions: "c,cpp"
1219 headers: "h,hpp,ipp"
--- trunk/test/configcheck/Makefile (revision 1401)
+++ trunk/test/configcheck/Makefile (revision 1402)
@@ -27,9 +27,13 @@
2727 IUTEST_HAS_IGNORE_TEST \
2828 IUTEST_HAS_MATCHERS \
2929 IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF \
30+ IUTEST_HAS_MATCHER_EACH \
3031 IUTEST_HAS_MATCHER_ELEMENTSARE \
3132 IUTEST_HAS_MATCHER_ELEMENTSAREARRAYFORWARD \
33+ IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR \
34+ IUTEST_HAS_MATCHER_POINTWISE \
3235 IUTEST_HAS_MATCHER_REGEX \
36+ IUTEST_HAS_MATCHER_VARIADIC \
3337 IUTEST_HAS_PACKAGE \
3438 IUTEST_HAS_PEEP \
3539 IUTEST_HAS_PEEP_CLASS \
--- trunk/test/cpplint/Makefile (revision 1401)
+++ trunk/test/cpplint/Makefile (revision 1402)
@@ -15,7 +15,7 @@
1515
1616 SUPPRESS_WHITESPACE_SUB=/indent,/braces,/comments,/newline,/labels,/operators,/parens
1717 SUPPRESS_WHITESPACE=$(subst /,-whitespace/,$(SUPPRESS_WHITESPACE_SUB))
18-SUPPRESS_BUILD_SUB=/include_what_you_use,/c++11,/c++tr1
18+SUPPRESS_BUILD_SUB=/include_what_you_use,/c++11,/c++tr1,/header_guard
1919 SUPPRESS_BUILD=$(subst /,-build/,$(SUPPRESS_BUILD_SUB))
2020 SUPPRESS_READABILITY=-readability/todo,-readability/braces,-readability/function
2121 SUPPRESS_RUNTIME=-runtime/int,-runtime/references,-runtime/string
@@ -55,6 +55,8 @@
5555 rm -rf cpplint.py
5656
5757 cpplint.py:
58- git clone https://github.com/google/styleguide.git cpplint
59- cp cpplint/cpplint/cpplint.py cpplint.py
58+ # git clone https://github.com/google/styleguide.git cpplint
59+ # cp cpplint/cpplint/cpplint.py cpplint.py
60+ git clone https://github.com/cpplint/cpplint.git cpplint
61+ cp cpplint/cpplint.py cpplint.py
6062 rm -rf cpplint
--- trunk/test/exception_tests.cpp (revision 1401)
+++ trunk/test/exception_tests.cpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -17,7 +17,19 @@
1717 // include
1818 #include "iutest.hpp"
1919
20-#if IUTEST_HAS_EXCEPTIONS
20+#if defined(IUTEST_USE_GTEST)
21+# if GTEST_VER < 0x01060000 && !IUTEST_HAS_SEH
22+# define EXCEPTION_CATCH_TEST 0
23+# endif
24+#endif
25+
26+#if !defined(EXCEPTION_CATCH_TEST)
27+# if IUTEST_HAS_EXCEPTIONS
28+# define EXCEPTION_CATCH_TEST 1
29+# endif
30+#endif
31+
32+#if EXCEPTION_CATCH_TEST
2133 #include <stdexcept>
2234
2335 IUTEST(ExceptionTest, StdExceptionThrow)
@@ -39,7 +51,9 @@
3951 #endif
4052 {
4153 IUTEST_INIT(&argc, argv);
42-#if IUTEST_HAS_EXCEPTIONS
54+#if EXCEPTION_CATCH_TEST
55+ ::iutest::IUTEST_FLAG(catch_exceptions) = true;
56+
4357 #if defined(OUTPUTXML)
4458 // 失敗テストを含むので xml 出力しない
4559 ::iutest::IUTEST_FLAG(output) = NULL;
--- trunk/test/matcher_tests.cpp (revision 1401)
+++ trunk/test/matcher_tests.cpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -279,6 +279,7 @@
279279 IUTEST_EXPECT_THAT(vv, Contains(Contains(Lt(4))));
280280 }
281281
282+#if IUTEST_HAS_MATCHER_EACH
282283 IUTEST(Matcher, Each)
283284 {
284285 IUTEST_EXPECT_THAT(gc, Each(1));
@@ -285,6 +286,7 @@
285286 IUTEST_EXPECT_THAT(va, Each(Le(10)));
286287 IUTEST_EXPECT_THAT(vv, Each(Each(Le(10))));
287288 }
289+#endif
288290
289291 IUTEST(Matcher, ContainerEq)
290292 {
@@ -296,6 +298,7 @@
296298 #endif
297299 }
298300
301+#if IUTEST_HAS_MATCHER_POINTWISE
299302 IUTEST(Matcher, Pointwise)
300303 {
301304 IUTEST_EXPECT_THAT(gn[0], Pointwise(Ne(), gn[1]));
@@ -307,8 +310,8 @@
307310 IUTEST_EXPECT_THAT(ga, Pointwise(Eq(), va));
308311 IUTEST_EXPECT_THAT(va, Pointwise(Eq(), ga));
309312 }
313+#endif
310314
311-
312315 #if !defined(IUTEST_USE_GMOCK) || (defined(GMOCK_VER) && GMOCK_VER >= 0x01070000)
313316 IUTEST(Matcher, IsEmpty)
314317 {
@@ -333,6 +336,7 @@
333336 }
334337 #endif
335338
339+#if IUTEST_HAS_MATCHER_EACH
336340 IUTEST(Matcher, Key)
337341 {
338342 IUTEST_EXPECT_THAT(gm, Each(Key(Le(10))));
@@ -342,12 +346,15 @@
342346 {
343347 IUTEST_EXPECT_THAT(gm, Each(Pair(Le(10), 100)));
344348 }
349+#endif
345350
346351 IUTEST(Matcher, Field)
347352 {
348353 IUTEST_EXPECT_THAT( gx, Field(&X::a, 1));
349354 IUTEST_EXPECT_THAT(&gx, Field(&X::a, 1));
355+#if IUTEST_HAS_MATCHER_EACH
350356 IUTEST_EXPECT_THAT( mx, Each(Pair(Le(10), Field(&X::b, Ge(0)))));
357+#endif
351358 }
352359
353360 IUTEST(Matcher, Property)
@@ -354,7 +361,9 @@
354361 {
355362 IUTEST_EXPECT_THAT( gx, Property(&X::GetA, 1));
356363 IUTEST_EXPECT_THAT(&gx, Property(&X::GetA, 1));
364+#if IUTEST_HAS_MATCHER_EACH
357365 IUTEST_EXPECT_THAT( mx, Each(Pair(Le(10), Property(&X::GetA, Ge(0)))));
366+#endif
358367 }
359368
360369 IUTEST(Matcher, ResultOf)
@@ -608,6 +617,7 @@
608617 CHECK_FAILURE( IUTEST_ASSERT_THAT(vv, Contains(Contains(Lt(0)))), "Contains: Contains: Lt: 0" );
609618 }
610619
620+#if IUTEST_HAS_MATCHER_EACH
611621 IUTEST(MatcherFailure, Each)
612622 {
613623 CHECK_FAILURE( IUTEST_ASSERT_THAT(va, Each(42)), "Each: 42" );
@@ -615,6 +625,7 @@
615625 CHECK_FAILURE( IUTEST_ASSERT_THAT(va, Each(Ne(9))), "Each: Ne: 9" );
616626 CHECK_FAILURE( IUTEST_ASSERT_THAT(vv, Each(Each(Gt(5)))), "Each: Each: Gt: 5" );
617627 }
628+#endif
618629
619630 IUTEST(MatcherFailure, ContainerEq)
620631 {
@@ -625,6 +636,7 @@
625636 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc, ContainerEq(ga)), "Mismatch element : 10 vs 3" );
626637 }
627638
639+#if IUTEST_HAS_MATCHER_POINTWISE
628640 IUTEST(MatcherFailure, Pointwise)
629641 {
630642 CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, Pointwise(Eq(), gc)), "Pointwise: Eq: { 1, 1, 1 }" );
@@ -631,6 +643,7 @@
631643 CHECK_FAILURE( IUTEST_ASSERT_THAT(ga, Pointwise(Eq(), gc)), "Mismatch element : 3 vs 10" );
632644 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc, Pointwise(Eq(), ga)), "Mismatch element : 10 vs 3" );
633645 }
646+#endif
634647
635648 #if !defined(IUTEST_USE_GMOCK) || (defined(GMOCK_VER) && GMOCK_VER >= 0x01070000)
636649 IUTEST(MatcherFailure, IsEmpty)
@@ -656,6 +669,7 @@
656669 }
657670 #endif
658671
672+#if IUTEST_HAS_MATCHER_EACH
659673 IUTEST(MatcherFailure, Key)
660674 {
661675 CHECK_FAILURE( IUTEST_ASSERT_THAT(gm, Each(Key(0))), "Each: Key: 0" );
@@ -666,6 +680,7 @@
666680 CHECK_FAILURE( IUTEST_ASSERT_THAT(gm, Each(Pair(Gt(5), 100))), "Each: Pair: (Gt: 5, 100)" );
667681 CHECK_FAILURE( IUTEST_ASSERT_THAT(gm, Each(Pair(_, Ne(100)))), "Each: Pair: (_, Ne: 100)" );
668682 }
683+#endif
669684
670685 IUTEST(MatcherFailure, Field)
671686 {
@@ -748,8 +763,10 @@
748763 , ElementsAre( 'h', 'o', 'G', 'e', '\0')), "ElementsAre(2): G");
749764 CHECK_FAILURE( IUTEST_ASSERT_THAT(va
750765 , ElementsAre(Ge(0), Gt(0), Lt(1))), "ElementsAre(2): Lt: 1");
766+#if IUTEST_HAS_MATCHER_EACH
751767 CHECK_FAILURE( IUTEST_ASSERT_THAT(gn, Each(
752768 ElementsAre(Lt(3), Lt(3)))), "Each: ElementsAre: {Lt: 3, Lt: 3}");
769+#endif
753770 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc
754771 , ElementsAre( Ge(0), Gt(0), Ne(0), Eq(0) ) ), "ElementsAre: argument[3] is less than 4");
755772 }
@@ -803,8 +820,10 @@
803820 , ElementsAre( 'h', 'o', 'G', 'e', '\0')), "ElementsAre(2): G");
804821 CHECK_FAILURE( IUTEST_ASSERT_THAT(va
805822 , ElementsAre(Ge(0), Gt(0), Lt(1))), "ElementsAre(2): Lt: 1");
823+#if IUTEST_HAS_MATCHER_EACH
806824 CHECK_FAILURE( IUTEST_ASSERT_THAT(gn, Each(
807825 ElementsAre(Lt(3), Lt(3)))), "Each: ElementsAre: {Lt: 3, Lt: 3}");
826+#endif
808827 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc
809828 , ElementsAre( Ge(0), Gt(0), Ne(0), Eq(0) ) ), "ElementsAre: argument[3] is less than 4");
810829 }
@@ -827,7 +846,6 @@
827846 , HasSubstr("7")
828847 , HasSubstr("8")
829848 ));
830- IUTEST_EXPECT_THAT(va, Each(AllOf( Ge(0), Le(10) )));
831849 }
832850
833851 IUTEST(Matcher, AnyOf)
@@ -846,7 +864,6 @@
846864 , HasSubstr("7")
847865 , HasSubstr("8")
848866 ));
849- IUTEST_EXPECT_THAT(va, Each(AnyOf( Ge(0), Le(10) )));
850867 }
851868
852869 IUTEST(MatcherFailure, AllOf)
@@ -855,8 +872,6 @@
855872 , AllOf( StartsWith("ho"), EndsWith("gE"))), "StartsWith: ho and EndsWith: gE");
856873 CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge"
857874 , AllOf( StartsWith("Ho"), EndsWith("ge"))), "StartsWith: Ho");
858- CHECK_FAILURE( IUTEST_ASSERT_THAT(va
859- , Each(AllOf( Ge(0), Le(5) ))), "Each: Ge: 0 and Le: 5");
860875 }
861876
862877 IUTEST(MatcherFailure, AnyOf)
@@ -863,9 +878,31 @@
863878 {
864879 CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge"
865880 , AnyOf( StartsWith("Ho"), EndsWith("gE"))), "StartsWith: Ho or EndsWith: gE");
881+}
882+
883+#if IUTEST_HAS_MATCHER_EACH
884+IUTEST(Matcher, EachAllOf)
885+{
886+ IUTEST_EXPECT_THAT(va, Each(AllOf( Ge(0), Le(10) )));
887+}
888+
889+IUTEST(Matcher, EachAnyOf)
890+{
891+ IUTEST_EXPECT_THAT(va, Each(AnyOf( Ge(0), Le(10) )));
892+}
893+
894+IUTEST(MatcherFailure, EachAllOf)
895+{
866896 CHECK_FAILURE( IUTEST_ASSERT_THAT(va
897+ , Each(AllOf( Ge(0), Le(5) ))), "Each: Ge: 0 and Le: 5");
898+}
899+
900+IUTEST(MatcherFailure, EachAnyOf)
901+{
902+ CHECK_FAILURE( IUTEST_ASSERT_THAT(va
867903 , Each(AnyOf( Gt(5), Lt(5) ))), "Each: Gt: 5 or Lt: 5");
868904 }
905+#endif
869906
870907 #endif
871908
--- trunk/test/no_test_tests.cpp (revision 1401)
+++ trunk/test/no_test_tests.cpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -29,17 +29,39 @@
2929
3030 {
3131 const int ret = IUTEST_RUN_ALL_TESTS();
32- if( ret == 0 ) return 1;
32+#if defined(IUTEST_NO_AD_HOC_TEST_RESULT)
33+ if( ret != 0 )
34+ {
35+ printf("*** expect: adhoc test result not collect ***\n");
36+ return 1;
37+ }
38+#else
39+ if( ret == 0 )
40+ {
41+ printf("*** expect: adhoc test result collect ***\n");
42+ return 1;
43+ }
44+#endif
3345 }
46+#if !defined(IUTEST_NO_AD_HOC_TEST_RESULT)
3447 {
3548 const int ret = IUTEST_RUN_ALL_TESTS();
36- if( ret == 0 ) return 1;
49+ if( ret == 0 )
50+ {
51+ printf("*** test result is cleared ***\n");
52+ return 1;
53+ }
3754 }
55+#endif
3856 #if !defined(IUTEST_USE_GTEST)
3957 {
4058 IUTEST_INIT(&argc, argv);
4159 const int ret = IUTEST_RUN_ALL_TESTS();
42- if( ret != 0 ) return 1;
60+ if( ret != 0 )
61+ {
62+ printf("*** expect: test result reset ***\n");
63+ return 1;
64+ }
4365 }
4466 #endif
4567 printf("*** Successful ***\n");
--- trunk/test/output_env_var_tests.cpp (revision 1401)
+++ trunk/test/output_env_var_tests.cpp (revision 1402)
@@ -2,11 +2,11 @@
22 //-----------------------------------------------------------------------
33 /**
44 * @file output_env_var_tests.cpp
5-* @brief environment variable (output setting) test
5+ * @brief environment variable (output setting) test
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2017, Takazumi Shirayanagi\n
9+ * Copyright (C) 2017-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -46,7 +46,11 @@
4646 IUTEST(FlagTest, Check)
4747 {
4848 IUTEST_ASSUME_EQ(0, g_result.setup_environment) << lasterror << ": " << strerror(lasterror); // putenv に失敗した場合はテストしない
49+#if !defined(IUTEST_NO_ENV_XML_OUTPUT_FILE)
4950 IUTEST_EXPECT_STREQ( "xml:test:invalid_file_path", ::iutest::IUTEST_FLAG(output).c_str() );
51+#else
52+ IUTEST_EXPECT_STREQ( "", ::iutest::IUTEST_FLAG(output).c_str() );
53+#endif
5054 }
5155
5256 IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
--- trunk/test/spi_tests_decl.cpp (revision 1401)
+++ trunk/test/spi_tests_decl.cpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2015-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2015-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -45,8 +45,8 @@
4545 #else
4646 FAILURE_MACRO( FLAVOR(_FLOAT_EQ)(0, 1), "" );
4747 FAILURE_MACRO( FLAVOR(_DOUBLE_EQ)(0, 1), "" );
48- FAILURE_MACRO( FLAVOR(_FLOAT_EQ)(0.0f/a, 0.0f/a), "" );
49- FAILURE_MACRO( FLAVOR(_DOUBLE_EQ)(0.0/a, 0.0f/a), "" );
48+ FAILURE_MACRO( FLAVOR(_FLOAT_EQ)(0.0f/fa, 0.0f/fa), "" );
49+ FAILURE_MACRO( FLAVOR(_DOUBLE_EQ)(0.0/da, 0.0f/da), "" );
5050 FAILURE_MACRO( FLAVOR(_PRED_FORMAT2)(::iutest::FloatLE , 2, 0), "" );
5151 FAILURE_MACRO( FLAVOR(_PRED_FORMAT2)(::iutest::DoubleLE, 2, 0), "" );
5252 #endif
--- trunk/test/syntax_tests.cpp (revision 1401)
+++ trunk/test/syntax_tests.cpp (revision 1402)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2013-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2013-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -545,9 +545,11 @@
545545 int z=1;
546546 IUTEST_EXPECT_THAT(a, ::iutest::Contains(0));
547547 IUTEST_EXPECT_THAT(a, ::iutest::Contains(::iutest::Lt(10)));
548+#if IUTEST_HAS_MATCHER_EACH
548549 IUTEST_EXPECT_THAT(a, ::iutest::Each(::iutest::Le(10)));
549550 IUTEST_EXPECT_THAT(a, ::iutest::Each(::iutest::_));
550551 IUTEST_EXPECT_THAT(a, ::iutest::Each(::iutest::A<int>()));
552+#endif
551553 IUTEST_EXPECT_THAT(&x, ::iutest::Field(&X::a, 0));
552554 IUTEST_EXPECT_THAT(x, ::iutest::Field(&X::a, 0));
553555 IUTEST_EXPECT_THAT(&x, ::iutest::Property(&X::GetA, 0));
@@ -609,6 +611,7 @@
609611
610612 IUTEST(SyntaxTest, AllOf)
611613 {
614+#if IUTEST_HAS_MATCHER_VARIADIC
612615 IUTEST_EXPECT_THAT("9347812650", ::iutest::AllOf(
613616 ::iutest::HasSubstr("0")
614617 , ::iutest::HasSubstr("1")
@@ -619,11 +622,28 @@
619622 , ::iutest::HasSubstr("6")
620623 , ::iutest::HasSubstr("7")
621624 , ::iutest::HasSubstr("8")
625+ , ::iutest::HasSubstr("9")
626+ , ::iutest::HasSubstr("0")
622627 ));
628+#else
629+ IUTEST_EXPECT_THAT("9347812650", ::iutest::AllOf(
630+ ::iutest::HasSubstr("0")
631+ , ::iutest::HasSubstr("1")
632+ , ::iutest::HasSubstr("2")
633+ , ::iutest::HasSubstr("3")
634+ , ::iutest::HasSubstr("4")
635+ , ::iutest::HasSubstr("5")
636+ , ::iutest::HasSubstr("6")
637+ , ::iutest::HasSubstr("7")
638+ , ::iutest::HasSubstr("8")
639+ , ::iutest::HasSubstr("9")
640+ ));
641+#endif
623642 }
624643
625644 IUTEST(SyntaxTest, AnyOf)
626645 {
646+#if IUTEST_HAS_MATCHER_VARIADIC
627647 IUTEST_EXPECT_THAT("hoge7", ::iutest::AnyOf(
628648 ::iutest::HasSubstr("0")
629649 , ::iutest::HasSubstr("1")
@@ -634,7 +654,23 @@
634654 , ::iutest::HasSubstr("6")
635655 , ::iutest::HasSubstr("7")
636656 , ::iutest::HasSubstr("8")
657+ , ::iutest::HasSubstr("9")
658+ , ::iutest::HasSubstr("0")
637659 ));
660+#else
661+ IUTEST_EXPECT_THAT("hoge7", ::iutest::AnyOf(
662+ ::iutest::HasSubstr("0")
663+ , ::iutest::HasSubstr("1")
664+ , ::iutest::HasSubstr("2")
665+ , ::iutest::HasSubstr("3")
666+ , ::iutest::HasSubstr("4")
667+ , ::iutest::HasSubstr("5")
668+ , ::iutest::HasSubstr("6")
669+ , ::iutest::HasSubstr("7")
670+ , ::iutest::HasSubstr("8")
671+ , ::iutest::HasSubstr("9")
672+ ));
673+#endif
638674 }
639675
640676 #endif
Show on old repository browser