• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1327 (tree)
Time2018-07-25 23:21:17
Authorsrz_zumix

Log Message

fix test #56

git@9b0eb1d06c06a4439bf6b7d6eab6f30bdb65f4fe
https://github.com/srz-zumix/iutest/commit/9b0eb1d06c06a4439bf6b7d6eab6f30bdb65f4fe


add test log

git@89f8bb38b79d3cd0957af6733fd64a2bad9aa642


change spec macro #56

git@f88971646655e8c71b94c65beafdb4c95f7ebdea


fix ad_hoc_test_result compatible #56

git@56ff459ed854c4d9d660f8a7e6c9d1046169e06e


fix warning
git@50d56402193647fc3d8d4cc0a8eded3335c81752


fix build error #56
git@7c05fc3527c25347ab912086538c54893931d708


fix build error #56

git@e1d7e8ded4a532760fd41a3835e7d6070231d24d


fix ad_hoc_test_result return type difference #56

git@9b738e6898929b52713caca54f80ffb323a5a5ed


fix gtest compatibility (/ad_hoc_testresut/ad_hoc_test_result/)

git@08a6415a471fb40768d3645406cf407048152534


add gtest release compatible test on buddy

git@ec8f3d4539f5eab8ec40775d82d1c04f82040391


update google test compatible test

git@49b4b93a0c2ebc5bd281e68fd2a1e782c52b51a4


fix typo

git@33ff02fb3b1141c48197ef9e393d466913acdb88


gtest 1.7 can be used outside of the lifespan of a test method,

git@c536877d988eef56edf451bbdd85aa0908f5d381


fix build error

git@1859da1827c0dd578a77328c4d376b161d7f4422


fix build error

git@410f77021cb9fcec51c05fdb06c771560f49970a


fix build error

git@172fbb31f6f09e2ff73b058cd2f74e74e93a3859


fix version

git@63b6d0efd28b11c2c9cafee3557e63d53858eea4


delete vs2008 projects

git@1b10cd1630705ac069b0594eba8884a2bfaf2c95


fix assignment operator warning #62

git@a87aff4147c3dc88c848aa49038b0ba021b8b124


Update iutest_matcher.hpp
git@6df20f241d013754de889ce5a55ae0a2ca53ce7a


update cxx detact for compile error test

git@fa9ba2e0102f108fe6a3c636237d26f8c939a433


refactoring macthers

git@afa145c2d89212963da45ab7ee8ae1d7ce36787a


Revert "rm IUTEST_PP_DISALLOW_ASSIGN #62"

This reverts commit 1a611738b0b36b609914057601c9a483acd3ec73.

git@09dc6966c9fc435fbf96482e25346151766888bc


rm IUTEST_PP_DISALLOW_ASSIGN #62

git@1a611738b0b36b609914057601c9a483acd3ec73

Change Summary

Incremental Difference

--- trunk/buddy.yml (revision 1326)
+++ trunk/buddy.yml (revision 1327)
@@ -170,3 +170,131 @@
170170 mount_filesystem_path: "/buddy/iutest"
171171 shell: "SH"
172172 trigger_condition: "ALWAYS"
173+- pipeline: "gtest-compatible-released"
174+ trigger_mode: "ON_EVERY_PUSH"
175+ ref_name: "master"
176+ ref_type: "BRANCH"
177+ actions:
178+ - action: "release-1.8.0"
179+ type: "BUILD"
180+ working_directory: "/buddy/iutest"
181+ docker_image_name: "srzzumix/googletest"
182+ docker_image_tag: "release-1.8.0"
183+ execute_commands:
184+ - "cd test"
185+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01080000 test"
186+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01080000 test"
187+ mount_filesystem_path: "/buddy/iutest"
188+ shell: "SH"
189+ trigger_condition: "ALWAYS"
190+ - action: "release-1.7.0"
191+ type: "BUILD"
192+ working_directory: "/buddy/iutest"
193+ docker_image_name: "srzzumix/googletest"
194+ docker_image_tag: "release-1.7.0"
195+ execute_commands:
196+ - "cd test"
197+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01070000 test"
198+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01070000 test"
199+ mount_filesystem_path: "/buddy/iutest"
200+ shell: "SH"
201+ trigger_condition: "ALWAYS"
202+ - action: "release-1.6.0"
203+ type: "BUILD"
204+ working_directory: "/buddy/iutest"
205+ docker_image_name: "srzzumix/googletest"
206+ docker_image_tag: "release-1.6.0"
207+ execute_commands:
208+ - "cd test"
209+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01060000 test"
210+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01060000 test"
211+ mount_filesystem_path: "/buddy/iutest"
212+ shell: "SH"
213+ trigger_condition: "ALWAYS"
214+ - action: "release-1.5.0"
215+ type: "BUILD"
216+ working_directory: "/buddy/iutest"
217+ docker_image_name: "srzzumix/googletest"
218+ docker_image_tag: "release-1.5.0"
219+ execute_commands:
220+ - "cd test"
221+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01050000 test"
222+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01050000 test"
223+ mount_filesystem_path: "/buddy/iutest"
224+ shell: "SH"
225+ trigger_condition: "ALWAYS"
226+ - action: "release-1.4.0"
227+ type: "BUILD"
228+ working_directory: "/buddy/iutest"
229+ docker_image_name: "srzzumix/googletest"
230+ docker_image_tag: "release-1.4.0"
231+ execute_commands:
232+ - "cd test"
233+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01040000 test"
234+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01040000 test"
235+ mount_filesystem_path: "/buddy/iutest"
236+ shell: "SH"
237+ trigger_condition: "ALWAYS"
238+ - action: "release-1.3.0"
239+ type: "BUILD"
240+ disabled: true
241+ working_directory: "/buddy/iutest"
242+ docker_image_name: "srzzumix/googletest"
243+ docker_image_tag: "release-1.3.0"
244+ execute_commands:
245+ - "cd test"
246+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01030000 test"
247+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01030000 test"
248+ mount_filesystem_path: "/buddy/iutest"
249+ shell: "BASH"
250+ trigger_condition: "ALWAYS"
251+ - action: "release-1.2.1"
252+ type: "BUILD"
253+ disabled: true
254+ working_directory: "/buddy/iutest"
255+ docker_image_name: "srzzumix/googletest"
256+ docker_image_tag: "release-1.2.1"
257+ execute_commands:
258+ - "cd test"
259+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01020100 test"
260+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01020100 test"
261+ mount_filesystem_path: "/buddy/iutest"
262+ shell: "BASH"
263+ trigger_condition: "ALWAYS"
264+ - action: "release-1.2.0"
265+ type: "BUILD"
266+ disabled: true
267+ working_directory: "/buddy/iutest"
268+ docker_image_name: "srzzumix/googletest"
269+ docker_image_tag: "release-1.2.0"
270+ execute_commands:
271+ - "cd test"
272+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01020000 test"
273+ - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01020000 test"
274+ mount_filesystem_path: "/buddy/iutest"
275+ shell: "SH"
276+ trigger_condition: "ALWAYS"
277+ - action: "release-1.1.0"
278+ type: "BUILD"
279+ disabled: true
280+ working_directory: "/buddy/iutest"
281+ docker_image_name: "srzzumix/googletest"
282+ docker_image_tag: "release-1.1.0"
283+ execute_commands:
284+ - "cd test"
285+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01010000 test"
286+ mount_filesystem_path: "/buddy/iutest"
287+ shell: "SH"
288+ trigger_condition: "ALWAYS"
289+ - action: "release-1.0.0"
290+ type: "BUILD"
291+ disabled: true
292+ working_directory: "/buddy/iutest"
293+ docker_image_name: "srzzumix/googletest"
294+ docker_image_tag: "release-1.0.0"
295+ execute_commands:
296+ - "cd test"
297+ - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01000000 test"
298+ mount_filesystem_path: "/buddy/iutest"
299+ shell: "SH"
300+ trigger_condition: "ALWAYS"
--- trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1326)
+++ trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1327)
@@ -2,7 +2,7 @@
22 //-----------------------------------------------------------------------
33 /**
44 * @file iutest_switch_for_gtest.hpp
5- * @brief switching to iutest from gtest / gtest from iutest
5+ * @brief switching to iutest from gtest
66 *
77 * @author t.shirayanagi
88 * @par copyright
@@ -181,6 +181,12 @@
181181 #define IUTEST_HAS_REGEX GTEST_USES_POSIX_RE
182182 #define IUTEST_HAS_SEH GTEST_HAS_SEH
183183
184+#if GTEST_VER < 0x01070000
185+# define IUTEST_NO_RECORDPROPERTY_OUTSIDE_TESTMETHOD_LIFESPAN
186+# define IUTEST_NO_UNITEST_AD_HOC_TEST_RESULT_ACCESSOR
187+# define IUTEST_NO_TESTCASE_AD_HOC_TEST_RESULT_ACCESSOR
188+#endif
189+
184190 #ifndef IUTEST_CXX_OVERRIDE
185191 # define IUTEST_CXX_OVERRIDE
186192 #endif
--- trunk/include/gtest/iutest_switch_for_iutest.hpp (revision 1326)
+++ trunk/include/gtest/iutest_switch_for_iutest.hpp (revision 1327)
@@ -2,11 +2,11 @@
22 //-----------------------------------------------------------------------
33 /**
44 * @file iutest_switch_for_iutest.hpp
5- * @brief switching to iutest from gtest / gtest from iutest
5+ * @brief switching to gtest from iutest
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2017, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
--- trunk/include/internal/iutest_pp.hpp (revision 1326)
+++ trunk/include/internal/iutest_pp.hpp (revision 1327)
@@ -19,18 +19,20 @@
1919 // define
2020
2121 /**
22- * @brief コピー禁止定義
22+ * @brief コピー禁止定義
2323 */
2424 #define IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(TypeName) \
25- TypeName(const TypeName&); \
26- TypeName& operator = (const TypeName&)
25+ TypeName(const TypeName&); \
26+ TypeName& operator = (const TypeName&)
2727
2828 /**
29- * @brief 代入禁止定義
29+ * @brief 代入禁止定義
3030 */
3131 #define IUTEST_PP_DISALLOW_ASSIGN(TypeName) \
32- TypeName& operator = (const TypeName&)
32+ private: \
33+ TypeName& operator = (const TypeName&)
3334
35+
3436 /**
3537 * @brief コピー/ムーブ禁止定義
3638 */
--- trunk/include/internal/iutest_pragma.hpp (revision 1326)
+++ trunk/include/internal/iutest_pragma.hpp (revision 1327)
@@ -156,6 +156,15 @@
156156 # define IUTEST_PRAGMA_EXTERN_TEMPLATE_WARN_DISABLE_END()
157157 #endif
158158
159+#if defined(_MSC_VER) && _MSC_VER < 1900
160+# define IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_BEGIN() IUTEST_PRAGMA_MSC_WARN_PUSH() \
161+ IUTEST_PRAGMA_MSC_WARN_DISABLE(4512)
162+# define IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_END() IUTEST_PRAGMA_MSC_WARN_POP()
163+#else
164+# define IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_BEGIN()
165+# define IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_END()
166+#endif
167+
159168 #if defined(_MSC_VER) && IUTEST_HAS_CONSTEXPR
160169 # define IUTEST_PRAGMA_CONSTEXPR_CALLED_AT_RUNTIME_WARN_DISABLE_BEGIN() IUTEST_PRAGMA_MSC_WARN_PUSH() \
161170 IUTEST_PRAGMA_MSC_WARN_DISABLE(4592)
--- trunk/include/iutest_assertion.hpp (revision 1326)
+++ trunk/include/iutest_assertion.hpp (revision 1327)
@@ -200,14 +200,6 @@
200200 : m_part_result(file, line, message.c_str(), type)
201201 {}
202202
203-private:
204- IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(AssertionHelper);
205-
206-#if IUTEST_HAS_RVALUE_REFS
207- AssertionHelper(AssertionHelper&& rhs) IUTEST_CXX_DELETED_FUNCTION;
208- AssertionHelper& operator=(AssertionHelper&&) IUTEST_CXX_DELETED_FUNCTION;
209-#endif
210-
211203 public:
212204 /** @private */
213205 class ScopedMessage : public detail::iu_list_node<ScopedMessage>
@@ -359,6 +351,9 @@
359351 private:
360352 friend class TestInfo;
361353 TestPartResult m_part_result;
354+
355+private:
356+ IUTEST_PP_DISALLOW_MOVE_AND_COPY_AND_ASSIGN(AssertionHelper);
362357 };
363358
364359 } // end of namespace iutest
--- trunk/include/iutest_case.hpp (revision 1326)
+++ trunk/include/iutest_case.hpp (revision 1327)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2017, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -125,9 +125,20 @@
125125 return TestEnv::AddDefaultPackageName(name());
126126 }
127127
128- /** テスト実行中じゃないときのリザルトの取得 */
128+ /**
129+ * @brief テスト実行中じゃないときのリザルトの取得
130+ * @deprecated
131+ */
129132 const TestResult* ad_hoc_testresult() const IUTEST_CXX_NOEXCEPT_SPEC
130133 {
134+ return ad_hoc_test_result();
135+ }
136+
137+ /**
138+ * @brief テスト実行中じゃないときのリザルトの取得
139+ */
140+ const TestResult* ad_hoc_test_result() const IUTEST_CXX_NOEXCEPT_SPEC
141+ {
131142 return &m_ad_hoc_testresult;
132143 }
133144
--- trunk/include/iutest_config.hpp (revision 1326)
+++ trunk/include/iutest_config.hpp (revision 1327)
@@ -689,6 +689,9 @@
689689 #define IUTEST_NO_PUTENV //!< putenv 関数がない場合は定義
690690 #define IUTEST_NO_GETCWD //!< getcwd 関数がない場合は定義
691691
692+//! RecordProperty が Test 以外の場所でも使用できない場合に定義される
693+#define IUTEST_NO_RECORDPROPERTY_OUTSIDE_TESTMETHOD_LIFESPAN
694+
692695 /**
693696 * @}
694697 */
--- trunk/include/iutest_core.hpp (revision 1326)
+++ trunk/include/iutest_core.hpp (revision 1327)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -93,8 +93,14 @@
9393 /** 失敗したテストケース総数 */
9494 int failed_test_case_count() const;
9595
96+ /**
97+ * @brief テスト実行中じゃないときのリザルトの取得
98+ * @deprecated
99+ */
100+ const TestResult* ad_hoc_testresult() const IUTEST_CXX_NOEXCEPT_SPEC { return ad_hoc_test_result(); }
101+
96102 /** テスト実行中じゃないときのリザルトの取得 */
97- const TestResult* ad_hoc_testresult() const IUTEST_CXX_NOEXCEPT_SPEC { return &m_ad_hoc_testresult; }
103+ const TestResult* ad_hoc_test_result() const IUTEST_CXX_NOEXCEPT_SPEC { return &m_ad_hoc_testresult; }
98104
99105 /** テストの実行ミリ秒 */
100106 TimeInMillisec elapsed_time() const IUTEST_CXX_NOEXCEPT_SPEC { return m_elapsedmsec; }
--- trunk/include/iutest_matcher.hpp (revision 1326)
+++ trunk/include/iutest_matcher.hpp (revision 1327)
@@ -56,6 +56,8 @@
5656 //======================================================================
5757 // class
5858
59+IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_BEGIN()
60+
5961 /**
6062 * @brief matcher interface
6163 */
@@ -65,9 +67,6 @@
6567 template<typename T>
6668 struct is_matcher : public iutest_type_traits::is_base_of<IMatcher, T> {};
6769 public:
68- // IMatcher(const IMatcher &) {}
69- IMatcher& operator = (const IMatcher&) { return *this; }
70- virtual ~IMatcher() {}
7170 virtual ::std::string WhichIs() const = 0;
7271 };
7372
@@ -84,7 +83,6 @@
8483 #define DECL_COMPARE_MATCHER(name, op) \
8584 template<typename T>class IUTEST_PP_CAT(name, Matcher): public IMatcher{ \
8685 public: explicit IUTEST_PP_CAT(name, Matcher)(const T& v) : m_expected(v) {}\
87- IUTEST_PP_CAT(name, Matcher)(const IUTEST_PP_CAT(name, Matcher) & rhs) : m_expected(rhs.m_expected) {}\
8886 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { \
8987 iu_global_format_stringstream strm; \
9088 strm << #name ": " << m_expected; return strm.str(); \
@@ -93,21 +91,17 @@
9391 if( actual op m_expected ) return AssertionSuccess(); \
9492 return AssertionFailure() << WhichIs(); \
9593 } \
96- private: IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(name, Matcher)); \
97- const T& m_expected; \
94+ private: const T& m_expected; \
9895 }
9996
10097 #define DECL_COMPARE_MATCHER2(name, op) \
10198 class IUTEST_PP_CAT(Twofold, IUTEST_PP_CAT(name, Matcher)): public IMatcher{ \
102- public: IUTEST_PP_CAT(Twofold, IUTEST_PP_CAT(name, Matcher))() {} \
103- IUTEST_PP_CAT(Twofold, IUTEST_PP_CAT(name, Matcher))(const IUTEST_PP_CAT(Twofold, IUTEST_PP_CAT(name, Matcher)) &) {}\
104- ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { return #name; } \
99+ public: ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { return #name; } \
105100 template<typename T, typename U>AssertionResult operator () \
106101 (const T& actual, const U& expected) const { \
107102 if( actual op expected ) return AssertionSuccess(); \
108103 return AssertionFailure() << WhichIs() << ": " << actual << " vs " << expected; \
109- } private: \
110- IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(Twofold, IUTEST_PP_CAT(name, Matcher)));\
104+ } \
111105 }
112106
113107
@@ -144,7 +138,7 @@
144138 iu_global_format_stringstream strm; strm << #name ": " << m_expected; \
145139 return strm.str(); \
146140 } \
147- private: IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(name, Matcher)); \
141+ private: \
148142 const T& m_expected; \
149143 }
150144
@@ -165,8 +159,6 @@
165159 class IsNullMatcher : public IMatcher
166160 {
167161 public:
168- IsNullMatcher() {}
169-public:
170162 template<typename U>
171163 AssertionResult operator ()(const U* actual) const
172164 {
@@ -180,8 +172,6 @@
180172 {
181173 return "Is Null";
182174 }
183-private:
184- IUTEST_PP_DISALLOW_ASSIGN(IsNullMatcher);
185175 };
186176
187177 /**
@@ -190,8 +180,6 @@
190180 class NotNullMatcher : public IMatcher
191181 {
192182 public:
193- NotNullMatcher() {}
194-public:
195183 template<typename U>
196184 AssertionResult operator ()(const U* actual) const
197185 {
@@ -205,8 +193,6 @@
205193 {
206194 return "Not Null";
207195 }
208-private:
209- IUTEST_PP_DISALLOW_ASSIGN(NotNullMatcher);
210196 };
211197
212198 /**
@@ -237,8 +223,6 @@
237223 return strm.str();
238224 }
239225 private:
240- IUTEST_PP_DISALLOW_ASSIGN(FloatingPointEqMatcher);
241-
242226 floating_point<T> m_expected;
243227 };
244228
@@ -270,8 +254,6 @@
270254 return strm.str();
271255 }
272256 private:
273- IUTEST_PP_DISALLOW_ASSIGN(NanSensitiveFloatingPointEqMatcher);
274-
275257 floating_point<T> m_expected;
276258 };
277259
@@ -282,13 +264,13 @@
282264 class StartsWithMatcher : public IMatcher
283265 {
284266 public:
285- explicit StartsWithMatcher(T str) : m_str(str) {}
267+ explicit StartsWithMatcher(T str) : m_expected(str) {}
286268
287269 public:
288270 template<typename U>
289271 AssertionResult operator ()(const U& actual) const
290272 {
291- if( StartsWith(actual, m_str) )
273+ if( StartsWith(actual, m_expected) )
292274 {
293275 return AssertionSuccess();
294276 }
@@ -299,7 +281,7 @@
299281 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE
300282 {
301283 iu_global_format_stringstream strm;
302- strm << "StartsWith: " << m_str;
284+ strm << "StartsWith: " << m_expected;
303285 return strm.str();
304286 }
305287 private:
@@ -323,9 +305,7 @@
323305 return StartsWith(actual, p);
324306 }
325307 private:
326- IUTEST_PP_DISALLOW_ASSIGN(StartsWithMatcher);
327-
328- T m_str;
308+ T m_expected;
329309 };
330310
331311 /**
@@ -336,7 +316,6 @@
336316 {
337317 public:
338318 explicit HasSubstrMatcher(T expected) : m_expected(expected) {}
339- HasSubstrMatcher(const HasSubstrMatcher & rhs) : m_expected(rhs.m_expected) {}
340319 public:
341320 template<typename U>
342321 AssertionResult operator ()(const U& actual) const
@@ -377,8 +356,6 @@
377356 }
378357
379358 private:
380- IUTEST_PP_DISALLOW_ASSIGN(HasSubstrMatcher);
381-
382359 T m_expected;
383360 };
384361
@@ -389,13 +366,13 @@
389366 class EndsWithMatcher : public IMatcher
390367 {
391368 public:
392- explicit EndsWithMatcher(T str) : m_str(str) {}
369+ explicit EndsWithMatcher(T str) : m_expected(str) {}
393370
394371 public:
395372 template<typename U>
396373 AssertionResult operator ()(const U& actual) const
397374 {
398- if( EndsWith(actual, m_str) )
375+ if( EndsWith(actual, m_expected) )
399376 {
400377 return AssertionSuccess();
401378 }
@@ -406,7 +383,7 @@
406383 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE
407384 {
408385 iu_global_format_stringstream strm;
409- strm << "EndsWith: " << m_str;
386+ strm << "EndsWith: " << m_expected;
410387 return strm.str();
411388 }
412389 private:
@@ -445,9 +422,7 @@
445422 return EndsWith(actual, p);
446423 }
447424 private:
448- IUTEST_PP_DISALLOW_ASSIGN(EndsWithMatcher);
449-
450- T m_str;
425+ T m_expected;
451426 };
452427
453428 /**
@@ -501,8 +476,6 @@
501476 return Equals(actual, p);
502477 }
503478 private:
504- IUTEST_PP_DISALLOW_ASSIGN(EqMatcher);
505-
506479 const T& m_expected;
507480 };
508481
@@ -523,8 +496,6 @@
523496 AssertionResult operator ()(const U&) const;
524497
525498 private:
526- IUTEST_PP_DISALLOW_ASSIGN(TypedEqMatcher);
527-
528499 T m_expected;
529500 };
530501
@@ -601,8 +572,6 @@
601572 }
602573
603574 private:
604- IUTEST_PP_DISALLOW_ASSIGN(ContainsMatcher);
605-
606575 T m_expected;
607576 };
608577
@@ -649,8 +618,6 @@
649618 }
650619
651620 private:
652- IUTEST_PP_DISALLOW_ASSIGN(EachMatcher);
653-
654621 T m_expected;
655622 };
656623
@@ -713,8 +680,6 @@
713680 }
714681
715682 private:
716- IUTEST_PP_DISALLOW_ASSIGN(ContainerEqMatcher);
717-
718683 const T& m_expected;
719684 ::std::string m_whichIs;
720685 };
@@ -779,8 +744,6 @@
779744 }
780745
781746 private:
782- IUTEST_PP_DISALLOW_ASSIGN(PointwiseMatcher);
783-
784747 M m_matcher;
785748 const T& m_expected;
786749 ::std::string m_whichIs;
@@ -792,9 +755,6 @@
792755 class IsEmptyMatcher : public IMatcher
793756 {
794757 public:
795- IsEmptyMatcher() {}
796-
797-public:
798758 template<typename U>
799759 AssertionResult operator ()(const U& actual)
800760 {
@@ -810,8 +770,6 @@
810770 {
811771 return "Is Empty";
812772 }
813-private:
814- IUTEST_PP_DISALLOW_ASSIGN(IsEmptyMatcher);
815773 };
816774
817775
@@ -857,8 +815,6 @@
857815 #endif
858816
859817 private:
860- IUTEST_PP_DISALLOW_ASSIGN(SizeIsMatcher);
861-
862818 T m_expected;
863819 };
864820
@@ -891,8 +847,6 @@
891847 }
892848
893849 private:
894- IUTEST_PP_DISALLOW_ASSIGN(AtMatcher);
895-
896850 size_t m_index;
897851 T m_expected;
898852 };
@@ -970,8 +924,6 @@
970924 }
971925
972926 private:
973- IUTEST_PP_DISALLOW_ASSIGN(ElementsAreArrayMatcher);
974-
975927 ::std::vector<T> m_expected;
976928 bool m_expected_elem_count;
977929 };
@@ -1057,7 +1009,6 @@
10571009 {
10581010 return StreamableToString(tuples::get<N>(matchers)) + ", " + WhichIs_<T, N + 1, LAST>(matchers);
10591011 }
1060- IUTEST_PP_DISALLOW_ASSIGN(ElementsAreMatcherBase);
10611012 };
10621013
10631014 #if IUTEST_HAS_VARIADIC_TEMPLATES
@@ -1106,8 +1057,6 @@
11061057 return ElementsAreMatcherBase::WhichIs<0>(m_matchers);
11071058 }
11081059 private:
1109- IUTEST_PP_DISALLOW_ASSIGN(ElementsAreMatcher);
1110-
11111060 tuples::tuple<T0, T1> m_matchers;
11121061 };
11131062 */
@@ -1121,7 +1070,7 @@
11211070 return Check(m_matchers, actual); } \
11221071 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { \
11231072 return ElementsAreMatcherBase::WhichIs<0>(m_matchers); } \
1124- private: IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(ElementsAreMatcher, n)); \
1073+ private: \
11251074 tuples::tuple< IUTEST_PP_ENUM_PARAMS(n, T) > m_matchers; \
11261075 }
11271076
@@ -1193,8 +1142,6 @@
11931142 #endif
11941143
11951144 private:
1196- IUTEST_PP_DISALLOW_ASSIGN(FieldMatcher);
1197-
11981145 const F& m_field;
11991146 T m_expected;
12001147 };
@@ -1250,8 +1197,6 @@
12501197 #endif
12511198
12521199 private:
1253- IUTEST_PP_DISALLOW_ASSIGN(PropertyMatcher);
1254-
12551200 const F& m_property;
12561201 T m_expected;
12571202 };
@@ -1285,8 +1230,6 @@
12851230 }
12861231
12871232 private:
1288- IUTEST_PP_DISALLOW_ASSIGN(KeyMatcher);
1289-
12901233 const T& m_expected;
12911234 };
12921235
@@ -1329,8 +1272,6 @@
13291272 }
13301273
13311274 private:
1332- IUTEST_PP_DISALLOW_ASSIGN(PairMatcher);
1333-
13341275 T1 m_m1;
13351276 T2 m_m2;
13361277 };
@@ -1370,8 +1311,6 @@
13701311 return static_cast<bool>(CastToMatcher(m_expected)((*m_func)(actual)));
13711312 }
13721313 private:
1373- IUTEST_PP_DISALLOW_ASSIGN(ResultOfMatcher);
1374-
13751314 F& m_func;
13761315 T m_expected;
13771316 };
@@ -1410,8 +1349,6 @@
14101349 return static_cast<bool>(CastToMatcher(m_expected)(*actual));
14111350 }
14121351 private:
1413- IUTEST_PP_DISALLOW_ASSIGN(PointeeMatcher);
1414-
14151352 T m_expected;
14161353 };
14171354
@@ -1444,8 +1381,6 @@
14441381 }
14451382
14461383 private:
1447- IUTEST_PP_DISALLOW_ASSIGN(NotMatcher);
1448-
14491384 T m_unexpected;
14501385 };
14511386
@@ -1456,9 +1391,6 @@
14561391 class AnyMatcher : public IMatcher
14571392 {
14581393 public:
1459- AnyMatcher() {}
1460- AnyMatcher(const AnyMatcher &) {}
1461-public:
14621394 AssertionResult operator ()(const T&) const
14631395 {
14641396 return AssertionSuccess();
@@ -1473,8 +1405,6 @@
14731405 strm << "A: " << detail::GetTypeName<T>();
14741406 return strm.str();
14751407 }
1476-private:
1477- IUTEST_PP_DISALLOW_ASSIGN(AnyMatcher);
14781408 };
14791409
14801410 /**
@@ -1484,7 +1414,6 @@
14841414 {
14851415 public:
14861416 AnythingMatcher() {}
1487- AnythingMatcher(const AnythingMatcher &) {}
14881417 public:
14891418 template<typename U>
14901419 AssertionResult operator ()(const U&) const
@@ -1497,8 +1426,6 @@
14971426 {
14981427 return "_";
14991428 }
1500-private:
1501- IUTEST_PP_DISALLOW_ASSIGN(AnythingMatcher);
15021429 };
15031430
15041431 #if IUTEST_HAS_MATCHER_REGEX
@@ -1549,8 +1476,6 @@
15491476 }
15501477
15511478 private:
1552- IUTEST_PP_DISALLOW_ASSIGN(RegexMatcher);
1553-
15541479 detail::iuRegex m_expected;
15551480 bool m_full_match;
15561481 };
@@ -1607,7 +1532,6 @@
16071532 {
16081533 return tuples::get<N>(matchers).WhichIs() + " and " + WhichIs_<T, N + 1, LAST>(matchers);
16091534 }
1610- IUTEST_PP_DISALLOW_ASSIGN(AllOfMatcherBase);
16111535 };
16121536
16131537 #if IUTEST_HAS_VARIADIC_TEMPLATES
@@ -1656,8 +1580,6 @@
16561580 return AllOfMatcherBase::WhichIs<0>(m_matchers);
16571581 }
16581582 private:
1659- IUTEST_PP_DISALLOW_ASSIGN(AllOfMatcher);
1660-
16611583 tuples::tuple<T0, T1> m_matchers;
16621584 };
16631585 */
@@ -1671,7 +1593,7 @@
16711593 return Check(m_matchers, actual); } \
16721594 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { \
16731595 return AllOfMatcherBase::WhichIs<0>(m_matchers); } \
1674- private: IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(AllOfMatcher, n)); \
1596+ private: \
16751597 tuples::tuple< IUTEST_PP_ENUM_PARAMS(n, T) > m_matchers; \
16761598 }
16771599
@@ -1737,8 +1659,6 @@
17371659 {
17381660 return tuples::get<N>(matchers).WhichIs() + " or " + WhichIs_<T, N + 1, LAST>(matchers);
17391661 }
1740-
1741- IUTEST_PP_DISALLOW_ASSIGN(AnyOfMatcherBase);
17421662 };
17431663
17441664 #if IUTEST_HAS_VARIADIC_TEMPLATES
@@ -1787,8 +1707,6 @@
17871707 return AnyOfMatcherBase::WhichIs<0>(m_matchers);
17881708 }
17891709 private:
1790- IUTEST_PP_DISALLOW_ASSIGN(AnyOfMatcher);
1791-
17921710 tuples::tuple<T0, T1> m_matchers;
17931711 };
17941712 */
@@ -1802,7 +1720,7 @@
18021720 return Check(m_matchers, actual); } \
18031721 ::std::string WhichIs() const IUTEST_CXX_OVERRIDE { \
18041722 return AnyOfMatcherBase::WhichIs<0>(m_matchers); } \
1805- private: IUTEST_PP_DISALLOW_ASSIGN(IUTEST_PP_CAT(AnyOfMatcher, n)); \
1723+ private: \
18061724 tuples::tuple< IUTEST_PP_ENUM_PARAMS(n, T) > m_matchers; \
18071725 }
18081726
@@ -1822,6 +1740,8 @@
18221740
18231741 #endif
18241742
1743+IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_END()
1744+
18251745 } // end of namespace detail
18261746
18271747 /**
--- trunk/include/iutest_ver.hpp (revision 1326)
+++ trunk/include/iutest_ver.hpp (revision 1327)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01160400u //!< iutest version 1.16.4.0
20+#define IUTEST_VER 0x01160406u //!< iutest version 1.16.4.6
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x16u //!< Minor Version
2323 #define IUTEST_MICROVER 0x04u //!< Micro Version
24-#define IUTEST_REVISION 0x00u //!< Revision
24+#define IUTEST_REVISION 0x06u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
@@ -120,6 +120,14 @@
120120 * @page CHANGELOG 変更履歴
121121 * @par Changes
122122 <ul>
123+ <li>v1.16.5.0
124+ <ul>
125+ <li>ad_hoc_testresult の取得関数名を ad_hoc_test_result に変更</li>
126+ <li>compatibility: iuutil に ad_hoc_testresult の取得関数を追加</li>
127+ <li>iuwandbox で std-cxx の指定をするとオプションチェックで失敗する不具合を修正</li>
128+ <li></li>
129+ </ul>
130+ </li>
123131 <li>v1.16.4.0
124132 <ul>
125133 <li>deprecated: IUTEST_IGNORE 関係を非推奨にしました</li>
--- trunk/include/util/iutest_util_tests.hpp (revision 1326)
+++ trunk/include/util/iutest_util_tests.hpp (revision 1327)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -295,6 +295,70 @@
295295 return NULL;
296296 }
297297
298+/**
299+ * @private
300+*/
301+inline const ::iutest::TestResult* TestResultPointer(const ::iutest::TestResult* result)
302+{
303+ return result;
304+}
305+/**
306+ * @private
307+*/
308+inline const ::iutest::TestResult* TestResultPointer(const ::iutest::TestResult& result)
309+{
310+ return &result;
311+}
312+
313+/**
314+ * @brief ad_hoc_test_result の取得
315+*/
316+inline const ::iutest::TestResult* GetAdHocTestResult()
317+{
318+#if !defined(IUTEST_NO_UNITEST_AD_HOC_TEST_RESULT_ACCESSOR)
319+ return TestResultPointer(::iutest::UnitTest::GetInstance()->ad_hoc_test_result());
320+#else
321+ return NULL;
322+#endif
323+}
324+
325+/**
326+ * @brief TestCase の ad_hoc_test_result の取得
327+*/
328+inline const ::iutest::TestResult* GetTestCaseAdHocResult(const ::iutest::TestCase* test_case)
329+{
330+#if !defined(IUTEST_NO_TESTCASE_AD_HOC_TEST_RESULT_ACCESSOR)
331+ return TestResultPointer(test_case->ad_hoc_test_result());
332+#else
333+ IUTEST_UNUSED_VAR(test_case);
334+ return GetAdHocTestResult();
335+#endif
336+}
337+
338+/**
339+ * @brief TestCase の ad_hoc_test_result の取得
340+*/
341+inline const ::iutest::TestResult* GetCurrentTestCaseAdHocResult()
342+{
343+ return GetTestCaseAdHocResult(::iutest::UnitTest::GetInstance()->current_test_case());
344+}
345+
346+/**
347+ * @brief get test result
348+*/
349+inline const ::iutest::TestResult* GetTestResult(const ::iutest::TestInfo* test_info)
350+{
351+ return TestResultPointer(test_info->result());
352+}
353+
354+/**
355+ * @brief get test result
356+*/
357+inline const ::iutest::TestResult* GetCurrentTestResult()
358+{
359+ return GetTestResult(::iutest::UnitTest::GetInstance()->current_test_info());
360+}
361+
298362 } // end of namespace iuutil
299363
300364 #endif // INCG_IRIS_IUTEST_UTIL_TESTS_HPP_4095FF9B_D6B8_4CD3_BF86_43DFED1760EA_
--- trunk/test/gtest_version_tests.cpp (revision 1326)
+++ trunk/test/gtest_version_tests.cpp (revision 1327)
@@ -18,6 +18,11 @@
1818
1919 #if defined(IUTEST_USE_GTEST)
2020
21+IUTEST(GTest, Print)
22+{
23+ IUTEST_SUCCEED() << GTEST_VER;
24+}
25+
2126 #if defined(GTEST_EXPECT_VER)
2227
2328 IUTEST(GTest, Version)
@@ -41,6 +46,11 @@
4146
4247 #if defined(IUTEST_USE_GMOCK)
4348
49+IUTEST(GMock, Print)
50+{
51+ IUTEST_SUCCEED() << GMOCK_VER;
52+}
53+
4454 #if !defined(GMOCK_EXPECT_VER) && defined(GTEST_EXPECT_VER)
4555 # define GMOCK_EXPECT_VER GTEST_EXPECT_VER
4656 #endif
--- trunk/test/matcher_tests.cpp (revision 1326)
+++ trunk/test/matcher_tests.cpp (revision 1327)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -92,7 +92,9 @@
9292
9393 IUTEST(Matcher, TypedEq)
9494 {
95+ int v=0;
9596 IUTEST_EXPECT_THAT(1, TypedEq<int>(1));
97+ IUTEST_EXPECT_THAT(&v, TypedEq<int*>(&v));
9698 }
9799
98100 IUTEST(Matcher, FloatEq)
--- trunk/test/record_property_tests.cpp (revision 1326)
+++ trunk/test/record_property_tests.cpp (revision 1327)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2013-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2013-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -18,13 +18,15 @@
1818 #include "iutest.hpp"
1919 #include "../include/iutest_spi.hpp"
2020
21-#if !defined(IUTEST_USE_GTEST)
2221 #if !IUTEST_HAS_ASSERTION_RETURN
2322 void CheckProperty_(const ::iutest::TestResult* tr, const char* key, const char* value)
2423 {
25- IUTEST_ASSERT_EQ(1, tr->test_property_count());
26- IUTEST_EXPECT_STREQ(key, tr->GetTestProperty(0).key());
27- IUTEST_EXPECT_STREQ(value, tr->GetTestProperty(0).value());
24+ if( tr != NULL )
25+ {
26+ IUTEST_ASSERT_EQ(1, tr->test_property_count());
27+ IUTEST_EXPECT_STREQ(key, tr->GetTestProperty(0).key());
28+ IUTEST_EXPECT_STREQ(value, tr->GetTestProperty(0).value());
29+ }
2830 }
2931 #endif
3032
@@ -35,9 +37,12 @@
3537 #endif
3638
3739 #if IUTEST_HAS_ASSERTION_RETURN
38- IUTEST_ASSERT_EQ(1, tr->test_property_count()) << ::iutest::AssertionReturn<bool>(false);
39- IUTEST_EXPECT_STREQ(key, tr->GetTestProperty(0).key()) << ::iutest::AssertionReturn<bool>(false);
40- IUTEST_EXPECT_STREQ(value, tr->GetTestProperty(0).value()) << ::iutest::AssertionReturn<bool>(false);
40+ if( tr != NULL )
41+ {
42+ IUTEST_ASSERT_EQ(1, tr->test_property_count()) << ::iutest::AssertionReturn<bool>(false);
43+ IUTEST_EXPECT_STREQ(key, tr->GetTestProperty(0).key()) << ::iutest::AssertionReturn<bool>(false);
44+ IUTEST_EXPECT_STREQ(value, tr->GetTestProperty(0).value()) << ::iutest::AssertionReturn<bool>(false);
45+ }
4146 #else
4247 CheckProperty_(tr, key, value);
4348 #endif
@@ -64,7 +69,7 @@
6469 IUTEST_EXPECT_NONFATAL_FAILURE( RecordProperty("errors" , "A"), "Reserved key");
6570 IUTEST_EXPECT_NONFATAL_FAILURE( RecordProperty("time" , "A"), "Reserved key");
6671 #endif
67- CheckProperty(::iutest::UnitTest::GetInstance()->current_test_case()->ad_hoc_testresult(), "foo", "A");
72+ CheckProperty(::iuutil::GetCurrentTestCaseAdHocResult(), "foo", "A");
6873 }
6974 };
7075
@@ -80,15 +85,13 @@
8085 IUTEST_EXPECT_NONFATAL_FAILURE( RecordProperty("type_param" , "B"), "Reserved key");
8186 IUTEST_EXPECT_NONFATAL_FAILURE( RecordProperty("value_param", "B"), "Reserved key");
8287 #endif
83- CheckProperty(::iutest::UnitTest::GetInstance()->current_test_info()->result(), "hoge", "B");
88+ CheckProperty(::iuutil::GetCurrentTestResult(), "hoge", "B");
8489
8590 // overwrite
8691 RecordProperty("hoge", "b");
87- CheckProperty(::iutest::UnitTest::GetInstance()->current_test_info()->result(), "hoge", "b");
92+ CheckProperty(::iuutil::GetCurrentTestResult(), "hoge", "b");
8893 }
8994
90-#endif
91-
9295 #ifdef UNICODE
9396 int wmain(int argc, wchar_t* argv[])
9497 #else
@@ -113,24 +116,41 @@
113116 {
114117 const int ret = IUTEST_RUN_ALL_TESTS();
115118 if( ret != 0 ) return 1;
116-#if !defined(IUTEST_USE_GTEST)
117- if( !CheckProperty(::iutest::UnitTest::GetInstance()->ad_hoc_testresult(), "bar", "C") )
119+#if !defined(IUTEST_NO_RECORDPROPERTY_OUTSIDE_TESTMETHOD_LIFESPAN)
120+ if( !CheckProperty(iuutil::GetAdHocTestResult(), "bar", "C") )
121+ {
122+ printf("ad hoc test result is not recorded\n");
118123 return 1;
124+ }
119125 #endif
120126 }
121-#if !defined(IUTEST_USE_GTEST)
127+#if !defined(IUTEST_NO_RECORDPROPERTY_OUTSIDE_TESTMETHOD_LIFESPAN)
122128 {
123129 const int ret = IUTEST_RUN_ALL_TESTS();
124130 if( ret != 0 ) return 1;
125- if( !CheckProperty(::iutest::UnitTest::GetInstance()->ad_hoc_testresult(), "bar", "C") )
131+ if( !CheckProperty(iuutil::GetAdHocTestResult(), "bar", "C") )
132+ {
133+ printf("ad hoc test result is cleared?\n");
126134 return 1;
135+ }
127136 }
128137 {
129138 IUTEST_INIT(&argc, argv);
130139 const int ret = IUTEST_RUN_ALL_TESTS();
131140 if( ret != 0 ) return 1;
132- if( CheckProperty(::iutest::UnitTest::GetInstance()->ad_hoc_testresult(), "bar", "C") )
141+#if !defined(IUTEST_USE_GTEST)
142+ if( CheckProperty(iuutil::GetAdHocTestResult(), "bar", "C") )
143+ {
144+ printf("ad hoc test result is not cleared?\n");
133145 return 1;
146+ }
147+#else
148+ if( !CheckProperty(iuutil::GetAdHocTestResult(), "bar", "C") )
149+ {
150+ printf("ad hoc test result is cleared? (iutest expect)\n");
151+ return 1;
152+ }
153+#endif
134154 }
135155 #endif
136156 printf("*** Successful ***\n");
Show on old repository browser