Merge lp:~sil2100/sync-monitor/packaging_review into lp:sync-monitor
- packaging_review
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 18 |
Proposed branch: | lp:~sil2100/sync-monitor/packaging_review |
Merge into: | lp:sync-monitor |
Diff against target: |
71399 lines (+69387/-475) 204 files modified
.bzr-builddeb/default.conf (+2/-0) .bzrignore (+2/-0) 3rd_party/CMakeLists.txt (+1/-0) 3rd_party/gmock/CMakeLists.txt (+171/-0) 3rd_party/gmock/gtest/CHANGES (+153/-0) 3rd_party/gmock/gtest/CMakeLists.txt (+250/-0) 3rd_party/gmock/gtest/CONTRIBUTORS (+37/-0) 3rd_party/gmock/gtest/Makefile.am (+305/-0) 3rd_party/gmock/gtest/README (+435/-0) 3rd_party/gmock/gtest/cmake/internal_utils.cmake (+227/-0) 3rd_party/gmock/gtest/codegear/gtest_all.cc (+38/-0) 3rd_party/gmock/gtest/codegear/gtest_link.cc (+40/-0) 3rd_party/gmock/gtest/configure.ac (+68/-0) 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h (+294/-0) 3rd_party/gmock/gtest/include/gtest/gtest-message.h (+250/-0) 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h (+1421/-0) 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump (+487/-0) 3rd_party/gmock/gtest/include/gtest/gtest-printers.h (+855/-0) 3rd_party/gmock/gtest/include/gtest/gtest-spi.h (+232/-0) 3rd_party/gmock/gtest/include/gtest/gtest-test-part.h (+179/-0) 3rd_party/gmock/gtest/include/gtest/gtest-typed-test.h (+259/-0) 3rd_party/gmock/gtest/include/gtest/gtest.h (+2291/-0) 3rd_party/gmock/gtest/include/gtest/gtest_pred_impl.h (+358/-0) 3rd_party/gmock/gtest/include/gtest/gtest_prod.h (+58/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h (+319/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-filepath.h (+206/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-internal.h (+1147/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h (+233/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h (+5143/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump (+301/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-param-util.h (+619/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-port.h (+1947/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-string.h (+167/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-tuple.h (+1012/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump (+339/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-type-util.h (+3331/-0) 3rd_party/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump (+297/-0) 3rd_party/gmock/gtest/m4/acx_pthread.m4 (+363/-0) 3rd_party/gmock/gtest/m4/gtest.m4 (+74/-0) 3rd_party/gmock/gtest/make/Makefile (+82/-0) 3rd_party/gmock/gtest/samples/prime_tables.h (+123/-0) 3rd_party/gmock/gtest/samples/sample1.cc (+68/-0) 3rd_party/gmock/gtest/samples/sample1.h (+43/-0) 3rd_party/gmock/gtest/samples/sample10_unittest.cc (+144/-0) 3rd_party/gmock/gtest/samples/sample1_unittest.cc (+153/-0) 3rd_party/gmock/gtest/samples/sample2.cc (+56/-0) 3rd_party/gmock/gtest/samples/sample2.h (+85/-0) 3rd_party/gmock/gtest/samples/sample2_unittest.cc (+109/-0) 3rd_party/gmock/gtest/samples/sample3-inl.h (+172/-0) 3rd_party/gmock/gtest/samples/sample3_unittest.cc (+151/-0) 3rd_party/gmock/gtest/samples/sample4.cc (+46/-0) 3rd_party/gmock/gtest/samples/sample4.h (+53/-0) 3rd_party/gmock/gtest/samples/sample4_unittest.cc (+45/-0) 3rd_party/gmock/gtest/samples/sample5_unittest.cc (+199/-0) 3rd_party/gmock/gtest/samples/sample6_unittest.cc (+224/-0) 3rd_party/gmock/gtest/samples/sample7_unittest.cc (+130/-0) 3rd_party/gmock/gtest/samples/sample8_unittest.cc (+173/-0) 3rd_party/gmock/gtest/samples/sample9_unittest.cc (+160/-0) 3rd_party/gmock/gtest/scripts/fuse_gtest_files.py (+250/-0) 3rd_party/gmock/gtest/scripts/gen_gtest_pred_impl.py (+730/-0) 3rd_party/gmock/gtest/scripts/gtest-config.in (+274/-0) 3rd_party/gmock/gtest/scripts/pump.py (+855/-0) 3rd_party/gmock/gtest/scripts/test/Makefile (+59/-0) 3rd_party/gmock/gtest/scripts/upload.py (+1387/-0) 3rd_party/gmock/gtest/scripts/upload_gtest.py (+78/-0) 3rd_party/gmock/gtest/src/gtest-all.cc (+48/-0) 3rd_party/gmock/gtest/src/gtest-death-test.cc (+1344/-0) 3rd_party/gmock/gtest/src/gtest-filepath.cc (+382/-0) 3rd_party/gmock/gtest/src/gtest-internal-inl.h (+1218/-0) 3rd_party/gmock/gtest/src/gtest-port.cc (+805/-0) 3rd_party/gmock/gtest/src/gtest-printers.cc (+363/-0) 3rd_party/gmock/gtest/src/gtest-test-part.cc (+110/-0) 3rd_party/gmock/gtest/src/gtest-typed-test.cc (+110/-0) 3rd_party/gmock/gtest/src/gtest.cc (+4961/-0) 3rd_party/gmock/gtest/src/gtest_main.cc (+38/-0) 3rd_party/gmock/gtest/test/gtest-death-test_ex_test.cc (+93/-0) 3rd_party/gmock/gtest/test/gtest-death-test_test.cc (+1368/-0) 3rd_party/gmock/gtest/test/gtest-filepath_test.cc (+680/-0) 3rd_party/gmock/gtest/test/gtest-linked_ptr_test.cc (+154/-0) 3rd_party/gmock/gtest/test/gtest-listener_test.cc (+310/-0) 3rd_party/gmock/gtest/test/gtest-message_test.cc (+159/-0) 3rd_party/gmock/gtest/test/gtest-options_test.cc (+215/-0) 3rd_party/gmock/gtest/test/gtest-param-test2_test.cc (+65/-0) 3rd_party/gmock/gtest/test/gtest-param-test_test.cc (+904/-0) 3rd_party/gmock/gtest/test/gtest-param-test_test.h (+57/-0) 3rd_party/gmock/gtest/test/gtest-port_test.cc (+1253/-0) 3rd_party/gmock/gtest/test/gtest-printers_test.cc (+1566/-0) 3rd_party/gmock/gtest/test/gtest-test-part_test.cc (+208/-0) 3rd_party/gmock/gtest/test/gtest-tuple_test.cc (+320/-0) 3rd_party/gmock/gtest/test/gtest-typed-test2_test.cc (+45/-0) 3rd_party/gmock/gtest/test/gtest-typed-test_test.cc (+360/-0) 3rd_party/gmock/gtest/test/gtest-typed-test_test.h (+66/-0) 3rd_party/gmock/gtest/test/gtest-unittest-api_test.cc (+341/-0) 3rd_party/gmock/gtest/test/gtest_all_test.cc (+47/-0) 3rd_party/gmock/gtest/test/gtest_break_on_failure_unittest.py (+218/-0) 3rd_party/gmock/gtest/test/gtest_break_on_failure_unittest_.cc (+88/-0) 3rd_party/gmock/gtest/test/gtest_catch_exceptions_test.py (+223/-0) 3rd_party/gmock/gtest/test/gtest_catch_exceptions_test_.cc (+311/-0) 3rd_party/gmock/gtest/test/gtest_color_test.py (+130/-0) 3rd_party/gmock/gtest/test/gtest_color_test_.cc (+71/-0) 3rd_party/gmock/gtest/test/gtest_env_var_test.py (+103/-0) 3rd_party/gmock/gtest/test/gtest_env_var_test_.cc (+126/-0) 3rd_party/gmock/gtest/test/gtest_environment_test.cc (+192/-0) 3rd_party/gmock/gtest/test/gtest_filter_unittest.py (+633/-0) 3rd_party/gmock/gtest/test/gtest_filter_unittest_.cc (+140/-0) 3rd_party/gmock/gtest/test/gtest_help_test.py (+172/-0) 3rd_party/gmock/gtest/test/gtest_help_test_.cc (+46/-0) 3rd_party/gmock/gtest/test/gtest_list_tests_unittest.py (+207/-0) 3rd_party/gmock/gtest/test/gtest_list_tests_unittest_.cc (+157/-0) 3rd_party/gmock/gtest/test/gtest_main_unittest.cc (+45/-0) 3rd_party/gmock/gtest/test/gtest_no_test_unittest.cc (+56/-0) 3rd_party/gmock/gtest/test/gtest_output_test.py (+335/-0) 3rd_party/gmock/gtest/test/gtest_output_test_.cc (+1034/-0) 3rd_party/gmock/gtest/test/gtest_output_test_golden_lin.txt (+720/-0) 3rd_party/gmock/gtest/test/gtest_pred_impl_unittest.cc (+2427/-0) 3rd_party/gmock/gtest/test/gtest_prod_test.cc (+57/-0) 3rd_party/gmock/gtest/test/gtest_repeat_test.cc (+253/-0) 3rd_party/gmock/gtest/test/gtest_shuffle_test.py (+325/-0) 3rd_party/gmock/gtest/test/gtest_shuffle_test_.cc (+103/-0) 3rd_party/gmock/gtest/test/gtest_sole_header_test.cc (+57/-0) 3rd_party/gmock/gtest/test/gtest_stress_test.cc (+256/-0) 3rd_party/gmock/gtest/test/gtest_test_utils.py (+305/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_ex_test.cc (+92/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_test.py (+171/-0) 3rd_party/gmock/gtest/test/gtest_throw_on_failure_test_.cc (+72/-0) 3rd_party/gmock/gtest/test/gtest_uninitialized_test.py (+70/-0) 3rd_party/gmock/gtest/test/gtest_uninitialized_test_.cc (+43/-0) 3rd_party/gmock/gtest/test/gtest_unittest.cc (+7415/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfile1_test_.cc (+49/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfile2_test_.cc (+49/-0) 3rd_party/gmock/gtest/test/gtest_xml_outfiles_test.py (+132/-0) 3rd_party/gmock/gtest/test/gtest_xml_output_unittest.py (+307/-0) 3rd_party/gmock/gtest/test/gtest_xml_output_unittest_.cc (+181/-0) 3rd_party/gmock/gtest/test/gtest_xml_test_utils.py (+194/-0) 3rd_party/gmock/gtest/test/production.cc (+36/-0) 3rd_party/gmock/gtest/test/production.h (+55/-0) 3rd_party/gmock/gtest/xcode/Config/DebugProject.xcconfig (+30/-0) 3rd_party/gmock/gtest/xcode/Config/FrameworkTarget.xcconfig (+17/-0) 3rd_party/gmock/gtest/xcode/Config/General.xcconfig (+41/-0) 3rd_party/gmock/gtest/xcode/Config/ReleaseProject.xcconfig (+32/-0) 3rd_party/gmock/gtest/xcode/Config/StaticLibraryTarget.xcconfig (+18/-0) 3rd_party/gmock/gtest/xcode/Config/TestTarget.xcconfig (+8/-0) 3rd_party/gmock/gtest/xcode/Resources/Info.plist (+30/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/Info.plist (+28/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/runtests.sh (+62/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget.cc (+63/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget.h (+59/-0) 3rd_party/gmock/gtest/xcode/Samples/FrameworkSample/widget_test.cc (+68/-0) 3rd_party/gmock/gtest/xcode/Scripts/runtests.sh (+65/-0) 3rd_party/gmock/gtest/xcode/Scripts/versiongenerate.py (+100/-0) 3rd_party/gmock/src/gmock-all.cc (+47/-0) 3rd_party/gmock/src/gmock-cardinalities.cc (+156/-0) 3rd_party/gmock/src/gmock-internal-utils.cc (+174/-0) 3rd_party/gmock/src/gmock-matchers.cc (+137/-0) 3rd_party/gmock/src/gmock-spec-builders.cc (+813/-0) 3rd_party/gmock/src/gmock.cc (+182/-0) 3rd_party/gmock/src/gmock_main.cc (+54/-0) CMakeLists.txt (+4/-0) accounts/applications/CMakeLists.txt (+4/-4) accounts/applications/calendar-sync.application.in (+7/-6) accounts/applications/contacts-sync.application.in (+7/-6) accounts/services/CMakeLists.txt (+4/-0) accounts/services/google-caldav.service.in (+2/-1) accounts/services/google-carddav.service.in (+2/-1) accounts/services/yahoo-caldav.service.in (+15/-0) accounts/services/yahoo-carddav.service.in (+15/-0) config.h.in (+4/-0) data/CMakeLists.txt (+8/-0) data/com.canonical.SyncMonitor.service.in (+3/-0) debian/changelog (+1/-1) debian/control (+19/-17) debian/copyright (+63/-7) debian/rules (+0/-4) debian/sync-monitor.install (+3/-1) src/CMakeLists.txt (+31/-9) src/address-book-trigger.cpp (+0/-71) src/address-book-trigger.h (+0/-45) src/eds-helper.cpp (+174/-0) src/eds-helper.h (+59/-0) src/main.cpp (+2/-0) src/notify-message-mock.cpp (+2/-1) src/notify-message-notify.cpp (+3/-2) src/notify-message.h (+1/-1) src/provider-template.cpp (+78/-0) src/provider-template.h (+42/-0) src/sync-account.cpp (+369/-176) src/sync-account.h (+44/-23) src/sync-configure.cpp (+241/-0) src/sync-configure.h (+65/-0) src/sync-daemon.cpp (+229/-75) src/sync-daemon.h (+34/-13) src/sync-dbus.cpp (+100/-0) src/sync-dbus.h (+101/-0) src/sync-queue.cpp (+105/-0) src/sync-queue.h (+47/-0) src/syncevolution-session-proxy.cpp (+17/-10) src/syncevolution-session-proxy.h (+1/-1) templates/CMakeLists.txt (+8/-0) templates/google.conf (+13/-0) templates/yahoo.conf (+5/-0) tests/CMakeLists.txt (+1/-0) tests/unittest/CMakeLists.txt (+26/-0) tests/unittest/sync-account-mock.h (+37/-0) tests/unittest/sync-queue-test.cpp (+201/-0) |
To merge this branch: | bzr merge lp:~sil2100/sync-monitor/packaging_review |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+214781@code.launchpad.net |
Commit message
Basic preliminary packaging review. Fixed packaging, copyright and changed the install directory (/usr/libdir is not valid in Ubuntu)
Description of the change
Basic preliminary packaging review. Fixed packaging, copyright and changed the install directory (/usr/libdir is not valid in Ubuntu)
- 59. By Łukasz Zemczak
-
Merge latest trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:59
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === added directory '.bzr-builddeb' | |||
2 | === added file '.bzr-builddeb/default.conf' | |||
3 | --- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000 | |||
4 | +++ .bzr-builddeb/default.conf 2014-04-08 15:07:37 +0000 | |||
5 | @@ -0,0 +1,2 @@ | |||
6 | 1 | [BUILDDEB] | ||
7 | 2 | split = True | ||
8 | 0 | 3 | ||
9 | === added file '.bzrignore' | |||
10 | --- .bzrignore 1970-01-01 00:00:00 +0000 | |||
11 | +++ .bzrignore 2014-04-08 15:07:37 +0000 | |||
12 | @@ -0,0 +1,2 @@ | |||
13 | 1 | CMakeLists.txt.user | ||
14 | 2 | build | ||
15 | 0 | 3 | ||
16 | === modified file '3rd_party/CMakeLists.txt' | |||
17 | --- 3rd_party/CMakeLists.txt 2014-02-14 22:58:16 +0000 | |||
18 | +++ 3rd_party/CMakeLists.txt 2014-04-08 15:07:37 +0000 | |||
19 | @@ -1,1 +1,2 @@ | |||
20 | 1 | add_subdirectory(syncevolution-qt) | 1 | add_subdirectory(syncevolution-qt) |
21 | 2 | add_subdirectory(gmock) | ||
22 | 2 | 3 | ||
23 | === added directory '3rd_party/gmock' | |||
24 | === added file '3rd_party/gmock/CMakeLists.txt' | |||
25 | --- 3rd_party/gmock/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
26 | +++ 3rd_party/gmock/CMakeLists.txt 2014-04-08 15:07:37 +0000 | |||
27 | @@ -0,0 +1,171 @@ | |||
28 | 1 | ######################################################################## | ||
29 | 2 | # CMake build script for Google Mock. | ||
30 | 3 | # | ||
31 | 4 | # To run the tests for Google Mock itself on Linux, use 'make test' or | ||
32 | 5 | # ctest. You can select which tests to run using 'ctest -R regex'. | ||
33 | 6 | # For more options, run 'ctest --help'. | ||
34 | 7 | |||
35 | 8 | # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to | ||
36 | 9 | # make it prominent in the GUI. | ||
37 | 10 | option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) | ||
38 | 11 | |||
39 | 12 | option(gmock_build_tests "Build all of Google Mock's own tests." OFF) | ||
40 | 13 | |||
41 | 14 | # A directory to find Google Test sources. | ||
42 | 15 | if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt") | ||
43 | 16 | set(gtest_dir gtest) | ||
44 | 17 | else() | ||
45 | 18 | set(gtest_dir ../gtest) | ||
46 | 19 | endif() | ||
47 | 20 | |||
48 | 21 | # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). | ||
49 | 22 | include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL) | ||
50 | 23 | |||
51 | 24 | if (COMMAND pre_project_set_up_hermetic_build) | ||
52 | 25 | # Google Test also calls hermetic setup functions from add_subdirectory, | ||
53 | 26 | # although its changes will not affect things at the current scope. | ||
54 | 27 | pre_project_set_up_hermetic_build() | ||
55 | 28 | endif() | ||
56 | 29 | |||
57 | 30 | ######################################################################## | ||
58 | 31 | # | ||
59 | 32 | # Project-wide settings | ||
60 | 33 | |||
61 | 34 | # Name of the project. | ||
62 | 35 | # | ||
63 | 36 | # CMake files in this project can refer to the root source directory | ||
64 | 37 | # as ${gmock_SOURCE_DIR} and to the root binary directory as | ||
65 | 38 | # ${gmock_BINARY_DIR}. | ||
66 | 39 | # Language "C" is required for find_package(Threads). | ||
67 | 40 | project(gmock CXX C) | ||
68 | 41 | cmake_minimum_required(VERSION 2.6.2) | ||
69 | 42 | |||
70 | 43 | if (COMMAND set_up_hermetic_build) | ||
71 | 44 | set_up_hermetic_build() | ||
72 | 45 | endif() | ||
73 | 46 | |||
74 | 47 | # Instructs CMake to process Google Test's CMakeLists.txt and add its | ||
75 | 48 | # targets to the current scope. We are placing Google Test's binary | ||
76 | 49 | # directory in a subdirectory of our own as VC compilation may break | ||
77 | 50 | # if they are the same (the default). | ||
78 | 51 | add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest") | ||
79 | 52 | |||
80 | 53 | # Although Google Test's CMakeLists.txt calls this function, the | ||
81 | 54 | # changes there don't affect the current scope. Therefore we have to | ||
82 | 55 | # call it again here. | ||
83 | 56 | config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake | ||
84 | 57 | |||
85 | 58 | # Adds Google Mock's and Google Test's header directories to the search path. | ||
86 | 59 | include_directories("${gmock_SOURCE_DIR}/include" | ||
87 | 60 | "${gmock_SOURCE_DIR}" | ||
88 | 61 | "${gtest_SOURCE_DIR}/include" | ||
89 | 62 | # This directory is needed to build directly from Google | ||
90 | 63 | # Test sources. | ||
91 | 64 | "${gtest_SOURCE_DIR}") | ||
92 | 65 | |||
93 | 66 | ######################################################################## | ||
94 | 67 | # | ||
95 | 68 | # Defines the gmock & gmock_main libraries. User tests should link | ||
96 | 69 | # with one of them. | ||
97 | 70 | |||
98 | 71 | # Google Mock libraries. We build them using more strict warnings than what | ||
99 | 72 | # are used for other targets, to ensure that Google Mock can be compiled by | ||
100 | 73 | # a user aggressive about warnings. | ||
101 | 74 | cxx_library(gmock | ||
102 | 75 | "${cxx_strict}" | ||
103 | 76 | "${gtest_dir}/src/gtest-all.cc" | ||
104 | 77 | src/gmock-all.cc) | ||
105 | 78 | |||
106 | 79 | cxx_library(gmock_main | ||
107 | 80 | "${cxx_strict}" | ||
108 | 81 | "${gtest_dir}/src/gtest-all.cc" | ||
109 | 82 | src/gmock-all.cc | ||
110 | 83 | src/gmock_main.cc) | ||
111 | 84 | |||
112 | 85 | ######################################################################## | ||
113 | 86 | # | ||
114 | 87 | # Google Mock's own tests. | ||
115 | 88 | # | ||
116 | 89 | # You can skip this section if you aren't interested in testing | ||
117 | 90 | # Google Mock itself. | ||
118 | 91 | # | ||
119 | 92 | # The tests are not built by default. To build them, set the | ||
120 | 93 | # gmock_build_tests option to ON. You can do it by running ccmake | ||
121 | 94 | # or specifying the -Dgmock_build_tests=ON flag when running cmake. | ||
122 | 95 | |||
123 | 96 | if (gmock_build_tests) | ||
124 | 97 | # This must be set in the root directory for the tests to be run by | ||
125 | 98 | # 'make test' or ctest. | ||
126 | 99 | enable_testing() | ||
127 | 100 | |||
128 | 101 | ############################################################ | ||
129 | 102 | # C++ tests built with standard compiler flags. | ||
130 | 103 | |||
131 | 104 | cxx_test(gmock-actions_test gmock_main) | ||
132 | 105 | cxx_test(gmock-cardinalities_test gmock_main) | ||
133 | 106 | cxx_test(gmock_ex_test gmock_main) | ||
134 | 107 | cxx_test(gmock-generated-actions_test gmock_main) | ||
135 | 108 | cxx_test(gmock-generated-function-mockers_test gmock_main) | ||
136 | 109 | cxx_test(gmock-generated-internal-utils_test gmock_main) | ||
137 | 110 | cxx_test(gmock-generated-matchers_test gmock_main) | ||
138 | 111 | cxx_test(gmock-internal-utils_test gmock_main) | ||
139 | 112 | cxx_test(gmock-matchers_test gmock_main) | ||
140 | 113 | cxx_test(gmock-more-actions_test gmock_main) | ||
141 | 114 | cxx_test(gmock-nice-strict_test gmock_main) | ||
142 | 115 | cxx_test(gmock-port_test gmock_main) | ||
143 | 116 | cxx_test(gmock-spec-builders_test gmock_main) | ||
144 | 117 | cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) | ||
145 | 118 | cxx_test(gmock_test gmock_main) | ||
146 | 119 | |||
147 | 120 | if (CMAKE_USE_PTHREADS_INIT) | ||
148 | 121 | cxx_test(gmock_stress_test gmock) | ||
149 | 122 | endif() | ||
150 | 123 | |||
151 | 124 | # gmock_all_test is commented to save time building and running tests. | ||
152 | 125 | # Uncomment if necessary. | ||
153 | 126 | # cxx_test(gmock_all_test gmock_main) | ||
154 | 127 | |||
155 | 128 | ############################################################ | ||
156 | 129 | # C++ tests built with non-standard compiler flags. | ||
157 | 130 | |||
158 | 131 | cxx_library(gmock_main_no_exception "${cxx_no_exception}" | ||
159 | 132 | "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) | ||
160 | 133 | |||
161 | 134 | cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" | ||
162 | 135 | "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) | ||
163 | 136 | |||
164 | 137 | cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" | ||
165 | 138 | "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) | ||
166 | 139 | |||
167 | 140 | cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}" | ||
168 | 141 | gmock_main_no_exception test/gmock-more-actions_test.cc) | ||
169 | 142 | |||
170 | 143 | cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}" | ||
171 | 144 | gmock_main_no_rtti test/gmock-spec-builders_test.cc) | ||
172 | 145 | |||
173 | 146 | cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}" | ||
174 | 147 | gmock_main_use_own_tuple test/gmock-spec-builders_test.cc) | ||
175 | 148 | |||
176 | 149 | cxx_shared_library(shared_gmock_main "${cxx_default}" | ||
177 | 150 | "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) | ||
178 | 151 | |||
179 | 152 | # Tests that a binary can be built with Google Mock as a shared library. On | ||
180 | 153 | # some system configurations, it may not possible to run the binary without | ||
181 | 154 | # knowing more details about the system configurations. We do not try to run | ||
182 | 155 | # this binary. To get a more robust shared library coverage, configure with | ||
183 | 156 | # -DBUILD_SHARED_LIBS=ON. | ||
184 | 157 | cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}" | ||
185 | 158 | shared_gmock_main test/gmock-spec-builders_test.cc) | ||
186 | 159 | set_target_properties(shared_gmock_test_ | ||
187 | 160 | PROPERTIES | ||
188 | 161 | COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") | ||
189 | 162 | |||
190 | 163 | ############################################################ | ||
191 | 164 | # Python tests. | ||
192 | 165 | |||
193 | 166 | cxx_executable(gmock_leak_test_ test gmock_main) | ||
194 | 167 | py_test(gmock_leak_test) | ||
195 | 168 | |||
196 | 169 | cxx_executable(gmock_output_test_ test gmock) | ||
197 | 170 | py_test(gmock_output_test) | ||
198 | 171 | endif() | ||
199 | 0 | 172 | ||
200 | === added directory '3rd_party/gmock/gtest' | |||
201 | === added file '3rd_party/gmock/gtest/CHANGES' | |||
202 | --- 3rd_party/gmock/gtest/CHANGES 1970-01-01 00:00:00 +0000 | |||
203 | +++ 3rd_party/gmock/gtest/CHANGES 2014-04-08 15:07:37 +0000 | |||
204 | @@ -0,0 +1,153 @@ | |||
205 | 1 | Changes for 1.7.0: | ||
206 | 2 | |||
207 | 3 | * New feature: death tests are supported on OpenBSD and in iOS | ||
208 | 4 | simulator now. | ||
209 | 5 | * New feature: Test::RecordProperty() can now be used outside of the | ||
210 | 6 | lifespan of a test method, in which case it will be attributed to | ||
211 | 7 | the current test case or the test program in the XML report. | ||
212 | 8 | * New feature (potentially breaking): --gtest_list_tests now prints | ||
213 | 9 | the type parameters and value parameters for each test. | ||
214 | 10 | * Improvement: char pointers and char arrays are now escaped properly | ||
215 | 11 | in failure messages. | ||
216 | 12 | * Improvement: failure summary in XML reports now includes file and | ||
217 | 13 | line information. | ||
218 | 14 | * Improvement: the <testsuites> XML element now has a timestamp attribute. | ||
219 | 15 | * Improvement: When --gtest_filter is specified, XML report now doesn't | ||
220 | 16 | contain information about tests that are filtered out. | ||
221 | 17 | * Fixed the bug where long --gtest_filter flag values are truncated in | ||
222 | 18 | death tests. | ||
223 | 19 | * Potentially breaking change: RUN_ALL_TESTS() is now implemented as a | ||
224 | 20 | function instead of a macro in order to work better with Clang. | ||
225 | 21 | * Compatibility fixes with C++ 11 and various platforms. | ||
226 | 22 | * Bug/warning fixes. | ||
227 | 23 | |||
228 | 24 | Changes for 1.6.0: | ||
229 | 25 | |||
230 | 26 | * New feature: ADD_FAILURE_AT() for reporting a test failure at the | ||
231 | 27 | given source location -- useful for writing testing utilities. | ||
232 | 28 | * New feature: the universal value printer is moved from Google Mock | ||
233 | 29 | to Google Test. | ||
234 | 30 | * New feature: type parameters and value parameters are reported in | ||
235 | 31 | the XML report now. | ||
236 | 32 | * A gtest_disable_pthreads CMake option. | ||
237 | 33 | * Colored output works in GNU Screen sessions now. | ||
238 | 34 | * Parameters of value-parameterized tests are now printed in the | ||
239 | 35 | textual output. | ||
240 | 36 | * Failures from ad hoc test assertions run before RUN_ALL_TESTS() are | ||
241 | 37 | now correctly reported. | ||
242 | 38 | * Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to | ||
243 | 39 | ostream. | ||
244 | 40 | * More complete handling of exceptions. | ||
245 | 41 | * GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter | ||
246 | 42 | name is already used by another library. | ||
247 | 43 | * --gtest_catch_exceptions is now true by default, allowing a test | ||
248 | 44 | program to continue after an exception is thrown. | ||
249 | 45 | * Value-parameterized test fixtures can now derive from Test and | ||
250 | 46 | WithParamInterface<T> separately, easing conversion of legacy tests. | ||
251 | 47 | * Death test messages are clearly marked to make them more | ||
252 | 48 | distinguishable from other messages. | ||
253 | 49 | * Compatibility fixes for Android, Google Native Client, MinGW, HP UX, | ||
254 | 50 | PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear), | ||
255 | 51 | IBM XL C++ (Visual Age C++), and C++0x. | ||
256 | 52 | * Bug fixes and implementation clean-ups. | ||
257 | 53 | * Potentially incompatible changes: disables the harmful 'make install' | ||
258 | 54 | command in autotools. | ||
259 | 55 | |||
260 | 56 | Changes for 1.5.0: | ||
261 | 57 | |||
262 | 58 | * New feature: assertions can be safely called in multiple threads | ||
263 | 59 | where the pthreads library is available. | ||
264 | 60 | * New feature: predicates used inside EXPECT_TRUE() and friends | ||
265 | 61 | can now generate custom failure messages. | ||
266 | 62 | * New feature: Google Test can now be compiled as a DLL. | ||
267 | 63 | * New feature: fused source files are included. | ||
268 | 64 | * New feature: prints help when encountering unrecognized Google Test flags. | ||
269 | 65 | * Experimental feature: CMake build script (requires CMake 2.6.4+). | ||
270 | 66 | * Experimental feature: the Pump script for meta programming. | ||
271 | 67 | * double values streamed to an assertion are printed with enough precision | ||
272 | 68 | to differentiate any two different values. | ||
273 | 69 | * Google Test now works on Solaris and AIX. | ||
274 | 70 | * Build and test script improvements. | ||
275 | 71 | * Bug fixes and implementation clean-ups. | ||
276 | 72 | |||
277 | 73 | Potentially breaking changes: | ||
278 | 74 | |||
279 | 75 | * Stopped supporting VC++ 7.1 with exceptions disabled. | ||
280 | 76 | * Dropped support for 'make install'. | ||
281 | 77 | |||
282 | 78 | Changes for 1.4.0: | ||
283 | 79 | |||
284 | 80 | * New feature: the event listener API | ||
285 | 81 | * New feature: test shuffling | ||
286 | 82 | * New feature: the XML report format is closer to junitreport and can | ||
287 | 83 | be parsed by Hudson now. | ||
288 | 84 | * New feature: when a test runs under Visual Studio, its failures are | ||
289 | 85 | integrated in the IDE. | ||
290 | 86 | * New feature: /MD(d) versions of VC++ projects. | ||
291 | 87 | * New feature: elapsed time for the tests is printed by default. | ||
292 | 88 | * New feature: comes with a TR1 tuple implementation such that Boost | ||
293 | 89 | is no longer needed for Combine(). | ||
294 | 90 | * New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends. | ||
295 | 91 | * New feature: the Xcode project can now produce static gtest | ||
296 | 92 | libraries in addition to a framework. | ||
297 | 93 | * Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile, | ||
298 | 94 | Symbian, gcc, and C++Builder. | ||
299 | 95 | * Bug fixes and implementation clean-ups. | ||
300 | 96 | |||
301 | 97 | Changes for 1.3.0: | ||
302 | 98 | |||
303 | 99 | * New feature: death tests on Windows, Cygwin, and Mac. | ||
304 | 100 | * New feature: ability to use Google Test assertions in other testing | ||
305 | 101 | frameworks. | ||
306 | 102 | * New feature: ability to run disabled test via | ||
307 | 103 | --gtest_also_run_disabled_tests. | ||
308 | 104 | * New feature: the --help flag for printing the usage. | ||
309 | 105 | * New feature: access to Google Test flag values in user code. | ||
310 | 106 | * New feature: a script that packs Google Test into one .h and one | ||
311 | 107 | .cc file for easy deployment. | ||
312 | 108 | * New feature: support for distributing test functions to multiple | ||
313 | 109 | machines (requires support from the test runner). | ||
314 | 110 | * Bug fixes and implementation clean-ups. | ||
315 | 111 | |||
316 | 112 | Changes for 1.2.1: | ||
317 | 113 | |||
318 | 114 | * Compatibility fixes for Linux IA-64 and IBM z/OS. | ||
319 | 115 | * Added support for using Boost and other TR1 implementations. | ||
320 | 116 | * Changes to the build scripts to support upcoming release of Google C++ | ||
321 | 117 | Mocking Framework. | ||
322 | 118 | * Added Makefile to the distribution package. | ||
323 | 119 | * Improved build instructions in README. | ||
324 | 120 | |||
325 | 121 | Changes for 1.2.0: | ||
326 | 122 | |||
327 | 123 | * New feature: value-parameterized tests. | ||
328 | 124 | * New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS) | ||
329 | 125 | macros. | ||
330 | 126 | * Changed the XML report format to match JUnit/Ant's. | ||
331 | 127 | * Added tests to the Xcode project. | ||
332 | 128 | * Added scons/SConscript for building with SCons. | ||
333 | 129 | * Added src/gtest-all.cc for building Google Test from a single file. | ||
334 | 130 | * Fixed compatibility with Solaris and z/OS. | ||
335 | 131 | * Enabled running Python tests on systems with python 2.3 installed, | ||
336 | 132 | e.g. Mac OS X 10.4. | ||
337 | 133 | * Bug fixes. | ||
338 | 134 | |||
339 | 135 | Changes for 1.1.0: | ||
340 | 136 | |||
341 | 137 | * New feature: type-parameterized tests. | ||
342 | 138 | * New feature: exception assertions. | ||
343 | 139 | * New feature: printing elapsed time of tests. | ||
344 | 140 | * Improved the robustness of death tests. | ||
345 | 141 | * Added an Xcode project and samples. | ||
346 | 142 | * Adjusted the output format on Windows to be understandable by Visual Studio. | ||
347 | 143 | * Minor bug fixes. | ||
348 | 144 | |||
349 | 145 | Changes for 1.0.1: | ||
350 | 146 | |||
351 | 147 | * Added project files for Visual Studio 7.1. | ||
352 | 148 | * Fixed issues with compiling on Mac OS X. | ||
353 | 149 | * Fixed issues with compiling on Cygwin. | ||
354 | 150 | |||
355 | 151 | Changes for 1.0.0: | ||
356 | 152 | |||
357 | 153 | * Initial Open Source release of Google Test | ||
358 | 0 | 154 | ||
359 | === added file '3rd_party/gmock/gtest/CMakeLists.txt' | |||
360 | --- 3rd_party/gmock/gtest/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
361 | +++ 3rd_party/gmock/gtest/CMakeLists.txt 2014-04-08 15:07:37 +0000 | |||
362 | @@ -0,0 +1,250 @@ | |||
363 | 1 | ######################################################################## | ||
364 | 2 | # CMake build script for Google Test. | ||
365 | 3 | # | ||
366 | 4 | # To run the tests for Google Test itself on Linux, use 'make test' or | ||
367 | 5 | # ctest. You can select which tests to run using 'ctest -R regex'. | ||
368 | 6 | # For more options, run 'ctest --help'. | ||
369 | 7 | |||
370 | 8 | # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to | ||
371 | 9 | # make it prominent in the GUI. | ||
372 | 10 | option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) | ||
373 | 11 | |||
374 | 12 | # When other libraries are using a shared version of runtime libraries, | ||
375 | 13 | # Google Test also has to use one. | ||
376 | 14 | option( | ||
377 | 15 | gtest_force_shared_crt | ||
378 | 16 | "Use shared (DLL) run-time lib even when Google Test is built as static lib." | ||
379 | 17 | OFF) | ||
380 | 18 | |||
381 | 19 | option(gtest_build_tests "Build all of gtest's own tests." OFF) | ||
382 | 20 | |||
383 | 21 | option(gtest_build_samples "Build gtest's sample programs." OFF) | ||
384 | 22 | |||
385 | 23 | option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF) | ||
386 | 24 | |||
387 | 25 | # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). | ||
388 | 26 | include(cmake/hermetic_build.cmake OPTIONAL) | ||
389 | 27 | |||
390 | 28 | if (COMMAND pre_project_set_up_hermetic_build) | ||
391 | 29 | pre_project_set_up_hermetic_build() | ||
392 | 30 | endif() | ||
393 | 31 | |||
394 | 32 | ######################################################################## | ||
395 | 33 | # | ||
396 | 34 | # Project-wide settings | ||
397 | 35 | |||
398 | 36 | # Name of the project. | ||
399 | 37 | # | ||
400 | 38 | # CMake files in this project can refer to the root source directory | ||
401 | 39 | # as ${gtest_SOURCE_DIR} and to the root binary directory as | ||
402 | 40 | # ${gtest_BINARY_DIR}. | ||
403 | 41 | # Language "C" is required for find_package(Threads). | ||
404 | 42 | project(gtest CXX C) | ||
405 | 43 | cmake_minimum_required(VERSION 2.6.2) | ||
406 | 44 | |||
407 | 45 | if (COMMAND set_up_hermetic_build) | ||
408 | 46 | set_up_hermetic_build() | ||
409 | 47 | endif() | ||
410 | 48 | |||
411 | 49 | # Define helper functions and macros used by Google Test. | ||
412 | 50 | include(cmake/internal_utils.cmake) | ||
413 | 51 | |||
414 | 52 | config_compiler_and_linker() # Defined in internal_utils.cmake. | ||
415 | 53 | |||
416 | 54 | # Where Google Test's .h files can be found. | ||
417 | 55 | include_directories( | ||
418 | 56 | ${gtest_SOURCE_DIR}/include | ||
419 | 57 | ${gtest_SOURCE_DIR}) | ||
420 | 58 | |||
421 | 59 | # Where Google Test's libraries can be found. | ||
422 | 60 | link_directories(${gtest_BINARY_DIR}/src) | ||
423 | 61 | |||
424 | 62 | ######################################################################## | ||
425 | 63 | # | ||
426 | 64 | # Defines the gtest & gtest_main libraries. User tests should link | ||
427 | 65 | # with one of them. | ||
428 | 66 | |||
429 | 67 | # Google Test libraries. We build them using more strict warnings than what | ||
430 | 68 | # are used for other targets, to ensure that gtest can be compiled by a user | ||
431 | 69 | # aggressive about warnings. | ||
432 | 70 | cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) | ||
433 | 71 | cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) | ||
434 | 72 | target_link_libraries(gtest_main gtest) | ||
435 | 73 | |||
436 | 74 | ######################################################################## | ||
437 | 75 | # | ||
438 | 76 | # Samples on how to link user tests with gtest or gtest_main. | ||
439 | 77 | # | ||
440 | 78 | # They are not built by default. To build them, set the | ||
441 | 79 | # gtest_build_samples option to ON. You can do it by running ccmake | ||
442 | 80 | # or specifying the -Dbuild_gtest_samples=ON flag when running cmake. | ||
443 | 81 | |||
444 | 82 | if (gtest_build_samples) | ||
445 | 83 | cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc) | ||
446 | 84 | cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc) | ||
447 | 85 | cxx_executable(sample3_unittest samples gtest_main) | ||
448 | 86 | cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc) | ||
449 | 87 | cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc) | ||
450 | 88 | cxx_executable(sample6_unittest samples gtest_main) | ||
451 | 89 | cxx_executable(sample7_unittest samples gtest_main) | ||
452 | 90 | cxx_executable(sample8_unittest samples gtest_main) | ||
453 | 91 | cxx_executable(sample9_unittest samples gtest) | ||
454 | 92 | cxx_executable(sample10_unittest samples gtest) | ||
455 | 93 | endif() | ||
456 | 94 | |||
457 | 95 | ######################################################################## | ||
458 | 96 | # | ||
459 | 97 | # Google Test's own tests. | ||
460 | 98 | # | ||
461 | 99 | # You can skip this section if you aren't interested in testing | ||
462 | 100 | # Google Test itself. | ||
463 | 101 | # | ||
464 | 102 | # The tests are not built by default. To build them, set the | ||
465 | 103 | # gtest_build_tests option to ON. You can do it by running ccmake | ||
466 | 104 | # or specifying the -Dgtest_build_tests=ON flag when running cmake. | ||
467 | 105 | |||
468 | 106 | if (gtest_build_tests) | ||
469 | 107 | # This must be set in the root directory for the tests to be run by | ||
470 | 108 | # 'make test' or ctest. | ||
471 | 109 | enable_testing() | ||
472 | 110 | |||
473 | 111 | ############################################################ | ||
474 | 112 | # C++ tests built with standard compiler flags. | ||
475 | 113 | |||
476 | 114 | cxx_test(gtest-death-test_test gtest_main) | ||
477 | 115 | cxx_test(gtest_environment_test gtest) | ||
478 | 116 | cxx_test(gtest-filepath_test gtest_main) | ||
479 | 117 | cxx_test(gtest-linked_ptr_test gtest_main) | ||
480 | 118 | cxx_test(gtest-listener_test gtest_main) | ||
481 | 119 | cxx_test(gtest_main_unittest gtest_main) | ||
482 | 120 | cxx_test(gtest-message_test gtest_main) | ||
483 | 121 | cxx_test(gtest_no_test_unittest gtest) | ||
484 | 122 | cxx_test(gtest-options_test gtest_main) | ||
485 | 123 | cxx_test(gtest-param-test_test gtest | ||
486 | 124 | test/gtest-param-test2_test.cc) | ||
487 | 125 | cxx_test(gtest-port_test gtest_main) | ||
488 | 126 | cxx_test(gtest_pred_impl_unittest gtest_main) | ||
489 | 127 | cxx_test(gtest-printers_test gtest_main) | ||
490 | 128 | cxx_test(gtest_prod_test gtest_main | ||
491 | 129 | test/production.cc) | ||
492 | 130 | cxx_test(gtest_repeat_test gtest) | ||
493 | 131 | cxx_test(gtest_sole_header_test gtest_main) | ||
494 | 132 | cxx_test(gtest_stress_test gtest) | ||
495 | 133 | cxx_test(gtest-test-part_test gtest_main) | ||
496 | 134 | cxx_test(gtest_throw_on_failure_ex_test gtest) | ||
497 | 135 | cxx_test(gtest-typed-test_test gtest_main | ||
498 | 136 | test/gtest-typed-test2_test.cc) | ||
499 | 137 | cxx_test(gtest_unittest gtest_main) | ||
500 | 138 | cxx_test(gtest-unittest-api_test gtest) | ||
501 | 139 | |||
502 | 140 | ############################################################ | ||
503 | 141 | # C++ tests built with non-standard compiler flags. | ||
504 | 142 | |||
505 | 143 | # MSVC 7.1 does not support STL with exceptions disabled. | ||
506 | 144 | if (NOT MSVC OR MSVC_VERSION GREATER 1310) | ||
507 | 145 | cxx_library(gtest_no_exception "${cxx_no_exception}" | ||
508 | 146 | src/gtest-all.cc) | ||
509 | 147 | cxx_library(gtest_main_no_exception "${cxx_no_exception}" | ||
510 | 148 | src/gtest-all.cc src/gtest_main.cc) | ||
511 | 149 | endif() | ||
512 | 150 | cxx_library(gtest_main_no_rtti "${cxx_no_rtti}" | ||
513 | 151 | src/gtest-all.cc src/gtest_main.cc) | ||
514 | 152 | |||
515 | 153 | cxx_test_with_flags(gtest-death-test_ex_nocatch_test | ||
516 | 154 | "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0" | ||
517 | 155 | gtest test/gtest-death-test_ex_test.cc) | ||
518 | 156 | cxx_test_with_flags(gtest-death-test_ex_catch_test | ||
519 | 157 | "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1" | ||
520 | 158 | gtest test/gtest-death-test_ex_test.cc) | ||
521 | 159 | |||
522 | 160 | cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" | ||
523 | 161 | gtest_main_no_rtti test/gtest_unittest.cc) | ||
524 | 162 | |||
525 | 163 | cxx_shared_library(gtest_dll "${cxx_default}" | ||
526 | 164 | src/gtest-all.cc src/gtest_main.cc) | ||
527 | 165 | |||
528 | 166 | cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}" | ||
529 | 167 | gtest_dll test/gtest_all_test.cc) | ||
530 | 168 | set_target_properties(gtest_dll_test_ | ||
531 | 169 | PROPERTIES | ||
532 | 170 | COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") | ||
533 | 171 | |||
534 | 172 | if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600) | ||
535 | 173 | # The C++ Standard specifies tuple_element<int, class>. | ||
536 | 174 | # Yet MSVC 10's <utility> declares tuple_element<size_t, class>. | ||
537 | 175 | # That declaration conflicts with our own standard-conforming | ||
538 | 176 | # tuple implementation. Therefore using our own tuple with | ||
539 | 177 | # MSVC 10 doesn't compile. | ||
540 | 178 | cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}" | ||
541 | 179 | src/gtest-all.cc src/gtest_main.cc) | ||
542 | 180 | |||
543 | 181 | cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}" | ||
544 | 182 | gtest_main_use_own_tuple test/gtest-tuple_test.cc) | ||
545 | 183 | |||
546 | 184 | cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}" | ||
547 | 185 | gtest_main_use_own_tuple | ||
548 | 186 | test/gtest-param-test_test.cc test/gtest-param-test2_test.cc) | ||
549 | 187 | endif() | ||
550 | 188 | |||
551 | 189 | ############################################################ | ||
552 | 190 | # Python tests. | ||
553 | 191 | |||
554 | 192 | cxx_executable(gtest_break_on_failure_unittest_ test gtest) | ||
555 | 193 | py_test(gtest_break_on_failure_unittest) | ||
556 | 194 | |||
557 | 195 | # MSVC 7.1 does not support STL with exceptions disabled. | ||
558 | 196 | if (NOT MSVC OR MSVC_VERSION GREATER 1310) | ||
559 | 197 | cxx_executable_with_flags( | ||
560 | 198 | gtest_catch_exceptions_no_ex_test_ | ||
561 | 199 | "${cxx_no_exception}" | ||
562 | 200 | gtest_main_no_exception | ||
563 | 201 | test/gtest_catch_exceptions_test_.cc) | ||
564 | 202 | endif() | ||
565 | 203 | |||
566 | 204 | cxx_executable_with_flags( | ||
567 | 205 | gtest_catch_exceptions_ex_test_ | ||
568 | 206 | "${cxx_exception}" | ||
569 | 207 | gtest_main | ||
570 | 208 | test/gtest_catch_exceptions_test_.cc) | ||
571 | 209 | py_test(gtest_catch_exceptions_test) | ||
572 | 210 | |||
573 | 211 | cxx_executable(gtest_color_test_ test gtest) | ||
574 | 212 | py_test(gtest_color_test) | ||
575 | 213 | |||
576 | 214 | cxx_executable(gtest_env_var_test_ test gtest) | ||
577 | 215 | py_test(gtest_env_var_test) | ||
578 | 216 | |||
579 | 217 | cxx_executable(gtest_filter_unittest_ test gtest) | ||
580 | 218 | py_test(gtest_filter_unittest) | ||
581 | 219 | |||
582 | 220 | cxx_executable(gtest_help_test_ test gtest_main) | ||
583 | 221 | py_test(gtest_help_test) | ||
584 | 222 | |||
585 | 223 | cxx_executable(gtest_list_tests_unittest_ test gtest) | ||
586 | 224 | py_test(gtest_list_tests_unittest) | ||
587 | 225 | |||
588 | 226 | cxx_executable(gtest_output_test_ test gtest) | ||
589 | 227 | py_test(gtest_output_test) | ||
590 | 228 | |||
591 | 229 | cxx_executable(gtest_shuffle_test_ test gtest) | ||
592 | 230 | py_test(gtest_shuffle_test) | ||
593 | 231 | |||
594 | 232 | # MSVC 7.1 does not support STL with exceptions disabled. | ||
595 | 233 | if (NOT MSVC OR MSVC_VERSION GREATER 1310) | ||
596 | 234 | cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception) | ||
597 | 235 | set_target_properties(gtest_throw_on_failure_test_ | ||
598 | 236 | PROPERTIES | ||
599 | 237 | COMPILE_FLAGS "${cxx_no_exception}") | ||
600 | 238 | py_test(gtest_throw_on_failure_test) | ||
601 | 239 | endif() | ||
602 | 240 | |||
603 | 241 | cxx_executable(gtest_uninitialized_test_ test gtest) | ||
604 | 242 | py_test(gtest_uninitialized_test) | ||
605 | 243 | |||
606 | 244 | cxx_executable(gtest_xml_outfile1_test_ test gtest_main) | ||
607 | 245 | cxx_executable(gtest_xml_outfile2_test_ test gtest_main) | ||
608 | 246 | py_test(gtest_xml_outfiles_test) | ||
609 | 247 | |||
610 | 248 | cxx_executable(gtest_xml_output_unittest_ test gtest) | ||
611 | 249 | py_test(gtest_xml_output_unittest) | ||
612 | 250 | endif() | ||
613 | 0 | 251 | ||
614 | === added file '3rd_party/gmock/gtest/CONTRIBUTORS' | |||
615 | --- 3rd_party/gmock/gtest/CONTRIBUTORS 1970-01-01 00:00:00 +0000 | |||
616 | +++ 3rd_party/gmock/gtest/CONTRIBUTORS 2014-04-08 15:07:37 +0000 | |||
617 | @@ -0,0 +1,37 @@ | |||
618 | 1 | # This file contains a list of people who've made non-trivial | ||
619 | 2 | # contribution to the Google C++ Testing Framework project. People | ||
620 | 3 | # who commit code to the project are encouraged to add their names | ||
621 | 4 | # here. Please keep the list sorted by first names. | ||
622 | 5 | |||
623 | 6 | Ajay Joshi <jaj@google.com> | ||
624 | 7 | Balázs Dán <balazs.dan@gmail.com> | ||
625 | 8 | Bharat Mediratta <bharat@menalto.com> | ||
626 | 9 | Chandler Carruth <chandlerc@google.com> | ||
627 | 10 | Chris Prince <cprince@google.com> | ||
628 | 11 | Chris Taylor <taylorc@google.com> | ||
629 | 12 | Dan Egnor <egnor@google.com> | ||
630 | 13 | Eric Roman <eroman@chromium.org> | ||
631 | 14 | Hady Zalek <hady.zalek@gmail.com> | ||
632 | 15 | Jeffrey Yasskin <jyasskin@google.com> | ||
633 | 16 | Jói Sigurðsson <joi@google.com> | ||
634 | 17 | Keir Mierle <mierle@gmail.com> | ||
635 | 18 | Keith Ray <keith.ray@gmail.com> | ||
636 | 19 | Kenton Varda <kenton@google.com> | ||
637 | 20 | Manuel Klimek <klimek@google.com> | ||
638 | 21 | Markus Heule <markus.heule@gmail.com> | ||
639 | 22 | Mika Raento <mikie@iki.fi> | ||
640 | 23 | Miklós Fazekas <mfazekas@szemafor.com> | ||
641 | 24 | Pasi Valminen <pasi.valminen@gmail.com> | ||
642 | 25 | Patrick Hanna <phanna@google.com> | ||
643 | 26 | Patrick Riley <pfr@google.com> | ||
644 | 27 | Peter Kaminski <piotrk@google.com> | ||
645 | 28 | Preston Jackson <preston.a.jackson@gmail.com> | ||
646 | 29 | Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com> | ||
647 | 30 | Russ Cox <rsc@google.com> | ||
648 | 31 | Russ Rufer <russ@pentad.com> | ||
649 | 32 | Sean Mcafee <eefacm@gmail.com> | ||
650 | 33 | Sigurður Ásgeirsson <siggi@google.com> | ||
651 | 34 | Tracy Bialik <tracy@pentad.com> | ||
652 | 35 | Vadim Berman <vadimb@google.com> | ||
653 | 36 | Vlad Losev <vladl@google.com> | ||
654 | 37 | Zhanyong Wan <wan@google.com> | ||
655 | 0 | 38 | ||
656 | === added file '3rd_party/gmock/gtest/Makefile.am' | |||
657 | --- 3rd_party/gmock/gtest/Makefile.am 1970-01-01 00:00:00 +0000 | |||
658 | +++ 3rd_party/gmock/gtest/Makefile.am 2014-04-08 15:07:37 +0000 | |||
659 | @@ -0,0 +1,305 @@ | |||
660 | 1 | # Automake file | ||
661 | 2 | |||
662 | 3 | ACLOCAL_AMFLAGS = -I m4 | ||
663 | 4 | |||
664 | 5 | # Nonstandard package files for distribution | ||
665 | 6 | EXTRA_DIST = \ | ||
666 | 7 | CHANGES \ | ||
667 | 8 | CONTRIBUTORS \ | ||
668 | 9 | LICENSE \ | ||
669 | 10 | include/gtest/gtest-param-test.h.pump \ | ||
670 | 11 | include/gtest/internal/gtest-param-util-generated.h.pump \ | ||
671 | 12 | include/gtest/internal/gtest-tuple.h.pump \ | ||
672 | 13 | include/gtest/internal/gtest-type-util.h.pump \ | ||
673 | 14 | make/Makefile \ | ||
674 | 15 | scripts/fuse_gtest_files.py \ | ||
675 | 16 | scripts/gen_gtest_pred_impl.py \ | ||
676 | 17 | scripts/pump.py \ | ||
677 | 18 | scripts/test/Makefile | ||
678 | 19 | |||
679 | 20 | # gtest source files that we don't compile directly. They are | ||
680 | 21 | # #included by gtest-all.cc. | ||
681 | 22 | GTEST_SRC = \ | ||
682 | 23 | src/gtest-death-test.cc \ | ||
683 | 24 | src/gtest-filepath.cc \ | ||
684 | 25 | src/gtest-internal-inl.h \ | ||
685 | 26 | src/gtest-port.cc \ | ||
686 | 27 | src/gtest-printers.cc \ | ||
687 | 28 | src/gtest-test-part.cc \ | ||
688 | 29 | src/gtest-typed-test.cc \ | ||
689 | 30 | src/gtest.cc | ||
690 | 31 | |||
691 | 32 | EXTRA_DIST += $(GTEST_SRC) | ||
692 | 33 | |||
693 | 34 | # Sample files that we don't compile. | ||
694 | 35 | EXTRA_DIST += \ | ||
695 | 36 | samples/prime_tables.h \ | ||
696 | 37 | samples/sample2_unittest.cc \ | ||
697 | 38 | samples/sample3_unittest.cc \ | ||
698 | 39 | samples/sample4_unittest.cc \ | ||
699 | 40 | samples/sample5_unittest.cc \ | ||
700 | 41 | samples/sample6_unittest.cc \ | ||
701 | 42 | samples/sample7_unittest.cc \ | ||
702 | 43 | samples/sample8_unittest.cc \ | ||
703 | 44 | samples/sample9_unittest.cc | ||
704 | 45 | |||
705 | 46 | # C++ test files that we don't compile directly. | ||
706 | 47 | EXTRA_DIST += \ | ||
707 | 48 | test/gtest-death-test_ex_test.cc \ | ||
708 | 49 | test/gtest-death-test_test.cc \ | ||
709 | 50 | test/gtest-filepath_test.cc \ | ||
710 | 51 | test/gtest-linked_ptr_test.cc \ | ||
711 | 52 | test/gtest-listener_test.cc \ | ||
712 | 53 | test/gtest-message_test.cc \ | ||
713 | 54 | test/gtest-options_test.cc \ | ||
714 | 55 | test/gtest-param-test2_test.cc \ | ||
715 | 56 | test/gtest-param-test2_test.cc \ | ||
716 | 57 | test/gtest-param-test_test.cc \ | ||
717 | 58 | test/gtest-param-test_test.cc \ | ||
718 | 59 | test/gtest-param-test_test.h \ | ||
719 | 60 | test/gtest-port_test.cc \ | ||
720 | 61 | test/gtest-printers_test.cc \ | ||
721 | 62 | test/gtest-test-part_test.cc \ | ||
722 | 63 | test/gtest-tuple_test.cc \ | ||
723 | 64 | test/gtest-typed-test2_test.cc \ | ||
724 | 65 | test/gtest-typed-test_test.cc \ | ||
725 | 66 | test/gtest-typed-test_test.h \ | ||
726 | 67 | test/gtest-unittest-api_test.cc \ | ||
727 | 68 | test/gtest_break_on_failure_unittest_.cc \ | ||
728 | 69 | test/gtest_catch_exceptions_test_.cc \ | ||
729 | 70 | test/gtest_color_test_.cc \ | ||
730 | 71 | test/gtest_env_var_test_.cc \ | ||
731 | 72 | test/gtest_environment_test.cc \ | ||
732 | 73 | test/gtest_filter_unittest_.cc \ | ||
733 | 74 | test/gtest_help_test_.cc \ | ||
734 | 75 | test/gtest_list_tests_unittest_.cc \ | ||
735 | 76 | test/gtest_main_unittest.cc \ | ||
736 | 77 | test/gtest_no_test_unittest.cc \ | ||
737 | 78 | test/gtest_output_test_.cc \ | ||
738 | 79 | test/gtest_pred_impl_unittest.cc \ | ||
739 | 80 | test/gtest_prod_test.cc \ | ||
740 | 81 | test/gtest_repeat_test.cc \ | ||
741 | 82 | test/gtest_shuffle_test_.cc \ | ||
742 | 83 | test/gtest_sole_header_test.cc \ | ||
743 | 84 | test/gtest_stress_test.cc \ | ||
744 | 85 | test/gtest_throw_on_failure_ex_test.cc \ | ||
745 | 86 | test/gtest_throw_on_failure_test_.cc \ | ||
746 | 87 | test/gtest_uninitialized_test_.cc \ | ||
747 | 88 | test/gtest_unittest.cc \ | ||
748 | 89 | test/gtest_unittest.cc \ | ||
749 | 90 | test/gtest_xml_outfile1_test_.cc \ | ||
750 | 91 | test/gtest_xml_outfile2_test_.cc \ | ||
751 | 92 | test/gtest_xml_output_unittest_.cc \ | ||
752 | 93 | test/production.cc \ | ||
753 | 94 | test/production.h | ||
754 | 95 | |||
755 | 96 | # Python tests that we don't run. | ||
756 | 97 | EXTRA_DIST += \ | ||
757 | 98 | test/gtest_break_on_failure_unittest.py \ | ||
758 | 99 | test/gtest_catch_exceptions_test.py \ | ||
759 | 100 | test/gtest_color_test.py \ | ||
760 | 101 | test/gtest_env_var_test.py \ | ||
761 | 102 | test/gtest_filter_unittest.py \ | ||
762 | 103 | test/gtest_help_test.py \ | ||
763 | 104 | test/gtest_list_tests_unittest.py \ | ||
764 | 105 | test/gtest_output_test.py \ | ||
765 | 106 | test/gtest_output_test_golden_lin.txt \ | ||
766 | 107 | test/gtest_shuffle_test.py \ | ||
767 | 108 | test/gtest_test_utils.py \ | ||
768 | 109 | test/gtest_throw_on_failure_test.py \ | ||
769 | 110 | test/gtest_uninitialized_test.py \ | ||
770 | 111 | test/gtest_xml_outfiles_test.py \ | ||
771 | 112 | test/gtest_xml_output_unittest.py \ | ||
772 | 113 | test/gtest_xml_test_utils.py | ||
773 | 114 | |||
774 | 115 | # CMake script | ||
775 | 116 | EXTRA_DIST += \ | ||
776 | 117 | CMakeLists.txt \ | ||
777 | 118 | cmake/internal_utils.cmake | ||
778 | 119 | |||
779 | 120 | # MSVC project files | ||
780 | 121 | EXTRA_DIST += \ | ||
781 | 122 | msvc/gtest-md.sln \ | ||
782 | 123 | msvc/gtest-md.vcproj \ | ||
783 | 124 | msvc/gtest.sln \ | ||
784 | 125 | msvc/gtest.vcproj \ | ||
785 | 126 | msvc/gtest_main-md.vcproj \ | ||
786 | 127 | msvc/gtest_main.vcproj \ | ||
787 | 128 | msvc/gtest_prod_test-md.vcproj \ | ||
788 | 129 | msvc/gtest_prod_test.vcproj \ | ||
789 | 130 | msvc/gtest_unittest-md.vcproj \ | ||
790 | 131 | msvc/gtest_unittest.vcproj | ||
791 | 132 | |||
792 | 133 | # xcode project files | ||
793 | 134 | EXTRA_DIST += \ | ||
794 | 135 | xcode/Config/DebugProject.xcconfig \ | ||
795 | 136 | xcode/Config/FrameworkTarget.xcconfig \ | ||
796 | 137 | xcode/Config/General.xcconfig \ | ||
797 | 138 | xcode/Config/ReleaseProject.xcconfig \ | ||
798 | 139 | xcode/Config/StaticLibraryTarget.xcconfig \ | ||
799 | 140 | xcode/Config/TestTarget.xcconfig \ | ||
800 | 141 | xcode/Resources/Info.plist \ | ||
801 | 142 | xcode/Scripts/runtests.sh \ | ||
802 | 143 | xcode/Scripts/versiongenerate.py \ | ||
803 | 144 | xcode/gtest.xcodeproj/project.pbxproj | ||
804 | 145 | |||
805 | 146 | # xcode sample files | ||
806 | 147 | EXTRA_DIST += \ | ||
807 | 148 | xcode/Samples/FrameworkSample/Info.plist \ | ||
808 | 149 | xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \ | ||
809 | 150 | xcode/Samples/FrameworkSample/runtests.sh \ | ||
810 | 151 | xcode/Samples/FrameworkSample/widget.cc \ | ||
811 | 152 | xcode/Samples/FrameworkSample/widget.h \ | ||
812 | 153 | xcode/Samples/FrameworkSample/widget_test.cc | ||
813 | 154 | |||
814 | 155 | # C++Builder project files | ||
815 | 156 | EXTRA_DIST += \ | ||
816 | 157 | codegear/gtest.cbproj \ | ||
817 | 158 | codegear/gtest.groupproj \ | ||
818 | 159 | codegear/gtest_all.cc \ | ||
819 | 160 | codegear/gtest_link.cc \ | ||
820 | 161 | codegear/gtest_main.cbproj \ | ||
821 | 162 | codegear/gtest_unittest.cbproj | ||
822 | 163 | |||
823 | 164 | # Distribute and install M4 macro | ||
824 | 165 | m4datadir = $(datadir)/aclocal | ||
825 | 166 | m4data_DATA = m4/gtest.m4 | ||
826 | 167 | EXTRA_DIST += $(m4data_DATA) | ||
827 | 168 | |||
828 | 169 | # We define the global AM_CPPFLAGS as everything we compile includes from these | ||
829 | 170 | # directories. | ||
830 | 171 | AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include | ||
831 | 172 | |||
832 | 173 | # Modifies compiler and linker flags for pthreads compatibility. | ||
833 | 174 | if HAVE_PTHREADS | ||
834 | 175 | AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1 | ||
835 | 176 | AM_LIBS = @PTHREAD_LIBS@ | ||
836 | 177 | else | ||
837 | 178 | AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0 | ||
838 | 179 | endif | ||
839 | 180 | |||
840 | 181 | # Build rules for libraries. | ||
841 | 182 | lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la | ||
842 | 183 | |||
843 | 184 | lib_libgtest_la_SOURCES = src/gtest-all.cc | ||
844 | 185 | |||
845 | 186 | pkginclude_HEADERS = \ | ||
846 | 187 | include/gtest/gtest-death-test.h \ | ||
847 | 188 | include/gtest/gtest-message.h \ | ||
848 | 189 | include/gtest/gtest-param-test.h \ | ||
849 | 190 | include/gtest/gtest-printers.h \ | ||
850 | 191 | include/gtest/gtest-spi.h \ | ||
851 | 192 | include/gtest/gtest-test-part.h \ | ||
852 | 193 | include/gtest/gtest-typed-test.h \ | ||
853 | 194 | include/gtest/gtest.h \ | ||
854 | 195 | include/gtest/gtest_pred_impl.h \ | ||
855 | 196 | include/gtest/gtest_prod.h | ||
856 | 197 | |||
857 | 198 | pkginclude_internaldir = $(pkgincludedir)/internal | ||
858 | 199 | pkginclude_internal_HEADERS = \ | ||
859 | 200 | include/gtest/internal/gtest-death-test-internal.h \ | ||
860 | 201 | include/gtest/internal/gtest-filepath.h \ | ||
861 | 202 | include/gtest/internal/gtest-internal.h \ | ||
862 | 203 | include/gtest/internal/gtest-linked_ptr.h \ | ||
863 | 204 | include/gtest/internal/gtest-param-util-generated.h \ | ||
864 | 205 | include/gtest/internal/gtest-param-util.h \ | ||
865 | 206 | include/gtest/internal/gtest-port.h \ | ||
866 | 207 | include/gtest/internal/gtest-string.h \ | ||
867 | 208 | include/gtest/internal/gtest-tuple.h \ | ||
868 | 209 | include/gtest/internal/gtest-type-util.h | ||
869 | 210 | |||
870 | 211 | lib_libgtest_main_la_SOURCES = src/gtest_main.cc | ||
871 | 212 | lib_libgtest_main_la_LIBADD = lib/libgtest.la | ||
872 | 213 | |||
873 | 214 | # Bulid rules for samples and tests. Automake's naming for some of | ||
874 | 215 | # these variables isn't terribly obvious, so this is a brief | ||
875 | 216 | # reference: | ||
876 | 217 | # | ||
877 | 218 | # TESTS -- Programs run automatically by "make check" | ||
878 | 219 | # check_PROGRAMS -- Programs built by "make check" but not necessarily run | ||
879 | 220 | |||
880 | 221 | noinst_LTLIBRARIES = samples/libsamples.la | ||
881 | 222 | |||
882 | 223 | samples_libsamples_la_SOURCES = \ | ||
883 | 224 | samples/sample1.cc \ | ||
884 | 225 | samples/sample1.h \ | ||
885 | 226 | samples/sample2.cc \ | ||
886 | 227 | samples/sample2.h \ | ||
887 | 228 | samples/sample3-inl.h \ | ||
888 | 229 | samples/sample4.cc \ | ||
889 | 230 | samples/sample4.h | ||
890 | 231 | |||
891 | 232 | TESTS= | ||
892 | 233 | TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \ | ||
893 | 234 | GTEST_BUILD_DIR="$(top_builddir)/test" | ||
894 | 235 | check_PROGRAMS= | ||
895 | 236 | |||
896 | 237 | # A simple sample on using gtest. | ||
897 | 238 | TESTS += samples/sample1_unittest | ||
898 | 239 | check_PROGRAMS += samples/sample1_unittest | ||
899 | 240 | samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc | ||
900 | 241 | samples_sample1_unittest_LDADD = lib/libgtest_main.la \ | ||
901 | 242 | lib/libgtest.la \ | ||
902 | 243 | samples/libsamples.la | ||
903 | 244 | |||
904 | 245 | # Another sample. It also verifies that libgtest works. | ||
905 | 246 | TESTS += samples/sample10_unittest | ||
906 | 247 | check_PROGRAMS += samples/sample10_unittest | ||
907 | 248 | samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc | ||
908 | 249 | samples_sample10_unittest_LDADD = lib/libgtest.la | ||
909 | 250 | |||
910 | 251 | # This tests most constructs of gtest and verifies that libgtest_main | ||
911 | 252 | # and libgtest work. | ||
912 | 253 | TESTS += test/gtest_all_test | ||
913 | 254 | check_PROGRAMS += test/gtest_all_test | ||
914 | 255 | test_gtest_all_test_SOURCES = test/gtest_all_test.cc | ||
915 | 256 | test_gtest_all_test_LDADD = lib/libgtest_main.la \ | ||
916 | 257 | lib/libgtest.la | ||
917 | 258 | |||
918 | 259 | # Tests that fused gtest files compile and work. | ||
919 | 260 | FUSED_GTEST_SRC = \ | ||
920 | 261 | fused-src/gtest/gtest-all.cc \ | ||
921 | 262 | fused-src/gtest/gtest.h \ | ||
922 | 263 | fused-src/gtest/gtest_main.cc | ||
923 | 264 | |||
924 | 265 | if HAVE_PYTHON | ||
925 | 266 | TESTS += test/fused_gtest_test | ||
926 | 267 | check_PROGRAMS += test/fused_gtest_test | ||
927 | 268 | test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \ | ||
928 | 269 | samples/sample1.cc samples/sample1_unittest.cc | ||
929 | 270 | test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src" | ||
930 | 271 | |||
931 | 272 | # Build rules for putting fused Google Test files into the distribution | ||
932 | 273 | # package. The user can also create those files by manually running | ||
933 | 274 | # scripts/fuse_gtest_files.py. | ||
934 | 275 | $(test_fused_gtest_test_SOURCES): fused-gtest | ||
935 | 276 | |||
936 | 277 | fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \ | ||
937 | 278 | $(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \ | ||
938 | 279 | scripts/fuse_gtest_files.py | ||
939 | 280 | mkdir -p "$(srcdir)/fused-src" | ||
940 | 281 | chmod -R u+w "$(srcdir)/fused-src" | ||
941 | 282 | rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc" | ||
942 | 283 | rm -f "$(srcdir)/fused-src/gtest/gtest.h" | ||
943 | 284 | "$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src" | ||
944 | 285 | cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/" | ||
945 | 286 | |||
946 | 287 | maintainer-clean-local: | ||
947 | 288 | rm -rf "$(srcdir)/fused-src" | ||
948 | 289 | endif | ||
949 | 290 | |||
950 | 291 | # Death tests may produce core dumps in the build directory. In case | ||
951 | 292 | # this happens, clean them to keep distcleancheck happy. | ||
952 | 293 | CLEANFILES = core | ||
953 | 294 | |||
954 | 295 | # Disables 'make install' as installing a compiled version of Google | ||
955 | 296 | # Test can lead to undefined behavior due to violation of the | ||
956 | 297 | # One-Definition Rule. | ||
957 | 298 | |||
958 | 299 | install-exec-local: | ||
959 | 300 | echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system." | ||
960 | 301 | false | ||
961 | 302 | |||
962 | 303 | install-data-local: | ||
963 | 304 | echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system." | ||
964 | 305 | false | ||
965 | 0 | 306 | ||
966 | === added file '3rd_party/gmock/gtest/README' | |||
967 | --- 3rd_party/gmock/gtest/README 1970-01-01 00:00:00 +0000 | |||
968 | +++ 3rd_party/gmock/gtest/README 2014-04-08 15:07:37 +0000 | |||
969 | @@ -0,0 +1,435 @@ | |||
970 | 1 | Google C++ Testing Framework | ||
971 | 2 | ============================ | ||
972 | 3 | |||
973 | 4 | http://code.google.com/p/googletest/ | ||
974 | 5 | |||
975 | 6 | Overview | ||
976 | 7 | -------- | ||
977 | 8 | |||
978 | 9 | Google's framework for writing C++ tests on a variety of platforms | ||
979 | 10 | (Linux, Mac OS X, Windows, Windows CE, Symbian, etc). Based on the | ||
980 | 11 | xUnit architecture. Supports automatic test discovery, a rich set of | ||
981 | 12 | assertions, user-defined assertions, death tests, fatal and non-fatal | ||
982 | 13 | failures, various options for running the tests, and XML test report | ||
983 | 14 | generation. | ||
984 | 15 | |||
985 | 16 | Please see the project page above for more information as well as the | ||
986 | 17 | mailing list for questions, discussions, and development. There is | ||
987 | 18 | also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please | ||
988 | 19 | join us! | ||
989 | 20 | |||
990 | 21 | Requirements for End Users | ||
991 | 22 | -------------------------- | ||
992 | 23 | |||
993 | 24 | Google Test is designed to have fairly minimal requirements to build | ||
994 | 25 | and use with your projects, but there are some. Currently, we support | ||
995 | 26 | Linux, Windows, Mac OS X, and Cygwin. We will also make our best | ||
996 | 27 | effort to support other platforms (e.g. Solaris, AIX, and z/OS). | ||
997 | 28 | However, since core members of the Google Test project have no access | ||
998 | 29 | to these platforms, Google Test may have outstanding issues there. If | ||
999 | 30 | you notice any problems on your platform, please notify | ||
1000 | 31 | googletestframework@googlegroups.com. Patches for fixing them are | ||
1001 | 32 | even more welcome! | ||
1002 | 33 | |||
1003 | 34 | ### Linux Requirements ### | ||
1004 | 35 | |||
1005 | 36 | These are the base requirements to build and use Google Test from a source | ||
1006 | 37 | package (as described below): | ||
1007 | 38 | * GNU-compatible Make or gmake | ||
1008 | 39 | * POSIX-standard shell | ||
1009 | 40 | * POSIX(-2) Regular Expressions (regex.h) | ||
1010 | 41 | * A C++98-standard-compliant compiler | ||
1011 | 42 | |||
1012 | 43 | ### Windows Requirements ### | ||
1013 | 44 | |||
1014 | 45 | * Microsoft Visual C++ 7.1 or newer | ||
1015 | 46 | |||
1016 | 47 | ### Cygwin Requirements ### | ||
1017 | 48 | |||
1018 | 49 | * Cygwin 1.5.25-14 or newer | ||
1019 | 50 | |||
1020 | 51 | ### Mac OS X Requirements ### | ||
1021 | 52 | |||
1022 | 53 | * Mac OS X 10.4 Tiger or newer | ||
1023 | 54 | * Developer Tools Installed | ||
1024 | 55 | |||
1025 | 56 | Also, you'll need CMake 2.6.4 or higher if you want to build the | ||
1026 | 57 | samples using the provided CMake script, regardless of the platform. | ||
1027 | 58 | |||
1028 | 59 | Requirements for Contributors | ||
1029 | 60 | ----------------------------- | ||
1030 | 61 | |||
1031 | 62 | We welcome patches. If you plan to contribute a patch, you need to | ||
1032 | 63 | build Google Test and its own tests from an SVN checkout (described | ||
1033 | 64 | below), which has further requirements: | ||
1034 | 65 | |||
1035 | 66 | * Python version 2.3 or newer (for running some of the tests and | ||
1036 | 67 | re-generating certain source files from templates) | ||
1037 | 68 | * CMake 2.6.4 or newer | ||
1038 | 69 | |||
1039 | 70 | Getting the Source | ||
1040 | 71 | ------------------ | ||
1041 | 72 | |||
1042 | 73 | There are two primary ways of getting Google Test's source code: you | ||
1043 | 74 | can download a stable source release in your preferred archive format, | ||
1044 | 75 | or directly check out the source from our Subversion (SVN) repositary. | ||
1045 | 76 | The SVN checkout requires a few extra steps and some extra software | ||
1046 | 77 | packages on your system, but lets you track the latest development and | ||
1047 | 78 | make patches much more easily, so we highly encourage it. | ||
1048 | 79 | |||
1049 | 80 | ### Source Package ### | ||
1050 | 81 | |||
1051 | 82 | Google Test is released in versioned source packages which can be | ||
1052 | 83 | downloaded from the download page [1]. Several different archive | ||
1053 | 84 | formats are provided, but the only difference is the tools used to | ||
1054 | 85 | manipulate them, and the size of the resulting file. Download | ||
1055 | 86 | whichever you are most comfortable with. | ||
1056 | 87 | |||
1057 | 88 | [1] http://code.google.com/p/googletest/downloads/list | ||
1058 | 89 | |||
1059 | 90 | Once the package is downloaded, expand it using whichever tools you | ||
1060 | 91 | prefer for that type. This will result in a new directory with the | ||
1061 | 92 | name "gtest-X.Y.Z" which contains all of the source code. Here are | ||
1062 | 93 | some examples on Linux: | ||
1063 | 94 | |||
1064 | 95 | tar -xvzf gtest-X.Y.Z.tar.gz | ||
1065 | 96 | tar -xvjf gtest-X.Y.Z.tar.bz2 | ||
1066 | 97 | unzip gtest-X.Y.Z.zip | ||
1067 | 98 | |||
1068 | 99 | ### SVN Checkout ### | ||
1069 | 100 | |||
1070 | 101 | To check out the main branch (also known as the "trunk") of Google | ||
1071 | 102 | Test, run the following Subversion command: | ||
1072 | 103 | |||
1073 | 104 | svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn | ||
1074 | 105 | |||
1075 | 106 | Setting up the Build | ||
1076 | 107 | -------------------- | ||
1077 | 108 | |||
1078 | 109 | To build Google Test and your tests that use it, you need to tell your | ||
1079 | 110 | build system where to find its headers and source files. The exact | ||
1080 | 111 | way to do it depends on which build system you use, and is usually | ||
1081 | 112 | straightforward. | ||
1082 | 113 | |||
1083 | 114 | ### Generic Build Instructions ### | ||
1084 | 115 | |||
1085 | 116 | Suppose you put Google Test in directory ${GTEST_DIR}. To build it, | ||
1086 | 117 | create a library build target (or a project as called by Visual Studio | ||
1087 | 118 | and Xcode) to compile | ||
1088 | 119 | |||
1089 | 120 | ${GTEST_DIR}/src/gtest-all.cc | ||
1090 | 121 | |||
1091 | 122 | with ${GTEST_DIR}/include in the system header search path and ${GTEST_DIR} | ||
1092 | 123 | in the normal header search path. Assuming a Linux-like system and gcc, | ||
1093 | 124 | something like the following will do: | ||
1094 | 125 | |||
1095 | 126 | g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \ | ||
1096 | 127 | -pthread -c ${GTEST_DIR}/src/gtest-all.cc | ||
1097 | 128 | ar -rv libgtest.a gtest-all.o | ||
1098 | 129 | |||
1099 | 130 | (We need -pthread as Google Test uses threads.) | ||
1100 | 131 | |||
1101 | 132 | Next, you should compile your test source file with | ||
1102 | 133 | ${GTEST_DIR}/include in the system header search path, and link it | ||
1103 | 134 | with gtest and any other necessary libraries: | ||
1104 | 135 | |||
1105 | 136 | g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \ | ||
1106 | 137 | -o your_test | ||
1107 | 138 | |||
1108 | 139 | As an example, the make/ directory contains a Makefile that you can | ||
1109 | 140 | use to build Google Test on systems where GNU make is available | ||
1110 | 141 | (e.g. Linux, Mac OS X, and Cygwin). It doesn't try to build Google | ||
1111 | 142 | Test's own tests. Instead, it just builds the Google Test library and | ||
1112 | 143 | a sample test. You can use it as a starting point for your own build | ||
1113 | 144 | script. | ||
1114 | 145 | |||
1115 | 146 | If the default settings are correct for your environment, the | ||
1116 | 147 | following commands should succeed: | ||
1117 | 148 | |||
1118 | 149 | cd ${GTEST_DIR}/make | ||
1119 | 150 | make | ||
1120 | 151 | ./sample1_unittest | ||
1121 | 152 | |||
1122 | 153 | If you see errors, try to tweak the contents of make/Makefile to make | ||
1123 | 154 | them go away. There are instructions in make/Makefile on how to do | ||
1124 | 155 | it. | ||
1125 | 156 | |||
1126 | 157 | ### Using CMake ### | ||
1127 | 158 | |||
1128 | 159 | Google Test comes with a CMake build script (CMakeLists.txt) that can | ||
1129 | 160 | be used on a wide range of platforms ("C" stands for cross-platofrm.). | ||
1130 | 161 | If you don't have CMake installed already, you can download it for | ||
1131 | 162 | free from http://www.cmake.org/. | ||
1132 | 163 | |||
1133 | 164 | CMake works by generating native makefiles or build projects that can | ||
1134 | 165 | be used in the compiler environment of your choice. The typical | ||
1135 | 166 | workflow starts with: | ||
1136 | 167 | |||
1137 | 168 | mkdir mybuild # Create a directory to hold the build output. | ||
1138 | 169 | cd mybuild | ||
1139 | 170 | cmake ${GTEST_DIR} # Generate native build scripts. | ||
1140 | 171 | |||
1141 | 172 | If you want to build Google Test's samples, you should replace the | ||
1142 | 173 | last command with | ||
1143 | 174 | |||
1144 | 175 | cmake -Dgtest_build_samples=ON ${GTEST_DIR} | ||
1145 | 176 | |||
1146 | 177 | If you are on a *nix system, you should now see a Makefile in the | ||
1147 | 178 | current directory. Just type 'make' to build gtest. | ||
1148 | 179 | |||
1149 | 180 | If you use Windows and have Vistual Studio installed, a gtest.sln file | ||
1150 | 181 | and several .vcproj files will be created. You can then build them | ||
1151 | 182 | using Visual Studio. | ||
1152 | 183 | |||
1153 | 184 | On Mac OS X with Xcode installed, a .xcodeproj file will be generated. | ||
1154 | 185 | |||
1155 | 186 | ### Legacy Build Scripts ### | ||
1156 | 187 | |||
1157 | 188 | Before settling on CMake, we have been providing hand-maintained build | ||
1158 | 189 | projects/scripts for Visual Studio, Xcode, and Autotools. While we | ||
1159 | 190 | continue to provide them for convenience, they are not actively | ||
1160 | 191 | maintained any more. We highly recommend that you follow the | ||
1161 | 192 | instructions in the previous two sections to integrate Google Test | ||
1162 | 193 | with your existing build system. | ||
1163 | 194 | |||
1164 | 195 | If you still need to use the legacy build scripts, here's how: | ||
1165 | 196 | |||
1166 | 197 | The msvc\ folder contains two solutions with Visual C++ projects. | ||
1167 | 198 | Open the gtest.sln or gtest-md.sln file using Visual Studio, and you | ||
1168 | 199 | are ready to build Google Test the same way you build any Visual | ||
1169 | 200 | Studio project. Files that have names ending with -md use DLL | ||
1170 | 201 | versions of Microsoft runtime libraries (the /MD or the /MDd compiler | ||
1171 | 202 | option). Files without that suffix use static versions of the runtime | ||
1172 | 203 | libraries (the /MT or the /MTd option). Please note that one must use | ||
1173 | 204 | the same option to compile both gtest and the test code. If you use | ||
1174 | 205 | Visual Studio 2005 or above, we recommend the -md version as /MD is | ||
1175 | 206 | the default for new projects in these versions of Visual Studio. | ||
1176 | 207 | |||
1177 | 208 | On Mac OS X, open the gtest.xcodeproj in the xcode/ folder using | ||
1178 | 209 | Xcode. Build the "gtest" target. The universal binary framework will | ||
1179 | 210 | end up in your selected build directory (selected in the Xcode | ||
1180 | 211 | "Preferences..." -> "Building" pane and defaults to xcode/build). | ||
1181 | 212 | Alternatively, at the command line, enter: | ||
1182 | 213 | |||
1183 | 214 | xcodebuild | ||
1184 | 215 | |||
1185 | 216 | This will build the "Release" configuration of gtest.framework in your | ||
1186 | 217 | default build location. See the "xcodebuild" man page for more | ||
1187 | 218 | information about building different configurations and building in | ||
1188 | 219 | different locations. | ||
1189 | 220 | |||
1190 | 221 | If you wish to use the Google Test Xcode project with Xcode 4.x and | ||
1191 | 222 | above, you need to either: | ||
1192 | 223 | * update the SDK configuration options in xcode/Config/General.xconfig. | ||
1193 | 224 | Comment options SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION. If | ||
1194 | 225 | you choose this route you lose the ability to target earlier versions | ||
1195 | 226 | of MacOS X. | ||
1196 | 227 | * Install an SDK for an earlier version. This doesn't appear to be | ||
1197 | 228 | supported by Apple, but has been reported to work | ||
1198 | 229 | (http://stackoverflow.com/questions/5378518). | ||
1199 | 230 | |||
1200 | 231 | Tweaking Google Test | ||
1201 | 232 | -------------------- | ||
1202 | 233 | |||
1203 | 234 | Google Test can be used in diverse environments. The default | ||
1204 | 235 | configuration may not work (or may not work well) out of the box in | ||
1205 | 236 | some environments. However, you can easily tweak Google Test by | ||
1206 | 237 | defining control macros on the compiler command line. Generally, | ||
1207 | 238 | these macros are named like GTEST_XYZ and you define them to either 1 | ||
1208 | 239 | or 0 to enable or disable a certain feature. | ||
1209 | 240 | |||
1210 | 241 | We list the most frequently used macros below. For a complete list, | ||
1211 | 242 | see file include/gtest/internal/gtest-port.h. | ||
1212 | 243 | |||
1213 | 244 | ### Choosing a TR1 Tuple Library ### | ||
1214 | 245 | |||
1215 | 246 | Some Google Test features require the C++ Technical Report 1 (TR1) | ||
1216 | 247 | tuple library, which is not yet available with all compilers. The | ||
1217 | 248 | good news is that Google Test implements a subset of TR1 tuple that's | ||
1218 | 249 | enough for its own need, and will automatically use this when the | ||
1219 | 250 | compiler doesn't provide TR1 tuple. | ||
1220 | 251 | |||
1221 | 252 | Usually you don't need to care about which tuple library Google Test | ||
1222 | 253 | uses. However, if your project already uses TR1 tuple, you need to | ||
1223 | 254 | tell Google Test to use the same TR1 tuple library the rest of your | ||
1224 | 255 | project uses, or the two tuple implementations will clash. To do | ||
1225 | 256 | that, add | ||
1226 | 257 | |||
1227 | 258 | -DGTEST_USE_OWN_TR1_TUPLE=0 | ||
1228 | 259 | |||
1229 | 260 | to the compiler flags while compiling Google Test and your tests. If | ||
1230 | 261 | you want to force Google Test to use its own tuple library, just add | ||
1231 | 262 | |||
1232 | 263 | -DGTEST_USE_OWN_TR1_TUPLE=1 | ||
1233 | 264 | |||
1234 | 265 | to the compiler flags instead. | ||
1235 | 266 | |||
1236 | 267 | If you don't want Google Test to use tuple at all, add | ||
1237 | 268 | |||
1238 | 269 | -DGTEST_HAS_TR1_TUPLE=0 | ||
1239 | 270 | |||
1240 | 271 | and all features using tuple will be disabled. | ||
1241 | 272 | |||
1242 | 273 | ### Multi-threaded Tests ### | ||
1243 | 274 | |||
1244 | 275 | Google Test is thread-safe where the pthread library is available. | ||
1245 | 276 | After #include "gtest/gtest.h", you can check the GTEST_IS_THREADSAFE | ||
1246 | 277 | macro to see whether this is the case (yes if the macro is #defined to | ||
1247 | 278 | 1, no if it's undefined.). | ||
1248 | 279 | |||
1249 | 280 | If Google Test doesn't correctly detect whether pthread is available | ||
1250 | 281 | in your environment, you can force it with | ||
1251 | 282 | |||
1252 | 283 | -DGTEST_HAS_PTHREAD=1 | ||
1253 | 284 | |||
1254 | 285 | or | ||
1255 | 286 | |||
1256 | 287 | -DGTEST_HAS_PTHREAD=0 | ||
1257 | 288 | |||
1258 | 289 | When Google Test uses pthread, you may need to add flags to your | ||
1259 | 290 | compiler and/or linker to select the pthread library, or you'll get | ||
1260 | 291 | link errors. If you use the CMake script or the deprecated Autotools | ||
1261 | 292 | script, this is taken care of for you. If you use your own build | ||
1262 | 293 | script, you'll need to read your compiler and linker's manual to | ||
1263 | 294 | figure out what flags to add. | ||
1264 | 295 | |||
1265 | 296 | ### As a Shared Library (DLL) ### | ||
1266 | 297 | |||
1267 | 298 | Google Test is compact, so most users can build and link it as a | ||
1268 | 299 | static library for the simplicity. You can choose to use Google Test | ||
1269 | 300 | as a shared library (known as a DLL on Windows) if you prefer. | ||
1270 | 301 | |||
1271 | 302 | To compile *gtest* as a shared library, add | ||
1272 | 303 | |||
1273 | 304 | -DGTEST_CREATE_SHARED_LIBRARY=1 | ||
1274 | 305 | |||
1275 | 306 | to the compiler flags. You'll also need to tell the linker to produce | ||
1276 | 307 | a shared library instead - consult your linker's manual for how to do | ||
1277 | 308 | it. | ||
1278 | 309 | |||
1279 | 310 | To compile your *tests* that use the gtest shared library, add | ||
1280 | 311 | |||
1281 | 312 | -DGTEST_LINKED_AS_SHARED_LIBRARY=1 | ||
1282 | 313 | |||
1283 | 314 | to the compiler flags. | ||
1284 | 315 | |||
1285 | 316 | Note: while the above steps aren't technically necessary today when | ||
1286 | 317 | using some compilers (e.g. GCC), they may become necessary in the | ||
1287 | 318 | future, if we decide to improve the speed of loading the library (see | ||
1288 | 319 | http://gcc.gnu.org/wiki/Visibility for details). Therefore you are | ||
1289 | 320 | recommended to always add the above flags when using Google Test as a | ||
1290 | 321 | shared library. Otherwise a future release of Google Test may break | ||
1291 | 322 | your build script. | ||
1292 | 323 | |||
1293 | 324 | ### Avoiding Macro Name Clashes ### | ||
1294 | 325 | |||
1295 | 326 | In C++, macros don't obey namespaces. Therefore two libraries that | ||
1296 | 327 | both define a macro of the same name will clash if you #include both | ||
1297 | 328 | definitions. In case a Google Test macro clashes with another | ||
1298 | 329 | library, you can force Google Test to rename its macro to avoid the | ||
1299 | 330 | conflict. | ||
1300 | 331 | |||
1301 | 332 | Specifically, if both Google Test and some other code define macro | ||
1302 | 333 | FOO, you can add | ||
1303 | 334 | |||
1304 | 335 | -DGTEST_DONT_DEFINE_FOO=1 | ||
1305 | 336 | |||
1306 | 337 | to the compiler flags to tell Google Test to change the macro's name | ||
1307 | 338 | from FOO to GTEST_FOO. Currently FOO can be FAIL, SUCCEED, or TEST. | ||
1308 | 339 | For example, with -DGTEST_DONT_DEFINE_TEST=1, you'll need to write | ||
1309 | 340 | |||
1310 | 341 | GTEST_TEST(SomeTest, DoesThis) { ... } | ||
1311 | 342 | |||
1312 | 343 | instead of | ||
1313 | 344 | |||
1314 | 345 | TEST(SomeTest, DoesThis) { ... } | ||
1315 | 346 | |||
1316 | 347 | in order to define a test. | ||
1317 | 348 | |||
1318 | 349 | Upgrating from an Earlier Version | ||
1319 | 350 | --------------------------------- | ||
1320 | 351 | |||
1321 | 352 | We strive to keep Google Test releases backward compatible. | ||
1322 | 353 | Sometimes, though, we have to make some breaking changes for the | ||
1323 | 354 | users' long-term benefits. This section describes what you'll need to | ||
1324 | 355 | do if you are upgrading from an earlier version of Google Test. | ||
1325 | 356 | |||
1326 | 357 | ### Upgrading from 1.3.0 or Earlier ### | ||
1327 | 358 | |||
1328 | 359 | You may need to explicitly enable or disable Google Test's own TR1 | ||
1329 | 360 | tuple library. See the instructions in section "Choosing a TR1 Tuple | ||
1330 | 361 | Library". | ||
1331 | 362 | |||
1332 | 363 | ### Upgrading from 1.4.0 or Earlier ### | ||
1333 | 364 | |||
1334 | 365 | The Autotools build script (configure + make) is no longer officially | ||
1335 | 366 | supportted. You are encouraged to migrate to your own build system or | ||
1336 | 367 | use CMake. If you still need to use Autotools, you can find | ||
1337 | 368 | instructions in the README file from Google Test 1.4.0. | ||
1338 | 369 | |||
1339 | 370 | On platforms where the pthread library is available, Google Test uses | ||
1340 | 371 | it in order to be thread-safe. See the "Multi-threaded Tests" section | ||
1341 | 372 | for what this means to your build script. | ||
1342 | 373 | |||
1343 | 374 | If you use Microsoft Visual C++ 7.1 with exceptions disabled, Google | ||
1344 | 375 | Test will no longer compile. This should affect very few people, as a | ||
1345 | 376 | large portion of STL (including <string>) doesn't compile in this mode | ||
1346 | 377 | anyway. We decided to stop supporting it in order to greatly simplify | ||
1347 | 378 | Google Test's implementation. | ||
1348 | 379 | |||
1349 | 380 | Developing Google Test | ||
1350 | 381 | ---------------------- | ||
1351 | 382 | |||
1352 | 383 | This section discusses how to make your own changes to Google Test. | ||
1353 | 384 | |||
1354 | 385 | ### Testing Google Test Itself ### | ||
1355 | 386 | |||
1356 | 387 | To make sure your changes work as intended and don't break existing | ||
1357 | 388 | functionality, you'll want to compile and run Google Test's own tests. | ||
1358 | 389 | For that you can use CMake: | ||
1359 | 390 | |||
1360 | 391 | mkdir mybuild | ||
1361 | 392 | cd mybuild | ||
1362 | 393 | cmake -Dgtest_build_tests=ON ${GTEST_DIR} | ||
1363 | 394 | |||
1364 | 395 | Make sure you have Python installed, as some of Google Test's tests | ||
1365 | 396 | are written in Python. If the cmake command complains about not being | ||
1366 | 397 | able to find Python ("Could NOT find PythonInterp (missing: | ||
1367 | 398 | PYTHON_EXECUTABLE)"), try telling it explicitly where your Python | ||
1368 | 399 | executable can be found: | ||
1369 | 400 | |||
1370 | 401 | cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR} | ||
1371 | 402 | |||
1372 | 403 | Next, you can build Google Test and all of its own tests. On *nix, | ||
1373 | 404 | this is usually done by 'make'. To run the tests, do | ||
1374 | 405 | |||
1375 | 406 | make test | ||
1376 | 407 | |||
1377 | 408 | All tests should pass. | ||
1378 | 409 | |||
1379 | 410 | ### Regenerating Source Files ### | ||
1380 | 411 | |||
1381 | 412 | Some of Google Test's source files are generated from templates (not | ||
1382 | 413 | in the C++ sense) using a script. A template file is named FOO.pump, | ||
1383 | 414 | where FOO is the name of the file it will generate. For example, the | ||
1384 | 415 | file include/gtest/internal/gtest-type-util.h.pump is used to generate | ||
1385 | 416 | gtest-type-util.h in the same directory. | ||
1386 | 417 | |||
1387 | 418 | Normally you don't need to worry about regenerating the source files, | ||
1388 | 419 | unless you need to modify them. In that case, you should modify the | ||
1389 | 420 | corresponding .pump files instead and run the pump.py Python script to | ||
1390 | 421 | regenerate them. You can find pump.py in the scripts/ directory. | ||
1391 | 422 | Read the Pump manual [2] for how to use it. | ||
1392 | 423 | |||
1393 | 424 | [2] http://code.google.com/p/googletest/wiki/PumpManual | ||
1394 | 425 | |||
1395 | 426 | ### Contributing a Patch ### | ||
1396 | 427 | |||
1397 | 428 | We welcome patches. Please read the Google Test developer's guide [3] | ||
1398 | 429 | for how you can contribute. In particular, make sure you have signed | ||
1399 | 430 | the Contributor License Agreement, or we won't be able to accept the | ||
1400 | 431 | patch. | ||
1401 | 432 | |||
1402 | 433 | [3] http://code.google.com/p/googletest/wiki/GoogleTestDevGuide | ||
1403 | 434 | |||
1404 | 435 | Happy testing! | ||
1405 | 0 | 436 | ||
1406 | === added directory '3rd_party/gmock/gtest/build-aux' | |||
1407 | === added file '3rd_party/gmock/gtest/build-aux/.keep' | |||
1408 | === added directory '3rd_party/gmock/gtest/cmake' | |||
1409 | === added file '3rd_party/gmock/gtest/cmake/internal_utils.cmake' | |||
1410 | --- 3rd_party/gmock/gtest/cmake/internal_utils.cmake 1970-01-01 00:00:00 +0000 | |||
1411 | +++ 3rd_party/gmock/gtest/cmake/internal_utils.cmake 2014-04-08 15:07:37 +0000 | |||
1412 | @@ -0,0 +1,227 @@ | |||
1413 | 1 | # Defines functions and macros useful for building Google Test and | ||
1414 | 2 | # Google Mock. | ||
1415 | 3 | # | ||
1416 | 4 | # Note: | ||
1417 | 5 | # | ||
1418 | 6 | # - This file will be run twice when building Google Mock (once via | ||
1419 | 7 | # Google Test's CMakeLists.txt, and once via Google Mock's). | ||
1420 | 8 | # Therefore it shouldn't have any side effects other than defining | ||
1421 | 9 | # the functions and macros. | ||
1422 | 10 | # | ||
1423 | 11 | # - The functions/macros defined in this file may depend on Google | ||
1424 | 12 | # Test and Google Mock's option() definitions, and thus must be | ||
1425 | 13 | # called *after* the options have been defined. | ||
1426 | 14 | |||
1427 | 15 | # Tweaks CMake's default compiler/linker settings to suit Google Test's needs. | ||
1428 | 16 | # | ||
1429 | 17 | # This must be a macro(), as inside a function string() can only | ||
1430 | 18 | # update variables in the function scope. | ||
1431 | 19 | macro(fix_default_compiler_settings_) | ||
1432 | 20 | if (MSVC) | ||
1433 | 21 | # For MSVC, CMake sets certain flags to defaults we want to override. | ||
1434 | 22 | # This replacement code is taken from sample in the CMake Wiki at | ||
1435 | 23 | # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace. | ||
1436 | 24 | foreach (flag_var | ||
1437 | 25 | CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE | ||
1438 | 26 | CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) | ||
1439 | 27 | if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt) | ||
1440 | 28 | # When Google Test is built as a shared library, it should also use | ||
1441 | 29 | # shared runtime libraries. Otherwise, it may end up with multiple | ||
1442 | 30 | # copies of runtime library data in different modules, resulting in | ||
1443 | 31 | # hard-to-find crashes. When it is built as a static library, it is | ||
1444 | 32 | # preferable to use CRT as static libraries, as we don't have to rely | ||
1445 | 33 | # on CRT DLLs being available. CMake always defaults to using shared | ||
1446 | 34 | # CRT libraries, so we override that default here. | ||
1447 | 35 | string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}") | ||
1448 | 36 | endif() | ||
1449 | 37 | |||
1450 | 38 | # We prefer more strict warning checking for building Google Test. | ||
1451 | 39 | # Replaces /W3 with /W4 in defaults. | ||
1452 | 40 | string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}") | ||
1453 | 41 | endforeach() | ||
1454 | 42 | endif() | ||
1455 | 43 | endmacro() | ||
1456 | 44 | |||
1457 | 45 | # Defines the compiler/linker flags used to build Google Test and | ||
1458 | 46 | # Google Mock. You can tweak these definitions to suit your need. A | ||
1459 | 47 | # variable's value is empty before it's explicitly assigned to. | ||
1460 | 48 | macro(config_compiler_and_linker) | ||
1461 | 49 | if (NOT gtest_disable_pthreads) | ||
1462 | 50 | # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT. | ||
1463 | 51 | find_package(Threads) | ||
1464 | 52 | endif() | ||
1465 | 53 | |||
1466 | 54 | fix_default_compiler_settings_() | ||
1467 | 55 | if (MSVC) | ||
1468 | 56 | # Newlines inside flags variables break CMake's NMake generator. | ||
1469 | 57 | # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds. | ||
1470 | 58 | set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi") | ||
1471 | 59 | if (MSVC_VERSION LESS 1400) | ||
1472 | 60 | # Suppress spurious warnings MSVC 7.1 sometimes issues. | ||
1473 | 61 | # Forcing value to bool. | ||
1474 | 62 | set(cxx_base_flags "${cxx_base_flags} -wd4800") | ||
1475 | 63 | # Copy constructor and assignment operator could not be generated. | ||
1476 | 64 | set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512") | ||
1477 | 65 | # Compatibility warnings not applicable to Google Test. | ||
1478 | 66 | # Resolved overload was found by argument-dependent lookup. | ||
1479 | 67 | set(cxx_base_flags "${cxx_base_flags} -wd4675") | ||
1480 | 68 | endif() | ||
1481 | 69 | set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32") | ||
1482 | 70 | set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN") | ||
1483 | 71 | set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1") | ||
1484 | 72 | set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0") | ||
1485 | 73 | set(cxx_no_rtti_flags "-GR-") | ||
1486 | 74 | elseif (CMAKE_COMPILER_IS_GNUCXX) | ||
1487 | 75 | set(cxx_base_flags "-Wall -Wshadow") | ||
1488 | 76 | set(cxx_exception_flags "-fexceptions") | ||
1489 | 77 | set(cxx_no_exception_flags "-fno-exceptions") | ||
1490 | 78 | # Until version 4.3.2, GCC doesn't define a macro to indicate | ||
1491 | 79 | # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI | ||
1492 | 80 | # explicitly. | ||
1493 | 81 | set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0") | ||
1494 | 82 | set(cxx_strict_flags | ||
1495 | 83 | "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers") | ||
1496 | 84 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") | ||
1497 | 85 | set(cxx_exception_flags "-features=except") | ||
1498 | 86 | # Sun Pro doesn't provide macros to indicate whether exceptions and | ||
1499 | 87 | # RTTI are enabled, so we define GTEST_HAS_* explicitly. | ||
1500 | 88 | set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0") | ||
1501 | 89 | set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0") | ||
1502 | 90 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR | ||
1503 | 91 | CMAKE_CXX_COMPILER_ID STREQUAL "XL") | ||
1504 | 92 | # CMake 2.8 changes Visual Age's compiler ID to "XL". | ||
1505 | 93 | set(cxx_exception_flags "-qeh") | ||
1506 | 94 | set(cxx_no_exception_flags "-qnoeh") | ||
1507 | 95 | # Until version 9.0, Visual Age doesn't define a macro to indicate | ||
1508 | 96 | # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI | ||
1509 | 97 | # explicitly. | ||
1510 | 98 | set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0") | ||
1511 | 99 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP") | ||
1512 | 100 | set(cxx_base_flags "-AA -mt") | ||
1513 | 101 | set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1") | ||
1514 | 102 | set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0") | ||
1515 | 103 | # RTTI can not be disabled in HP aCC compiler. | ||
1516 | 104 | set(cxx_no_rtti_flags "") | ||
1517 | 105 | endif() | ||
1518 | 106 | |||
1519 | 107 | if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed. | ||
1520 | 108 | set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") | ||
1521 | 109 | else() | ||
1522 | 110 | set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0") | ||
1523 | 111 | endif() | ||
1524 | 112 | |||
1525 | 113 | # For building gtest's own tests and samples. | ||
1526 | 114 | set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}") | ||
1527 | 115 | set(cxx_no_exception | ||
1528 | 116 | "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}") | ||
1529 | 117 | set(cxx_default "${cxx_exception}") | ||
1530 | 118 | set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}") | ||
1531 | 119 | set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1") | ||
1532 | 120 | |||
1533 | 121 | # For building the gtest libraries. | ||
1534 | 122 | set(cxx_strict "${cxx_default} ${cxx_strict_flags}") | ||
1535 | 123 | endmacro() | ||
1536 | 124 | |||
1537 | 125 | # Defines the gtest & gtest_main libraries. User tests should link | ||
1538 | 126 | # with one of them. | ||
1539 | 127 | function(cxx_library_with_type name type cxx_flags) | ||
1540 | 128 | # type can be either STATIC or SHARED to denote a static or shared library. | ||
1541 | 129 | # ARGN refers to additional arguments after 'cxx_flags'. | ||
1542 | 130 | add_library(${name} ${type} ${ARGN}) | ||
1543 | 131 | set_target_properties(${name} | ||
1544 | 132 | PROPERTIES | ||
1545 | 133 | COMPILE_FLAGS "${cxx_flags}") | ||
1546 | 134 | if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") | ||
1547 | 135 | set_target_properties(${name} | ||
1548 | 136 | PROPERTIES | ||
1549 | 137 | COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1") | ||
1550 | 138 | endif() | ||
1551 | 139 | if (CMAKE_USE_PTHREADS_INIT) | ||
1552 | 140 | target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) | ||
1553 | 141 | endif() | ||
1554 | 142 | endfunction() | ||
1555 | 143 | |||
1556 | 144 | ######################################################################## | ||
1557 | 145 | # | ||
1558 | 146 | # Helper functions for creating build targets. | ||
1559 | 147 | |||
1560 | 148 | function(cxx_shared_library name cxx_flags) | ||
1561 | 149 | cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) | ||
1562 | 150 | endfunction() | ||
1563 | 151 | |||
1564 | 152 | function(cxx_library name cxx_flags) | ||
1565 | 153 | cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN}) | ||
1566 | 154 | endfunction() | ||
1567 | 155 | |||
1568 | 156 | # cxx_executable_with_flags(name cxx_flags libs srcs...) | ||
1569 | 157 | # | ||
1570 | 158 | # creates a named C++ executable that depends on the given libraries and | ||
1571 | 159 | # is built from the given source files with the given compiler flags. | ||
1572 | 160 | function(cxx_executable_with_flags name cxx_flags libs) | ||
1573 | 161 | add_executable(${name} ${ARGN}) | ||
1574 | 162 | if (cxx_flags) | ||
1575 | 163 | set_target_properties(${name} | ||
1576 | 164 | PROPERTIES | ||
1577 | 165 | COMPILE_FLAGS "${cxx_flags}") | ||
1578 | 166 | endif() | ||
1579 | 167 | if (BUILD_SHARED_LIBS) | ||
1580 | 168 | set_target_properties(${name} | ||
1581 | 169 | PROPERTIES | ||
1582 | 170 | COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") | ||
1583 | 171 | endif() | ||
1584 | 172 | # To support mixing linking in static and dynamic libraries, link each | ||
1585 | 173 | # library in with an extra call to target_link_libraries. | ||
1586 | 174 | foreach (lib "${libs}") | ||
1587 | 175 | target_link_libraries(${name} ${lib}) | ||
1588 | 176 | endforeach() | ||
1589 | 177 | endfunction() | ||
1590 | 178 | |||
1591 | 179 | # cxx_executable(name dir lib srcs...) | ||
1592 | 180 | # | ||
1593 | 181 | # creates a named target that depends on the given libs and is built | ||
1594 | 182 | # from the given source files. dir/name.cc is implicitly included in | ||
1595 | 183 | # the source file list. | ||
1596 | 184 | function(cxx_executable name dir libs) | ||
1597 | 185 | cxx_executable_with_flags( | ||
1598 | 186 | ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN}) | ||
1599 | 187 | endfunction() | ||
1600 | 188 | |||
1601 | 189 | # Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE. | ||
1602 | 190 | find_package(PythonInterp) | ||
1603 | 191 | |||
1604 | 192 | # cxx_test_with_flags(name cxx_flags libs srcs...) | ||
1605 | 193 | # | ||
1606 | 194 | # creates a named C++ test that depends on the given libs and is built | ||
1607 | 195 | # from the given source files with the given compiler flags. | ||
1608 | 196 | function(cxx_test_with_flags name cxx_flags libs) | ||
1609 | 197 | cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN}) | ||
1610 | 198 | add_test(${name} ${name}) | ||
1611 | 199 | endfunction() | ||
1612 | 200 | |||
1613 | 201 | # cxx_test(name libs srcs...) | ||
1614 | 202 | # | ||
1615 | 203 | # creates a named test target that depends on the given libs and is | ||
1616 | 204 | # built from the given source files. Unlike cxx_test_with_flags, | ||
1617 | 205 | # test/name.cc is already implicitly included in the source file list. | ||
1618 | 206 | function(cxx_test name libs) | ||
1619 | 207 | cxx_test_with_flags("${name}" "${cxx_default}" "${libs}" | ||
1620 | 208 | "test/${name}.cc" ${ARGN}) | ||
1621 | 209 | endfunction() | ||
1622 | 210 | |||
1623 | 211 | # py_test(name) | ||
1624 | 212 | # | ||
1625 | 213 | # creates a Python test with the given name whose main module is in | ||
1626 | 214 | # test/name.py. It does nothing if Python is not installed. | ||
1627 | 215 | function(py_test name) | ||
1628 | 216 | # We are not supporting Python tests on Linux yet as they consider | ||
1629 | 217 | # all Linux environments to be google3 and try to use google3 features. | ||
1630 | 218 | if (PYTHONINTERP_FOUND) | ||
1631 | 219 | # ${CMAKE_BINARY_DIR} is known at configuration time, so we can | ||
1632 | 220 | # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known | ||
1633 | 221 | # only at ctest runtime (by calling ctest -c <Configuration>), so | ||
1634 | 222 | # we have to escape $ to delay variable substitution here. | ||
1635 | 223 | add_test(${name} | ||
1636 | 224 | ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py | ||
1637 | 225 | --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE}) | ||
1638 | 226 | endif() | ||
1639 | 227 | endfunction() | ||
1640 | 0 | 228 | ||
1641 | === added directory '3rd_party/gmock/gtest/codegear' | |||
1642 | === added file '3rd_party/gmock/gtest/codegear/gtest_all.cc' | |||
1643 | --- 3rd_party/gmock/gtest/codegear/gtest_all.cc 1970-01-01 00:00:00 +0000 | |||
1644 | +++ 3rd_party/gmock/gtest/codegear/gtest_all.cc 2014-04-08 15:07:37 +0000 | |||
1645 | @@ -0,0 +1,38 @@ | |||
1646 | 1 | // Copyright 2009, Google Inc. | ||
1647 | 2 | // All rights reserved. | ||
1648 | 3 | // | ||
1649 | 4 | // Redistribution and use in source and binary forms, with or without | ||
1650 | 5 | // modification, are permitted provided that the following conditions are | ||
1651 | 6 | // met: | ||
1652 | 7 | // | ||
1653 | 8 | // * Redistributions of source code must retain the above copyright | ||
1654 | 9 | // notice, this list of conditions and the following disclaimer. | ||
1655 | 10 | // * Redistributions in binary form must reproduce the above | ||
1656 | 11 | // copyright notice, this list of conditions and the following disclaimer | ||
1657 | 12 | // in the documentation and/or other materials provided with the | ||
1658 | 13 | // distribution. | ||
1659 | 14 | // * Neither the name of Google Inc. nor the names of its | ||
1660 | 15 | // contributors may be used to endorse or promote products derived from | ||
1661 | 16 | // this software without specific prior written permission. | ||
1662 | 17 | // | ||
1663 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
1664 | 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
1665 | 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
1666 | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
1667 | 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
1668 | 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
1669 | 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1670 | 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1671 | 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1672 | 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
1673 | 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1674 | 29 | // | ||
1675 | 30 | // Author: Josh Kelley (joshkel@gmail.com) | ||
1676 | 31 | // | ||
1677 | 32 | // Google C++ Testing Framework (Google Test) | ||
1678 | 33 | // | ||
1679 | 34 | // C++Builder's IDE cannot build a static library from files with hyphens | ||
1680 | 35 | // in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . | ||
1681 | 36 | // This file serves as a workaround. | ||
1682 | 37 | |||
1683 | 38 | #include "src/gtest-all.cc" | ||
1684 | 0 | 39 | ||
1685 | === added file '3rd_party/gmock/gtest/codegear/gtest_link.cc' | |||
1686 | --- 3rd_party/gmock/gtest/codegear/gtest_link.cc 1970-01-01 00:00:00 +0000 | |||
1687 | +++ 3rd_party/gmock/gtest/codegear/gtest_link.cc 2014-04-08 15:07:37 +0000 | |||
1688 | @@ -0,0 +1,40 @@ | |||
1689 | 1 | // Copyright 2009, Google Inc. | ||
1690 | 2 | // All rights reserved. | ||
1691 | 3 | // | ||
1692 | 4 | // Redistribution and use in source and binary forms, with or without | ||
1693 | 5 | // modification, are permitted provided that the following conditions are | ||
1694 | 6 | // met: | ||
1695 | 7 | // | ||
1696 | 8 | // * Redistributions of source code must retain the above copyright | ||
1697 | 9 | // notice, this list of conditions and the following disclaimer. | ||
1698 | 10 | // * Redistributions in binary form must reproduce the above | ||
1699 | 11 | // copyright notice, this list of conditions and the following disclaimer | ||
1700 | 12 | // in the documentation and/or other materials provided with the | ||
1701 | 13 | // distribution. | ||
1702 | 14 | // * Neither the name of Google Inc. nor the names of its | ||
1703 | 15 | // contributors may be used to endorse or promote products derived from | ||
1704 | 16 | // this software without specific prior written permission. | ||
1705 | 17 | // | ||
1706 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
1707 | 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
1708 | 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
1709 | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
1710 | 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
1711 | 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
1712 | 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1713 | 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1714 | 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1715 | 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
1716 | 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1717 | 29 | // | ||
1718 | 30 | // Author: Josh Kelley (joshkel@gmail.com) | ||
1719 | 31 | // | ||
1720 | 32 | // Google C++ Testing Framework (Google Test) | ||
1721 | 33 | // | ||
1722 | 34 | // Links gtest.lib and gtest_main.lib into the current project in C++Builder. | ||
1723 | 35 | // This means that these libraries can't be renamed, but it's the only way to | ||
1724 | 36 | // ensure that Debug versus Release test builds are linked against the | ||
1725 | 37 | // appropriate Debug or Release build of the libraries. | ||
1726 | 38 | |||
1727 | 39 | #pragma link "gtest.lib" | ||
1728 | 40 | #pragma link "gtest_main.lib" | ||
1729 | 0 | 41 | ||
1730 | === added file '3rd_party/gmock/gtest/configure.ac' | |||
1731 | --- 3rd_party/gmock/gtest/configure.ac 1970-01-01 00:00:00 +0000 | |||
1732 | +++ 3rd_party/gmock/gtest/configure.ac 2014-04-08 15:07:37 +0000 | |||
1733 | @@ -0,0 +1,68 @@ | |||
1734 | 1 | m4_include(m4/acx_pthread.m4) | ||
1735 | 2 | |||
1736 | 3 | # At this point, the Xcode project assumes the version string will be three | ||
1737 | 4 | # integers separated by periods and surrounded by square brackets (e.g. | ||
1738 | 5 | # "[1.0.1]"). It also asumes that there won't be any closing parenthesis | ||
1739 | 6 | # between "AC_INIT(" and the closing ")" including comments and strings. | ||
1740 | 7 | AC_INIT([Google C++ Testing Framework], | ||
1741 | 8 | [1.7.0], | ||
1742 | 9 | [googletestframework@googlegroups.com], | ||
1743 | 10 | [gtest]) | ||
1744 | 11 | |||
1745 | 12 | # Provide various options to initialize the Autoconf and configure processes. | ||
1746 | 13 | AC_PREREQ([2.59]) | ||
1747 | 14 | AC_CONFIG_SRCDIR([./LICENSE]) | ||
1748 | 15 | AC_CONFIG_MACRO_DIR([m4]) | ||
1749 | 16 | AC_CONFIG_AUX_DIR([build-aux]) | ||
1750 | 17 | AC_CONFIG_HEADERS([build-aux/config.h]) | ||
1751 | 18 | AC_CONFIG_FILES([Makefile]) | ||
1752 | 19 | AC_CONFIG_FILES([scripts/gtest-config], [chmod +x scripts/gtest-config]) | ||
1753 | 20 | |||
1754 | 21 | # Initialize Automake with various options. We require at least v1.9, prevent | ||
1755 | 22 | # pedantic complaints about package files, and enable various distribution | ||
1756 | 23 | # targets. | ||
1757 | 24 | AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects]) | ||
1758 | 25 | |||
1759 | 26 | # Check for programs used in building Google Test. | ||
1760 | 27 | AC_PROG_CC | ||
1761 | 28 | AC_PROG_CXX | ||
1762 | 29 | AC_LANG([C++]) | ||
1763 | 30 | AC_PROG_LIBTOOL | ||
1764 | 31 | |||
1765 | 32 | # TODO(chandlerc@google.com): Currently we aren't running the Python tests | ||
1766 | 33 | # against the interpreter detected by AM_PATH_PYTHON, and so we condition | ||
1767 | 34 | # HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's | ||
1768 | 35 | # version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env" | ||
1769 | 36 | # hashbang. | ||
1770 | 37 | PYTHON= # We *do not* allow the user to specify a python interpreter | ||
1771 | 38 | AC_PATH_PROG([PYTHON],[python],[:]) | ||
1772 | 39 | AS_IF([test "$PYTHON" != ":"], | ||
1773 | 40 | [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])]) | ||
1774 | 41 | AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"]) | ||
1775 | 42 | |||
1776 | 43 | # Configure pthreads. | ||
1777 | 44 | AC_ARG_WITH([pthreads], | ||
1778 | 45 | [AS_HELP_STRING([--with-pthreads], | ||
1779 | 46 | [use pthreads (default is yes)])], | ||
1780 | 47 | [with_pthreads=$withval], | ||
1781 | 48 | [with_pthreads=check]) | ||
1782 | 49 | |||
1783 | 50 | have_pthreads=no | ||
1784 | 51 | AS_IF([test "x$with_pthreads" != "xno"], | ||
1785 | 52 | [ACX_PTHREAD( | ||
1786 | 53 | [], | ||
1787 | 54 | [AS_IF([test "x$with_pthreads" != "xcheck"], | ||
1788 | 55 | [AC_MSG_FAILURE( | ||
1789 | 56 | [--with-pthreads was specified, but unable to be used])])]) | ||
1790 | 57 | have_pthreads="$acx_pthread_ok"]) | ||
1791 | 58 | AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" = "xyes"]) | ||
1792 | 59 | AC_SUBST(PTHREAD_CFLAGS) | ||
1793 | 60 | AC_SUBST(PTHREAD_LIBS) | ||
1794 | 61 | |||
1795 | 62 | # TODO(chandlerc@google.com) Check for the necessary system headers. | ||
1796 | 63 | |||
1797 | 64 | # TODO(chandlerc@google.com) Check the types, structures, and other compiler | ||
1798 | 65 | # and architecture characteristics. | ||
1799 | 66 | |||
1800 | 67 | # Output the generated files. No further autoconf macros may be used. | ||
1801 | 68 | AC_OUTPUT | ||
1802 | 0 | 69 | ||
1803 | === added directory '3rd_party/gmock/gtest/include' | |||
1804 | === added directory '3rd_party/gmock/gtest/include/gtest' | |||
1805 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-death-test.h' | |||
1806 | --- 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h 1970-01-01 00:00:00 +0000 | |||
1807 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-death-test.h 2014-04-08 15:07:37 +0000 | |||
1808 | @@ -0,0 +1,294 @@ | |||
1809 | 1 | // Copyright 2005, Google Inc. | ||
1810 | 2 | // All rights reserved. | ||
1811 | 3 | // | ||
1812 | 4 | // Redistribution and use in source and binary forms, with or without | ||
1813 | 5 | // modification, are permitted provided that the following conditions are | ||
1814 | 6 | // met: | ||
1815 | 7 | // | ||
1816 | 8 | // * Redistributions of source code must retain the above copyright | ||
1817 | 9 | // notice, this list of conditions and the following disclaimer. | ||
1818 | 10 | // * Redistributions in binary form must reproduce the above | ||
1819 | 11 | // copyright notice, this list of conditions and the following disclaimer | ||
1820 | 12 | // in the documentation and/or other materials provided with the | ||
1821 | 13 | // distribution. | ||
1822 | 14 | // * Neither the name of Google Inc. nor the names of its | ||
1823 | 15 | // contributors may be used to endorse or promote products derived from | ||
1824 | 16 | // this software without specific prior written permission. | ||
1825 | 17 | // | ||
1826 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
1827 | 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
1828 | 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
1829 | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
1830 | 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
1831 | 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
1832 | 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1833 | 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1834 | 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1835 | 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
1836 | 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1837 | 29 | // | ||
1838 | 30 | // Author: wan@google.com (Zhanyong Wan) | ||
1839 | 31 | // | ||
1840 | 32 | // The Google C++ Testing Framework (Google Test) | ||
1841 | 33 | // | ||
1842 | 34 | // This header file defines the public API for death tests. It is | ||
1843 | 35 | // #included by gtest.h so a user doesn't need to include this | ||
1844 | 36 | // directly. | ||
1845 | 37 | |||
1846 | 38 | #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ | ||
1847 | 39 | #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ | ||
1848 | 40 | |||
1849 | 41 | #include "gtest/internal/gtest-death-test-internal.h" | ||
1850 | 42 | |||
1851 | 43 | namespace testing { | ||
1852 | 44 | |||
1853 | 45 | // This flag controls the style of death tests. Valid values are "threadsafe", | ||
1854 | 46 | // meaning that the death test child process will re-execute the test binary | ||
1855 | 47 | // from the start, running only a single death test, or "fast", | ||
1856 | 48 | // meaning that the child process will execute the test logic immediately | ||
1857 | 49 | // after forking. | ||
1858 | 50 | GTEST_DECLARE_string_(death_test_style); | ||
1859 | 51 | |||
1860 | 52 | #if GTEST_HAS_DEATH_TEST | ||
1861 | 53 | |||
1862 | 54 | namespace internal { | ||
1863 | 55 | |||
1864 | 56 | // Returns a Boolean value indicating whether the caller is currently | ||
1865 | 57 | // executing in the context of the death test child process. Tools such as | ||
1866 | 58 | // Valgrind heap checkers may need this to modify their behavior in death | ||
1867 | 59 | // tests. IMPORTANT: This is an internal utility. Using it may break the | ||
1868 | 60 | // implementation of death tests. User code MUST NOT use it. | ||
1869 | 61 | GTEST_API_ bool InDeathTestChild(); | ||
1870 | 62 | |||
1871 | 63 | } // namespace internal | ||
1872 | 64 | |||
1873 | 65 | // The following macros are useful for writing death tests. | ||
1874 | 66 | |||
1875 | 67 | // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is | ||
1876 | 68 | // executed: | ||
1877 | 69 | // | ||
1878 | 70 | // 1. It generates a warning if there is more than one active | ||
1879 | 71 | // thread. This is because it's safe to fork() or clone() only | ||
1880 | 72 | // when there is a single thread. | ||
1881 | 73 | // | ||
1882 | 74 | // 2. The parent process clone()s a sub-process and runs the death | ||
1883 | 75 | // test in it; the sub-process exits with code 0 at the end of the | ||
1884 | 76 | // death test, if it hasn't exited already. | ||
1885 | 77 | // | ||
1886 | 78 | // 3. The parent process waits for the sub-process to terminate. | ||
1887 | 79 | // | ||
1888 | 80 | // 4. The parent process checks the exit code and error message of | ||
1889 | 81 | // the sub-process. | ||
1890 | 82 | // | ||
1891 | 83 | // Examples: | ||
1892 | 84 | // | ||
1893 | 85 | // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); | ||
1894 | 86 | // for (int i = 0; i < 5; i++) { | ||
1895 | 87 | // EXPECT_DEATH(server.ProcessRequest(i), | ||
1896 | 88 | // "Invalid request .* in ProcessRequest()") | ||
1897 | 89 | // << "Failed to die on request " << i; | ||
1898 | 90 | // } | ||
1899 | 91 | // | ||
1900 | 92 | // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); | ||
1901 | 93 | // | ||
1902 | 94 | // bool KilledBySIGHUP(int exit_code) { | ||
1903 | 95 | // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; | ||
1904 | 96 | // } | ||
1905 | 97 | // | ||
1906 | 98 | // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); | ||
1907 | 99 | // | ||
1908 | 100 | // On the regular expressions used in death tests: | ||
1909 | 101 | // | ||
1910 | 102 | // On POSIX-compliant systems (*nix), we use the <regex.h> library, | ||
1911 | 103 | // which uses the POSIX extended regex syntax. | ||
1912 | 104 | // | ||
1913 | 105 | // On other platforms (e.g. Windows), we only support a simple regex | ||
1914 | 106 | // syntax implemented as part of Google Test. This limited | ||
1915 | 107 | // implementation should be enough most of the time when writing | ||
1916 | 108 | // death tests; though it lacks many features you can find in PCRE | ||
1917 | 109 | // or POSIX extended regex syntax. For example, we don't support | ||
1918 | 110 | // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and | ||
1919 | 111 | // repetition count ("x{5,7}"), among others. | ||
1920 | 112 | // | ||
1921 | 113 | // Below is the syntax that we do support. We chose it to be a | ||
1922 | 114 | // subset of both PCRE and POSIX extended regex, so it's easy to | ||
1923 | 115 | // learn wherever you come from. In the following: 'A' denotes a | ||
1924 | 116 | // literal character, period (.), or a single \\ escape sequence; | ||
1925 | 117 | // 'x' and 'y' denote regular expressions; 'm' and 'n' are for | ||
1926 | 118 | // natural numbers. | ||
1927 | 119 | // | ||
1928 | 120 | // c matches any literal character c | ||
1929 | 121 | // \\d matches any decimal digit | ||
1930 | 122 | // \\D matches any character that's not a decimal digit | ||
1931 | 123 | // \\f matches \f | ||
1932 | 124 | // \\n matches \n | ||
1933 | 125 | // \\r matches \r | ||
1934 | 126 | // \\s matches any ASCII whitespace, including \n | ||
1935 | 127 | // \\S matches any character that's not a whitespace | ||
1936 | 128 | // \\t matches \t | ||
1937 | 129 | // \\v matches \v | ||
1938 | 130 | // \\w matches any letter, _, or decimal digit | ||
1939 | 131 | // \\W matches any character that \\w doesn't match | ||
1940 | 132 | // \\c matches any literal character c, which must be a punctuation | ||
1941 | 133 | // . matches any single character except \n | ||
1942 | 134 | // A? matches 0 or 1 occurrences of A | ||
1943 | 135 | // A* matches 0 or many occurrences of A | ||
1944 | 136 | // A+ matches 1 or many occurrences of A | ||
1945 | 137 | // ^ matches the beginning of a string (not that of each line) | ||
1946 | 138 | // $ matches the end of a string (not that of each line) | ||
1947 | 139 | // xy matches x followed by y | ||
1948 | 140 | // | ||
1949 | 141 | // If you accidentally use PCRE or POSIX extended regex features | ||
1950 | 142 | // not implemented by us, you will get a run-time failure. In that | ||
1951 | 143 | // case, please try to rewrite your regular expression within the | ||
1952 | 144 | // above syntax. | ||
1953 | 145 | // | ||
1954 | 146 | // This implementation is *not* meant to be as highly tuned or robust | ||
1955 | 147 | // as a compiled regex library, but should perform well enough for a | ||
1956 | 148 | // death test, which already incurs significant overhead by launching | ||
1957 | 149 | // a child process. | ||
1958 | 150 | // | ||
1959 | 151 | // Known caveats: | ||
1960 | 152 | // | ||
1961 | 153 | // A "threadsafe" style death test obtains the path to the test | ||
1962 | 154 | // program from argv[0] and re-executes it in the sub-process. For | ||
1963 | 155 | // simplicity, the current implementation doesn't search the PATH | ||
1964 | 156 | // when launching the sub-process. This means that the user must | ||
1965 | 157 | // invoke the test program via a path that contains at least one | ||
1966 | 158 | // path separator (e.g. path/to/foo_test and | ||
1967 | 159 | // /absolute/path/to/bar_test are fine, but foo_test is not). This | ||
1968 | 160 | // is rarely a problem as people usually don't put the test binary | ||
1969 | 161 | // directory in PATH. | ||
1970 | 162 | // | ||
1971 | 163 | // TODO(wan@google.com): make thread-safe death tests search the PATH. | ||
1972 | 164 | |||
1973 | 165 | // Asserts that a given statement causes the program to exit, with an | ||
1974 | 166 | // integer exit status that satisfies predicate, and emitting error output | ||
1975 | 167 | // that matches regex. | ||
1976 | 168 | # define ASSERT_EXIT(statement, predicate, regex) \ | ||
1977 | 169 | GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) | ||
1978 | 170 | |||
1979 | 171 | // Like ASSERT_EXIT, but continues on to successive tests in the | ||
1980 | 172 | // test case, if any: | ||
1981 | 173 | # define EXPECT_EXIT(statement, predicate, regex) \ | ||
1982 | 174 | GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) | ||
1983 | 175 | |||
1984 | 176 | // Asserts that a given statement causes the program to exit, either by | ||
1985 | 177 | // explicitly exiting with a nonzero exit code or being killed by a | ||
1986 | 178 | // signal, and emitting error output that matches regex. | ||
1987 | 179 | # define ASSERT_DEATH(statement, regex) \ | ||
1988 | 180 | ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) | ||
1989 | 181 | |||
1990 | 182 | // Like ASSERT_DEATH, but continues on to successive tests in the | ||
1991 | 183 | // test case, if any: | ||
1992 | 184 | # define EXPECT_DEATH(statement, regex) \ | ||
1993 | 185 | EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) | ||
1994 | 186 | |||
1995 | 187 | // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: | ||
1996 | 188 | |||
1997 | 189 | // Tests that an exit code describes a normal exit with a given exit code. | ||
1998 | 190 | class GTEST_API_ ExitedWithCode { | ||
1999 | 191 | public: | ||
2000 | 192 | explicit ExitedWithCode(int exit_code); | ||
2001 | 193 | bool operator()(int exit_status) const; | ||
2002 | 194 | private: | ||
2003 | 195 | // No implementation - assignment is unsupported. | ||
2004 | 196 | void operator=(const ExitedWithCode& other); | ||
2005 | 197 | |||
2006 | 198 | const int exit_code_; | ||
2007 | 199 | }; | ||
2008 | 200 | |||
2009 | 201 | # if !GTEST_OS_WINDOWS | ||
2010 | 202 | // Tests that an exit code describes an exit due to termination by a | ||
2011 | 203 | // given signal. | ||
2012 | 204 | class GTEST_API_ KilledBySignal { | ||
2013 | 205 | public: | ||
2014 | 206 | explicit KilledBySignal(int signum); | ||
2015 | 207 | bool operator()(int exit_status) const; | ||
2016 | 208 | private: | ||
2017 | 209 | const int signum_; | ||
2018 | 210 | }; | ||
2019 | 211 | # endif // !GTEST_OS_WINDOWS | ||
2020 | 212 | |||
2021 | 213 | // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. | ||
2022 | 214 | // The death testing framework causes this to have interesting semantics, | ||
2023 | 215 | // since the sideeffects of the call are only visible in opt mode, and not | ||
2024 | 216 | // in debug mode. | ||
2025 | 217 | // | ||
2026 | 218 | // In practice, this can be used to test functions that utilize the | ||
2027 | 219 | // LOG(DFATAL) macro using the following style: | ||
2028 | 220 | // | ||
2029 | 221 | // int DieInDebugOr12(int* sideeffect) { | ||
2030 | 222 | // if (sideeffect) { | ||
2031 | 223 | // *sideeffect = 12; | ||
2032 | 224 | // } | ||
2033 | 225 | // LOG(DFATAL) << "death"; | ||
2034 | 226 | // return 12; | ||
2035 | 227 | // } | ||
2036 | 228 | // | ||
2037 | 229 | // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { | ||
2038 | 230 | // int sideeffect = 0; | ||
2039 | 231 | // // Only asserts in dbg. | ||
2040 | 232 | // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); | ||
2041 | 233 | // | ||
2042 | 234 | // #ifdef NDEBUG | ||
2043 | 235 | // // opt-mode has sideeffect visible. | ||
2044 | 236 | // EXPECT_EQ(12, sideeffect); | ||
2045 | 237 | // #else | ||
2046 | 238 | // // dbg-mode no visible sideeffect. | ||
2047 | 239 | // EXPECT_EQ(0, sideeffect); | ||
2048 | 240 | // #endif | ||
2049 | 241 | // } | ||
2050 | 242 | // | ||
2051 | 243 | // This will assert that DieInDebugReturn12InOpt() crashes in debug | ||
2052 | 244 | // mode, usually due to a DCHECK or LOG(DFATAL), but returns the | ||
2053 | 245 | // appropriate fallback value (12 in this case) in opt mode. If you | ||
2054 | 246 | // need to test that a function has appropriate side-effects in opt | ||
2055 | 247 | // mode, include assertions against the side-effects. A general | ||
2056 | 248 | // pattern for this is: | ||
2057 | 249 | // | ||
2058 | 250 | // EXPECT_DEBUG_DEATH({ | ||
2059 | 251 | // // Side-effects here will have an effect after this statement in | ||
2060 | 252 | // // opt mode, but none in debug mode. | ||
2061 | 253 | // EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); | ||
2062 | 254 | // }, "death"); | ||
2063 | 255 | // | ||
2064 | 256 | # ifdef NDEBUG | ||
2065 | 257 | |||
2066 | 258 | # define EXPECT_DEBUG_DEATH(statement, regex) \ | ||
2067 | 259 | GTEST_EXECUTE_STATEMENT_(statement, regex) | ||
2068 | 260 | |||
2069 | 261 | # define ASSERT_DEBUG_DEATH(statement, regex) \ | ||
2070 | 262 | GTEST_EXECUTE_STATEMENT_(statement, regex) | ||
2071 | 263 | |||
2072 | 264 | # else | ||
2073 | 265 | |||
2074 | 266 | # define EXPECT_DEBUG_DEATH(statement, regex) \ | ||
2075 | 267 | EXPECT_DEATH(statement, regex) | ||
2076 | 268 | |||
2077 | 269 | # define ASSERT_DEBUG_DEATH(statement, regex) \ | ||
2078 | 270 | ASSERT_DEATH(statement, regex) | ||
2079 | 271 | |||
2080 | 272 | # endif // NDEBUG for EXPECT_DEBUG_DEATH | ||
2081 | 273 | #endif // GTEST_HAS_DEATH_TEST | ||
2082 | 274 | |||
2083 | 275 | // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and | ||
2084 | 276 | // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if | ||
2085 | 277 | // death tests are supported; otherwise they just issue a warning. This is | ||
2086 | 278 | // useful when you are combining death test assertions with normal test | ||
2087 | 279 | // assertions in one test. | ||
2088 | 280 | #if GTEST_HAS_DEATH_TEST | ||
2089 | 281 | # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ | ||
2090 | 282 | EXPECT_DEATH(statement, regex) | ||
2091 | 283 | # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ | ||
2092 | 284 | ASSERT_DEATH(statement, regex) | ||
2093 | 285 | #else | ||
2094 | 286 | # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ | ||
2095 | 287 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) | ||
2096 | 288 | # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ | ||
2097 | 289 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) | ||
2098 | 290 | #endif | ||
2099 | 291 | |||
2100 | 292 | } // namespace testing | ||
2101 | 293 | |||
2102 | 294 | #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ | ||
2103 | 0 | 295 | ||
2104 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-message.h' | |||
2105 | --- 3rd_party/gmock/gtest/include/gtest/gtest-message.h 1970-01-01 00:00:00 +0000 | |||
2106 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-message.h 2014-04-08 15:07:37 +0000 | |||
2107 | @@ -0,0 +1,250 @@ | |||
2108 | 1 | // Copyright 2005, Google Inc. | ||
2109 | 2 | // All rights reserved. | ||
2110 | 3 | // | ||
2111 | 4 | // Redistribution and use in source and binary forms, with or without | ||
2112 | 5 | // modification, are permitted provided that the following conditions are | ||
2113 | 6 | // met: | ||
2114 | 7 | // | ||
2115 | 8 | // * Redistributions of source code must retain the above copyright | ||
2116 | 9 | // notice, this list of conditions and the following disclaimer. | ||
2117 | 10 | // * Redistributions in binary form must reproduce the above | ||
2118 | 11 | // copyright notice, this list of conditions and the following disclaimer | ||
2119 | 12 | // in the documentation and/or other materials provided with the | ||
2120 | 13 | // distribution. | ||
2121 | 14 | // * Neither the name of Google Inc. nor the names of its | ||
2122 | 15 | // contributors may be used to endorse or promote products derived from | ||
2123 | 16 | // this software without specific prior written permission. | ||
2124 | 17 | // | ||
2125 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
2126 | 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
2127 | 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
2128 | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
2129 | 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
2130 | 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
2131 | 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
2132 | 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
2133 | 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
2134 | 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
2135 | 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
2136 | 29 | // | ||
2137 | 30 | // Author: wan@google.com (Zhanyong Wan) | ||
2138 | 31 | // | ||
2139 | 32 | // The Google C++ Testing Framework (Google Test) | ||
2140 | 33 | // | ||
2141 | 34 | // This header file defines the Message class. | ||
2142 | 35 | // | ||
2143 | 36 | // IMPORTANT NOTE: Due to limitation of the C++ language, we have to | ||
2144 | 37 | // leave some internal implementation details in this header file. | ||
2145 | 38 | // They are clearly marked by comments like this: | ||
2146 | 39 | // | ||
2147 | 40 | // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | ||
2148 | 41 | // | ||
2149 | 42 | // Such code is NOT meant to be used by a user directly, and is subject | ||
2150 | 43 | // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user | ||
2151 | 44 | // program! | ||
2152 | 45 | |||
2153 | 46 | #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ | ||
2154 | 47 | #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ | ||
2155 | 48 | |||
2156 | 49 | #include <limits> | ||
2157 | 50 | |||
2158 | 51 | #include "gtest/internal/gtest-port.h" | ||
2159 | 52 | |||
2160 | 53 | // Ensures that there is at least one operator<< in the global namespace. | ||
2161 | 54 | // See Message& operator<<(...) below for why. | ||
2162 | 55 | void operator<<(const testing::internal::Secret&, int); | ||
2163 | 56 | |||
2164 | 57 | namespace testing { | ||
2165 | 58 | |||
2166 | 59 | // The Message class works like an ostream repeater. | ||
2167 | 60 | // | ||
2168 | 61 | // Typical usage: | ||
2169 | 62 | // | ||
2170 | 63 | // 1. You stream a bunch of values to a Message object. | ||
2171 | 64 | // It will remember the text in a stringstream. | ||
2172 | 65 | // 2. Then you stream the Message object to an ostream. | ||
2173 | 66 | // This causes the text in the Message to be streamed | ||
2174 | 67 | // to the ostream. | ||
2175 | 68 | // | ||
2176 | 69 | // For example; | ||
2177 | 70 | // | ||
2178 | 71 | // testing::Message foo; | ||
2179 | 72 | // foo << 1 << " != " << 2; | ||
2180 | 73 | // std::cout << foo; | ||
2181 | 74 | // | ||
2182 | 75 | // will print "1 != 2". | ||
2183 | 76 | // | ||
2184 | 77 | // Message is not intended to be inherited from. In particular, its | ||
2185 | 78 | // destructor is not virtual. | ||
2186 | 79 | // | ||
2187 | 80 | // Note that stringstream behaves differently in gcc and in MSVC. You | ||
2188 | 81 | // can stream a NULL char pointer to it in the former, but not in the | ||
2189 | 82 | // latter (it causes an access violation if you do). The Message | ||
2190 | 83 | // class hides this difference by treating a NULL char pointer as | ||
2191 | 84 | // "(null)". | ||
2192 | 85 | class GTEST_API_ Message { | ||
2193 | 86 | private: | ||
2194 | 87 | // The type of basic IO manipulators (endl, ends, and flush) for | ||
2195 | 88 | // narrow streams. | ||
2196 | 89 | typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); | ||
2197 | 90 | |||
2198 | 91 | public: | ||
2199 | 92 | // Constructs an empty Message. | ||
2200 | 93 | Message(); | ||
2201 | 94 | |||
2202 | 95 | // Copy constructor. | ||
2203 | 96 | Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT | ||
2204 | 97 | *ss_ << msg.GetString(); | ||
2205 | 98 | } | ||
2206 | 99 | |||
2207 | 100 | // Constructs a Message from a C-string. | ||
2208 | 101 | explicit Message(const char* str) : ss_(new ::std::stringstream) { | ||
2209 | 102 | *ss_ << str; | ||
2210 | 103 | } | ||
2211 | 104 | |||
2212 | 105 | #if GTEST_OS_SYMBIAN | ||
2213 | 106 | // Streams a value (either a pointer or not) to this object. | ||
2214 | 107 | template <typename T> | ||
2215 | 108 | inline Message& operator <<(const T& value) { | ||
2216 | 109 | StreamHelper(typename internal::is_pointer<T>::type(), value); | ||
2217 | 110 | return *this; | ||
2218 | 111 | } | ||
2219 | 112 | #else | ||
2220 | 113 | // Streams a non-pointer value to this object. | ||
2221 | 114 | template <typename T> | ||
2222 | 115 | inline Message& operator <<(const T& val) { | ||
2223 | 116 | // Some libraries overload << for STL containers. These | ||
2224 | 117 | // overloads are defined in the global namespace instead of ::std. | ||
2225 | 118 | // | ||
2226 | 119 | // C++'s symbol lookup rule (i.e. Koenig lookup) says that these | ||
2227 | 120 | // overloads are visible in either the std namespace or the global | ||
2228 | 121 | // namespace, but not other namespaces, including the testing | ||
2229 | 122 | // namespace which Google Test's Message class is in. | ||
2230 | 123 | // | ||
2231 | 124 | // To allow STL containers (and other types that has a << operator | ||
2232 | 125 | // defined in the global namespace) to be used in Google Test | ||
2233 | 126 | // assertions, testing::Message must access the custom << operator | ||
2234 | 127 | // from the global namespace. With this using declaration, | ||
2235 | 128 | // overloads of << defined in the global namespace and those | ||
2236 | 129 | // visible via Koenig lookup are both exposed in this function. | ||
2237 | 130 | using ::operator <<; | ||
2238 | 131 | *ss_ << val; | ||
2239 | 132 | return *this; | ||
2240 | 133 | } | ||
2241 | 134 | |||
2242 | 135 | // Streams a pointer value to this object. | ||
2243 | 136 | // | ||
2244 | 137 | // This function is an overload of the previous one. When you | ||
2245 | 138 | // stream a pointer to a Message, this definition will be used as it | ||
2246 | 139 | // is more specialized. (The C++ Standard, section | ||
2247 | 140 | // [temp.func.order].) If you stream a non-pointer, then the | ||
2248 | 141 | // previous definition will be used. | ||
2249 | 142 | // | ||
2250 | 143 | // The reason for this overload is that streaming a NULL pointer to | ||
2251 | 144 | // ostream is undefined behavior. Depending on the compiler, you | ||
2252 | 145 | // may get "0", "(nil)", "(null)", or an access violation. To | ||
2253 | 146 | // ensure consistent result across compilers, we always treat NULL | ||
2254 | 147 | // as "(null)". | ||
2255 | 148 | template <typename T> | ||
2256 | 149 | inline Message& operator <<(T* const& pointer) { // NOLINT | ||
2257 | 150 | if (pointer == NULL) { | ||
2258 | 151 | *ss_ << "(null)"; | ||
2259 | 152 | } else { | ||
2260 | 153 | *ss_ << pointer; | ||
2261 | 154 | } | ||
2262 | 155 | return *this; | ||
2263 | 156 | } | ||
2264 | 157 | #endif // GTEST_OS_SYMBIAN | ||
2265 | 158 | |||
2266 | 159 | // Since the basic IO manipulators are overloaded for both narrow | ||
2267 | 160 | // and wide streams, we have to provide this specialized definition | ||
2268 | 161 | // of operator <<, even though its body is the same as the | ||
2269 | 162 | // templatized version above. Without this definition, streaming | ||
2270 | 163 | // endl or other basic IO manipulators to Message will confuse the | ||
2271 | 164 | // compiler. | ||
2272 | 165 | Message& operator <<(BasicNarrowIoManip val) { | ||
2273 | 166 | *ss_ << val; | ||
2274 | 167 | return *this; | ||
2275 | 168 | } | ||
2276 | 169 | |||
2277 | 170 | // Instead of 1/0, we want to see true/false for bool values. | ||
2278 | 171 | Message& operator <<(bool b) { | ||
2279 | 172 | return *this << (b ? "true" : "false"); | ||
2280 | 173 | } | ||
2281 | 174 | |||
2282 | 175 | // These two overloads allow streaming a wide C string to a Message | ||
2283 | 176 | // using the UTF-8 encoding. | ||
2284 | 177 | Message& operator <<(const wchar_t* wide_c_str); | ||
2285 | 178 | Message& operator <<(wchar_t* wide_c_str); | ||
2286 | 179 | |||
2287 | 180 | #if GTEST_HAS_STD_WSTRING | ||
2288 | 181 | // Converts the given wide string to a narrow string using the UTF-8 | ||
2289 | 182 | // encoding, and streams the result to this Message object. | ||
2290 | 183 | Message& operator <<(const ::std::wstring& wstr); | ||
2291 | 184 | #endif // GTEST_HAS_STD_WSTRING | ||
2292 | 185 | |||
2293 | 186 | #if GTEST_HAS_GLOBAL_WSTRING | ||
2294 | 187 | // Converts the given wide string to a narrow string using the UTF-8 | ||
2295 | 188 | // encoding, and streams the result to this Message object. | ||
2296 | 189 | Message& operator <<(const ::wstring& wstr); | ||
2297 | 190 | #endif // GTEST_HAS_GLOBAL_WSTRING | ||
2298 | 191 | |||
2299 | 192 | // Gets the text streamed to this object so far as an std::string. | ||
2300 | 193 | // Each '\0' character in the buffer is replaced with "\\0". | ||
2301 | 194 | // | ||
2302 | 195 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. | ||
2303 | 196 | std::string GetString() const; | ||
2304 | 197 | |||
2305 | 198 | private: | ||
2306 | 199 | |||
2307 | 200 | #if GTEST_OS_SYMBIAN | ||
2308 | 201 | // These are needed as the Nokia Symbian Compiler cannot decide between | ||
2309 | 202 | // const T& and const T* in a function template. The Nokia compiler _can_ | ||
2310 | 203 | // decide between class template specializations for T and T*, so a | ||
2311 | 204 | // tr1::type_traits-like is_pointer works, and we can overload on that. | ||
2312 | 205 | template <typename T> | ||
2313 | 206 | inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { | ||
2314 | 207 | if (pointer == NULL) { | ||
2315 | 208 | *ss_ << "(null)"; | ||
2316 | 209 | } else { | ||
2317 | 210 | *ss_ << pointer; | ||
2318 | 211 | } | ||
2319 | 212 | } | ||
2320 | 213 | template <typename T> | ||
2321 | 214 | inline void StreamHelper(internal::false_type /*is_pointer*/, | ||
2322 | 215 | const T& value) { | ||
2323 | 216 | // See the comments in Message& operator <<(const T&) above for why | ||
2324 | 217 | // we need this using statement. | ||
2325 | 218 | using ::operator <<; | ||
2326 | 219 | *ss_ << value; | ||
2327 | 220 | } | ||
2328 | 221 | #endif // GTEST_OS_SYMBIAN | ||
2329 | 222 | |||
2330 | 223 | // We'll hold the text streamed to this object here. | ||
2331 | 224 | const internal::scoped_ptr< ::std::stringstream> ss_; | ||
2332 | 225 | |||
2333 | 226 | // We declare (but don't implement) this to prevent the compiler | ||
2334 | 227 | // from implementing the assignment operator. | ||
2335 | 228 | void operator=(const Message&); | ||
2336 | 229 | }; | ||
2337 | 230 | |||
2338 | 231 | // Streams a Message to an ostream. | ||
2339 | 232 | inline std::ostream& operator <<(std::ostream& os, const Message& sb) { | ||
2340 | 233 | return os << sb.GetString(); | ||
2341 | 234 | } | ||
2342 | 235 | |||
2343 | 236 | namespace internal { | ||
2344 | 237 | |||
2345 | 238 | // Converts a streamable value to an std::string. A NULL pointer is | ||
2346 | 239 | // converted to "(null)". When the input value is a ::string, | ||
2347 | 240 | // ::std::string, ::wstring, or ::std::wstring object, each NUL | ||
2348 | 241 | // character in it is replaced with "\\0". | ||
2349 | 242 | template <typename T> | ||
2350 | 243 | std::string StreamableToString(const T& streamable) { | ||
2351 | 244 | return (Message() << streamable).GetString(); | ||
2352 | 245 | } | ||
2353 | 246 | |||
2354 | 247 | } // namespace internal | ||
2355 | 248 | } // namespace testing | ||
2356 | 249 | |||
2357 | 250 | #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ | ||
2358 | 0 | 251 | ||
2359 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-param-test.h' | |||
2360 | --- 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h 1970-01-01 00:00:00 +0000 | |||
2361 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h 2014-04-08 15:07:37 +0000 | |||
2362 | @@ -0,0 +1,1421 @@ | |||
2363 | 1 | // This file was GENERATED by command: | ||
2364 | 2 | // pump.py gtest-param-test.h.pump | ||
2365 | 3 | // DO NOT EDIT BY HAND!!! | ||
2366 | 4 | |||
2367 | 5 | // Copyright 2008, Google Inc. | ||
2368 | 6 | // All rights reserved. | ||
2369 | 7 | // | ||
2370 | 8 | // Redistribution and use in source and binary forms, with or without | ||
2371 | 9 | // modification, are permitted provided that the following conditions are | ||
2372 | 10 | // met: | ||
2373 | 11 | // | ||
2374 | 12 | // * Redistributions of source code must retain the above copyright | ||
2375 | 13 | // notice, this list of conditions and the following disclaimer. | ||
2376 | 14 | // * Redistributions in binary form must reproduce the above | ||
2377 | 15 | // copyright notice, this list of conditions and the following disclaimer | ||
2378 | 16 | // in the documentation and/or other materials provided with the | ||
2379 | 17 | // distribution. | ||
2380 | 18 | // * Neither the name of Google Inc. nor the names of its | ||
2381 | 19 | // contributors may be used to endorse or promote products derived from | ||
2382 | 20 | // this software without specific prior written permission. | ||
2383 | 21 | // | ||
2384 | 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
2385 | 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
2386 | 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
2387 | 25 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
2388 | 26 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
2389 | 27 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
2390 | 28 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
2391 | 29 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
2392 | 30 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
2393 | 31 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
2394 | 32 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
2395 | 33 | // | ||
2396 | 34 | // Authors: vladl@google.com (Vlad Losev) | ||
2397 | 35 | // | ||
2398 | 36 | // Macros and functions for implementing parameterized tests | ||
2399 | 37 | // in Google C++ Testing Framework (Google Test) | ||
2400 | 38 | // | ||
2401 | 39 | // This file is generated by a SCRIPT. DO NOT EDIT BY HAND! | ||
2402 | 40 | // | ||
2403 | 41 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
2404 | 42 | #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
2405 | 43 | |||
2406 | 44 | |||
2407 | 45 | // Value-parameterized tests allow you to test your code with different | ||
2408 | 46 | // parameters without writing multiple copies of the same test. | ||
2409 | 47 | // | ||
2410 | 48 | // Here is how you use value-parameterized tests: | ||
2411 | 49 | |||
2412 | 50 | #if 0 | ||
2413 | 51 | |||
2414 | 52 | // To write value-parameterized tests, first you should define a fixture | ||
2415 | 53 | // class. It is usually derived from testing::TestWithParam<T> (see below for | ||
2416 | 54 | // another inheritance scheme that's sometimes useful in more complicated | ||
2417 | 55 | // class hierarchies), where the type of your parameter values. | ||
2418 | 56 | // TestWithParam<T> is itself derived from testing::Test. T can be any | ||
2419 | 57 | // copyable type. If it's a raw pointer, you are responsible for managing the | ||
2420 | 58 | // lifespan of the pointed values. | ||
2421 | 59 | |||
2422 | 60 | class FooTest : public ::testing::TestWithParam<const char*> { | ||
2423 | 61 | // You can implement all the usual class fixture members here. | ||
2424 | 62 | }; | ||
2425 | 63 | |||
2426 | 64 | // Then, use the TEST_P macro to define as many parameterized tests | ||
2427 | 65 | // for this fixture as you want. The _P suffix is for "parameterized" | ||
2428 | 66 | // or "pattern", whichever you prefer to think. | ||
2429 | 67 | |||
2430 | 68 | TEST_P(FooTest, DoesBlah) { | ||
2431 | 69 | // Inside a test, access the test parameter with the GetParam() method | ||
2432 | 70 | // of the TestWithParam<T> class: | ||
2433 | 71 | EXPECT_TRUE(foo.Blah(GetParam())); | ||
2434 | 72 | ... | ||
2435 | 73 | } | ||
2436 | 74 | |||
2437 | 75 | TEST_P(FooTest, HasBlahBlah) { | ||
2438 | 76 | ... | ||
2439 | 77 | } | ||
2440 | 78 | |||
2441 | 79 | // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test | ||
2442 | 80 | // case with any set of parameters you want. Google Test defines a number | ||
2443 | 81 | // of functions for generating test parameters. They return what we call | ||
2444 | 82 | // (surprise!) parameter generators. Here is a summary of them, which | ||
2445 | 83 | // are all in the testing namespace: | ||
2446 | 84 | // | ||
2447 | 85 | // | ||
2448 | 86 | // Range(begin, end [, step]) - Yields values {begin, begin+step, | ||
2449 | 87 | // begin+step+step, ...}. The values do not | ||
2450 | 88 | // include end. step defaults to 1. | ||
2451 | 89 | // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. | ||
2452 | 90 | // ValuesIn(container) - Yields values from a C-style array, an STL | ||
2453 | 91 | // ValuesIn(begin,end) container, or an iterator range [begin, end). | ||
2454 | 92 | // Bool() - Yields sequence {false, true}. | ||
2455 | 93 | // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product | ||
2456 | 94 | // for the math savvy) of the values generated | ||
2457 | 95 | // by the N generators. | ||
2458 | 96 | // | ||
2459 | 97 | // For more details, see comments at the definitions of these functions below | ||
2460 | 98 | // in this file. | ||
2461 | 99 | // | ||
2462 | 100 | // The following statement will instantiate tests from the FooTest test case | ||
2463 | 101 | // each with parameter values "meeny", "miny", and "moe". | ||
2464 | 102 | |||
2465 | 103 | INSTANTIATE_TEST_CASE_P(InstantiationName, | ||
2466 | 104 | FooTest, | ||
2467 | 105 | Values("meeny", "miny", "moe")); | ||
2468 | 106 | |||
2469 | 107 | // To distinguish different instances of the pattern, (yes, you | ||
2470 | 108 | // can instantiate it more then once) the first argument to the | ||
2471 | 109 | // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the | ||
2472 | 110 | // actual test case name. Remember to pick unique prefixes for different | ||
2473 | 111 | // instantiations. The tests from the instantiation above will have | ||
2474 | 112 | // these names: | ||
2475 | 113 | // | ||
2476 | 114 | // * InstantiationName/FooTest.DoesBlah/0 for "meeny" | ||
2477 | 115 | // * InstantiationName/FooTest.DoesBlah/1 for "miny" | ||
2478 | 116 | // * InstantiationName/FooTest.DoesBlah/2 for "moe" | ||
2479 | 117 | // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" | ||
2480 | 118 | // * InstantiationName/FooTest.HasBlahBlah/1 for "miny" | ||
2481 | 119 | // * InstantiationName/FooTest.HasBlahBlah/2 for "moe" | ||
2482 | 120 | // | ||
2483 | 121 | // You can use these names in --gtest_filter. | ||
2484 | 122 | // | ||
2485 | 123 | // This statement will instantiate all tests from FooTest again, each | ||
2486 | 124 | // with parameter values "cat" and "dog": | ||
2487 | 125 | |||
2488 | 126 | const char* pets[] = {"cat", "dog"}; | ||
2489 | 127 | INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); | ||
2490 | 128 | |||
2491 | 129 | // The tests from the instantiation above will have these names: | ||
2492 | 130 | // | ||
2493 | 131 | // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" | ||
2494 | 132 | // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" | ||
2495 | 133 | // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" | ||
2496 | 134 | // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" | ||
2497 | 135 | // | ||
2498 | 136 | // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests | ||
2499 | 137 | // in the given test case, whether their definitions come before or | ||
2500 | 138 | // AFTER the INSTANTIATE_TEST_CASE_P statement. | ||
2501 | 139 | // | ||
2502 | 140 | // Please also note that generator expressions (including parameters to the | ||
2503 | 141 | // generators) are evaluated in InitGoogleTest(), after main() has started. | ||
2504 | 142 | // This allows the user on one hand, to adjust generator parameters in order | ||
2505 | 143 | // to dynamically determine a set of tests to run and on the other hand, | ||
2506 | 144 | // give the user a chance to inspect the generated tests with Google Test | ||
2507 | 145 | // reflection API before RUN_ALL_TESTS() is executed. | ||
2508 | 146 | // | ||
2509 | 147 | // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc | ||
2510 | 148 | // for more examples. | ||
2511 | 149 | // | ||
2512 | 150 | // In the future, we plan to publish the API for defining new parameter | ||
2513 | 151 | // generators. But for now this interface remains part of the internal | ||
2514 | 152 | // implementation and is subject to change. | ||
2515 | 153 | // | ||
2516 | 154 | // | ||
2517 | 155 | // A parameterized test fixture must be derived from testing::Test and from | ||
2518 | 156 | // testing::WithParamInterface<T>, where T is the type of the parameter | ||
2519 | 157 | // values. Inheriting from TestWithParam<T> satisfies that requirement because | ||
2520 | 158 | // TestWithParam<T> inherits from both Test and WithParamInterface. In more | ||
2521 | 159 | // complicated hierarchies, however, it is occasionally useful to inherit | ||
2522 | 160 | // separately from Test and WithParamInterface. For example: | ||
2523 | 161 | |||
2524 | 162 | class BaseTest : public ::testing::Test { | ||
2525 | 163 | // You can inherit all the usual members for a non-parameterized test | ||
2526 | 164 | // fixture here. | ||
2527 | 165 | }; | ||
2528 | 166 | |||
2529 | 167 | class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> { | ||
2530 | 168 | // The usual test fixture members go here too. | ||
2531 | 169 | }; | ||
2532 | 170 | |||
2533 | 171 | TEST_F(BaseTest, HasFoo) { | ||
2534 | 172 | // This is an ordinary non-parameterized test. | ||
2535 | 173 | } | ||
2536 | 174 | |||
2537 | 175 | TEST_P(DerivedTest, DoesBlah) { | ||
2538 | 176 | // GetParam works just the same here as if you inherit from TestWithParam. | ||
2539 | 177 | EXPECT_TRUE(foo.Blah(GetParam())); | ||
2540 | 178 | } | ||
2541 | 179 | |||
2542 | 180 | #endif // 0 | ||
2543 | 181 | |||
2544 | 182 | #include "gtest/internal/gtest-port.h" | ||
2545 | 183 | |||
2546 | 184 | #if !GTEST_OS_SYMBIAN | ||
2547 | 185 | # include <utility> | ||
2548 | 186 | #endif | ||
2549 | 187 | |||
2550 | 188 | // scripts/fuse_gtest.py depends on gtest's own header being #included | ||
2551 | 189 | // *unconditionally*. Therefore these #includes cannot be moved | ||
2552 | 190 | // inside #if GTEST_HAS_PARAM_TEST. | ||
2553 | 191 | #include "gtest/internal/gtest-internal.h" | ||
2554 | 192 | #include "gtest/internal/gtest-param-util.h" | ||
2555 | 193 | #include "gtest/internal/gtest-param-util-generated.h" | ||
2556 | 194 | |||
2557 | 195 | #if GTEST_HAS_PARAM_TEST | ||
2558 | 196 | |||
2559 | 197 | namespace testing { | ||
2560 | 198 | |||
2561 | 199 | // Functions producing parameter generators. | ||
2562 | 200 | // | ||
2563 | 201 | // Google Test uses these generators to produce parameters for value- | ||
2564 | 202 | // parameterized tests. When a parameterized test case is instantiated | ||
2565 | 203 | // with a particular generator, Google Test creates and runs tests | ||
2566 | 204 | // for each element in the sequence produced by the generator. | ||
2567 | 205 | // | ||
2568 | 206 | // In the following sample, tests from test case FooTest are instantiated | ||
2569 | 207 | // each three times with parameter values 3, 5, and 8: | ||
2570 | 208 | // | ||
2571 | 209 | // class FooTest : public TestWithParam<int> { ... }; | ||
2572 | 210 | // | ||
2573 | 211 | // TEST_P(FooTest, TestThis) { | ||
2574 | 212 | // } | ||
2575 | 213 | // TEST_P(FooTest, TestThat) { | ||
2576 | 214 | // } | ||
2577 | 215 | // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); | ||
2578 | 216 | // | ||
2579 | 217 | |||
2580 | 218 | // Range() returns generators providing sequences of values in a range. | ||
2581 | 219 | // | ||
2582 | 220 | // Synopsis: | ||
2583 | 221 | // Range(start, end) | ||
2584 | 222 | // - returns a generator producing a sequence of values {start, start+1, | ||
2585 | 223 | // start+2, ..., }. | ||
2586 | 224 | // Range(start, end, step) | ||
2587 | 225 | // - returns a generator producing a sequence of values {start, start+step, | ||
2588 | 226 | // start+step+step, ..., }. | ||
2589 | 227 | // Notes: | ||
2590 | 228 | // * The generated sequences never include end. For example, Range(1, 5) | ||
2591 | 229 | // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) | ||
2592 | 230 | // returns a generator producing {1, 3, 5, 7}. | ||
2593 | 231 | // * start and end must have the same type. That type may be any integral or | ||
2594 | 232 | // floating-point type or a user defined type satisfying these conditions: | ||
2595 | 233 | // * It must be assignable (have operator=() defined). | ||
2596 | 234 | // * It must have operator+() (operator+(int-compatible type) for | ||
2597 | 235 | // two-operand version). | ||
2598 | 236 | // * It must have operator<() defined. | ||
2599 | 237 | // Elements in the resulting sequences will also have that type. | ||
2600 | 238 | // * Condition start < end must be satisfied in order for resulting sequences | ||
2601 | 239 | // to contain any elements. | ||
2602 | 240 | // | ||
2603 | 241 | template <typename T, typename IncrementT> | ||
2604 | 242 | internal::ParamGenerator<T> Range(T start, T end, IncrementT step) { | ||
2605 | 243 | return internal::ParamGenerator<T>( | ||
2606 | 244 | new internal::RangeGenerator<T, IncrementT>(start, end, step)); | ||
2607 | 245 | } | ||
2608 | 246 | |||
2609 | 247 | template <typename T> | ||
2610 | 248 | internal::ParamGenerator<T> Range(T start, T end) { | ||
2611 | 249 | return Range(start, end, 1); | ||
2612 | 250 | } | ||
2613 | 251 | |||
2614 | 252 | // ValuesIn() function allows generation of tests with parameters coming from | ||
2615 | 253 | // a container. | ||
2616 | 254 | // | ||
2617 | 255 | // Synopsis: | ||
2618 | 256 | // ValuesIn(const T (&array)[N]) | ||
2619 | 257 | // - returns a generator producing sequences with elements from | ||
2620 | 258 | // a C-style array. | ||
2621 | 259 | // ValuesIn(const Container& container) | ||
2622 | 260 | // - returns a generator producing sequences with elements from | ||
2623 | 261 | // an STL-style container. | ||
2624 | 262 | // ValuesIn(Iterator begin, Iterator end) | ||
2625 | 263 | // - returns a generator producing sequences with elements from | ||
2626 | 264 | // a range [begin, end) defined by a pair of STL-style iterators. These | ||
2627 | 265 | // iterators can also be plain C pointers. | ||
2628 | 266 | // | ||
2629 | 267 | // Please note that ValuesIn copies the values from the containers | ||
2630 | 268 | // passed in and keeps them to generate tests in RUN_ALL_TESTS(). | ||
2631 | 269 | // | ||
2632 | 270 | // Examples: | ||
2633 | 271 | // | ||
2634 | 272 | // This instantiates tests from test case StringTest | ||
2635 | 273 | // each with C-string values of "foo", "bar", and "baz": | ||
2636 | 274 | // | ||
2637 | 275 | // const char* strings[] = {"foo", "bar", "baz"}; | ||
2638 | 276 | // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); | ||
2639 | 277 | // | ||
2640 | 278 | // This instantiates tests from test case StlStringTest | ||
2641 | 279 | // each with STL strings with values "a" and "b": | ||
2642 | 280 | // | ||
2643 | 281 | // ::std::vector< ::std::string> GetParameterStrings() { | ||
2644 | 282 | // ::std::vector< ::std::string> v; | ||
2645 | 283 | // v.push_back("a"); | ||
2646 | 284 | // v.push_back("b"); | ||
2647 | 285 | // return v; | ||
2648 | 286 | // } | ||
2649 | 287 | // | ||
2650 | 288 | // INSTANTIATE_TEST_CASE_P(CharSequence, | ||
2651 | 289 | // StlStringTest, | ||
2652 | 290 | // ValuesIn(GetParameterStrings())); | ||
2653 | 291 | // | ||
2654 | 292 | // | ||
2655 | 293 | // This will also instantiate tests from CharTest | ||
2656 | 294 | // each with parameter values 'a' and 'b': | ||
2657 | 295 | // | ||
2658 | 296 | // ::std::list<char> GetParameterChars() { | ||
2659 | 297 | // ::std::list<char> list; | ||
2660 | 298 | // list.push_back('a'); | ||
2661 | 299 | // list.push_back('b'); | ||
2662 | 300 | // return list; | ||
2663 | 301 | // } | ||
2664 | 302 | // ::std::list<char> l = GetParameterChars(); | ||
2665 | 303 | // INSTANTIATE_TEST_CASE_P(CharSequence2, | ||
2666 | 304 | // CharTest, | ||
2667 | 305 | // ValuesIn(l.begin(), l.end())); | ||
2668 | 306 | // | ||
2669 | 307 | template <typename ForwardIterator> | ||
2670 | 308 | internal::ParamGenerator< | ||
2671 | 309 | typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> | ||
2672 | 310 | ValuesIn(ForwardIterator begin, ForwardIterator end) { | ||
2673 | 311 | typedef typename ::testing::internal::IteratorTraits<ForwardIterator> | ||
2674 | 312 | ::value_type ParamType; | ||
2675 | 313 | return internal::ParamGenerator<ParamType>( | ||
2676 | 314 | new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end)); | ||
2677 | 315 | } | ||
2678 | 316 | |||
2679 | 317 | template <typename T, size_t N> | ||
2680 | 318 | internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) { | ||
2681 | 319 | return ValuesIn(array, array + N); | ||
2682 | 320 | } | ||
2683 | 321 | |||
2684 | 322 | template <class Container> | ||
2685 | 323 | internal::ParamGenerator<typename Container::value_type> ValuesIn( | ||
2686 | 324 | const Container& container) { | ||
2687 | 325 | return ValuesIn(container.begin(), container.end()); | ||
2688 | 326 | } | ||
2689 | 327 | |||
2690 | 328 | // Values() allows generating tests from explicitly specified list of | ||
2691 | 329 | // parameters. | ||
2692 | 330 | // | ||
2693 | 331 | // Synopsis: | ||
2694 | 332 | // Values(T v1, T v2, ..., T vN) | ||
2695 | 333 | // - returns a generator producing sequences with elements v1, v2, ..., vN. | ||
2696 | 334 | // | ||
2697 | 335 | // For example, this instantiates tests from test case BarTest each | ||
2698 | 336 | // with values "one", "two", and "three": | ||
2699 | 337 | // | ||
2700 | 338 | // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); | ||
2701 | 339 | // | ||
2702 | 340 | // This instantiates tests from test case BazTest each with values 1, 2, 3.5. | ||
2703 | 341 | // The exact type of values will depend on the type of parameter in BazTest. | ||
2704 | 342 | // | ||
2705 | 343 | // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); | ||
2706 | 344 | // | ||
2707 | 345 | // Currently, Values() supports from 1 to 50 parameters. | ||
2708 | 346 | // | ||
2709 | 347 | template <typename T1> | ||
2710 | 348 | internal::ValueArray1<T1> Values(T1 v1) { | ||
2711 | 349 | return internal::ValueArray1<T1>(v1); | ||
2712 | 350 | } | ||
2713 | 351 | |||
2714 | 352 | template <typename T1, typename T2> | ||
2715 | 353 | internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { | ||
2716 | 354 | return internal::ValueArray2<T1, T2>(v1, v2); | ||
2717 | 355 | } | ||
2718 | 356 | |||
2719 | 357 | template <typename T1, typename T2, typename T3> | ||
2720 | 358 | internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { | ||
2721 | 359 | return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); | ||
2722 | 360 | } | ||
2723 | 361 | |||
2724 | 362 | template <typename T1, typename T2, typename T3, typename T4> | ||
2725 | 363 | internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { | ||
2726 | 364 | return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); | ||
2727 | 365 | } | ||
2728 | 366 | |||
2729 | 367 | template <typename T1, typename T2, typename T3, typename T4, typename T5> | ||
2730 | 368 | internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
2731 | 369 | T5 v5) { | ||
2732 | 370 | return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); | ||
2733 | 371 | } | ||
2734 | 372 | |||
2735 | 373 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2736 | 374 | typename T6> | ||
2737 | 375 | internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, | ||
2738 | 376 | T4 v4, T5 v5, T6 v6) { | ||
2739 | 377 | return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); | ||
2740 | 378 | } | ||
2741 | 379 | |||
2742 | 380 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2743 | 381 | typename T6, typename T7> | ||
2744 | 382 | internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, | ||
2745 | 383 | T4 v4, T5 v5, T6 v6, T7 v7) { | ||
2746 | 384 | return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, | ||
2747 | 385 | v6, v7); | ||
2748 | 386 | } | ||
2749 | 387 | |||
2750 | 388 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2751 | 389 | typename T6, typename T7, typename T8> | ||
2752 | 390 | internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, | ||
2753 | 391 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { | ||
2754 | 392 | return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, | ||
2755 | 393 | v5, v6, v7, v8); | ||
2756 | 394 | } | ||
2757 | 395 | |||
2758 | 396 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2759 | 397 | typename T6, typename T7, typename T8, typename T9> | ||
2760 | 398 | internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, | ||
2761 | 399 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { | ||
2762 | 400 | return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, | ||
2763 | 401 | v4, v5, v6, v7, v8, v9); | ||
2764 | 402 | } | ||
2765 | 403 | |||
2766 | 404 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2767 | 405 | typename T6, typename T7, typename T8, typename T9, typename T10> | ||
2768 | 406 | internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, | ||
2769 | 407 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { | ||
2770 | 408 | return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, | ||
2771 | 409 | v2, v3, v4, v5, v6, v7, v8, v9, v10); | ||
2772 | 410 | } | ||
2773 | 411 | |||
2774 | 412 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2775 | 413 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2776 | 414 | typename T11> | ||
2777 | 415 | internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, | ||
2778 | 416 | T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2779 | 417 | T10 v10, T11 v11) { | ||
2780 | 418 | return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, | ||
2781 | 419 | T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); | ||
2782 | 420 | } | ||
2783 | 421 | |||
2784 | 422 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2785 | 423 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2786 | 424 | typename T11, typename T12> | ||
2787 | 425 | internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2788 | 426 | T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2789 | 427 | T10 v10, T11 v11, T12 v12) { | ||
2790 | 428 | return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2791 | 429 | T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); | ||
2792 | 430 | } | ||
2793 | 431 | |||
2794 | 432 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2795 | 433 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2796 | 434 | typename T11, typename T12, typename T13> | ||
2797 | 435 | internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, | ||
2798 | 436 | T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2799 | 437 | T10 v10, T11 v11, T12 v12, T13 v13) { | ||
2800 | 438 | return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2801 | 439 | T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); | ||
2802 | 440 | } | ||
2803 | 441 | |||
2804 | 442 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2805 | 443 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2806 | 444 | typename T11, typename T12, typename T13, typename T14> | ||
2807 | 445 | internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2808 | 446 | T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2809 | 447 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { | ||
2810 | 448 | return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2811 | 449 | T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, | ||
2812 | 450 | v14); | ||
2813 | 451 | } | ||
2814 | 452 | |||
2815 | 453 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2816 | 454 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2817 | 455 | typename T11, typename T12, typename T13, typename T14, typename T15> | ||
2818 | 456 | internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2819 | 457 | T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, | ||
2820 | 458 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { | ||
2821 | 459 | return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2822 | 460 | T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, | ||
2823 | 461 | v13, v14, v15); | ||
2824 | 462 | } | ||
2825 | 463 | |||
2826 | 464 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2827 | 465 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2828 | 466 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2829 | 467 | typename T16> | ||
2830 | 468 | internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2831 | 469 | T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
2832 | 470 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
2833 | 471 | T16 v16) { | ||
2834 | 472 | return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2835 | 473 | T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, | ||
2836 | 474 | v12, v13, v14, v15, v16); | ||
2837 | 475 | } | ||
2838 | 476 | |||
2839 | 477 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2840 | 478 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2841 | 479 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2842 | 480 | typename T16, typename T17> | ||
2843 | 481 | internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2844 | 482 | T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
2845 | 483 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
2846 | 484 | T16 v16, T17 v17) { | ||
2847 | 485 | return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2848 | 486 | T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, | ||
2849 | 487 | v11, v12, v13, v14, v15, v16, v17); | ||
2850 | 488 | } | ||
2851 | 489 | |||
2852 | 490 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2853 | 491 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2854 | 492 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2855 | 493 | typename T16, typename T17, typename T18> | ||
2856 | 494 | internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2857 | 495 | T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, | ||
2858 | 496 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
2859 | 497 | T16 v16, T17 v17, T18 v18) { | ||
2860 | 498 | return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2861 | 499 | T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, | ||
2862 | 500 | v10, v11, v12, v13, v14, v15, v16, v17, v18); | ||
2863 | 501 | } | ||
2864 | 502 | |||
2865 | 503 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2866 | 504 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2867 | 505 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2868 | 506 | typename T16, typename T17, typename T18, typename T19> | ||
2869 | 507 | internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2870 | 508 | T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, | ||
2871 | 509 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, | ||
2872 | 510 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { | ||
2873 | 511 | return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2874 | 512 | T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, | ||
2875 | 513 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); | ||
2876 | 514 | } | ||
2877 | 515 | |||
2878 | 516 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2879 | 517 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2880 | 518 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2881 | 519 | typename T16, typename T17, typename T18, typename T19, typename T20> | ||
2882 | 520 | internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2883 | 521 | T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
2884 | 522 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, | ||
2885 | 523 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { | ||
2886 | 524 | return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2887 | 525 | T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, | ||
2888 | 526 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); | ||
2889 | 527 | } | ||
2890 | 528 | |||
2891 | 529 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2892 | 530 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2893 | 531 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2894 | 532 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2895 | 533 | typename T21> | ||
2896 | 534 | internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2897 | 535 | T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
2898 | 536 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, | ||
2899 | 537 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { | ||
2900 | 538 | return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2901 | 539 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, | ||
2902 | 540 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); | ||
2903 | 541 | } | ||
2904 | 542 | |||
2905 | 543 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2906 | 544 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2907 | 545 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2908 | 546 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2909 | 547 | typename T21, typename T22> | ||
2910 | 548 | internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2911 | 549 | T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, | ||
2912 | 550 | T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
2913 | 551 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
2914 | 552 | T21 v21, T22 v22) { | ||
2915 | 553 | return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2916 | 554 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, | ||
2917 | 555 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, | ||
2918 | 556 | v20, v21, v22); | ||
2919 | 557 | } | ||
2920 | 558 | |||
2921 | 559 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2922 | 560 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2923 | 561 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2924 | 562 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2925 | 563 | typename T21, typename T22, typename T23> | ||
2926 | 564 | internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2927 | 565 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, | ||
2928 | 566 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
2929 | 567 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
2930 | 568 | T21 v21, T22 v22, T23 v23) { | ||
2931 | 569 | return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2932 | 570 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, | ||
2933 | 571 | v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, | ||
2934 | 572 | v20, v21, v22, v23); | ||
2935 | 573 | } | ||
2936 | 574 | |||
2937 | 575 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2938 | 576 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2939 | 577 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2940 | 578 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2941 | 579 | typename T21, typename T22, typename T23, typename T24> | ||
2942 | 580 | internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2943 | 581 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, | ||
2944 | 582 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
2945 | 583 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
2946 | 584 | T21 v21, T22 v22, T23 v23, T24 v24) { | ||
2947 | 585 | return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2948 | 586 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, | ||
2949 | 587 | v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, | ||
2950 | 588 | v19, v20, v21, v22, v23, v24); | ||
2951 | 589 | } | ||
2952 | 590 | |||
2953 | 591 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2954 | 592 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2955 | 593 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2956 | 594 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2957 | 595 | typename T21, typename T22, typename T23, typename T24, typename T25> | ||
2958 | 596 | internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2959 | 597 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, | ||
2960 | 598 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, | ||
2961 | 599 | T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, | ||
2962 | 600 | T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { | ||
2963 | 601 | return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2964 | 602 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, | ||
2965 | 603 | v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, | ||
2966 | 604 | v18, v19, v20, v21, v22, v23, v24, v25); | ||
2967 | 605 | } | ||
2968 | 606 | |||
2969 | 607 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2970 | 608 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2971 | 609 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2972 | 610 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2973 | 611 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
2974 | 612 | typename T26> | ||
2975 | 613 | internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2976 | 614 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
2977 | 615 | T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2978 | 616 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
2979 | 617 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
2980 | 618 | T26 v26) { | ||
2981 | 619 | return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
2982 | 620 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
2983 | 621 | T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, | ||
2984 | 622 | v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); | ||
2985 | 623 | } | ||
2986 | 624 | |||
2987 | 625 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
2988 | 626 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
2989 | 627 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
2990 | 628 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
2991 | 629 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
2992 | 630 | typename T26, typename T27> | ||
2993 | 631 | internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
2994 | 632 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, | ||
2995 | 633 | T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
2996 | 634 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
2997 | 635 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
2998 | 636 | T26 v26, T27 v27) { | ||
2999 | 637 | return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3000 | 638 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3001 | 639 | T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, | ||
3002 | 640 | v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); | ||
3003 | 641 | } | ||
3004 | 642 | |||
3005 | 643 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3006 | 644 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3007 | 645 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3008 | 646 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3009 | 647 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3010 | 648 | typename T26, typename T27, typename T28> | ||
3011 | 649 | internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3012 | 650 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, | ||
3013 | 651 | T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3014 | 652 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3015 | 653 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3016 | 654 | T26 v26, T27 v27, T28 v28) { | ||
3017 | 655 | return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3018 | 656 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3019 | 657 | T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, | ||
3020 | 658 | v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, | ||
3021 | 659 | v28); | ||
3022 | 660 | } | ||
3023 | 661 | |||
3024 | 662 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3025 | 663 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3026 | 664 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3027 | 665 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3028 | 666 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3029 | 667 | typename T26, typename T27, typename T28, typename T29> | ||
3030 | 668 | internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3031 | 669 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3032 | 670 | T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3033 | 671 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3034 | 672 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3035 | 673 | T26 v26, T27 v27, T28 v28, T29 v29) { | ||
3036 | 674 | return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3037 | 675 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3038 | 676 | T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, | ||
3039 | 677 | v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, | ||
3040 | 678 | v27, v28, v29); | ||
3041 | 679 | } | ||
3042 | 680 | |||
3043 | 681 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3044 | 682 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3045 | 683 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3046 | 684 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3047 | 685 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3048 | 686 | typename T26, typename T27, typename T28, typename T29, typename T30> | ||
3049 | 687 | internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3050 | 688 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3051 | 689 | T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, | ||
3052 | 690 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, | ||
3053 | 691 | T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, | ||
3054 | 692 | T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { | ||
3055 | 693 | return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3056 | 694 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3057 | 695 | T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, | ||
3058 | 696 | v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, | ||
3059 | 697 | v26, v27, v28, v29, v30); | ||
3060 | 698 | } | ||
3061 | 699 | |||
3062 | 700 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3063 | 701 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3064 | 702 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3065 | 703 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3066 | 704 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3067 | 705 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3068 | 706 | typename T31> | ||
3069 | 707 | internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3070 | 708 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3071 | 709 | T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
3072 | 710 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3073 | 711 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3074 | 712 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { | ||
3075 | 713 | return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3076 | 714 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3077 | 715 | T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, | ||
3078 | 716 | v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, | ||
3079 | 717 | v25, v26, v27, v28, v29, v30, v31); | ||
3080 | 718 | } | ||
3081 | 719 | |||
3082 | 720 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3083 | 721 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3084 | 722 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3085 | 723 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3086 | 724 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3087 | 725 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3088 | 726 | typename T31, typename T32> | ||
3089 | 727 | internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3090 | 728 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3091 | 729 | T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
3092 | 730 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3093 | 731 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3094 | 732 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, | ||
3095 | 733 | T32 v32) { | ||
3096 | 734 | return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3097 | 735 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3098 | 736 | T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, | ||
3099 | 737 | v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, | ||
3100 | 738 | v24, v25, v26, v27, v28, v29, v30, v31, v32); | ||
3101 | 739 | } | ||
3102 | 740 | |||
3103 | 741 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3104 | 742 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3105 | 743 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3106 | 744 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3107 | 745 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3108 | 746 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3109 | 747 | typename T31, typename T32, typename T33> | ||
3110 | 748 | internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3111 | 749 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3112 | 750 | T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, | ||
3113 | 751 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3114 | 752 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3115 | 753 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, | ||
3116 | 754 | T32 v32, T33 v33) { | ||
3117 | 755 | return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3118 | 756 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3119 | 757 | T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, | ||
3120 | 758 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, | ||
3121 | 759 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); | ||
3122 | 760 | } | ||
3123 | 761 | |||
3124 | 762 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3125 | 763 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3126 | 764 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3127 | 765 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3128 | 766 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3129 | 767 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3130 | 768 | typename T31, typename T32, typename T33, typename T34> | ||
3131 | 769 | internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3132 | 770 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3133 | 771 | T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, | ||
3134 | 772 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, | ||
3135 | 773 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, | ||
3136 | 774 | T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, | ||
3137 | 775 | T31 v31, T32 v32, T33 v33, T34 v34) { | ||
3138 | 776 | return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3139 | 777 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3140 | 778 | T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, | ||
3141 | 779 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, | ||
3142 | 780 | v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); | ||
3143 | 781 | } | ||
3144 | 782 | |||
3145 | 783 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3146 | 784 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3147 | 785 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3148 | 786 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3149 | 787 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3150 | 788 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3151 | 789 | typename T31, typename T32, typename T33, typename T34, typename T35> | ||
3152 | 790 | internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3153 | 791 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3154 | 792 | T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
3155 | 793 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, | ||
3156 | 794 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, | ||
3157 | 795 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, | ||
3158 | 796 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { | ||
3159 | 797 | return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3160 | 798 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3161 | 799 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, | ||
3162 | 800 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, | ||
3163 | 801 | v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); | ||
3164 | 802 | } | ||
3165 | 803 | |||
3166 | 804 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3167 | 805 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3168 | 806 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3169 | 807 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3170 | 808 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3171 | 809 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3172 | 810 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3173 | 811 | typename T36> | ||
3174 | 812 | internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3175 | 813 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3176 | 814 | T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
3177 | 815 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, | ||
3178 | 816 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, | ||
3179 | 817 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, | ||
3180 | 818 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { | ||
3181 | 819 | return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3182 | 820 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3183 | 821 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, | ||
3184 | 822 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, | ||
3185 | 823 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, | ||
3186 | 824 | v34, v35, v36); | ||
3187 | 825 | } | ||
3188 | 826 | |||
3189 | 827 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3190 | 828 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3191 | 829 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3192 | 830 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3193 | 831 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3194 | 832 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3195 | 833 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3196 | 834 | typename T36, typename T37> | ||
3197 | 835 | internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3198 | 836 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3199 | 837 | T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, | ||
3200 | 838 | T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
3201 | 839 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
3202 | 840 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, | ||
3203 | 841 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, | ||
3204 | 842 | T37 v37) { | ||
3205 | 843 | return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3206 | 844 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3207 | 845 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, | ||
3208 | 846 | v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, | ||
3209 | 847 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, | ||
3210 | 848 | v34, v35, v36, v37); | ||
3211 | 849 | } | ||
3212 | 850 | |||
3213 | 851 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3214 | 852 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3215 | 853 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3216 | 854 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3217 | 855 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3218 | 856 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3219 | 857 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3220 | 858 | typename T36, typename T37, typename T38> | ||
3221 | 859 | internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3222 | 860 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3223 | 861 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, | ||
3224 | 862 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
3225 | 863 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
3226 | 864 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, | ||
3227 | 865 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, | ||
3228 | 866 | T37 v37, T38 v38) { | ||
3229 | 867 | return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3230 | 868 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3231 | 869 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, | ||
3232 | 870 | v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, | ||
3233 | 871 | v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, | ||
3234 | 872 | v33, v34, v35, v36, v37, v38); | ||
3235 | 873 | } | ||
3236 | 874 | |||
3237 | 875 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3238 | 876 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3239 | 877 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3240 | 878 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3241 | 879 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3242 | 880 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3243 | 881 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3244 | 882 | typename T36, typename T37, typename T38, typename T39> | ||
3245 | 883 | internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3246 | 884 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3247 | 885 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, | ||
3248 | 886 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, | ||
3249 | 887 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, | ||
3250 | 888 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, | ||
3251 | 889 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, | ||
3252 | 890 | T37 v37, T38 v38, T39 v39) { | ||
3253 | 891 | return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3254 | 892 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3255 | 893 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, | ||
3256 | 894 | v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, | ||
3257 | 895 | v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, | ||
3258 | 896 | v32, v33, v34, v35, v36, v37, v38, v39); | ||
3259 | 897 | } | ||
3260 | 898 | |||
3261 | 899 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3262 | 900 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3263 | 901 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3264 | 902 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3265 | 903 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3266 | 904 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3267 | 905 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3268 | 906 | typename T36, typename T37, typename T38, typename T39, typename T40> | ||
3269 | 907 | internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3270 | 908 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3271 | 909 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, | ||
3272 | 910 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, | ||
3273 | 911 | T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, | ||
3274 | 912 | T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, | ||
3275 | 913 | T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, | ||
3276 | 914 | T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { | ||
3277 | 915 | return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3278 | 916 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3279 | 917 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3280 | 918 | T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, | ||
3281 | 919 | v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, | ||
3282 | 920 | v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); | ||
3283 | 921 | } | ||
3284 | 922 | |||
3285 | 923 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3286 | 924 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3287 | 925 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3288 | 926 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3289 | 927 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3290 | 928 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3291 | 929 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3292 | 930 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3293 | 931 | typename T41> | ||
3294 | 932 | internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3295 | 933 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3296 | 934 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, | ||
3297 | 935 | T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3298 | 936 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3299 | 937 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3300 | 938 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, | ||
3301 | 939 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { | ||
3302 | 940 | return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3303 | 941 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3304 | 942 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3305 | 943 | T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, | ||
3306 | 944 | v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, | ||
3307 | 945 | v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); | ||
3308 | 946 | } | ||
3309 | 947 | |||
3310 | 948 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3311 | 949 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3312 | 950 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3313 | 951 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3314 | 952 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3315 | 953 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3316 | 954 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3317 | 955 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3318 | 956 | typename T41, typename T42> | ||
3319 | 957 | internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3320 | 958 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3321 | 959 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, | ||
3322 | 960 | T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3323 | 961 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3324 | 962 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3325 | 963 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, | ||
3326 | 964 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, | ||
3327 | 965 | T42 v42) { | ||
3328 | 966 | return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3329 | 967 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3330 | 968 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3331 | 969 | T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, | ||
3332 | 970 | v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, | ||
3333 | 971 | v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, | ||
3334 | 972 | v42); | ||
3335 | 973 | } | ||
3336 | 974 | |||
3337 | 975 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3338 | 976 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3339 | 977 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3340 | 978 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3341 | 979 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3342 | 980 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3343 | 981 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3344 | 982 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3345 | 983 | typename T41, typename T42, typename T43> | ||
3346 | 984 | internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3347 | 985 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3348 | 986 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, | ||
3349 | 987 | T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3350 | 988 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3351 | 989 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3352 | 990 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, | ||
3353 | 991 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, | ||
3354 | 992 | T42 v42, T43 v43) { | ||
3355 | 993 | return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3356 | 994 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3357 | 995 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3358 | 996 | T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, | ||
3359 | 997 | v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, | ||
3360 | 998 | v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, | ||
3361 | 999 | v41, v42, v43); | ||
3362 | 1000 | } | ||
3363 | 1001 | |||
3364 | 1002 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3365 | 1003 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3366 | 1004 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3367 | 1005 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3368 | 1006 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3369 | 1007 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3370 | 1008 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3371 | 1009 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3372 | 1010 | typename T41, typename T42, typename T43, typename T44> | ||
3373 | 1011 | internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3374 | 1012 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3375 | 1013 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3376 | 1014 | T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, | ||
3377 | 1015 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, | ||
3378 | 1016 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, | ||
3379 | 1017 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, | ||
3380 | 1018 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, | ||
3381 | 1019 | T42 v42, T43 v43, T44 v44) { | ||
3382 | 1020 | return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3383 | 1021 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3384 | 1022 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3385 | 1023 | T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, | ||
3386 | 1024 | v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, | ||
3387 | 1025 | v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, | ||
3388 | 1026 | v40, v41, v42, v43, v44); | ||
3389 | 1027 | } | ||
3390 | 1028 | |||
3391 | 1029 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3392 | 1030 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3393 | 1031 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3394 | 1032 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3395 | 1033 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3396 | 1034 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3397 | 1035 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3398 | 1036 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3399 | 1037 | typename T41, typename T42, typename T43, typename T44, typename T45> | ||
3400 | 1038 | internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3401 | 1039 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3402 | 1040 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3403 | 1041 | T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, | ||
3404 | 1042 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, | ||
3405 | 1043 | T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, | ||
3406 | 1044 | T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, | ||
3407 | 1045 | T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, | ||
3408 | 1046 | T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { | ||
3409 | 1047 | return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3410 | 1048 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3411 | 1049 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3412 | 1050 | T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, | ||
3413 | 1051 | v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, | ||
3414 | 1052 | v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, | ||
3415 | 1053 | v39, v40, v41, v42, v43, v44, v45); | ||
3416 | 1054 | } | ||
3417 | 1055 | |||
3418 | 1056 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3419 | 1057 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3420 | 1058 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3421 | 1059 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3422 | 1060 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3423 | 1061 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3424 | 1062 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3425 | 1063 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3426 | 1064 | typename T41, typename T42, typename T43, typename T44, typename T45, | ||
3427 | 1065 | typename T46> | ||
3428 | 1066 | internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3429 | 1067 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3430 | 1068 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3431 | 1069 | T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
3432 | 1070 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3433 | 1071 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3434 | 1072 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, | ||
3435 | 1073 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, | ||
3436 | 1074 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { | ||
3437 | 1075 | return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3438 | 1076 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3439 | 1077 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3440 | 1078 | T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, | ||
3441 | 1079 | v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, | ||
3442 | 1080 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, | ||
3443 | 1081 | v38, v39, v40, v41, v42, v43, v44, v45, v46); | ||
3444 | 1082 | } | ||
3445 | 1083 | |||
3446 | 1084 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3447 | 1085 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3448 | 1086 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3449 | 1087 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3450 | 1088 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3451 | 1089 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3452 | 1090 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3453 | 1091 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3454 | 1092 | typename T41, typename T42, typename T43, typename T44, typename T45, | ||
3455 | 1093 | typename T46, typename T47> | ||
3456 | 1094 | internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3457 | 1095 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3458 | 1096 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3459 | 1097 | T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, | ||
3460 | 1098 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3461 | 1099 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3462 | 1100 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, | ||
3463 | 1101 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, | ||
3464 | 1102 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { | ||
3465 | 1103 | return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3466 | 1104 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3467 | 1105 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3468 | 1106 | T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, | ||
3469 | 1107 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, | ||
3470 | 1108 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, | ||
3471 | 1109 | v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); | ||
3472 | 1110 | } | ||
3473 | 1111 | |||
3474 | 1112 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3475 | 1113 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3476 | 1114 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3477 | 1115 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3478 | 1116 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3479 | 1117 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3480 | 1118 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3481 | 1119 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3482 | 1120 | typename T41, typename T42, typename T43, typename T44, typename T45, | ||
3483 | 1121 | typename T46, typename T47, typename T48> | ||
3484 | 1122 | internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3485 | 1123 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3486 | 1124 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3487 | 1125 | T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, | ||
3488 | 1126 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, | ||
3489 | 1127 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, | ||
3490 | 1128 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, | ||
3491 | 1129 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, | ||
3492 | 1130 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, | ||
3493 | 1131 | T48 v48) { | ||
3494 | 1132 | return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3495 | 1133 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3496 | 1134 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3497 | 1135 | T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, | ||
3498 | 1136 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, | ||
3499 | 1137 | v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, | ||
3500 | 1138 | v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); | ||
3501 | 1139 | } | ||
3502 | 1140 | |||
3503 | 1141 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3504 | 1142 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3505 | 1143 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3506 | 1144 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3507 | 1145 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3508 | 1146 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3509 | 1147 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3510 | 1148 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3511 | 1149 | typename T41, typename T42, typename T43, typename T44, typename T45, | ||
3512 | 1150 | typename T46, typename T47, typename T48, typename T49> | ||
3513 | 1151 | internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3514 | 1152 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3515 | 1153 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3516 | 1154 | T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, | ||
3517 | 1155 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, | ||
3518 | 1156 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, | ||
3519 | 1157 | T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, | ||
3520 | 1158 | T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, | ||
3521 | 1159 | T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, | ||
3522 | 1160 | T47 v47, T48 v48, T49 v49) { | ||
3523 | 1161 | return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3524 | 1162 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3525 | 1163 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3526 | 1164 | T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, | ||
3527 | 1165 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, | ||
3528 | 1166 | v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, | ||
3529 | 1167 | v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); | ||
3530 | 1168 | } | ||
3531 | 1169 | |||
3532 | 1170 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
3533 | 1171 | typename T6, typename T7, typename T8, typename T9, typename T10, | ||
3534 | 1172 | typename T11, typename T12, typename T13, typename T14, typename T15, | ||
3535 | 1173 | typename T16, typename T17, typename T18, typename T19, typename T20, | ||
3536 | 1174 | typename T21, typename T22, typename T23, typename T24, typename T25, | ||
3537 | 1175 | typename T26, typename T27, typename T28, typename T29, typename T30, | ||
3538 | 1176 | typename T31, typename T32, typename T33, typename T34, typename T35, | ||
3539 | 1177 | typename T36, typename T37, typename T38, typename T39, typename T40, | ||
3540 | 1178 | typename T41, typename T42, typename T43, typename T44, typename T45, | ||
3541 | 1179 | typename T46, typename T47, typename T48, typename T49, typename T50> | ||
3542 | 1180 | internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, | ||
3543 | 1181 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, | ||
3544 | 1182 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, | ||
3545 | 1183 | T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, | ||
3546 | 1184 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, | ||
3547 | 1185 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, | ||
3548 | 1186 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, | ||
3549 | 1187 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, | ||
3550 | 1188 | T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, | ||
3551 | 1189 | T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { | ||
3552 | 1190 | return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, | ||
3553 | 1191 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, | ||
3554 | 1192 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, | ||
3555 | 1193 | T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, | ||
3556 | 1194 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, | ||
3557 | 1195 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, | ||
3558 | 1196 | v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, | ||
3559 | 1197 | v48, v49, v50); | ||
3560 | 1198 | } | ||
3561 | 1199 | |||
3562 | 1200 | // Bool() allows generating tests with parameters in a set of (false, true). | ||
3563 | 1201 | // | ||
3564 | 1202 | // Synopsis: | ||
3565 | 1203 | // Bool() | ||
3566 | 1204 | // - returns a generator producing sequences with elements {false, true}. | ||
3567 | 1205 | // | ||
3568 | 1206 | // It is useful when testing code that depends on Boolean flags. Combinations | ||
3569 | 1207 | // of multiple flags can be tested when several Bool()'s are combined using | ||
3570 | 1208 | // Combine() function. | ||
3571 | 1209 | // | ||
3572 | 1210 | // In the following example all tests in the test case FlagDependentTest | ||
3573 | 1211 | // will be instantiated twice with parameters false and true. | ||
3574 | 1212 | // | ||
3575 | 1213 | // class FlagDependentTest : public testing::TestWithParam<bool> { | ||
3576 | 1214 | // virtual void SetUp() { | ||
3577 | 1215 | // external_flag = GetParam(); | ||
3578 | 1216 | // } | ||
3579 | 1217 | // } | ||
3580 | 1218 | // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); | ||
3581 | 1219 | // | ||
3582 | 1220 | inline internal::ParamGenerator<bool> Bool() { | ||
3583 | 1221 | return Values(false, true); | ||
3584 | 1222 | } | ||
3585 | 1223 | |||
3586 | 1224 | # if GTEST_HAS_COMBINE | ||
3587 | 1225 | // Combine() allows the user to combine two or more sequences to produce | ||
3588 | 1226 | // values of a Cartesian product of those sequences' elements. | ||
3589 | 1227 | // | ||
3590 | 1228 | // Synopsis: | ||
3591 | 1229 | // Combine(gen1, gen2, ..., genN) | ||
3592 | 1230 | // - returns a generator producing sequences with elements coming from | ||
3593 | 1231 | // the Cartesian product of elements from the sequences generated by | ||
3594 | 1232 | // gen1, gen2, ..., genN. The sequence elements will have a type of | ||
3595 | 1233 | // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types | ||
3596 | 1234 | // of elements from sequences produces by gen1, gen2, ..., genN. | ||
3597 | 1235 | // | ||
3598 | 1236 | // Combine can have up to 10 arguments. This number is currently limited | ||
3599 | 1237 | // by the maximum number of elements in the tuple implementation used by Google | ||
3600 | 1238 | // Test. | ||
3601 | 1239 | // | ||
3602 | 1240 | // Example: | ||
3603 | 1241 | // | ||
3604 | 1242 | // This will instantiate tests in test case AnimalTest each one with | ||
3605 | 1243 | // the parameter values tuple("cat", BLACK), tuple("cat", WHITE), | ||
3606 | 1244 | // tuple("dog", BLACK), and tuple("dog", WHITE): | ||
3607 | 1245 | // | ||
3608 | 1246 | // enum Color { BLACK, GRAY, WHITE }; | ||
3609 | 1247 | // class AnimalTest | ||
3610 | 1248 | // : public testing::TestWithParam<tuple<const char*, Color> > {...}; | ||
3611 | 1249 | // | ||
3612 | 1250 | // TEST_P(AnimalTest, AnimalLooksNice) {...} | ||
3613 | 1251 | // | ||
3614 | 1252 | // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, | ||
3615 | 1253 | // Combine(Values("cat", "dog"), | ||
3616 | 1254 | // Values(BLACK, WHITE))); | ||
3617 | 1255 | // | ||
3618 | 1256 | // This will instantiate tests in FlagDependentTest with all variations of two | ||
3619 | 1257 | // Boolean flags: | ||
3620 | 1258 | // | ||
3621 | 1259 | // class FlagDependentTest | ||
3622 | 1260 | // : public testing::TestWithParam<tuple<bool, bool> > { | ||
3623 | 1261 | // virtual void SetUp() { | ||
3624 | 1262 | // // Assigns external_flag_1 and external_flag_2 values from the tuple. | ||
3625 | 1263 | // tie(external_flag_1, external_flag_2) = GetParam(); | ||
3626 | 1264 | // } | ||
3627 | 1265 | // }; | ||
3628 | 1266 | // | ||
3629 | 1267 | // TEST_P(FlagDependentTest, TestFeature1) { | ||
3630 | 1268 | // // Test your code using external_flag_1 and external_flag_2 here. | ||
3631 | 1269 | // } | ||
3632 | 1270 | // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, | ||
3633 | 1271 | // Combine(Bool(), Bool())); | ||
3634 | 1272 | // | ||
3635 | 1273 | template <typename Generator1, typename Generator2> | ||
3636 | 1274 | internal::CartesianProductHolder2<Generator1, Generator2> Combine( | ||
3637 | 1275 | const Generator1& g1, const Generator2& g2) { | ||
3638 | 1276 | return internal::CartesianProductHolder2<Generator1, Generator2>( | ||
3639 | 1277 | g1, g2); | ||
3640 | 1278 | } | ||
3641 | 1279 | |||
3642 | 1280 | template <typename Generator1, typename Generator2, typename Generator3> | ||
3643 | 1281 | internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( | ||
3644 | 1282 | const Generator1& g1, const Generator2& g2, const Generator3& g3) { | ||
3645 | 1283 | return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( | ||
3646 | 1284 | g1, g2, g3); | ||
3647 | 1285 | } | ||
3648 | 1286 | |||
3649 | 1287 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3650 | 1288 | typename Generator4> | ||
3651 | 1289 | internal::CartesianProductHolder4<Generator1, Generator2, Generator3, | ||
3652 | 1290 | Generator4> Combine( | ||
3653 | 1291 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3654 | 1292 | const Generator4& g4) { | ||
3655 | 1293 | return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, | ||
3656 | 1294 | Generator4>( | ||
3657 | 1295 | g1, g2, g3, g4); | ||
3658 | 1296 | } | ||
3659 | 1297 | |||
3660 | 1298 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3661 | 1299 | typename Generator4, typename Generator5> | ||
3662 | 1300 | internal::CartesianProductHolder5<Generator1, Generator2, Generator3, | ||
3663 | 1301 | Generator4, Generator5> Combine( | ||
3664 | 1302 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3665 | 1303 | const Generator4& g4, const Generator5& g5) { | ||
3666 | 1304 | return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, | ||
3667 | 1305 | Generator4, Generator5>( | ||
3668 | 1306 | g1, g2, g3, g4, g5); | ||
3669 | 1307 | } | ||
3670 | 1308 | |||
3671 | 1309 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3672 | 1310 | typename Generator4, typename Generator5, typename Generator6> | ||
3673 | 1311 | internal::CartesianProductHolder6<Generator1, Generator2, Generator3, | ||
3674 | 1312 | Generator4, Generator5, Generator6> Combine( | ||
3675 | 1313 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3676 | 1314 | const Generator4& g4, const Generator5& g5, const Generator6& g6) { | ||
3677 | 1315 | return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, | ||
3678 | 1316 | Generator4, Generator5, Generator6>( | ||
3679 | 1317 | g1, g2, g3, g4, g5, g6); | ||
3680 | 1318 | } | ||
3681 | 1319 | |||
3682 | 1320 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3683 | 1321 | typename Generator4, typename Generator5, typename Generator6, | ||
3684 | 1322 | typename Generator7> | ||
3685 | 1323 | internal::CartesianProductHolder7<Generator1, Generator2, Generator3, | ||
3686 | 1324 | Generator4, Generator5, Generator6, Generator7> Combine( | ||
3687 | 1325 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3688 | 1326 | const Generator4& g4, const Generator5& g5, const Generator6& g6, | ||
3689 | 1327 | const Generator7& g7) { | ||
3690 | 1328 | return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, | ||
3691 | 1329 | Generator4, Generator5, Generator6, Generator7>( | ||
3692 | 1330 | g1, g2, g3, g4, g5, g6, g7); | ||
3693 | 1331 | } | ||
3694 | 1332 | |||
3695 | 1333 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3696 | 1334 | typename Generator4, typename Generator5, typename Generator6, | ||
3697 | 1335 | typename Generator7, typename Generator8> | ||
3698 | 1336 | internal::CartesianProductHolder8<Generator1, Generator2, Generator3, | ||
3699 | 1337 | Generator4, Generator5, Generator6, Generator7, Generator8> Combine( | ||
3700 | 1338 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3701 | 1339 | const Generator4& g4, const Generator5& g5, const Generator6& g6, | ||
3702 | 1340 | const Generator7& g7, const Generator8& g8) { | ||
3703 | 1341 | return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, | ||
3704 | 1342 | Generator4, Generator5, Generator6, Generator7, Generator8>( | ||
3705 | 1343 | g1, g2, g3, g4, g5, g6, g7, g8); | ||
3706 | 1344 | } | ||
3707 | 1345 | |||
3708 | 1346 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3709 | 1347 | typename Generator4, typename Generator5, typename Generator6, | ||
3710 | 1348 | typename Generator7, typename Generator8, typename Generator9> | ||
3711 | 1349 | internal::CartesianProductHolder9<Generator1, Generator2, Generator3, | ||
3712 | 1350 | Generator4, Generator5, Generator6, Generator7, Generator8, | ||
3713 | 1351 | Generator9> Combine( | ||
3714 | 1352 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3715 | 1353 | const Generator4& g4, const Generator5& g5, const Generator6& g6, | ||
3716 | 1354 | const Generator7& g7, const Generator8& g8, const Generator9& g9) { | ||
3717 | 1355 | return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, | ||
3718 | 1356 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( | ||
3719 | 1357 | g1, g2, g3, g4, g5, g6, g7, g8, g9); | ||
3720 | 1358 | } | ||
3721 | 1359 | |||
3722 | 1360 | template <typename Generator1, typename Generator2, typename Generator3, | ||
3723 | 1361 | typename Generator4, typename Generator5, typename Generator6, | ||
3724 | 1362 | typename Generator7, typename Generator8, typename Generator9, | ||
3725 | 1363 | typename Generator10> | ||
3726 | 1364 | internal::CartesianProductHolder10<Generator1, Generator2, Generator3, | ||
3727 | 1365 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, | ||
3728 | 1366 | Generator10> Combine( | ||
3729 | 1367 | const Generator1& g1, const Generator2& g2, const Generator3& g3, | ||
3730 | 1368 | const Generator4& g4, const Generator5& g5, const Generator6& g6, | ||
3731 | 1369 | const Generator7& g7, const Generator8& g8, const Generator9& g9, | ||
3732 | 1370 | const Generator10& g10) { | ||
3733 | 1371 | return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, | ||
3734 | 1372 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, | ||
3735 | 1373 | Generator10>( | ||
3736 | 1374 | g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); | ||
3737 | 1375 | } | ||
3738 | 1376 | # endif // GTEST_HAS_COMBINE | ||
3739 | 1377 | |||
3740 | 1378 | |||
3741 | 1379 | |||
3742 | 1380 | # define TEST_P(test_case_name, test_name) \ | ||
3743 | 1381 | class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ | ||
3744 | 1382 | : public test_case_name { \ | ||
3745 | 1383 | public: \ | ||
3746 | 1384 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ | ||
3747 | 1385 | virtual void TestBody(); \ | ||
3748 | 1386 | private: \ | ||
3749 | 1387 | static int AddToRegistry() { \ | ||
3750 | 1388 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ | ||
3751 | 1389 | GetTestCasePatternHolder<test_case_name>(\ | ||
3752 | 1390 | #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ | ||
3753 | 1391 | #test_case_name, \ | ||
3754 | 1392 | #test_name, \ | ||
3755 | 1393 | new ::testing::internal::TestMetaFactory< \ | ||
3756 | 1394 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ | ||
3757 | 1395 | return 0; \ | ||
3758 | 1396 | } \ | ||
3759 | 1397 | static int gtest_registering_dummy_; \ | ||
3760 | 1398 | GTEST_DISALLOW_COPY_AND_ASSIGN_(\ | ||
3761 | 1399 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ | ||
3762 | 1400 | }; \ | ||
3763 | 1401 | int GTEST_TEST_CLASS_NAME_(test_case_name, \ | ||
3764 | 1402 | test_name)::gtest_registering_dummy_ = \ | ||
3765 | 1403 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ | ||
3766 | 1404 | void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() | ||
3767 | 1405 | |||
3768 | 1406 | # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ | ||
3769 | 1407 | ::testing::internal::ParamGenerator<test_case_name::ParamType> \ | ||
3770 | 1408 | gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ | ||
3771 | 1409 | int gtest_##prefix##test_case_name##_dummy_ = \ | ||
3772 | 1410 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ | ||
3773 | 1411 | GetTestCasePatternHolder<test_case_name>(\ | ||
3774 | 1412 | #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ | ||
3775 | 1413 | #prefix, \ | ||
3776 | 1414 | >est_##prefix##test_case_name##_EvalGenerator_, \ | ||
3777 | 1415 | __FILE__, __LINE__) | ||
3778 | 1416 | |||
3779 | 1417 | } // namespace testing | ||
3780 | 1418 | |||
3781 | 1419 | #endif // GTEST_HAS_PARAM_TEST | ||
3782 | 1420 | |||
3783 | 1421 | #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
3784 | 0 | 1422 | ||
3785 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump' | |||
3786 | --- 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump 1970-01-01 00:00:00 +0000 | |||
3787 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-param-test.h.pump 2014-04-08 15:07:37 +0000 | |||
3788 | @@ -0,0 +1,487 @@ | |||
3789 | 1 | $$ -*- mode: c++; -*- | ||
3790 | 2 | $var n = 50 $$ Maximum length of Values arguments we want to support. | ||
3791 | 3 | $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. | ||
3792 | 4 | // Copyright 2008, Google Inc. | ||
3793 | 5 | // All rights reserved. | ||
3794 | 6 | // | ||
3795 | 7 | // Redistribution and use in source and binary forms, with or without | ||
3796 | 8 | // modification, are permitted provided that the following conditions are | ||
3797 | 9 | // met: | ||
3798 | 10 | // | ||
3799 | 11 | // * Redistributions of source code must retain the above copyright | ||
3800 | 12 | // notice, this list of conditions and the following disclaimer. | ||
3801 | 13 | // * Redistributions in binary form must reproduce the above | ||
3802 | 14 | // copyright notice, this list of conditions and the following disclaimer | ||
3803 | 15 | // in the documentation and/or other materials provided with the | ||
3804 | 16 | // distribution. | ||
3805 | 17 | // * Neither the name of Google Inc. nor the names of its | ||
3806 | 18 | // contributors may be used to endorse or promote products derived from | ||
3807 | 19 | // this software without specific prior written permission. | ||
3808 | 20 | // | ||
3809 | 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
3810 | 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
3811 | 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
3812 | 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
3813 | 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
3814 | 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
3815 | 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
3816 | 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
3817 | 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
3818 | 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
3819 | 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
3820 | 32 | // | ||
3821 | 33 | // Authors: vladl@google.com (Vlad Losev) | ||
3822 | 34 | // | ||
3823 | 35 | // Macros and functions for implementing parameterized tests | ||
3824 | 36 | // in Google C++ Testing Framework (Google Test) | ||
3825 | 37 | // | ||
3826 | 38 | // This file is generated by a SCRIPT. DO NOT EDIT BY HAND! | ||
3827 | 39 | // | ||
3828 | 40 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
3829 | 41 | #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
3830 | 42 | |||
3831 | 43 | |||
3832 | 44 | // Value-parameterized tests allow you to test your code with different | ||
3833 | 45 | // parameters without writing multiple copies of the same test. | ||
3834 | 46 | // | ||
3835 | 47 | // Here is how you use value-parameterized tests: | ||
3836 | 48 | |||
3837 | 49 | #if 0 | ||
3838 | 50 | |||
3839 | 51 | // To write value-parameterized tests, first you should define a fixture | ||
3840 | 52 | // class. It is usually derived from testing::TestWithParam<T> (see below for | ||
3841 | 53 | // another inheritance scheme that's sometimes useful in more complicated | ||
3842 | 54 | // class hierarchies), where the type of your parameter values. | ||
3843 | 55 | // TestWithParam<T> is itself derived from testing::Test. T can be any | ||
3844 | 56 | // copyable type. If it's a raw pointer, you are responsible for managing the | ||
3845 | 57 | // lifespan of the pointed values. | ||
3846 | 58 | |||
3847 | 59 | class FooTest : public ::testing::TestWithParam<const char*> { | ||
3848 | 60 | // You can implement all the usual class fixture members here. | ||
3849 | 61 | }; | ||
3850 | 62 | |||
3851 | 63 | // Then, use the TEST_P macro to define as many parameterized tests | ||
3852 | 64 | // for this fixture as you want. The _P suffix is for "parameterized" | ||
3853 | 65 | // or "pattern", whichever you prefer to think. | ||
3854 | 66 | |||
3855 | 67 | TEST_P(FooTest, DoesBlah) { | ||
3856 | 68 | // Inside a test, access the test parameter with the GetParam() method | ||
3857 | 69 | // of the TestWithParam<T> class: | ||
3858 | 70 | EXPECT_TRUE(foo.Blah(GetParam())); | ||
3859 | 71 | ... | ||
3860 | 72 | } | ||
3861 | 73 | |||
3862 | 74 | TEST_P(FooTest, HasBlahBlah) { | ||
3863 | 75 | ... | ||
3864 | 76 | } | ||
3865 | 77 | |||
3866 | 78 | // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test | ||
3867 | 79 | // case with any set of parameters you want. Google Test defines a number | ||
3868 | 80 | // of functions for generating test parameters. They return what we call | ||
3869 | 81 | // (surprise!) parameter generators. Here is a summary of them, which | ||
3870 | 82 | // are all in the testing namespace: | ||
3871 | 83 | // | ||
3872 | 84 | // | ||
3873 | 85 | // Range(begin, end [, step]) - Yields values {begin, begin+step, | ||
3874 | 86 | // begin+step+step, ...}. The values do not | ||
3875 | 87 | // include end. step defaults to 1. | ||
3876 | 88 | // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. | ||
3877 | 89 | // ValuesIn(container) - Yields values from a C-style array, an STL | ||
3878 | 90 | // ValuesIn(begin,end) container, or an iterator range [begin, end). | ||
3879 | 91 | // Bool() - Yields sequence {false, true}. | ||
3880 | 92 | // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product | ||
3881 | 93 | // for the math savvy) of the values generated | ||
3882 | 94 | // by the N generators. | ||
3883 | 95 | // | ||
3884 | 96 | // For more details, see comments at the definitions of these functions below | ||
3885 | 97 | // in this file. | ||
3886 | 98 | // | ||
3887 | 99 | // The following statement will instantiate tests from the FooTest test case | ||
3888 | 100 | // each with parameter values "meeny", "miny", and "moe". | ||
3889 | 101 | |||
3890 | 102 | INSTANTIATE_TEST_CASE_P(InstantiationName, | ||
3891 | 103 | FooTest, | ||
3892 | 104 | Values("meeny", "miny", "moe")); | ||
3893 | 105 | |||
3894 | 106 | // To distinguish different instances of the pattern, (yes, you | ||
3895 | 107 | // can instantiate it more then once) the first argument to the | ||
3896 | 108 | // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the | ||
3897 | 109 | // actual test case name. Remember to pick unique prefixes for different | ||
3898 | 110 | // instantiations. The tests from the instantiation above will have | ||
3899 | 111 | // these names: | ||
3900 | 112 | // | ||
3901 | 113 | // * InstantiationName/FooTest.DoesBlah/0 for "meeny" | ||
3902 | 114 | // * InstantiationName/FooTest.DoesBlah/1 for "miny" | ||
3903 | 115 | // * InstantiationName/FooTest.DoesBlah/2 for "moe" | ||
3904 | 116 | // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" | ||
3905 | 117 | // * InstantiationName/FooTest.HasBlahBlah/1 for "miny" | ||
3906 | 118 | // * InstantiationName/FooTest.HasBlahBlah/2 for "moe" | ||
3907 | 119 | // | ||
3908 | 120 | // You can use these names in --gtest_filter. | ||
3909 | 121 | // | ||
3910 | 122 | // This statement will instantiate all tests from FooTest again, each | ||
3911 | 123 | // with parameter values "cat" and "dog": | ||
3912 | 124 | |||
3913 | 125 | const char* pets[] = {"cat", "dog"}; | ||
3914 | 126 | INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); | ||
3915 | 127 | |||
3916 | 128 | // The tests from the instantiation above will have these names: | ||
3917 | 129 | // | ||
3918 | 130 | // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" | ||
3919 | 131 | // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" | ||
3920 | 132 | // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" | ||
3921 | 133 | // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" | ||
3922 | 134 | // | ||
3923 | 135 | // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests | ||
3924 | 136 | // in the given test case, whether their definitions come before or | ||
3925 | 137 | // AFTER the INSTANTIATE_TEST_CASE_P statement. | ||
3926 | 138 | // | ||
3927 | 139 | // Please also note that generator expressions (including parameters to the | ||
3928 | 140 | // generators) are evaluated in InitGoogleTest(), after main() has started. | ||
3929 | 141 | // This allows the user on one hand, to adjust generator parameters in order | ||
3930 | 142 | // to dynamically determine a set of tests to run and on the other hand, | ||
3931 | 143 | // give the user a chance to inspect the generated tests with Google Test | ||
3932 | 144 | // reflection API before RUN_ALL_TESTS() is executed. | ||
3933 | 145 | // | ||
3934 | 146 | // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc | ||
3935 | 147 | // for more examples. | ||
3936 | 148 | // | ||
3937 | 149 | // In the future, we plan to publish the API for defining new parameter | ||
3938 | 150 | // generators. But for now this interface remains part of the internal | ||
3939 | 151 | // implementation and is subject to change. | ||
3940 | 152 | // | ||
3941 | 153 | // | ||
3942 | 154 | // A parameterized test fixture must be derived from testing::Test and from | ||
3943 | 155 | // testing::WithParamInterface<T>, where T is the type of the parameter | ||
3944 | 156 | // values. Inheriting from TestWithParam<T> satisfies that requirement because | ||
3945 | 157 | // TestWithParam<T> inherits from both Test and WithParamInterface. In more | ||
3946 | 158 | // complicated hierarchies, however, it is occasionally useful to inherit | ||
3947 | 159 | // separately from Test and WithParamInterface. For example: | ||
3948 | 160 | |||
3949 | 161 | class BaseTest : public ::testing::Test { | ||
3950 | 162 | // You can inherit all the usual members for a non-parameterized test | ||
3951 | 163 | // fixture here. | ||
3952 | 164 | }; | ||
3953 | 165 | |||
3954 | 166 | class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> { | ||
3955 | 167 | // The usual test fixture members go here too. | ||
3956 | 168 | }; | ||
3957 | 169 | |||
3958 | 170 | TEST_F(BaseTest, HasFoo) { | ||
3959 | 171 | // This is an ordinary non-parameterized test. | ||
3960 | 172 | } | ||
3961 | 173 | |||
3962 | 174 | TEST_P(DerivedTest, DoesBlah) { | ||
3963 | 175 | // GetParam works just the same here as if you inherit from TestWithParam. | ||
3964 | 176 | EXPECT_TRUE(foo.Blah(GetParam())); | ||
3965 | 177 | } | ||
3966 | 178 | |||
3967 | 179 | #endif // 0 | ||
3968 | 180 | |||
3969 | 181 | #include "gtest/internal/gtest-port.h" | ||
3970 | 182 | |||
3971 | 183 | #if !GTEST_OS_SYMBIAN | ||
3972 | 184 | # include <utility> | ||
3973 | 185 | #endif | ||
3974 | 186 | |||
3975 | 187 | // scripts/fuse_gtest.py depends on gtest's own header being #included | ||
3976 | 188 | // *unconditionally*. Therefore these #includes cannot be moved | ||
3977 | 189 | // inside #if GTEST_HAS_PARAM_TEST. | ||
3978 | 190 | #include "gtest/internal/gtest-internal.h" | ||
3979 | 191 | #include "gtest/internal/gtest-param-util.h" | ||
3980 | 192 | #include "gtest/internal/gtest-param-util-generated.h" | ||
3981 | 193 | |||
3982 | 194 | #if GTEST_HAS_PARAM_TEST | ||
3983 | 195 | |||
3984 | 196 | namespace testing { | ||
3985 | 197 | |||
3986 | 198 | // Functions producing parameter generators. | ||
3987 | 199 | // | ||
3988 | 200 | // Google Test uses these generators to produce parameters for value- | ||
3989 | 201 | // parameterized tests. When a parameterized test case is instantiated | ||
3990 | 202 | // with a particular generator, Google Test creates and runs tests | ||
3991 | 203 | // for each element in the sequence produced by the generator. | ||
3992 | 204 | // | ||
3993 | 205 | // In the following sample, tests from test case FooTest are instantiated | ||
3994 | 206 | // each three times with parameter values 3, 5, and 8: | ||
3995 | 207 | // | ||
3996 | 208 | // class FooTest : public TestWithParam<int> { ... }; | ||
3997 | 209 | // | ||
3998 | 210 | // TEST_P(FooTest, TestThis) { | ||
3999 | 211 | // } | ||
4000 | 212 | // TEST_P(FooTest, TestThat) { | ||
4001 | 213 | // } | ||
4002 | 214 | // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); | ||
4003 | 215 | // | ||
4004 | 216 | |||
4005 | 217 | // Range() returns generators providing sequences of values in a range. | ||
4006 | 218 | // | ||
4007 | 219 | // Synopsis: | ||
4008 | 220 | // Range(start, end) | ||
4009 | 221 | // - returns a generator producing a sequence of values {start, start+1, | ||
4010 | 222 | // start+2, ..., }. | ||
4011 | 223 | // Range(start, end, step) | ||
4012 | 224 | // - returns a generator producing a sequence of values {start, start+step, | ||
4013 | 225 | // start+step+step, ..., }. | ||
4014 | 226 | // Notes: | ||
4015 | 227 | // * The generated sequences never include end. For example, Range(1, 5) | ||
4016 | 228 | // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) | ||
4017 | 229 | // returns a generator producing {1, 3, 5, 7}. | ||
4018 | 230 | // * start and end must have the same type. That type may be any integral or | ||
4019 | 231 | // floating-point type or a user defined type satisfying these conditions: | ||
4020 | 232 | // * It must be assignable (have operator=() defined). | ||
4021 | 233 | // * It must have operator+() (operator+(int-compatible type) for | ||
4022 | 234 | // two-operand version). | ||
4023 | 235 | // * It must have operator<() defined. | ||
4024 | 236 | // Elements in the resulting sequences will also have that type. | ||
4025 | 237 | // * Condition start < end must be satisfied in order for resulting sequences | ||
4026 | 238 | // to contain any elements. | ||
4027 | 239 | // | ||
4028 | 240 | template <typename T, typename IncrementT> | ||
4029 | 241 | internal::ParamGenerator<T> Range(T start, T end, IncrementT step) { | ||
4030 | 242 | return internal::ParamGenerator<T>( | ||
4031 | 243 | new internal::RangeGenerator<T, IncrementT>(start, end, step)); | ||
4032 | 244 | } | ||
4033 | 245 | |||
4034 | 246 | template <typename T> | ||
4035 | 247 | internal::ParamGenerator<T> Range(T start, T end) { | ||
4036 | 248 | return Range(start, end, 1); | ||
4037 | 249 | } | ||
4038 | 250 | |||
4039 | 251 | // ValuesIn() function allows generation of tests with parameters coming from | ||
4040 | 252 | // a container. | ||
4041 | 253 | // | ||
4042 | 254 | // Synopsis: | ||
4043 | 255 | // ValuesIn(const T (&array)[N]) | ||
4044 | 256 | // - returns a generator producing sequences with elements from | ||
4045 | 257 | // a C-style array. | ||
4046 | 258 | // ValuesIn(const Container& container) | ||
4047 | 259 | // - returns a generator producing sequences with elements from | ||
4048 | 260 | // an STL-style container. | ||
4049 | 261 | // ValuesIn(Iterator begin, Iterator end) | ||
4050 | 262 | // - returns a generator producing sequences with elements from | ||
4051 | 263 | // a range [begin, end) defined by a pair of STL-style iterators. These | ||
4052 | 264 | // iterators can also be plain C pointers. | ||
4053 | 265 | // | ||
4054 | 266 | // Please note that ValuesIn copies the values from the containers | ||
4055 | 267 | // passed in and keeps them to generate tests in RUN_ALL_TESTS(). | ||
4056 | 268 | // | ||
4057 | 269 | // Examples: | ||
4058 | 270 | // | ||
4059 | 271 | // This instantiates tests from test case StringTest | ||
4060 | 272 | // each with C-string values of "foo", "bar", and "baz": | ||
4061 | 273 | // | ||
4062 | 274 | // const char* strings[] = {"foo", "bar", "baz"}; | ||
4063 | 275 | // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); | ||
4064 | 276 | // | ||
4065 | 277 | // This instantiates tests from test case StlStringTest | ||
4066 | 278 | // each with STL strings with values "a" and "b": | ||
4067 | 279 | // | ||
4068 | 280 | // ::std::vector< ::std::string> GetParameterStrings() { | ||
4069 | 281 | // ::std::vector< ::std::string> v; | ||
4070 | 282 | // v.push_back("a"); | ||
4071 | 283 | // v.push_back("b"); | ||
4072 | 284 | // return v; | ||
4073 | 285 | // } | ||
4074 | 286 | // | ||
4075 | 287 | // INSTANTIATE_TEST_CASE_P(CharSequence, | ||
4076 | 288 | // StlStringTest, | ||
4077 | 289 | // ValuesIn(GetParameterStrings())); | ||
4078 | 290 | // | ||
4079 | 291 | // | ||
4080 | 292 | // This will also instantiate tests from CharTest | ||
4081 | 293 | // each with parameter values 'a' and 'b': | ||
4082 | 294 | // | ||
4083 | 295 | // ::std::list<char> GetParameterChars() { | ||
4084 | 296 | // ::std::list<char> list; | ||
4085 | 297 | // list.push_back('a'); | ||
4086 | 298 | // list.push_back('b'); | ||
4087 | 299 | // return list; | ||
4088 | 300 | // } | ||
4089 | 301 | // ::std::list<char> l = GetParameterChars(); | ||
4090 | 302 | // INSTANTIATE_TEST_CASE_P(CharSequence2, | ||
4091 | 303 | // CharTest, | ||
4092 | 304 | // ValuesIn(l.begin(), l.end())); | ||
4093 | 305 | // | ||
4094 | 306 | template <typename ForwardIterator> | ||
4095 | 307 | internal::ParamGenerator< | ||
4096 | 308 | typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> | ||
4097 | 309 | ValuesIn(ForwardIterator begin, ForwardIterator end) { | ||
4098 | 310 | typedef typename ::testing::internal::IteratorTraits<ForwardIterator> | ||
4099 | 311 | ::value_type ParamType; | ||
4100 | 312 | return internal::ParamGenerator<ParamType>( | ||
4101 | 313 | new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end)); | ||
4102 | 314 | } | ||
4103 | 315 | |||
4104 | 316 | template <typename T, size_t N> | ||
4105 | 317 | internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) { | ||
4106 | 318 | return ValuesIn(array, array + N); | ||
4107 | 319 | } | ||
4108 | 320 | |||
4109 | 321 | template <class Container> | ||
4110 | 322 | internal::ParamGenerator<typename Container::value_type> ValuesIn( | ||
4111 | 323 | const Container& container) { | ||
4112 | 324 | return ValuesIn(container.begin(), container.end()); | ||
4113 | 325 | } | ||
4114 | 326 | |||
4115 | 327 | // Values() allows generating tests from explicitly specified list of | ||
4116 | 328 | // parameters. | ||
4117 | 329 | // | ||
4118 | 330 | // Synopsis: | ||
4119 | 331 | // Values(T v1, T v2, ..., T vN) | ||
4120 | 332 | // - returns a generator producing sequences with elements v1, v2, ..., vN. | ||
4121 | 333 | // | ||
4122 | 334 | // For example, this instantiates tests from test case BarTest each | ||
4123 | 335 | // with values "one", "two", and "three": | ||
4124 | 336 | // | ||
4125 | 337 | // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); | ||
4126 | 338 | // | ||
4127 | 339 | // This instantiates tests from test case BazTest each with values 1, 2, 3.5. | ||
4128 | 340 | // The exact type of values will depend on the type of parameter in BazTest. | ||
4129 | 341 | // | ||
4130 | 342 | // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); | ||
4131 | 343 | // | ||
4132 | 344 | // Currently, Values() supports from 1 to $n parameters. | ||
4133 | 345 | // | ||
4134 | 346 | $range i 1..n | ||
4135 | 347 | $for i [[ | ||
4136 | 348 | $range j 1..i | ||
4137 | 349 | |||
4138 | 350 | template <$for j, [[typename T$j]]> | ||
4139 | 351 | internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) { | ||
4140 | 352 | return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]); | ||
4141 | 353 | } | ||
4142 | 354 | |||
4143 | 355 | ]] | ||
4144 | 356 | |||
4145 | 357 | // Bool() allows generating tests with parameters in a set of (false, true). | ||
4146 | 358 | // | ||
4147 | 359 | // Synopsis: | ||
4148 | 360 | // Bool() | ||
4149 | 361 | // - returns a generator producing sequences with elements {false, true}. | ||
4150 | 362 | // | ||
4151 | 363 | // It is useful when testing code that depends on Boolean flags. Combinations | ||
4152 | 364 | // of multiple flags can be tested when several Bool()'s are combined using | ||
4153 | 365 | // Combine() function. | ||
4154 | 366 | // | ||
4155 | 367 | // In the following example all tests in the test case FlagDependentTest | ||
4156 | 368 | // will be instantiated twice with parameters false and true. | ||
4157 | 369 | // | ||
4158 | 370 | // class FlagDependentTest : public testing::TestWithParam<bool> { | ||
4159 | 371 | // virtual void SetUp() { | ||
4160 | 372 | // external_flag = GetParam(); | ||
4161 | 373 | // } | ||
4162 | 374 | // } | ||
4163 | 375 | // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); | ||
4164 | 376 | // | ||
4165 | 377 | inline internal::ParamGenerator<bool> Bool() { | ||
4166 | 378 | return Values(false, true); | ||
4167 | 379 | } | ||
4168 | 380 | |||
4169 | 381 | # if GTEST_HAS_COMBINE | ||
4170 | 382 | // Combine() allows the user to combine two or more sequences to produce | ||
4171 | 383 | // values of a Cartesian product of those sequences' elements. | ||
4172 | 384 | // | ||
4173 | 385 | // Synopsis: | ||
4174 | 386 | // Combine(gen1, gen2, ..., genN) | ||
4175 | 387 | // - returns a generator producing sequences with elements coming from | ||
4176 | 388 | // the Cartesian product of elements from the sequences generated by | ||
4177 | 389 | // gen1, gen2, ..., genN. The sequence elements will have a type of | ||
4178 | 390 | // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types | ||
4179 | 391 | // of elements from sequences produces by gen1, gen2, ..., genN. | ||
4180 | 392 | // | ||
4181 | 393 | // Combine can have up to $maxtuple arguments. This number is currently limited | ||
4182 | 394 | // by the maximum number of elements in the tuple implementation used by Google | ||
4183 | 395 | // Test. | ||
4184 | 396 | // | ||
4185 | 397 | // Example: | ||
4186 | 398 | // | ||
4187 | 399 | // This will instantiate tests in test case AnimalTest each one with | ||
4188 | 400 | // the parameter values tuple("cat", BLACK), tuple("cat", WHITE), | ||
4189 | 401 | // tuple("dog", BLACK), and tuple("dog", WHITE): | ||
4190 | 402 | // | ||
4191 | 403 | // enum Color { BLACK, GRAY, WHITE }; | ||
4192 | 404 | // class AnimalTest | ||
4193 | 405 | // : public testing::TestWithParam<tuple<const char*, Color> > {...}; | ||
4194 | 406 | // | ||
4195 | 407 | // TEST_P(AnimalTest, AnimalLooksNice) {...} | ||
4196 | 408 | // | ||
4197 | 409 | // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, | ||
4198 | 410 | // Combine(Values("cat", "dog"), | ||
4199 | 411 | // Values(BLACK, WHITE))); | ||
4200 | 412 | // | ||
4201 | 413 | // This will instantiate tests in FlagDependentTest with all variations of two | ||
4202 | 414 | // Boolean flags: | ||
4203 | 415 | // | ||
4204 | 416 | // class FlagDependentTest | ||
4205 | 417 | // : public testing::TestWithParam<tuple<bool, bool> > { | ||
4206 | 418 | // virtual void SetUp() { | ||
4207 | 419 | // // Assigns external_flag_1 and external_flag_2 values from the tuple. | ||
4208 | 420 | // tie(external_flag_1, external_flag_2) = GetParam(); | ||
4209 | 421 | // } | ||
4210 | 422 | // }; | ||
4211 | 423 | // | ||
4212 | 424 | // TEST_P(FlagDependentTest, TestFeature1) { | ||
4213 | 425 | // // Test your code using external_flag_1 and external_flag_2 here. | ||
4214 | 426 | // } | ||
4215 | 427 | // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, | ||
4216 | 428 | // Combine(Bool(), Bool())); | ||
4217 | 429 | // | ||
4218 | 430 | $range i 2..maxtuple | ||
4219 | 431 | $for i [[ | ||
4220 | 432 | $range j 1..i | ||
4221 | 433 | |||
4222 | 434 | template <$for j, [[typename Generator$j]]> | ||
4223 | 435 | internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine( | ||
4224 | 436 | $for j, [[const Generator$j& g$j]]) { | ||
4225 | 437 | return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>( | ||
4226 | 438 | $for j, [[g$j]]); | ||
4227 | 439 | } | ||
4228 | 440 | |||
4229 | 441 | ]] | ||
4230 | 442 | # endif // GTEST_HAS_COMBINE | ||
4231 | 443 | |||
4232 | 444 | |||
4233 | 445 | |||
4234 | 446 | # define TEST_P(test_case_name, test_name) \ | ||
4235 | 447 | class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ | ||
4236 | 448 | : public test_case_name { \ | ||
4237 | 449 | public: \ | ||
4238 | 450 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ | ||
4239 | 451 | virtual void TestBody(); \ | ||
4240 | 452 | private: \ | ||
4241 | 453 | static int AddToRegistry() { \ | ||
4242 | 454 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ | ||
4243 | 455 | GetTestCasePatternHolder<test_case_name>(\ | ||
4244 | 456 | #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ | ||
4245 | 457 | #test_case_name, \ | ||
4246 | 458 | #test_name, \ | ||
4247 | 459 | new ::testing::internal::TestMetaFactory< \ | ||
4248 | 460 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ | ||
4249 | 461 | return 0; \ | ||
4250 | 462 | } \ | ||
4251 | 463 | static int gtest_registering_dummy_; \ | ||
4252 | 464 | GTEST_DISALLOW_COPY_AND_ASSIGN_(\ | ||
4253 | 465 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ | ||
4254 | 466 | }; \ | ||
4255 | 467 | int GTEST_TEST_CLASS_NAME_(test_case_name, \ | ||
4256 | 468 | test_name)::gtest_registering_dummy_ = \ | ||
4257 | 469 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ | ||
4258 | 470 | void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() | ||
4259 | 471 | |||
4260 | 472 | # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ | ||
4261 | 473 | ::testing::internal::ParamGenerator<test_case_name::ParamType> \ | ||
4262 | 474 | gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ | ||
4263 | 475 | int gtest_##prefix##test_case_name##_dummy_ = \ | ||
4264 | 476 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ | ||
4265 | 477 | GetTestCasePatternHolder<test_case_name>(\ | ||
4266 | 478 | #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ | ||
4267 | 479 | #prefix, \ | ||
4268 | 480 | >est_##prefix##test_case_name##_EvalGenerator_, \ | ||
4269 | 481 | __FILE__, __LINE__) | ||
4270 | 482 | |||
4271 | 483 | } // namespace testing | ||
4272 | 484 | |||
4273 | 485 | #endif // GTEST_HAS_PARAM_TEST | ||
4274 | 486 | |||
4275 | 487 | #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ | ||
4276 | 0 | 488 | ||
4277 | === added file '3rd_party/gmock/gtest/include/gtest/gtest-printers.h' | |||
4278 | --- 3rd_party/gmock/gtest/include/gtest/gtest-printers.h 1970-01-01 00:00:00 +0000 | |||
4279 | +++ 3rd_party/gmock/gtest/include/gtest/gtest-printers.h 2014-04-08 15:07:37 +0000 | |||
4280 | @@ -0,0 +1,855 @@ | |||
4281 | 1 | // Copyright 2007, Google Inc. | ||
4282 | 2 | // All rights reserved. | ||
4283 | 3 | // | ||
4284 | 4 | // Redistribution and use in source and binary forms, with or without | ||
4285 | 5 | // modification, are permitted provided that the following conditions are | ||
4286 | 6 | // met: | ||
4287 | 7 | // | ||
4288 | 8 | // * Redistributions of source code must retain the above copyright | ||
4289 | 9 | // notice, this list of conditions and the following disclaimer. | ||
4290 | 10 | // * Redistributions in binary form must reproduce the above | ||
4291 | 11 | // copyright notice, this list of conditions and the following disclaimer | ||
4292 | 12 | // in the documentation and/or other materials provided with the | ||
4293 | 13 | // distribution. | ||
4294 | 14 | // * Neither the name of Google Inc. nor the names of its | ||
4295 | 15 | // contributors may be used to endorse or promote products derived from | ||
4296 | 16 | // this software without specific prior written permission. | ||
4297 | 17 | // | ||
4298 | 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
4299 | 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
4300 | 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
4301 | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
4302 | 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
4303 | 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
4304 | 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
4305 | 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
4306 | 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
4307 | 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
4308 | 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
4309 | 29 | // | ||
4310 | 30 | // Author: wan@google.com (Zhanyong Wan) | ||
4311 | 31 | |||
4312 | 32 | // Google Test - The Google C++ Testing Framework | ||
4313 | 33 | // | ||
4314 | 34 | // This file implements a universal value printer that can print a | ||
4315 | 35 | // value of any type T: | ||
4316 | 36 | // | ||
4317 | 37 | // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr); | ||
4318 | 38 | // | ||
4319 | 39 | // A user can teach this function how to print a class type T by | ||
4320 | 40 | // defining either operator<<() or PrintTo() in the namespace that | ||
4321 | 41 | // defines T. More specifically, the FIRST defined function in the | ||
4322 | 42 | // following list will be used (assuming T is defined in namespace | ||
4323 | 43 | // foo): | ||
4324 | 44 | // | ||
4325 | 45 | // 1. foo::PrintTo(const T&, ostream*) | ||
4326 | 46 | // 2. operator<<(ostream&, const T&) defined in either foo or the | ||
4327 | 47 | // global namespace. | ||
4328 | 48 | // | ||
4329 | 49 | // If none of the above is defined, it will print the debug string of | ||
4330 | 50 | // the value if it is a protocol buffer, or print the raw bytes in the | ||
4331 | 51 | // value otherwise. | ||
4332 | 52 | // | ||
4333 | 53 | // To aid debugging: when T is a reference type, the address of the | ||
4334 | 54 | // value is also printed; when T is a (const) char pointer, both the | ||
4335 | 55 | // pointer value and the NUL-terminated string it points to are | ||
4336 | 56 | // printed. | ||
4337 | 57 | // | ||
4338 | 58 | // We also provide some convenient wrappers: | ||
4339 | 59 | // | ||
4340 | 60 | // // Prints a value to a string. For a (const or not) char | ||
4341 | 61 | // // pointer, the NUL-terminated string (but not the pointer) is | ||
4342 | 62 | // // printed. | ||
4343 | 63 | // std::string ::testing::PrintToString(const T& value); | ||
4344 | 64 | // | ||
4345 | 65 | // // Prints a value tersely: for a reference type, the referenced | ||
4346 | 66 | // // value (but not the address) is printed; for a (const or not) char | ||
4347 | 67 | // // pointer, the NUL-terminated string (but not the pointer) is | ||
4348 | 68 | // // printed. | ||
4349 | 69 | // void ::testing::internal::UniversalTersePrint(const T& value, ostream*); | ||
4350 | 70 | // | ||
4351 | 71 | // // Prints value using the type inferred by the compiler. The difference | ||
4352 | 72 | // // from UniversalTersePrint() is that this function prints both the | ||
4353 | 73 | // // pointer and the NUL-terminated string for a (const or not) char pointer. | ||
4354 | 74 | // void ::testing::internal::UniversalPrint(const T& value, ostream*); | ||
4355 | 75 | // | ||
4356 | 76 | // // Prints the fields of a tuple tersely to a string vector, one | ||
4357 | 77 | // // element for each field. Tuple support must be enabled in | ||
4358 | 78 | // // gtest-port.h. | ||
4359 | 79 | // std::vector<string> UniversalTersePrintTupleFieldsToStrings( | ||
4360 | 80 | // const Tuple& value); | ||
4361 | 81 | // | ||
4362 | 82 | // Known limitation: | ||
4363 | 83 | // | ||
4364 | 84 | // The print primitives print the elements of an STL-style container | ||
4365 | 85 | // using the compiler-inferred type of *iter where iter is a | ||
4366 | 86 | // const_iterator of the container. When const_iterator is an input | ||
4367 | 87 | // iterator but not a forward iterator, this inferred type may not | ||
4368 | 88 | // match value_type, and the print output may be incorrect. In | ||
4369 | 89 | // practice, this is rarely a problem as for most containers | ||
4370 | 90 | // const_iterator is a forward iterator. We'll fix this if there's an | ||
4371 | 91 | // actual need for it. Note that this fix cannot rely on value_type | ||
4372 | 92 | // being defined as many user-defined container types don't have | ||
4373 | 93 | // value_type. | ||
4374 | 94 | |||
4375 | 95 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ | ||
4376 | 96 | #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ | ||
4377 | 97 | |||
4378 | 98 | #include <ostream> // NOLINT | ||
4379 | 99 | #include <sstream> | ||
4380 | 100 | #include <string> | ||
4381 | 101 | #include <utility> | ||
4382 | 102 | #include <vector> | ||
4383 | 103 | #include "gtest/internal/gtest-port.h" | ||
4384 | 104 | #include "gtest/internal/gtest-internal.h" | ||
4385 | 105 | |||
4386 | 106 | namespace testing { | ||
4387 | 107 | |||
4388 | 108 | // Definitions in the 'internal' and 'internal2' name spaces are | ||
4389 | 109 | // subject to change without notice. DO NOT USE THEM IN USER CODE! | ||
4390 | 110 | namespace internal2 { | ||
4391 | 111 | |||
4392 | 112 | // Prints the given number of bytes in the given object to the given | ||
4393 | 113 | // ostream. | ||
4394 | 114 | GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, | ||
4395 | 115 | size_t count, | ||
4396 | 116 | ::std::ostream* os); | ||
4397 | 117 | |||
4398 | 118 | // For selecting which printer to use when a given type has neither << | ||
4399 | 119 | // nor PrintTo(). | ||
4400 | 120 | enum TypeKind { | ||
4401 | 121 | kProtobuf, // a protobuf type | ||
4402 | 122 | kConvertibleToInteger, // a type implicitly convertible to BiggestInt | ||
4403 | 123 | // (e.g. a named or unnamed enum type) | ||
4404 | 124 | kOtherType // anything else | ||
4405 | 125 | }; | ||
4406 | 126 | |||
4407 | 127 | // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called | ||
4408 | 128 | // by the universal printer to print a value of type T when neither | ||
4409 | 129 | // operator<< nor PrintTo() is defined for T, where kTypeKind is the | ||
4410 | 130 | // "kind" of T as defined by enum TypeKind. | ||
4411 | 131 | template <typename T, TypeKind kTypeKind> | ||
4412 | 132 | class TypeWithoutFormatter { | ||
4413 | 133 | public: | ||
4414 | 134 | // This default version is called when kTypeKind is kOtherType. | ||
4415 | 135 | static void PrintValue(const T& value, ::std::ostream* os) { | ||
4416 | 136 | PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value), | ||
4417 | 137 | sizeof(value), os); | ||
4418 | 138 | } | ||
4419 | 139 | }; | ||
4420 | 140 | |||
4421 | 141 | // We print a protobuf using its ShortDebugString() when the string | ||
4422 | 142 | // doesn't exceed this many characters; otherwise we print it using | ||
4423 | 143 | // DebugString() for better readability. | ||
4424 | 144 | const size_t kProtobufOneLinerMaxLength = 50; | ||
4425 | 145 | |||
4426 | 146 | template <typename T> | ||
4427 | 147 | class TypeWithoutFormatter<T, kProtobuf> { | ||
4428 | 148 | public: | ||
4429 | 149 | static void PrintValue(const T& value, ::std::ostream* os) { | ||
4430 | 150 | const ::testing::internal::string short_str = value.ShortDebugString(); | ||
4431 | 151 | const ::testing::internal::string pretty_str = | ||
4432 | 152 | short_str.length() <= kProtobufOneLinerMaxLength ? | ||
4433 | 153 | short_str : ("\n" + value.DebugString()); | ||
4434 | 154 | *os << ("<" + pretty_str + ">"); | ||
4435 | 155 | } | ||
4436 | 156 | }; | ||
4437 | 157 | |||
4438 | 158 | template <typename T> | ||
4439 | 159 | class TypeWithoutFormatter<T, kConvertibleToInteger> { | ||
4440 | 160 | public: | ||
4441 | 161 | // Since T has no << operator or PrintTo() but can be implicitly | ||
4442 | 162 | // converted to BiggestInt, we print it as a BiggestInt. | ||
4443 | 163 | // | ||
4444 | 164 | // Most likely T is an enum type (either named or unnamed), in which | ||
4445 | 165 | // case printing it as an integer is the desired behavior. In case | ||
4446 | 166 | // T is not an enum, printing it as an integer is the best we can do | ||
4447 | 167 | // given that it has no user-defined printer. | ||
4448 | 168 | static void PrintValue(const T& value, ::std::ostream* os) { | ||
4449 | 169 | const internal::BiggestInt kBigInt = value; | ||
4450 | 170 | *os << kBigInt; | ||
4451 | 171 | } | ||
4452 | 172 | }; | ||
4453 | 173 | |||
4454 | 174 | // Prints the given value to the given ostream. If the value is a | ||
4455 | 175 | // protocol message, its debug string is printed; if it's an enum or | ||
4456 | 176 | // of a type implicitly convertible to BiggestInt, it's printed as an | ||
4457 | 177 | // integer; otherwise the bytes in the value are printed. This is | ||
4458 | 178 | // what UniversalPrinter<T>::Print() does when it knows nothing about | ||
4459 | 179 | // type T and T has neither << operator nor PrintTo(). | ||
4460 | 180 | // | ||
4461 | 181 | // A user can override this behavior for a class type Foo by defining | ||
4462 | 182 | // a << operator in the namespace where Foo is defined. | ||
4463 | 183 | // | ||
4464 | 184 | // We put this operator in namespace 'internal2' instead of 'internal' | ||
4465 | 185 | // to simplify the implementation, as much code in 'internal' needs to | ||
4466 | 186 | // use << in STL, which would conflict with our own << were it defined | ||
4467 | 187 | // in 'internal'. | ||
4468 | 188 | // | ||
4469 | 189 | // Note that this operator<< takes a generic std::basic_ostream<Char, | ||
4470 | 190 | // CharTraits> type instead of the more restricted std::ostream. If | ||
4471 | 191 | // we define it to take an std::ostream instead, we'll get an | ||
4472 | 192 | // "ambiguous overloads" compiler error when trying to print a type | ||
4473 | 193 | // Foo that supports streaming to std::basic_ostream<Char, | ||
4474 | 194 | // CharTraits>, as the compiler cannot tell whether | ||
4475 | 195 | // operator<<(std::ostream&, const T&) or | ||
4476 | 196 | // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more | ||
4477 | 197 | // specific. | ||
4478 | 198 | template <typename Char, typename CharTraits, typename T> | ||
4479 | 199 | ::std::basic_ostream<Char, CharTraits>& operator<<( | ||
4480 | 200 | ::std::basic_ostream<Char, CharTraits>& os, const T& x) { | ||
4481 | 201 | TypeWithoutFormatter<T, | ||
4482 | 202 | (internal::IsAProtocolMessage<T>::value ? kProtobuf : | ||
4483 | 203 | internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? | ||
4484 | 204 | kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); | ||
4485 | 205 | return os; | ||
4486 | 206 | } | ||
4487 | 207 | |||
4488 | 208 | } // namespace internal2 | ||
4489 | 209 | } // namespace testing | ||
4490 | 210 | |||
4491 | 211 | // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up | ||
4492 | 212 | // magic needed for implementing UniversalPrinter won't work. | ||
4493 | 213 | namespace testing_internal { | ||
4494 | 214 | |||
4495 | 215 | // Used to print a value that is not an STL-style container when the | ||
4496 | 216 | // user doesn't define PrintTo() for it. | ||
4497 | 217 | template <typename T> | ||
4498 | 218 | void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { | ||
4499 | 219 | // With the following statement, during unqualified name lookup, | ||
4500 | 220 | // testing::internal2::operator<< appears as if it was declared in | ||
4501 | 221 | // the nearest enclosing namespace that contains both | ||
4502 | 222 | // ::testing_internal and ::testing::internal2, i.e. the global | ||
4503 | 223 | // namespace. For more details, refer to the C++ Standard section | ||
4504 | 224 | // 7.3.4-1 [namespace.udir]. This allows us to fall back onto | ||
4505 | 225 | // testing::internal2::operator<< in case T doesn't come with a << | ||
4506 | 226 | // operator. | ||
4507 | 227 | // | ||
4508 | 228 | // We cannot write 'using ::testing::internal2::operator<<;', which | ||
4509 | 229 | // gcc 3.3 fails to compile due to a compiler bug. | ||
4510 | 230 | using namespace ::testing::internal2; // NOLINT | ||
4511 | 231 | |||
4512 | 232 | // Assuming T is defined in namespace foo, in the next statement, | ||
4513 | 233 | // the compiler will consider all of: | ||
4514 | 234 | // | ||
4515 | 235 | // 1. foo::operator<< (thanks to Koenig look-up), | ||
4516 | 236 | // 2. ::operator<< (as the current namespace is enclosed in ::), | ||
4517 | 237 | // 3. testing::internal2::operator<< (thanks to the using statement above). | ||
4518 | 238 | // | ||
4519 | 239 | // The operator<< whose type matches T best will be picked. | ||
4520 | 240 | // | ||
4521 | 241 | // We deliberately allow #2 to be a candidate, as sometimes it's | ||
4522 | 242 | // impossible to define #1 (e.g. when foo is ::std, defining | ||
4523 | 243 | // anything in it is undefined behavior unless you are a compiler | ||
4524 | 244 | // vendor.). | ||
4525 | 245 | *os << value; | ||
4526 | 246 | } | ||
4527 | 247 | |||
4528 | 248 | } // namespace testing_internal | ||
4529 | 249 | |||
4530 | 250 | namespace testing { | ||
4531 | 251 | namespace internal { | ||
4532 | 252 | |||
4533 | 253 | // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given | ||
4534 | 254 | // value to the given ostream. The caller must ensure that | ||
4535 | 255 | // 'ostream_ptr' is not NULL, or the behavior is undefined. | ||
4536 | 256 | // | ||
4537 | 257 | // We define UniversalPrinter as a class template (as opposed to a | ||
4538 | 258 | // function template), as we need to partially specialize it for | ||
4539 | 259 | // reference types, which cannot be done with function templates. | ||
4540 | 260 | template <typename T> | ||
4541 | 261 | class UniversalPrinter; | ||
4542 | 262 | |||
4543 | 263 | template <typename T> | ||
4544 | 264 | void UniversalPrint(const T& value, ::std::ostream* os); | ||
4545 | 265 | |||
4546 | 266 | // Used to print an STL-style container when the user doesn't define | ||
4547 | 267 | // a PrintTo() for it. | ||
4548 | 268 | template <typename C> | ||
4549 | 269 | void DefaultPrintTo(IsContainer /* dummy */, | ||
4550 | 270 | false_type /* is not a pointer */, | ||
4551 | 271 | const C& container, ::std::ostream* os) { | ||
4552 | 272 | const size_t kMaxCount = 32; // The maximum number of elements to print. | ||
4553 | 273 | *os << '{'; | ||
4554 | 274 | size_t count = 0; | ||
4555 | 275 | for (typename C::const_iterator it = container.begin(); | ||
4556 | 276 | it != container.end(); ++it, ++count) { | ||
4557 | 277 | if (count > 0) { | ||
4558 | 278 | *os << ','; | ||
4559 | 279 | if (count == kMaxCount) { // Enough has been printed. | ||
4560 | 280 | *os << " ..."; | ||
4561 | 281 | break; | ||
4562 | 282 | } | ||
4563 | 283 | } | ||
4564 | 284 | *os << ' '; | ||
4565 | 285 | // We cannot call PrintTo(*it, os) here as PrintTo() doesn't | ||
4566 | 286 | // handle *it being a native array. | ||
4567 | 287 | internal::UniversalPrint(*it, os); | ||
4568 | 288 | } | ||
4569 | 289 | |||
4570 | 290 | if (count > 0) { | ||
4571 | 291 | *os << ' '; | ||
4572 | 292 | } | ||
4573 | 293 | *os << '}'; | ||
4574 | 294 | } | ||
4575 | 295 | |||
4576 | 296 | // Used to print a pointer that is neither a char pointer nor a member | ||
4577 | 297 | // pointer, when the user doesn't define PrintTo() for it. (A member | ||
4578 | 298 | // variable pointer or member function pointer doesn't really point to | ||
4579 | 299 | // a location in the address space. Their representation is | ||
4580 | 300 | // implementation-defined. Therefore they will be printed as raw | ||
4581 | 301 | // bytes.) | ||
4582 | 302 | template <typename T> | ||
4583 | 303 | void DefaultPrintTo(IsNotContainer /* dummy */, | ||
4584 | 304 | true_type /* is a pointer */, | ||
4585 | 305 | T* p, ::std::ostream* os) { | ||
4586 | 306 | if (p == NULL) { | ||
4587 | 307 | *os << "NULL"; | ||
4588 | 308 | } else { | ||
4589 | 309 | // C++ doesn't allow casting from a function pointer to any object | ||
4590 | 310 | // pointer. | ||
4591 | 311 | // | ||
4592 | 312 | // IsTrue() silences warnings: "Condition is always true", | ||
4593 | 313 | // "unreachable code". | ||
4594 | 314 | if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) { | ||
4595 | 315 | // T is not a function type. We just call << to print p, | ||
4596 | 316 | // relying on ADL to pick up user-defined << for their pointer | ||
4597 | 317 | // types, if any. | ||
4598 | 318 | *os << p; | ||
4599 | 319 | } else { | ||
4600 | 320 | // T is a function type, so '*os << p' doesn't do what we want | ||
4601 | 321 | // (it just prints p as bool). We want to print p as a const | ||
4602 | 322 | // void*. However, we cannot cast it to const void* directly, | ||
4603 | 323 | // even using reinterpret_cast, as earlier versions of gcc | ||
4604 | 324 | // (e.g. 3.4.5) cannot compile the cast when p is a function | ||
4605 | 325 | // pointer. Casting to UInt64 first solves the problem. | ||
4606 | 326 | *os << reinterpret_cast<const void*>( | ||
4607 | 327 | reinterpret_cast<internal::UInt64>(p)); | ||
4608 | 328 | } | ||
4609 | 329 | } | ||
4610 | 330 | } | ||
4611 | 331 | |||
4612 | 332 | // Used to print a non-container, non-pointer value when the user | ||
4613 | 333 | // doesn't define PrintTo() for it. | ||
4614 | 334 | template <typename T> | ||
4615 | 335 | void DefaultPrintTo(IsNotContainer /* dummy */, | ||
4616 | 336 | false_type /* is not a pointer */, | ||
4617 | 337 | const T& value, ::std::ostream* os) { | ||
4618 | 338 | ::testing_internal::DefaultPrintNonContainerTo(value, os); | ||
4619 | 339 | } | ||
4620 | 340 | |||
4621 | 341 | // Prints the given value using the << operator if it has one; | ||
4622 | 342 | // otherwise prints the bytes in it. This is what | ||
4623 | 343 | // UniversalPrinter<T>::Print() does when PrintTo() is not specialized | ||
4624 | 344 | // or overloaded for type T. | ||
4625 | 345 | // | ||
4626 | 346 | // A user can override this behavior for a class type Foo by defining | ||
4627 | 347 | // an overload of PrintTo() in the namespace where Foo is defined. We | ||
4628 | 348 | // give the user this option as sometimes defining a << operator for | ||
4629 | 349 | // Foo is not desirable (e.g. the coding style may prevent doing it, | ||
4630 | 350 | // or there is already a << operator but it doesn't do what the user | ||
4631 | 351 | // wants). | ||
4632 | 352 | template <typename T> | ||
4633 | 353 | void PrintTo(const T& value, ::std::ostream* os) { | ||
4634 | 354 | // DefaultPrintTo() is overloaded. The type of its first two | ||
4635 | 355 | // arguments determine which version will be picked. If T is an | ||
4636 | 356 | // STL-style container, the version for container will be called; if | ||
4637 | 357 | // T is a pointer, the pointer version will be called; otherwise the | ||
4638 | 358 | // generic version will be called. | ||
4639 | 359 | // | ||
4640 | 360 | // Note that we check for container types here, prior to we check | ||
4641 | 361 | // for protocol message types in our operator<<. The rationale is: | ||
4642 | 362 | // | ||
4643 | 363 | // For protocol messages, we want to give people a chance to | ||
4644 | 364 | // override Google Mock's format by defining a PrintTo() or | ||
4645 | 365 | // operator<<. For STL containers, other formats can be | ||
4646 | 366 | // incompatible with Google Mock's format for the container | ||
4647 | 367 | // elements; therefore we check for container types here to ensure | ||
4648 | 368 | // that our format is used. | ||
4649 | 369 | // | ||
4650 | 370 | // The second argument of DefaultPrintTo() is needed to bypass a bug | ||
4651 | 371 | // in Symbian's C++ compiler that prevents it from picking the right | ||
4652 | 372 | // overload between: | ||
4653 | 373 | // | ||
4654 | 374 | // PrintTo(const T& x, ...); | ||
4655 | 375 | // PrintTo(T* x, ...); | ||
4656 | 376 | DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os); | ||
4657 | 377 | } | ||
4658 | 378 | |||
4659 | 379 | // The following list of PrintTo() overloads tells | ||
4660 | 380 | // UniversalPrinter<T>::Print() how to print standard types (built-in | ||
4661 | 381 | // types, strings, plain arrays, and pointers). | ||
4662 | 382 | |||
4663 | 383 | // Overloads for various char types. | ||
4664 | 384 | GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); | ||
4665 | 385 | GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); | ||
4666 | 386 | inline void PrintTo(char c, ::std::ostream* os) { | ||
4667 | 387 | // When printing a plain char, we always treat it as unsigned. This | ||
4668 | 388 | // way, the output won't be affected by whether the compiler thinks | ||
4669 | 389 | // char is signed or not. | ||
4670 | 390 | PrintTo(static_cast<unsigned char>(c), os); | ||
4671 | 391 | } | ||
4672 | 392 | |||
4673 | 393 | // Overloads for other simple built-in types. | ||
4674 | 394 | inline void PrintTo(bool x, ::std::ostream* os) { | ||
4675 | 395 | *os << (x ? "true" : "false"); | ||
4676 | 396 | } | ||
4677 | 397 | |||
4678 | 398 | // Overload for wchar_t type. | ||
4679 | 399 | // Prints a wchar_t as a symbol if it is printable or as its internal | ||
4680 | 400 | // code otherwise and also as its decimal code (except for L'\0'). | ||
4681 | 401 | // The L'\0' char is printed as "L'\\0'". The decimal code is printed | ||
4682 | 402 | // as signed integer when wchar_t is implemented by the compiler | ||
4683 | 403 | // as a signed type and is printed as an unsigned integer when wchar_t | ||
4684 | 404 | // is implemented as an unsigned type. | ||
4685 | 405 | GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); | ||
4686 | 406 | |||
4687 | 407 | // Overloads for C strings. | ||
4688 | 408 | GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); | ||
4689 | 409 | inline void PrintTo(char* s, ::std::ostream* os) { | ||
4690 | 410 | PrintTo(ImplicitCast_<const char*>(s), os); | ||
4691 | 411 | } | ||
4692 | 412 | |||
4693 | 413 | // signed/unsigned char is often used for representing binary data, so | ||
4694 | 414 | // we print pointers to it as void* to be safe. | ||
4695 | 415 | inline void PrintTo(const signed char* s, ::std::ostream* os) { | ||
4696 | 416 | PrintTo(ImplicitCast_<const void*>(s), os); | ||
4697 | 417 | } | ||
4698 | 418 | inline void PrintTo(signed char* s, ::std::ostream* os) { | ||
4699 | 419 | PrintTo(ImplicitCast_<const void*>(s), os); | ||
4700 | 420 | } | ||
4701 | 421 | inline void PrintTo(const unsigned char* s, ::std::ostream* os) { | ||
4702 | 422 | PrintTo(ImplicitCast_<const void*>(s), os); | ||
4703 | 423 | } | ||
4704 | 424 | inline void PrintTo(unsigned char* s, ::std::ostream* os) { | ||
4705 | 425 | PrintTo(ImplicitCast_<const void*>(s), os); | ||
4706 | 426 | } | ||
4707 | 427 | |||
4708 | 428 | // MSVC can be configured to define wchar_t as a typedef of unsigned | ||
4709 | 429 | // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native | ||
4710 | 430 | // type. When wchar_t is a typedef, defining an overload for const | ||
4711 | 431 | // wchar_t* would cause unsigned short* be printed as a wide string, | ||
4712 | 432 | // possibly causing invalid memory accesses. | ||
4713 | 433 | #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) | ||
4714 | 434 | // Overloads for wide C strings | ||
4715 | 435 | GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); | ||
4716 | 436 | inline void PrintTo(wchar_t* s, ::std::ostream* os) { | ||
4717 | 437 | PrintTo(ImplicitCast_<const wchar_t*>(s), os); | ||
4718 | 438 | } | ||
4719 | 439 | #endif | ||
4720 | 440 | |||
4721 | 441 | // Overload for C arrays. Multi-dimensional arrays are printed | ||
4722 | 442 | // properly. | ||
4723 | 443 | |||
4724 | 444 | // Prints the given number of elements in an array, without printing | ||
4725 | 445 | // the curly braces. | ||
4726 | 446 | template <typename T> | ||
4727 | 447 | void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { | ||
4728 | 448 | UniversalPrint(a[0], os); | ||
4729 | 449 | for (size_t i = 1; i != count; i++) { | ||
4730 | 450 | *os << ", "; | ||
4731 | 451 | UniversalPrint(a[i], os); | ||
4732 | 452 | } | ||
4733 | 453 | } | ||
4734 | 454 | |||
4735 | 455 | // Overloads for ::string and ::std::string. | ||
4736 | 456 | #if GTEST_HAS_GLOBAL_STRING | ||
4737 | 457 | GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); | ||
4738 | 458 | inline void PrintTo(const ::string& s, ::std::ostream* os) { | ||
4739 | 459 | PrintStringTo(s, os); | ||
4740 | 460 | } | ||
4741 | 461 | #endif // GTEST_HAS_GLOBAL_STRING | ||
4742 | 462 | |||
4743 | 463 | GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); | ||
4744 | 464 | inline void PrintTo(const ::std::string& s, ::std::ostream* os) { | ||
4745 | 465 | PrintStringTo(s, os); | ||
4746 | 466 | } | ||
4747 | 467 | |||
4748 | 468 | // Overloads for ::wstring and ::std::wstring. | ||
4749 | 469 | #if GTEST_HAS_GLOBAL_WSTRING | ||
4750 | 470 | GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); | ||
4751 | 471 | inline void PrintTo(const ::wstring& s, ::std::ostream* os) { | ||
4752 | 472 | PrintWideStringTo(s, os); | ||
4753 | 473 | } | ||
4754 | 474 | #endif // GTEST_HAS_GLOBAL_WSTRING | ||
4755 | 475 | |||
4756 | 476 | #if GTEST_HAS_STD_WSTRING | ||
4757 | 477 | GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); | ||
4758 | 478 | inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { | ||
4759 | 479 | PrintWideStringTo(s, os); | ||
4760 | 480 | } | ||
4761 | 481 | #endif // GTEST_HAS_STD_WSTRING | ||
4762 | 482 | |||
4763 | 483 | #if GTEST_HAS_TR1_TUPLE | ||
4764 | 484 | // Overload for ::std::tr1::tuple. Needed for printing function arguments, | ||
4765 | 485 | // which are packed as tuples. | ||
4766 | 486 | |||
4767 | 487 | // Helper function for printing a tuple. T must be instantiated with | ||
4768 | 488 | // a tuple type. | ||
4769 | 489 | template <typename T> | ||
4770 | 490 | void PrintTupleTo(const T& t, ::std::ostream* os); | ||
4771 | 491 | |||
4772 | 492 | // Overloaded PrintTo() for tuples of various arities. We support | ||
4773 | 493 | // tuples of up-to 10 fields. The following implementation works | ||
4774 | 494 | // regardless of whether tr1::tuple is implemented using the | ||
4775 | 495 | // non-standard variadic template feature or not. | ||
4776 | 496 | |||
4777 | 497 | inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { | ||
4778 | 498 | PrintTupleTo(t, os); | ||
4779 | 499 | } | ||
4780 | 500 | |||
4781 | 501 | template <typename T1> | ||
4782 | 502 | void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) { | ||
4783 | 503 | PrintTupleTo(t, os); | ||
4784 | 504 | } | ||
4785 | 505 | |||
4786 | 506 | template <typename T1, typename T2> | ||
4787 | 507 | void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) { | ||
4788 | 508 | PrintTupleTo(t, os); | ||
4789 | 509 | } | ||
4790 | 510 | |||
4791 | 511 | template <typename T1, typename T2, typename T3> | ||
4792 | 512 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) { | ||
4793 | 513 | PrintTupleTo(t, os); | ||
4794 | 514 | } | ||
4795 | 515 | |||
4796 | 516 | template <typename T1, typename T2, typename T3, typename T4> | ||
4797 | 517 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) { | ||
4798 | 518 | PrintTupleTo(t, os); | ||
4799 | 519 | } | ||
4800 | 520 | |||
4801 | 521 | template <typename T1, typename T2, typename T3, typename T4, typename T5> | ||
4802 | 522 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t, | ||
4803 | 523 | ::std::ostream* os) { | ||
4804 | 524 | PrintTupleTo(t, os); | ||
4805 | 525 | } | ||
4806 | 526 | |||
4807 | 527 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
4808 | 528 | typename T6> | ||
4809 | 529 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t, | ||
4810 | 530 | ::std::ostream* os) { | ||
4811 | 531 | PrintTupleTo(t, os); | ||
4812 | 532 | } | ||
4813 | 533 | |||
4814 | 534 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
4815 | 535 | typename T6, typename T7> | ||
4816 | 536 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t, | ||
4817 | 537 | ::std::ostream* os) { | ||
4818 | 538 | PrintTupleTo(t, os); | ||
4819 | 539 | } | ||
4820 | 540 | |||
4821 | 541 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
4822 | 542 | typename T6, typename T7, typename T8> | ||
4823 | 543 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t, | ||
4824 | 544 | ::std::ostream* os) { | ||
4825 | 545 | PrintTupleTo(t, os); | ||
4826 | 546 | } | ||
4827 | 547 | |||
4828 | 548 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
4829 | 549 | typename T6, typename T7, typename T8, typename T9> | ||
4830 | 550 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t, | ||
4831 | 551 | ::std::ostream* os) { | ||
4832 | 552 | PrintTupleTo(t, os); | ||
4833 | 553 | } | ||
4834 | 554 | |||
4835 | 555 | template <typename T1, typename T2, typename T3, typename T4, typename T5, | ||
4836 | 556 | typename T6, typename T7, typename T8, typename T9, typename T10> | ||
4837 | 557 | void PrintTo( | ||
4838 | 558 | const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t, | ||
4839 | 559 | ::std::ostream* os) { | ||
4840 | 560 | PrintTupleTo(t, os); | ||
4841 | 561 | } | ||
4842 | 562 | #endif // GTEST_HAS_TR1_TUPLE | ||
4843 | 563 | |||
4844 | 564 | // Overload for std::pair. | ||
4845 | 565 | template <typename T1, typename T2> | ||
4846 | 566 | void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) { | ||
4847 | 567 | *os << '('; | ||
4848 | 568 | // We cannot use UniversalPrint(value.first, os) here, as T1 may be | ||
4849 | 569 | // a reference type. The same for printing value.second. | ||
4850 | 570 | UniversalPrinter<T1>::Print(value.first, os); | ||
4851 | 571 | *os << ", "; | ||
4852 | 572 | UniversalPrinter<T2>::Print(value.second, os); | ||
4853 | 573 | *os << ')'; | ||
4854 | 574 | } | ||
4855 | 575 | |||
4856 | 576 | // Implements printing a non-reference type T by letting the compiler | ||
4857 | 577 | // pick the right overload of PrintTo() for T. | ||
4858 | 578 | template <typename T> | ||
4859 | 579 | class UniversalPrinter { | ||
4860 | 580 | public: | ||
4861 | 581 | // MSVC warns about adding const to a function type, so we want to | ||
4862 | 582 | // disable the warning. | ||
4863 | 583 | #ifdef _MSC_VER | ||
4864 | 584 | # pragma warning(push) // Saves the current warning state. | ||
4865 | 585 | # pragma warning(disable:4180) // Temporarily disables warning 4180. | ||
4866 | 586 | #endif // _MSC_VER | ||
4867 | 587 | |||
4868 | 588 | // Note: we deliberately don't call this PrintTo(), as that name | ||
4869 | 589 | // conflicts with ::testing::internal::PrintTo in the body of the | ||
4870 | 590 | // function. | ||
4871 | 591 | static void Print(const T& value, ::std::ostream* os) { | ||
4872 | 592 | // By default, ::testing::internal::PrintTo() is used for printing | ||
4873 | 593 | // the value. | ||
4874 | 594 | // | ||
4875 | 595 | // Thanks to Koenig look-up, if T is a class and has its own | ||
4876 | 596 | // PrintTo() function defined in its namespace, that function will | ||
4877 | 597 | // be visible here. Since it is more specific than the generic ones | ||
4878 | 598 | // in ::testing::internal, it will be picked by the compiler in the | ||
4879 | 599 | // following statement - exactly what we want. | ||
4880 | 600 | PrintTo(value, os); | ||
4881 | 601 | } | ||
4882 | 602 | |||
4883 | 603 | #ifdef _MSC_VER | ||
4884 | 604 | # pragma warning(pop) // Restores the warning state. | ||
4885 | 605 | #endif // _MSC_VER | ||
4886 | 606 | }; | ||
4887 | 607 | |||
4888 | 608 | // UniversalPrintArray(begin, len, os) prints an array of 'len' | ||
4889 | 609 | // elements, starting at address 'begin'. | ||
4890 | 610 | template <typename T> | ||
4891 | 611 | void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { | ||
4892 | 612 | if (len == 0) { | ||
4893 | 613 | *os << "{}"; | ||
4894 | 614 | } else { | ||
4895 | 615 | *os << "{ "; | ||
4896 | 616 | const size_t kThreshold = 18; | ||
4897 | 617 | const size_t kChunkSize = 8; | ||
4898 | 618 | // If the array has more than kThreshold elements, we'll have to | ||
4899 | 619 | // omit some details by printing only the first and the last | ||
4900 | 620 | // kChunkSize elements. | ||
4901 | 621 | // TODO(wan@google.com): let the user control the threshold using a flag. | ||
4902 | 622 | if (len <= kThreshold) { | ||
4903 | 623 | PrintRawArrayTo(begin, len, os); | ||
4904 | 624 | } else { | ||
4905 | 625 | PrintRawArrayTo(begin, kChunkSize, os); | ||
4906 | 626 | *os << ", ..., "; | ||
4907 | 627 | PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); | ||
4908 | 628 | } | ||
4909 | 629 | *os << " }"; | ||
4910 | 630 | } | ||
4911 | 631 | } | ||
4912 | 632 | // This overload prints a (const) char array compactly. | ||
4913 | 633 | GTEST_API_ void UniversalPrintArray( | ||
4914 | 634 | const char* begin, size_t len, ::std::ostream* os); | ||
4915 | 635 | |||
4916 | 636 | // This overload prints a (const) wchar_t array compactly. | ||
4917 | 637 | GTEST_API_ void UniversalPrintArray( | ||
4918 | 638 | const wchar_t* begin, size_t len, ::std::ostream* os); | ||
4919 | 639 | |||
4920 | 640 | // Implements printing an array type T[N]. | ||
4921 | 641 | template <typename T, size_t N> | ||
4922 | 642 | class UniversalPrinter<T[N]> { | ||
4923 | 643 | public: | ||
4924 | 644 | // Prints the given array, omitting some elements when there are too | ||
4925 | 645 | // many. | ||
4926 | 646 | static void Print(const T (&a)[N], ::std::ostream* os) { | ||
4927 | 647 | UniversalPrintArray(a, N, os); | ||
4928 | 648 | } | ||
4929 | 649 | }; | ||
4930 | 650 | |||
4931 | 651 | // Implements printing a reference type T&. | ||
4932 | 652 | template <typename T> | ||
4933 | 653 | class UniversalPrinter<T&> { | ||
4934 | 654 | public: | ||
4935 | 655 | // MSVC warns about adding const to a function type, so we want to | ||
4936 | 656 | // disable the warning. | ||
4937 | 657 | #ifdef _MSC_VER | ||
4938 | 658 | # pragma warning(push) // Saves the current warning state. | ||
4939 | 659 | # pragma warning(disable:4180) // Temporarily disables warning 4180. | ||
4940 | 660 | #endif // _MSC_VER | ||
4941 | 661 | |||
4942 | 662 | static void Print(const T& value, ::std::ostream* os) { | ||
4943 | 663 | // Prints the address of the value. We use reinterpret_cast here | ||
4944 | 664 | // as static_cast doesn't compile when T is a function type. | ||
4945 | 665 | *os << "@" << reinterpret_cast<const void*>(&value) << " "; | ||
4946 | 666 | |||
4947 | 667 | // Then prints the value itself. | ||
4948 | 668 | UniversalPrint(value, os); | ||
4949 | 669 | } | ||
4950 | 670 | |||
4951 | 671 | #ifdef _MSC_VER | ||
4952 | 672 | # pragma warning(pop) // Restores the warning state. | ||
4953 | 673 | #endif // _MSC_VER | ||
4954 | 674 | }; | ||
4955 | 675 | |||
4956 | 676 | // Prints a value tersely: for a reference type, the referenced value | ||
4957 | 677 | // (but not the address) is printed; for a (const) char pointer, the | ||
4958 | 678 | // NUL-terminated string (but not the pointer) is printed. | ||
4959 | 679 | |||
4960 | 680 | template <typename T> | ||
4961 | 681 | class UniversalTersePrinter { | ||
4962 | 682 | public: | ||
4963 | 683 | static void Print(const T& value, ::std::ostream* os) { | ||
4964 | 684 | UniversalPrint(value, os); | ||
4965 | 685 | } | ||
4966 | 686 | }; | ||
4967 | 687 | template <typename T> | ||
4968 | 688 | class UniversalTersePrinter<T&> { | ||
4969 | 689 | public: | ||
4970 | 690 | static void Print(const T& value, ::std::ostream* os) { | ||
4971 | 691 | UniversalPrint(value, os); | ||
4972 | 692 | } | ||
4973 | 693 | }; | ||
4974 | 694 | template <typename T, size_t N> | ||
4975 | 695 | class UniversalTersePrinter<T[N]> { | ||
4976 | 696 | public: | ||
4977 | 697 | static void Print(const T (&value)[N], ::std::ostream* os) { | ||
4978 | 698 | UniversalPrinter<T[N]>::Print(value, os); | ||
4979 | 699 | } | ||
4980 | 700 | }; | ||
4981 | 701 | template <> | ||
4982 | 702 | class UniversalTersePrinter<const char*> { | ||
4983 | 703 | public: | ||
4984 | 704 | static void Print(const char* str, ::std::ostream* os) { | ||
4985 | 705 | if (str == NULL) { | ||
4986 | 706 | *os << "NULL"; | ||
4987 | 707 | } else { | ||
4988 | 708 | UniversalPrint(string(str), os); | ||
4989 | 709 | } | ||
4990 | 710 | } | ||
4991 | 711 | }; | ||
4992 | 712 | template <> | ||
4993 | 713 | class UniversalTersePrinter<char*> { | ||
4994 | 714 | public: | ||
4995 | 715 | static void Print(char* str, ::std::ostream* os) { | ||
4996 | 716 | UniversalTersePrinter<const char*>::Print(str, os); | ||
4997 | 717 | } | ||
4998 | 718 | }; | ||
4999 | 719 | |||
5000 | 720 | #if GTEST_HAS_STD_WSTRING |
PASSED: Continuous integration, rev:58 jenkins. qa.ubuntu. com/job/ sync-monitor- ci/34/ jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- amd64-ci/ 34 jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- armhf-ci/ 34 jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- armhf-ci/ 34/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ sync-monitor- trusty- i386-ci/ 34
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/sync- monitor- ci/34/rebuild
http://