Merge remote-tracking branch 'origin/develop'
git@6d0e3f3a34a7c8ec6cd2a6c9519bee396ff4a8d9
https://github.com/srz-zumix/iutest/commit/6d0e3f3a34a7c8ec6cd2a6c9519bee396ff4a8d9
@@ -6,6 +6,9 @@ | ||
6 | 6 | |
7 | 7 | * Improved |
8 | 8 | |
9 | +* Changes | |
10 | + * deprecated: IUTEST_USE_OWN_LIST | |
11 | + | |
9 | 12 | * Bug fixes |
10 | 13 | |
11 | 14 | -------------------------------------------------- |
@@ -1,4 +1,4 @@ | ||
1 | -[![Travis-CI Build Status](https://travis-ci.org/srz-zumix/iutest.svg?branch=master)](https://travis-ci.org/srz-zumix/iutest) | |
1 | +[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest) | |
2 | 2 | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/master) |
3 | 3 | [![Coverity Scan Build Status](https://scan.coverity.com/projects/1316/badge.svg)](https://scan.coverity.com/projects/srz-zumix-iutest) |
4 | 4 | [![Codeship Status for srz-zumix/iutest](https://codeship.com/projects/5bc87030-5b41-0133-6000-4242aa07dce3/status?branch=master)](https://codeship.com/projects/110695) |
@@ -103,7 +103,7 @@ | ||
103 | 103 | |
104 | 104 | |CI|master|develop|Tests| |
105 | 105 | |:--|:--|:--|:--| |
106 | -|Travis CI |[![Travis-CI Build Status](https://travis-ci.org/srz-zumix/iutest.svg?branch=master)](https://travis-ci.org/srz-zumix/iutest)|[![Travis-CI Build Status](https://travis-ci.org/srz-zumix/iutest.svg?branch=develop)](https://travis-ci.org/srz-zumix/iutest)|Basic tests, Google Test compatibility, Coverage, Coverity-scan| | |
106 | +|Travis CI |[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest)|[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=develop)](https://travis-ci.com/srz-zumix/iutest)|Basic tests, Google Test compatibility, Coverage, Coverity-scan| | |
107 | 107 | |AppVeyor |[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/master)|[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/develop?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/develop)|Windows, Visual Studio, Cygwin, MINGW, NuGet| |
108 | 108 | | |[![AppVeyor Build PREFAST status](https://ci.appveyor.com/api/projects/status/0w0wuhc58kre178q/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest-xsqun/branch/master)|[![AppVeyor Build PREFAST status](https://ci.appveyor.com/api/projects/status/0w0wuhc58kre178q/branch/develop?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest-xsqun/branch/develop)|Visual Studio PREFAST (Code Analysis)| |
109 | 109 | |Wercker |[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/develop "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|Syntax tests for compiler each version| |
@@ -42,11 +42,23 @@ | ||
42 | 42 | docker_image_tag: "latest" |
43 | 43 | execute_commands: |
44 | 44 | - "cd test" |
45 | - - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01080000 GTEST_EXPECT_LATEST=1 gtest-version" | |
46 | - - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01080000 GTEST_EXPECT_LATEST=1 gtest-version" | |
45 | + - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01080100 GTEST_EXPECT_LATEST=1 gtest-version" | |
46 | + - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01080100 GTEST_EXPECT_LATEST=1 gtest-version" | |
47 | 47 | mount_filesystem_path: "/buddy/iutest" |
48 | 48 | shell: "SH" |
49 | 49 | trigger_condition: "ALWAYS" |
50 | + - action: "release-1.8.1" | |
51 | + type: "BUILD" | |
52 | + working_directory: "/buddy/iutest" | |
53 | + docker_image_name: "srzzumix/googletest" | |
54 | + docker_image_tag: "release-1.8.1" | |
55 | + execute_commands: | |
56 | + - "cd test" | |
57 | + - "make USE_GTEST=1 GTEST_EXPECT_VER=0x01080100 gtest-version" | |
58 | + - "make USE_GTEST=1 USE_GMOCK=1 GTEST_EXPECT_VER=0x01080100 gtest-version" | |
59 | + mount_filesystem_path: "/buddy/iutest" | |
60 | + shell: "SH" | |
61 | + trigger_condition: "ALWAYS" | |
50 | 62 | - action: "release-1.8.0" |
51 | 63 | type: "BUILD" |
52 | 64 | working_directory: "/buddy/iutest" |
@@ -32,7 +32,7 @@ | ||
32 | 32 | |
33 | 33 | //!< Minor Version |
34 | 34 | #ifndef GMOCK_MINORVER |
35 | -# if defined(GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_) | |
35 | +# if !defined(GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_) | |
36 | 36 | # define GMOCK_MINORVER 0x08 |
37 | 37 | # define GMOCK_LATEST 1 |
38 | 38 | # elif defined(GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_) |
@@ -50,8 +50,19 @@ | ||
50 | 50 | # endif |
51 | 51 | #endif |
52 | 52 | |
53 | +//!< Micro Version | |
54 | +#ifndef GMOCK_MICROVER | |
55 | +# if GMOCK_MICROVER == 0x08 && defined(GMOCK_INCLUDE_GMOCK_MORE_MATCHERS_H_) | |
56 | +# define GMOCK_MICROVER 0x01 | |
57 | +# endif | |
58 | +#endif | |
59 | + | |
60 | +#ifndef GMOCK_MICROVER | |
61 | +# define GMOCK_MICROVER 0x00 | |
62 | +#endif | |
63 | + | |
53 | 64 | #ifndef GMOCK_BUILD |
54 | -# define GMOCK_BUILD 0x00 //!< Build | |
65 | +# define GMOCK_BUILD GMOCK_MICROVER //!< @deprecated | |
55 | 66 | #endif |
56 | 67 | |
57 | 68 | #ifndef GMOCK_REVISION |
@@ -61,13 +72,13 @@ | ||
61 | 72 | #ifndef GMOCK_VER |
62 | 73 | # define GMOCK_VER ((GMOCK_MAJORVER<<24) \ |
63 | 74 | |(GMOCK_MINORVER<<16) \ |
64 | - |(GMOCK_BUILD<<8) \ | |
75 | + |(GMOCK_MICROVER<<8) \ | |
65 | 76 | |(GMOCK_REVISION<<0) \ |
66 | - ) //!< google test version | |
77 | + ) //!< google mock version | |
67 | 78 | #endif |
68 | 79 | |
69 | 80 | #if !defined(GMOCK_LATEST) |
70 | -# define GMOCK_LATEST 0 //!< google test development latest version | |
81 | +# define GMOCK_LATEST 0 //!< google mock development latest version | |
71 | 82 | #endif |
72 | 83 | |
73 | 84 | #endif |
@@ -32,7 +32,7 @@ | ||
32 | 32 | |
33 | 33 | //!< Minor Version |
34 | 34 | #ifndef GTEST_MINORVER |
35 | -# if defined(GTEST_STRINGIFY_) | |
35 | +# if !defined(GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_) | |
36 | 36 | # define GTEST_MINORVER 0x08 |
37 | 37 | # define GTEST_LATEST 1 |
38 | 38 | # elif defined(GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_) |
@@ -58,16 +58,20 @@ | ||
58 | 58 | |
59 | 59 | //!< Micro Version |
60 | 60 | #ifndef GTEST_MICROVER |
61 | -# if GTEST_MINORVER == 0x02 && defined(GTEST_HAS_CLONE) | |
61 | +# if GTEST_MINORVER == 0x08 && defined(GTEST_STRINGIFY_) | |
62 | +# define GTEST_MICROVER 0x01 | |
63 | +# elif GTEST_MINORVER == 0x02 && defined(GTEST_HAS_CLONE) | |
62 | 64 | # define GTEST_MICROVER 0x01 |
63 | 65 | # elif GTEST_MINORVER == 0x00 |
64 | 66 | // 判断難しい |
65 | 67 | # define GTEST_MICROVER 0x01 |
66 | -# else | |
67 | -# define GTEST_MICROVER 0x00 | |
68 | 68 | # endif |
69 | 69 | #endif |
70 | 70 | |
71 | +#ifndef GTEST_MICROVER | |
72 | +# define GTEST_MICROVER 0x00 | |
73 | +#endif | |
74 | + | |
71 | 75 | #ifndef GTEST_BUILD |
72 | 76 | # define GTEST_BUILD GTEST_MICROVER //!< @deprecated |
73 | 77 | #endif |
@@ -276,7 +276,7 @@ | ||
276 | 276 | // tuple |
277 | 277 | namespace tuples |
278 | 278 | { |
279 | -#if GTEST_HAS_STD_TUPLE_ | |
279 | +#if GTEST_VER >= 0x01090000 || GTEST_LATEST || (defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_) | |
280 | 280 | using ::std::tuple; |
281 | 281 | using ::std::tuple_size; |
282 | 282 | using ::std::tuple_element; |
@@ -30,8 +30,11 @@ | ||
30 | 30 | class UnitTestImpl |
31 | 31 | { |
32 | 32 | protected: |
33 | +#if IUTEST_USE_OWN_LIST | |
33 | 34 | typedef detail::iu_list<TestCase> iuTestCases; |
34 | - //typedef ::std::vector<TestCase*> iuTestCases; | |
35 | +#else | |
36 | + typedef ::std::vector<TestCase*> iuTestCases; | |
37 | +#endif | |
35 | 38 | typedef ::std::vector<Environment*> iuEnvironmentList; |
36 | 39 | protected: |
37 | 40 | UnitTestImpl() : m_total_test_num(0), m_disable_num(0), m_should_run_num(0) |
@@ -17,8 +17,12 @@ | ||
17 | 17 | |
18 | 18 | //====================================================================== |
19 | 19 | // include |
20 | -#ifdef _IUTEST_DEBUG | |
21 | -#include <assert.h> | |
20 | +#if IUTEST_USE_OWN_LIST | |
21 | +# ifdef _IUTEST_DEBUG | |
22 | +# include <assert.h> | |
23 | +# endif | |
24 | +#else | |
25 | +# include <list> | |
22 | 26 | #endif |
23 | 27 | |
24 | 28 | namespace iutest { |
@@ -25,6 +29,8 @@ | ||
25 | 29 | namespace detail |
26 | 30 | { |
27 | 31 | |
32 | +#if IUTEST_USE_OWN_LIST | |
33 | + | |
28 | 34 | //====================================================================== |
29 | 35 | // class |
30 | 36 | /** |
@@ -80,7 +86,7 @@ | ||
80 | 86 | _Myt& operator ++ () { m_node = m_node->next; return *this; } |
81 | 87 | _Myt& operator -- () { m_node = m_node->prev; return *this; } |
82 | 88 | value_ptr operator -> () IUTEST_CXX_NOEXCEPT_SPEC { return ptr(); } |
83 | - value_ref operator * () IUTEST_CXX_NOEXCEPT_SPEC { return *m_node; } | |
89 | + value_ptr operator * () IUTEST_CXX_NOEXCEPT_SPEC { return m_node; } | |
84 | 90 | value_ptr ptr() const IUTEST_CXX_NOEXCEPT_SPEC { return m_node; } |
85 | 91 | |
86 | 92 | operator value_ptr () { return ptr(); } |
@@ -225,7 +231,7 @@ | ||
225 | 231 | p->prev = prev; |
226 | 232 | } |
227 | 233 | // 削除 |
228 | - void erase(node_ptr p) | |
234 | + void remove(node_ptr p) | |
229 | 235 | { |
230 | 236 | if( p == NULL ) |
231 | 237 | { |
@@ -255,7 +261,7 @@ | ||
255 | 261 | } |
256 | 262 | void erase(iterator it) |
257 | 263 | { |
258 | - erase(it.ptr()); | |
264 | + remove(it.ptr()); | |
259 | 265 | } |
260 | 266 | public: |
261 | 267 | /** |
@@ -444,6 +450,9 @@ | ||
444 | 450 | #endif |
445 | 451 | }; |
446 | 452 | |
453 | +#endif | |
454 | + | |
455 | + | |
447 | 456 | IUTEST_PRAGMA_WARN_PUSH() |
448 | 457 | IUTEST_PRAGMA_WARN_DISABLE_NOEXCEPT_TPYE() |
449 | 458 |
@@ -455,29 +464,32 @@ | ||
455 | 464 | { |
456 | 465 | r.shuffle(begin, last); |
457 | 466 | } |
458 | - | |
467 | +#if IUTEST_USE_OWN_LIST | |
459 | 468 | template<typename Node, typename Fn> |
460 | 469 | void RandomShuffle(iu_list<Node>& list, Fn& r) |
461 | 470 | { |
462 | 471 | list.shuffle(r); |
463 | 472 | } |
464 | -template<typename Node, typename Fn> | |
465 | -void RandomShuffle(::std::vector<Node>& list, Fn& r) | |
473 | +#endif | |
474 | +template<typename T, typename Fn> | |
475 | +void RandomShuffle(::std::vector<T>& list, Fn& r) | |
466 | 476 | { |
467 | 477 | RandomShuffle(list.begin(), list.end(), r); |
468 | 478 | } |
469 | 479 | |
480 | +#if IUTEST_USE_OWN_LIST | |
470 | 481 | template<typename Node, typename Fn> |
471 | 482 | Node* FindList(const iu_list<Node>& list, Fn& f) |
472 | 483 | { |
473 | 484 | return list.find(f); |
474 | 485 | } |
475 | -template<typename Node, typename Fn> | |
476 | -Node FindList(const ::std::vector<Node>& list, Fn& f) | |
486 | +#else | |
487 | +template<typename T, typename Fn> | |
488 | +T FindList(const ::std::vector<T>& list, Fn& f) | |
477 | 489 | { |
478 | - for( typename ::std::vector<Node>::const_iterator it=list.begin(), end=list.end(); it != end; ++it ) | |
490 | + for(typename ::std::vector<T>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) | |
479 | 491 | { |
480 | - if( f(*it) ) | |
492 | + if(f(*it)) | |
481 | 493 | { |
482 | 494 | return *it; |
483 | 495 | } |
@@ -484,10 +496,14 @@ | ||
484 | 496 | } |
485 | 497 | return NULL; |
486 | 498 | } |
499 | +#endif | |
487 | 500 | |
501 | + | |
488 | 502 | /** |
489 | 503 | * @brief 条件に合う要素数をカウント |
490 | 504 | */ |
505 | +#if IUTEST_USE_OWN_LIST | |
506 | + | |
491 | 507 | template<typename Node, typename Fn> |
492 | 508 | int CountIf(const iu_list<Node>& list, Fn f) |
493 | 509 | { |
@@ -494,7 +510,7 @@ | ||
494 | 510 | int count = 0; |
495 | 511 | for( typename iu_list<Node>::const_iterator it = list.begin(), end=list.end(); it != end; ++it ) |
496 | 512 | { |
497 | - if( f(it) ) | |
513 | + if( f(*it) ) | |
498 | 514 | { |
499 | 515 | ++count; |
500 | 516 | } |
@@ -502,9 +518,30 @@ | ||
502 | 518 | return count; |
503 | 519 | } |
504 | 520 | |
521 | +#else | |
522 | + | |
523 | +template<typename T, typename Fn> | |
524 | +int CountIf(const ::std::vector<T>& list, Fn f) | |
525 | +{ | |
526 | + int count = 0; | |
527 | + for(typename ::std::vector<T>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) | |
528 | + { | |
529 | + if(f(*it)) | |
530 | + { | |
531 | + ++count; | |
532 | + } | |
533 | + } | |
534 | + return count; | |
535 | +} | |
536 | + | |
537 | +#endif | |
538 | + | |
539 | + | |
505 | 540 | /** |
506 | 541 | * @brief リストの示す値の総和 |
507 | 542 | */ |
543 | +#if IUTEST_USE_OWN_LIST | |
544 | + | |
508 | 545 | template<typename Node, typename Fn> |
509 | 546 | int SumOverList(const iu_list<Node>& list, Fn f) |
510 | 547 | { |
@@ -511,14 +548,32 @@ | ||
511 | 548 | int count = 0; |
512 | 549 | for( typename iu_list<Node>::const_iterator it = list.begin(), end=list.end(); it != end; ++it ) |
513 | 550 | { |
514 | - count += ((*it).*f)(); | |
551 | + count += ((*it)->*f)(); | |
515 | 552 | } |
516 | 553 | return count; |
517 | 554 | } |
518 | 555 | |
556 | +#else | |
557 | + | |
558 | +template<typename T, typename Fn> | |
559 | +int SumOverList(const ::std::vector<T>& list, Fn f) | |
560 | +{ | |
561 | + int count = 0; | |
562 | + for(typename ::std::vector<T>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) | |
563 | + { | |
564 | + count += ((*it)->*f)(); | |
565 | + } | |
566 | + return count; | |
567 | +} | |
568 | + | |
569 | +#endif | |
570 | + | |
571 | + | |
519 | 572 | /** |
520 | 573 | * @brief リストの示す真の総和 |
521 | 574 | */ |
575 | +#if IUTEST_USE_OWN_LIST | |
576 | + | |
522 | 577 | template<typename Node, typename Fn> |
523 | 578 | int CountIfOverList(const iu_list<Node>& list, Fn f) |
524 | 579 | { |
@@ -525,7 +580,7 @@ | ||
525 | 580 | int count = 0; |
526 | 581 | for( typename iu_list<Node>::const_iterator it = list.begin(), end=list.end(); it != end; ++it ) |
527 | 582 | { |
528 | - if( ((*it).*f)() ) | |
583 | + if( ((*it)->*f)() ) | |
529 | 584 | { |
530 | 585 | ++count; |
531 | 586 | } |
@@ -533,15 +588,35 @@ | ||
533 | 588 | return count; |
534 | 589 | } |
535 | 590 | |
591 | +#else | |
592 | + | |
593 | +template<typename T, typename Fn> | |
594 | +int CountIfOverList(const ::std::vector<T>& list, Fn f) | |
595 | +{ | |
596 | + int count = 0; | |
597 | + for(typename ::std::vector<T>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) | |
598 | + { | |
599 | + if(((*it)->*f)()) | |
600 | + { | |
601 | + ++count; | |
602 | + } | |
603 | + } | |
604 | + return count; | |
605 | +} | |
606 | + | |
607 | +#endif | |
608 | + | |
536 | 609 | /** |
537 | 610 | * @brief 条件に合う要素があるかどうか |
538 | 611 | */ |
612 | +#if IUTEST_USE_OWN_LIST | |
613 | + | |
539 | 614 | template<typename Node, typename Fn> |
540 | 615 | bool AnyOverList(const iu_list<Node>& list, Fn f) |
541 | 616 | { |
542 | 617 | for( typename iu_list<Node>::const_iterator it = list.begin(), end=list.end(); it != end; ++it ) |
543 | 618 | { |
544 | - if( ((*it).*f)() ) | |
619 | + if( ((*it)->*f)() ) | |
545 | 620 | { |
546 | 621 | return true; |
547 | 622 | } |
@@ -549,6 +624,23 @@ | ||
549 | 624 | return false; |
550 | 625 | } |
551 | 626 | |
627 | +#else | |
628 | + | |
629 | +template<typename T, typename Fn> | |
630 | +bool AnyOverList(const ::std::vector<T>& list, Fn f) | |
631 | +{ | |
632 | + for(typename ::std::vector<T>::const_iterator it = list.begin(), end = list.end(); it != end; ++it) | |
633 | + { | |
634 | + if(((*it)->*f)()) | |
635 | + { | |
636 | + return true; | |
637 | + } | |
638 | + } | |
639 | + return false; | |
640 | +} | |
641 | + | |
642 | +#endif | |
643 | + | |
552 | 644 | IUTEST_PRAGMA_WARN_POP() |
553 | 645 | |
554 | 646 | } // end of namespace detail |
@@ -202,8 +202,11 @@ | ||
202 | 202 | |
203 | 203 | public: |
204 | 204 | /** @private */ |
205 | - class ScopedMessage : public detail::iu_list_node<ScopedMessage> | |
206 | - , public detail::iuCodeMessage | |
205 | + class ScopedMessage | |
206 | + : public detail::iuCodeMessage | |
207 | +#if IUTEST_USE_OWN_LIST | |
208 | + , public detail::iu_list_node<ScopedMessage> | |
209 | +#endif | |
207 | 210 | { |
208 | 211 | public: |
209 | 212 | ScopedMessage(const detail::iuCodeMessage& msg) // NOLINT |
@@ -213,7 +216,7 @@ | ||
213 | 216 | } |
214 | 217 | ~ScopedMessage() |
215 | 218 | { |
216 | - ScopedTrace::GetInstance().list.erase(this); | |
219 | + ScopedTrace::GetInstance().list.remove(this); | |
217 | 220 | } |
218 | 221 | }; |
219 | 222 | private: |
@@ -220,13 +223,17 @@ | ||
220 | 223 | class ScopedTrace |
221 | 224 | { |
222 | 225 | public: |
226 | +#if IUTEST_USE_OWN_LIST | |
223 | 227 | typedef detail::iu_list<ScopedMessage> msg_list; |
228 | +#else | |
229 | + typedef ::std::list<ScopedMessage*> msg_list; | |
230 | +#endif | |
224 | 231 | msg_list list; |
225 | 232 | static ScopedTrace& GetInstance() { static ScopedTrace inst; return inst; } |
226 | 233 | public: |
227 | 234 | void append_message(TestPartResult& part_result) |
228 | 235 | { |
229 | - if( list.count() ) | |
236 | + if( list.size() ) | |
230 | 237 | { |
231 | 238 | part_result.add_message("\niutest trace:"); |
232 | 239 | for( msg_list::iterator it = list.begin(), end=list.end(); it != end; ++it ) |
@@ -234,7 +241,7 @@ | ||
234 | 241 | // TODO : 追加メッセージとして保存するべき |
235 | 242 | // 現状はテスト結果のメッセージに追加している。 |
236 | 243 | part_result.add_message("\n"); |
237 | - part_result.add_message(it->make_message().c_str()); | |
244 | + part_result.add_message((*it)->make_message().c_str()); | |
238 | 245 | } |
239 | 246 | } |
240 | 247 | } |
@@ -28,11 +28,18 @@ | ||
28 | 28 | * @brief テストケース |
29 | 29 | */ |
30 | 30 | class TestCase |
31 | +#if IUTEST_USE_OWN_LIST | |
31 | 32 | : public detail::iu_list_node<TestCase> |
33 | +#endif | |
32 | 34 | { |
33 | 35 | protected: |
34 | - typedef detail::iu_list<TestInfo> iuTestInfos; //!< TestInfo リスト | |
35 | - //typedef ::std::vector<TestInfo*> iuTestInfos; //!< TestInfo リスト | |
36 | + //! TestInfo リスト | |
37 | +#if IUTEST_USE_OWN_LIST | |
38 | + typedef detail::iu_list<TestInfo> iuTestInfos; | |
39 | +#else | |
40 | + typedef ::std::vector<TestInfo*> iuTestInfos; | |
41 | +#endif | |
42 | + | |
36 | 43 | protected: |
37 | 44 | /** |
38 | 45 | * @brief コンストラクタ |
@@ -640,6 +640,20 @@ | ||
640 | 640 | |
641 | 641 | |
642 | 642 | /** |
643 | + * @brief テストの所持を独自リストクラスで行う | |
644 | + * @deprecated | |
645 | +*/ | |
646 | +#if !defined(IUTEST_USE_OWN_LIST) | |
647 | +# if defined(IUTEST_NO_TEMPLATE_TEMPLATES) | |
648 | +# define IUTEST_USE_OWN_LIST 1 | |
649 | +# endif | |
650 | +#endif | |
651 | + | |
652 | +#if !defined(IUTEST_USE_OWN_LIST) | |
653 | +# define IUTEST_USE_OWN_LIST 0 | |
654 | +#endif | |
655 | + | |
656 | +/** | |
643 | 657 | * @} |
644 | 658 | */ |
645 | 659 |
@@ -29,7 +29,9 @@ | ||
29 | 29 | * @brief テスト情報クラス |
30 | 30 | */ |
31 | 31 | class TestInfo |
32 | +#if IUTEST_USE_OWN_LIST | |
32 | 33 | : public detail::iu_list_node<TestInfo> |
34 | +#endif | |
33 | 35 | { |
34 | 36 | public: |
35 | 37 | /** |
@@ -17,11 +17,11 @@ | ||
17 | 17 | |
18 | 18 | //====================================================================== |
19 | 19 | // define |
20 | -#define IUTEST_VER 0x01169903u //!< iutest version 1.16.99.3 | |
20 | +#define IUTEST_VER 0x01169905u //!< iutest version 1.16.99.5 | |
21 | 21 | #define IUTEST_MAJORVER 0x01u //!< Major Version |
22 | 22 | #define IUTEST_MINORVER 0x16u //!< Minor Version |
23 | 23 | #define IUTEST_MICROVER 0x99u //!< Micro Version |
24 | -#define IUTEST_REVISION 0x03u //!< Revision | |
24 | +#define IUTEST_REVISION 0x05u //!< Revision | |
25 | 25 | |
26 | 26 | #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated |
27 | 27 |
@@ -120,6 +120,11 @@ | ||
120 | 120 | * @page CHANGELOG 変更履歴 |
121 | 121 | * @par Changes |
122 | 122 | <ul> |
123 | + <li>v1.17.0.0 | |
124 | + <ul> | |
125 | + <li></li> | |
126 | + </ul> | |
127 | + </li> | |
123 | 128 | <li>v1.16.7.0 |
124 | 129 | <ul> |
125 | 130 | <li>古い google mock の互換性エラー修正</li> |
@@ -0,0 +1 @@ | ||
1 | +*/ |
@@ -91,6 +91,10 @@ | ||
91 | 91 | } |
92 | 92 | { |
93 | 93 | ::std::optional<int> opt = ::std::nullopt; |
94 | + IUTEST_EXPECT_EQ(::std::nullopt, opt); | |
95 | + } | |
96 | + { | |
97 | + ::std::optional<int> opt = ::std::nullopt; | |
94 | 98 | IUTEST_EXPECT_FALSE(opt); |
95 | 99 | IUTEST_EXPECT_NONFATAL_FAILURE(IUTEST_EXPECT_EQ(1234, opt), "1234"); |
96 | 100 | } |