]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / third-party / gtest-1.8.1 / fused-src / gtest / gtest.h
CommitLineData
7c673cae
FG
1// Copyright 2005, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 29
7c673cae 30//
f67539c2 31// The Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
32//
33// This header file defines the public API for Google Test. It should be
34// included by any test program that uses Google Test.
35//
36// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
37// leave some internal implementation details in this header file.
38// They are clearly marked by comments like this:
39//
40// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
41//
42// Such code is NOT meant to be used by a user directly, and is subject
43// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
44// program!
45//
46// Acknowledgment: Google Test borrowed the idea of automatic test
47// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
48// easyUnit framework.
49
f67539c2
TL
50// GOOGLETEST_CM0001 DO NOT DELETE
51
7c673cae
FG
52#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
53#define GTEST_INCLUDE_GTEST_GTEST_H_
54
55#include <limits>
1e59de90 56#include <memory>
7c673cae
FG
57#include <ostream>
58#include <vector>
59
60// Copyright 2005, Google Inc.
61// All rights reserved.
62//
63// Redistribution and use in source and binary forms, with or without
64// modification, are permitted provided that the following conditions are
65// met:
66//
67// * Redistributions of source code must retain the above copyright
68// notice, this list of conditions and the following disclaimer.
69// * Redistributions in binary form must reproduce the above
70// copyright notice, this list of conditions and the following disclaimer
71// in the documentation and/or other materials provided with the
72// distribution.
73// * Neither the name of Google Inc. nor the names of its
74// contributors may be used to endorse or promote products derived from
75// this software without specific prior written permission.
76//
77// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
78// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
79// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
80// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
81// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
82// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
83// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
84// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
85// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
87// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88//
f67539c2 89// The Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
90//
91// This header file declares functions and macros used internally by
92// Google Test. They are subject to change without notice.
93
f67539c2
TL
94// GOOGLETEST_CM0001 DO NOT DELETE
95
7c673cae
FG
96#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
97#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
98
99// Copyright 2005, Google Inc.
100// All rights reserved.
101//
102// Redistribution and use in source and binary forms, with or without
103// modification, are permitted provided that the following conditions are
104// met:
105//
106// * Redistributions of source code must retain the above copyright
107// notice, this list of conditions and the following disclaimer.
108// * Redistributions in binary form must reproduce the above
109// copyright notice, this list of conditions and the following disclaimer
110// in the documentation and/or other materials provided with the
111// distribution.
112// * Neither the name of Google Inc. nor the names of its
113// contributors may be used to endorse or promote products derived from
114// this software without specific prior written permission.
115//
116// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
117// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
118// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
119// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
120// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
121// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
122// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
123// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
124// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
125// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
126// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
127//
7c673cae
FG
128// Low-level types and utilities for porting Google Test to various
129// platforms. All macros ending with _ and symbols defined in an
130// internal namespace are subject to change without notice. Code
131// outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
132// end with _ are part of Google Test's public API and can be used by
133// code outside Google Test.
134//
135// This file is fundamental to Google Test. All other Google Test source
136// files are expected to #include this. Therefore, it cannot #include
137// any other Google Test header.
138
f67539c2
TL
139// GOOGLETEST_CM0001 DO NOT DELETE
140
7c673cae
FG
141#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
142#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
143
144// Environment-describing macros
145// -----------------------------
146//
147// Google Test can be used in many different environments. Macros in
148// this section tell Google Test what kind of environment it is being
149// used in, such that Google Test can provide environment-specific
150// features and implementations.
151//
152// Google Test tries to automatically detect the properties of its
153// environment, so users usually don't need to worry about these
154// macros. However, the automatic detection is not perfect.
155// Sometimes it's necessary for a user to define some of the following
156// macros in the build script to override Google Test's decisions.
157//
158// If the user doesn't define a macro in the list, Google Test will
159// provide a default definition. After this header is #included, all
160// macros in this list will be defined to either 1 or 0.
161//
162// Notes to maintainers:
163// - Each macro here is a user-tweakable knob; do not grow the list
164// lightly.
165// - Use #if to key off these macros. Don't use #ifdef or "#if
166// defined(...)", which will not work as these macros are ALWAYS
167// defined.
168//
169// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
170// is/isn't available.
171// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
172// are enabled.
173// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
f67539c2
TL
174// is/isn't available
175// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
176// is/isn't available
7c673cae
FG
177// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
178// expressions are/aren't available.
179// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
180// is/isn't available.
181// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
182// enabled.
183// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
184// std::wstring does/doesn't work (Google Test can
185// be used where std::wstring is unavailable).
186// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
187// is/isn't available.
188// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
189// compiler supports Microsoft's "Structured
190// Exception Handling".
191// GTEST_HAS_STREAM_REDIRECTION
192// - Define it to 1/0 to indicate whether the
193// platform supports I/O stream redirection using
194// dup() and dup2().
195// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
196// Test's own tr1 tuple implementation should be
197// used. Unused when the user sets
198// GTEST_HAS_TR1_TUPLE to 0.
199// GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
200// is building in C++11/C++98 mode.
201// GTEST_LINKED_AS_SHARED_LIBRARY
202// - Define to 1 when compiling tests that use
203// Google Test as a shared library (known as
204// DLL on Windows).
205// GTEST_CREATE_SHARED_LIBRARY
206// - Define to 1 when compiling Google Test itself
207// as a shared library.
f67539c2
TL
208// GTEST_DEFAULT_DEATH_TEST_STYLE
209// - The default value of --gtest_death_test_style.
210// The legacy default has been "fast" in the open
211// source version since 2008. The recommended value
212// is "threadsafe", and can be set in
213// custom/gtest-port.h.
7c673cae
FG
214
215// Platform-indicating macros
216// --------------------------
217//
218// Macros indicating the platform on which Google Test is being used
219// (a macro is defined to 1 if compiled on the given platform;
220// otherwise UNDEFINED -- it's never defined to 0.). Google Test
221// defines these macros automatically. Code outside Google Test MUST
222// NOT define them.
223//
224// GTEST_OS_AIX - IBM AIX
225// GTEST_OS_CYGWIN - Cygwin
226// GTEST_OS_FREEBSD - FreeBSD
f67539c2 227// GTEST_OS_FUCHSIA - Fuchsia
7c673cae
FG
228// GTEST_OS_HPUX - HP-UX
229// GTEST_OS_LINUX - Linux
230// GTEST_OS_LINUX_ANDROID - Google Android
231// GTEST_OS_MAC - Mac OS X
232// GTEST_OS_IOS - iOS
233// GTEST_OS_NACL - Google Native Client (NaCl)
f67539c2 234// GTEST_OS_NETBSD - NetBSD
7c673cae
FG
235// GTEST_OS_OPENBSD - OpenBSD
236// GTEST_OS_QNX - QNX
237// GTEST_OS_SOLARIS - Sun Solaris
238// GTEST_OS_SYMBIAN - Symbian
239// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
240// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
241// GTEST_OS_WINDOWS_MINGW - MinGW
242// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
243// GTEST_OS_WINDOWS_PHONE - Windows Phone
244// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
245// GTEST_OS_ZOS - z/OS
246//
247// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
248// most stable support. Since core members of the Google Test project
249// don't have access to other platforms, support for them may be less
250// stable. If you notice any problems on your platform, please notify
251// googletestframework@googlegroups.com (patches for fixing them are
252// even more welcome!).
253//
254// It is possible that none of the GTEST_OS_* macros are defined.
255
256// Feature-indicating macros
257// -------------------------
258//
259// Macros indicating which Google Test features are available (a macro
260// is defined to 1 if the corresponding feature is supported;
261// otherwise UNDEFINED -- it's never defined to 0.). Google Test
262// defines these macros automatically. Code outside Google Test MUST
263// NOT define them.
264//
265// These macros are public so that portable tests can be written.
266// Such tests typically surround code using a feature with an #if
267// which controls that code. For example:
268//
269// #if GTEST_HAS_DEATH_TEST
270// EXPECT_DEATH(DoSomethingDeadly());
271// #endif
272//
273// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
274// tests)
275// GTEST_HAS_DEATH_TEST - death tests
7c673cae
FG
276// GTEST_HAS_TYPED_TEST - typed tests
277// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
278// GTEST_IS_THREADSAFE - Google Test is thread-safe.
f67539c2 279// GOOGLETEST_CM0007 DO NOT DELETE
7c673cae
FG
280// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
281// GTEST_HAS_POSIX_RE (see above) which users can
282// define themselves.
283// GTEST_USES_SIMPLE_RE - our own simple regex is used;
f67539c2 284// the above RE\b(s) are mutually exclusive.
7c673cae
FG
285// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
286
287// Misc public macros
288// ------------------
289//
290// GTEST_FLAG(flag_name) - references the variable corresponding to
291// the given Google Test flag.
292
293// Internal utilities
294// ------------------
295//
296// The following macros and utilities are for Google Test's INTERNAL
297// use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
298//
299// Macros for basic C++ coding:
300// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
301// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
302// variable don't have to be used.
303// GTEST_DISALLOW_ASSIGN_ - disables operator=.
304// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
305// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
306// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
307// suppressed (constant conditional).
308// GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
309// is suppressed.
310//
311// C++11 feature wrappers:
312//
f67539c2 313// testing::internal::forward - portability wrapper for std::forward.
7c673cae
FG
314// testing::internal::move - portability wrapper for std::move.
315//
316// Synchronization:
317// Mutex, MutexLock, ThreadLocal, GetThreadCount()
318// - synchronization primitives.
319//
320// Template meta programming:
321// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
322// IteratorTraits - partial implementation of std::iterator_traits, which
323// is not available in libCstd when compiled with Sun C++.
324//
325// Smart pointers:
326// scoped_ptr - as in TR2.
327//
328// Regular expressions:
329// RE - a simple regular expression class using the POSIX
f67539c2
TL
330// Extended Regular Expression syntax on UNIX-like platforms
331// GOOGLETEST_CM0008 DO NOT DELETE
332// or a reduced regular exception syntax on other
333// platforms, including Windows.
7c673cae
FG
334// Logging:
335// GTEST_LOG_() - logs messages at the specified severity level.
336// LogToStderr() - directs all log messages to stderr.
337// FlushInfoLog() - flushes informational log messages.
338//
339// Stdout and stderr capturing:
340// CaptureStdout() - starts capturing stdout.
341// GetCapturedStdout() - stops capturing stdout and returns the captured
342// string.
343// CaptureStderr() - starts capturing stderr.
344// GetCapturedStderr() - stops capturing stderr and returns the captured
345// string.
346//
347// Integer types:
348// TypeWithSize - maps an integer to a int type.
349// Int32, UInt32, Int64, UInt64, TimeInMillis
350// - integers of known sizes.
351// BiggestInt - the biggest signed integer type.
352//
353// Command-line utilities:
354// GTEST_DECLARE_*() - declares a flag.
355// GTEST_DEFINE_*() - defines a flag.
356// GetInjectableArgvs() - returns the command line as a vector of strings.
357//
358// Environment variable utilities:
359// GetEnv() - gets the value of an environment variable.
360// BoolFromGTestEnv() - parses a bool environment variable.
361// Int32FromGTestEnv() - parses an Int32 environment variable.
362// StringFromGTestEnv() - parses a string environment variable.
363
364#include <ctype.h> // for isspace, etc
365#include <stddef.h> // for ptrdiff_t
366#include <stdlib.h>
367#include <stdio.h>
368#include <string.h>
369#ifndef _WIN32_WCE
370# include <sys/types.h>
371# include <sys/stat.h>
372#endif // !_WIN32_WCE
373
374#if defined __APPLE__
375# include <AvailabilityMacros.h>
376# include <TargetConditionals.h>
377#endif
378
f67539c2
TL
379// Brings in the definition of HAS_GLOBAL_STRING. This must be done
380// BEFORE we test HAS_GLOBAL_STRING.
381#include <string> // NOLINT
7c673cae
FG
382#include <algorithm> // NOLINT
383#include <iostream> // NOLINT
384#include <sstream> // NOLINT
7c673cae 385#include <utility>
f67539c2 386#include <vector> // NOLINT
7c673cae 387
f67539c2
TL
388// Copyright 2015, Google Inc.
389// All rights reserved.
390//
391// Redistribution and use in source and binary forms, with or without
392// modification, are permitted provided that the following conditions are
393// met:
394//
395// * Redistributions of source code must retain the above copyright
396// notice, this list of conditions and the following disclaimer.
397// * Redistributions in binary form must reproduce the above
398// copyright notice, this list of conditions and the following disclaimer
399// in the documentation and/or other materials provided with the
400// distribution.
401// * Neither the name of Google Inc. nor the names of its
402// contributors may be used to endorse or promote products derived from
403// this software without specific prior written permission.
404//
405// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
406// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
407// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
408// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
409// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
410// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
411// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
412// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
413// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
414// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
415// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
416//
417// The Google C++ Testing and Mocking Framework (Google Test)
418//
419// This header file defines the GTEST_OS_* macro.
420// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
7c673cae 421
f67539c2
TL
422#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
423#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
7c673cae
FG
424
425// Determines the platform on which Google Test is compiled.
426#ifdef __CYGWIN__
427# define GTEST_OS_CYGWIN 1
428#elif defined __SYMBIAN32__
429# define GTEST_OS_SYMBIAN 1
430#elif defined _WIN32
431# define GTEST_OS_WINDOWS 1
432# ifdef _WIN32_WCE
433# define GTEST_OS_WINDOWS_MOBILE 1
434# elif defined(__MINGW__) || defined(__MINGW32__)
435# define GTEST_OS_WINDOWS_MINGW 1
436# elif defined(WINAPI_FAMILY)
437# include <winapifamily.h>
438# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
439# define GTEST_OS_WINDOWS_DESKTOP 1
440# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
441# define GTEST_OS_WINDOWS_PHONE 1
442# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
443# define GTEST_OS_WINDOWS_RT 1
f67539c2
TL
444# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)
445# define GTEST_OS_WINDOWS_PHONE 1
446# define GTEST_OS_WINDOWS_TV_TITLE 1
7c673cae
FG
447# else
448 // WINAPI_FAMILY defined but no known partition matched.
449 // Default to desktop.
450# define GTEST_OS_WINDOWS_DESKTOP 1
451# endif
452# else
453# define GTEST_OS_WINDOWS_DESKTOP 1
454# endif // _WIN32_WCE
455#elif defined __APPLE__
456# define GTEST_OS_MAC 1
457# if TARGET_OS_IPHONE
458# define GTEST_OS_IOS 1
459# endif
460#elif defined __FreeBSD__
461# define GTEST_OS_FREEBSD 1
f67539c2
TL
462#elif defined __Fuchsia__
463# define GTEST_OS_FUCHSIA 1
7c673cae
FG
464#elif defined __linux__
465# define GTEST_OS_LINUX 1
466# if defined __ANDROID__
467# define GTEST_OS_LINUX_ANDROID 1
468# endif
469#elif defined __MVS__
470# define GTEST_OS_ZOS 1
471#elif defined(__sun) && defined(__SVR4)
472# define GTEST_OS_SOLARIS 1
473#elif defined(_AIX)
474# define GTEST_OS_AIX 1
475#elif defined(__hpux)
476# define GTEST_OS_HPUX 1
477#elif defined __native_client__
478# define GTEST_OS_NACL 1
f67539c2
TL
479#elif defined __NetBSD__
480# define GTEST_OS_NETBSD 1
7c673cae
FG
481#elif defined __OpenBSD__
482# define GTEST_OS_OPENBSD 1
483#elif defined __QNX__
484# define GTEST_OS_QNX 1
485#endif // __CYGWIN__
486
f67539c2
TL
487#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
488// Copyright 2015, Google Inc.
489// All rights reserved.
490//
491// Redistribution and use in source and binary forms, with or without
492// modification, are permitted provided that the following conditions are
493// met:
494//
495// * Redistributions of source code must retain the above copyright
496// notice, this list of conditions and the following disclaimer.
497// * Redistributions in binary form must reproduce the above
498// copyright notice, this list of conditions and the following disclaimer
499// in the documentation and/or other materials provided with the
500// distribution.
501// * Neither the name of Google Inc. nor the names of its
502// contributors may be used to endorse or promote products derived from
503// this software without specific prior written permission.
504//
505// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
506// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
507// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
508// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
509// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
510// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
511// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
512// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
513// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
514// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
515// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
516//
517// Injection point for custom user configurations. See README for details
518//
519// ** Custom implementation starts here **
520
521#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
522#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
523
524#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
525
526#if !defined(GTEST_DEV_EMAIL_)
527# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
528# define GTEST_FLAG_PREFIX_ "gtest_"
529# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
530# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
531# define GTEST_NAME_ "Google Test"
532# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
533#endif // !defined(GTEST_DEV_EMAIL_)
534
535#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
536# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
537#endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
538
539// Determines the version of gcc that is used to compile this.
540#ifdef __GNUC__
541// 40302 means version 4.3.2.
542# define GTEST_GCC_VER_ \
543 (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
544#endif // __GNUC__
545
7c673cae
FG
546// Macros for disabling Microsoft Visual C++ warnings.
547//
548// GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
549// /* code that triggers warnings C4800 and C4385 */
550// GTEST_DISABLE_MSC_WARNINGS_POP_()
f67539c2 551#if _MSC_VER >= 1400
7c673cae
FG
552# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
553 __pragma(warning(push)) \
554 __pragma(warning(disable: warnings))
555# define GTEST_DISABLE_MSC_WARNINGS_POP_() \
556 __pragma(warning(pop))
557#else
558// Older versions of MSVC don't have __pragma.
559# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
560# define GTEST_DISABLE_MSC_WARNINGS_POP_()
561#endif
562
f67539c2
TL
563// Clang on Windows does not understand MSVC's pragma warning.
564// We need clang-specific way to disable function deprecation warning.
565#ifdef __clang__
566# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
567 _Pragma("clang diagnostic push") \
568 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
569 _Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
570#define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
571 _Pragma("clang diagnostic pop")
572#else
573# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
574 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
575# define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
576 GTEST_DISABLE_MSC_WARNINGS_POP_()
577#endif
578
7c673cae
FG
579#ifndef GTEST_LANG_CXX11
580// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
581// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
582// value for __cplusplus, and recent versions of clang, gcc, and
583// probably other compilers set that too in C++11 mode.
f67539c2 584# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900
7c673cae
FG
585// Compiling in at least C++11 mode.
586# define GTEST_LANG_CXX11 1
587# else
588# define GTEST_LANG_CXX11 0
589# endif
590#endif
591
592// Distinct from C++11 language support, some environments don't provide
593// proper C++11 library support. Notably, it's possible to build in
594// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
595// with no C++11 support.
596//
597// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
598// 20110325, but maintenance releases in the 4.4 and 4.5 series followed
599// this date, so check for those versions by their date stamps.
600// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
601#if GTEST_LANG_CXX11 && \
602 (!defined(__GLIBCXX__) || ( \
603 __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
604 /* Blacklist of patch releases of older branches: */ \
605 __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
606 __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
607 __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
608 __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
609# define GTEST_STDLIB_CXX11 1
610#endif
611
612// Only use C++11 library features if the library provides them.
613#if GTEST_STDLIB_CXX11
614# define GTEST_HAS_STD_BEGIN_AND_END_ 1
615# define GTEST_HAS_STD_FORWARD_LIST_ 1
f67539c2
TL
616# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)
617// works only with VS2015U2 and better
618# define GTEST_HAS_STD_FUNCTION_ 1
619# endif
7c673cae
FG
620# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
621# define GTEST_HAS_STD_MOVE_ 1
622# define GTEST_HAS_STD_UNIQUE_PTR_ 1
f67539c2
TL
623# define GTEST_HAS_STD_SHARED_PTR_ 1
624# define GTEST_HAS_UNORDERED_MAP_ 1
625# define GTEST_HAS_UNORDERED_SET_ 1
7c673cae
FG
626#endif
627
628// C++11 specifies that <tuple> provides std::tuple.
629// Some platforms still might not have it, however.
630#if GTEST_LANG_CXX11
631# define GTEST_HAS_STD_TUPLE_ 1
632# if defined(__clang__)
f67539c2
TL
633// Inspired by
634// https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros
7c673cae
FG
635# if defined(__has_include) && !__has_include(<tuple>)
636# undef GTEST_HAS_STD_TUPLE_
637# endif
638# elif defined(_MSC_VER)
639// Inspired by boost/config/stdlib/dinkumware.hpp
640# if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
641# undef GTEST_HAS_STD_TUPLE_
642# endif
643# elif defined(__GLIBCXX__)
644// Inspired by boost/config/stdlib/libstdcpp3.hpp,
645// http://gcc.gnu.org/gcc-4.2/changes.html and
f67539c2 646// https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
7c673cae
FG
647# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
648# undef GTEST_HAS_STD_TUPLE_
649# endif
650# endif
651#endif
652
653// Brings in definitions for functions used in the testing::internal::posix
654// namespace (read, write, close, chdir, isatty, stat). We do not currently
655// use them on Windows Mobile.
656#if GTEST_OS_WINDOWS
657# if !GTEST_OS_WINDOWS_MOBILE
658# include <direct.h>
659# include <io.h>
660# endif
661// In order to avoid having to include <windows.h>, use forward declaration
f67539c2
TL
662#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
663// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
664// separate (equivalent) structs, instead of using typedef
665typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
666#else
667// Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
7c673cae
FG
668// This assumption is verified by
669// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
f67539c2
TL
670typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
671#endif
7c673cae
FG
672#else
673// This assumes that non-Windows OSes provide unistd.h. For OSes where this
674// is not the case, we need to include headers that provide the functions
675// mentioned above.
676# include <unistd.h>
677# include <strings.h>
678#endif // GTEST_OS_WINDOWS
679
680#if GTEST_OS_LINUX_ANDROID
681// Used to define __ANDROID_API__ matching the target NDK API level.
682# include <android/api-level.h> // NOLINT
683#endif
684
685// Defines this to true iff Google Test can use POSIX regular expressions.
686#ifndef GTEST_HAS_POSIX_RE
687# if GTEST_OS_LINUX_ANDROID
688// On Android, <regex.h> is only available starting with Gingerbread.
689# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
690# else
691# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
692# endif
693#endif
694
f67539c2
TL
695#if GTEST_USES_PCRE
696// The appropriate headers have already been included.
697
698#elif GTEST_HAS_POSIX_RE
7c673cae
FG
699
700// On some platforms, <regex.h> needs someone to define size_t, and
701// won't compile otherwise. We can #include it here as we already
702// included <stdlib.h>, which is guaranteed to define size_t through
703// <stddef.h>.
704# include <regex.h> // NOLINT
705
706# define GTEST_USES_POSIX_RE 1
707
708#elif GTEST_OS_WINDOWS
709
710// <regex.h> is not available on Windows. Use our own simple regex
711// implementation instead.
712# define GTEST_USES_SIMPLE_RE 1
713
714#else
715
716// <regex.h> may not be available on this platform. Use our own
717// simple regex implementation instead.
718# define GTEST_USES_SIMPLE_RE 1
719
f67539c2 720#endif // GTEST_USES_PCRE
7c673cae
FG
721
722#ifndef GTEST_HAS_EXCEPTIONS
723// The user didn't tell us whether exceptions are enabled, so we need
724// to figure it out.
f67539c2
TL
725# if defined(_MSC_VER) && defined(_CPPUNWIND)
726// MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.
727# define GTEST_HAS_EXCEPTIONS 1
728# elif defined(__BORLANDC__)
729// C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
7c673cae
FG
730// macro to enable exceptions, so we'll do the same.
731// Assumes that exceptions are enabled by default.
732# ifndef _HAS_EXCEPTIONS
733# define _HAS_EXCEPTIONS 1
734# endif // _HAS_EXCEPTIONS
735# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
736# elif defined(__clang__)
737// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
738// but iff cleanups are enabled after that. In Obj-C++ files, there can be
739// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
740// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
741// exceptions starting at clang r206352, but which checked for cleanups prior to
742// that. To reliably check for C++ exception availability with clang, check for
743// __EXCEPTIONS && __has_feature(cxx_exceptions).
744# define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
745# elif defined(__GNUC__) && __EXCEPTIONS
746// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
747# define GTEST_HAS_EXCEPTIONS 1
748# elif defined(__SUNPRO_CC)
749// Sun Pro CC supports exceptions. However, there is no compile-time way of
750// detecting whether they are enabled or not. Therefore, we assume that
751// they are enabled unless the user tells us otherwise.
752# define GTEST_HAS_EXCEPTIONS 1
753# elif defined(__IBMCPP__) && __EXCEPTIONS
754// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
755# define GTEST_HAS_EXCEPTIONS 1
756# elif defined(__HP_aCC)
757// Exception handling is in effect by default in HP aCC compiler. It has to
758// be turned of by +noeh compiler option if desired.
759# define GTEST_HAS_EXCEPTIONS 1
760# else
761// For other compilers, we assume exceptions are disabled to be
762// conservative.
763# define GTEST_HAS_EXCEPTIONS 0
764# endif // defined(_MSC_VER) || defined(__BORLANDC__)
765#endif // GTEST_HAS_EXCEPTIONS
766
767#if !defined(GTEST_HAS_STD_STRING)
768// Even though we don't use this macro any longer, we keep it in case
769// some clients still depend on it.
770# define GTEST_HAS_STD_STRING 1
771#elif !GTEST_HAS_STD_STRING
772// The user told us that ::std::string isn't available.
f67539c2 773# error "::std::string isn't available."
7c673cae
FG
774#endif // !defined(GTEST_HAS_STD_STRING)
775
776#ifndef GTEST_HAS_GLOBAL_STRING
7c673cae 777# define GTEST_HAS_GLOBAL_STRING 0
7c673cae
FG
778#endif // GTEST_HAS_GLOBAL_STRING
779
780#ifndef GTEST_HAS_STD_WSTRING
781// The user didn't tell us whether ::std::wstring is available, so we need
782// to figure it out.
f67539c2 783// FIXME: uses autoconf to detect whether ::std::wstring
7c673cae
FG
784// is available.
785
786// Cygwin 1.7 and below doesn't support ::std::wstring.
787// Solaris' libc++ doesn't support it either. Android has
788// no support for it at least as recent as Froyo (2.2).
789# define GTEST_HAS_STD_WSTRING \
790 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
791
792#endif // GTEST_HAS_STD_WSTRING
793
794#ifndef GTEST_HAS_GLOBAL_WSTRING
795// The user didn't tell us whether ::wstring is available, so we need
796// to figure it out.
797# define GTEST_HAS_GLOBAL_WSTRING \
798 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
799#endif // GTEST_HAS_GLOBAL_WSTRING
800
801// Determines whether RTTI is available.
802#ifndef GTEST_HAS_RTTI
803// The user didn't tell us whether RTTI is enabled, so we need to
804// figure it out.
805
806# ifdef _MSC_VER
807
808# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
809# define GTEST_HAS_RTTI 1
810# else
811# define GTEST_HAS_RTTI 0
812# endif
813
814// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
815# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
816
817# ifdef __GXX_RTTI
818// When building against STLport with the Android NDK and with
819// -frtti -fno-exceptions, the build fails at link time with undefined
820// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
821// so disable RTTI when detected.
822# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
823 !defined(__EXCEPTIONS)
824# define GTEST_HAS_RTTI 0
825# else
826# define GTEST_HAS_RTTI 1
827# endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
828# else
829# define GTEST_HAS_RTTI 0
830# endif // __GXX_RTTI
831
832// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
833// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
834// first version with C++ support.
835# elif defined(__clang__)
836
837# define GTEST_HAS_RTTI __has_feature(cxx_rtti)
838
839// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
840// both the typeid and dynamic_cast features are present.
841# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
842
843# ifdef __RTTI_ALL__
844# define GTEST_HAS_RTTI 1
845# else
846# define GTEST_HAS_RTTI 0
847# endif
848
849# else
850
851// For all other compilers, we assume RTTI is enabled.
852# define GTEST_HAS_RTTI 1
853
854# endif // _MSC_VER
855
856#endif // GTEST_HAS_RTTI
857
858// It's this header's responsibility to #include <typeinfo> when RTTI
859// is enabled.
860#if GTEST_HAS_RTTI
861# include <typeinfo>
862#endif
863
864// Determines whether Google Test can use the pthreads library.
865#ifndef GTEST_HAS_PTHREAD
866// The user didn't tell us explicitly, so we make reasonable assumptions about
867// which platforms have pthreads support.
868//
869// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
870// to your compiler flags.
f67539c2
TL
871#define GTEST_HAS_PTHREAD \
872 (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
873 GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
7c673cae
FG
874#endif // GTEST_HAS_PTHREAD
875
876#if GTEST_HAS_PTHREAD
877// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
878// true.
879# include <pthread.h> // NOLINT
880
881// For timespec and nanosleep, used below.
882# include <time.h> // NOLINT
883#endif
884
f67539c2
TL
885// Determines if hash_map/hash_set are available.
886// Only used for testing against those containers.
887#if !defined(GTEST_HAS_HASH_MAP_)
888# if defined(_MSC_VER) && (_MSC_VER < 1900)
889# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
890# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
891# endif // _MSC_VER
892#endif // !defined(GTEST_HAS_HASH_MAP_)
893
7c673cae
FG
894// Determines whether Google Test can use tr1/tuple. You can define
895// this macro to 0 to prevent Google Test from using tuple (any
896// feature depending on tuple with be disabled in this mode).
897#ifndef GTEST_HAS_TR1_TUPLE
898# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
899// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
900# define GTEST_HAS_TR1_TUPLE 0
f67539c2
TL
901# elif defined(_MSC_VER) && (_MSC_VER >= 1910)
902// Prevent `warning C4996: 'std::tr1': warning STL4002:
903// The non-Standard std::tr1 namespace and TR1-only machinery
904// are deprecated and will be REMOVED.`
905# define GTEST_HAS_TR1_TUPLE 0
906# elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)
907// libc++ doesn't support TR1.
908# define GTEST_HAS_TR1_TUPLE 0
7c673cae
FG
909# else
910// The user didn't tell us not to do it, so we assume it's OK.
911# define GTEST_HAS_TR1_TUPLE 1
912# endif
913#endif // GTEST_HAS_TR1_TUPLE
914
915// Determines whether Google Test's own tr1 tuple implementation
916// should be used.
917#ifndef GTEST_USE_OWN_TR1_TUPLE
f67539c2
TL
918// We use our own tuple implementation on Symbian.
919# if GTEST_OS_SYMBIAN
920# define GTEST_USE_OWN_TR1_TUPLE 1
921# else
7c673cae
FG
922// The user didn't tell us, so we need to figure it out.
923
924// We use our own TR1 tuple if we aren't sure the user has an
925// implementation of it already. At this time, libstdc++ 4.0.0+ and
926// MSVC 2010 are the only mainstream standard libraries that come
927// with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
928// pretends to be GCC by defining __GNUC__ and friends, but cannot
929// compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
930// tuple in a 323 MB Feature Pack download, which we cannot assume the
931// user has. QNX's QCC compiler is a modified GCC but it doesn't
932// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
933// and it can be used with some compilers that define __GNUC__.
934# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
f67539c2
TL
935 && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \
936 || (_MSC_VER >= 1600 && _MSC_VER < 1900)
7c673cae
FG
937# define GTEST_ENV_HAS_TR1_TUPLE_ 1
938# endif
939
940// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
941// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
942// can build with clang but need to use gcc4.2's libstdc++).
943# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
944# define GTEST_ENV_HAS_STD_TUPLE_ 1
945# endif
946
947# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
948# define GTEST_USE_OWN_TR1_TUPLE 0
949# else
950# define GTEST_USE_OWN_TR1_TUPLE 1
951# endif
f67539c2 952# endif // GTEST_OS_SYMBIAN
7c673cae
FG
953#endif // GTEST_USE_OWN_TR1_TUPLE
954
f67539c2
TL
955// To avoid conditional compilation we make it gtest-port.h's responsibility
956// to #include the header implementing tuple.
7c673cae
FG
957#if GTEST_HAS_STD_TUPLE_
958# include <tuple> // IWYU pragma: export
959# define GTEST_TUPLE_NAMESPACE_ ::std
960#endif // GTEST_HAS_STD_TUPLE_
961
962// We include tr1::tuple even if std::tuple is available to define printers for
963// them.
964#if GTEST_HAS_TR1_TUPLE
965# ifndef GTEST_TUPLE_NAMESPACE_
966# define GTEST_TUPLE_NAMESPACE_ ::std::tr1
967# endif // GTEST_TUPLE_NAMESPACE_
968
969# if GTEST_USE_OWN_TR1_TUPLE
970// This file was GENERATED by command:
971// pump.py gtest-tuple.h.pump
972// DO NOT EDIT BY HAND!!!
973
974// Copyright 2009 Google Inc.
975// All Rights Reserved.
976//
977// Redistribution and use in source and binary forms, with or without
978// modification, are permitted provided that the following conditions are
979// met:
980//
981// * Redistributions of source code must retain the above copyright
982// notice, this list of conditions and the following disclaimer.
983// * Redistributions in binary form must reproduce the above
984// copyright notice, this list of conditions and the following disclaimer
985// in the documentation and/or other materials provided with the
986// distribution.
987// * Neither the name of Google Inc. nor the names of its
988// contributors may be used to endorse or promote products derived from
989// this software without specific prior written permission.
990//
991// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
992// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
993// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
994// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
995// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
996// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
997// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
998// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
999// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1000// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1001// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 1002
7c673cae
FG
1003
1004// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
1005
f67539c2
TL
1006// GOOGLETEST_CM0001 DO NOT DELETE
1007
7c673cae
FG
1008#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1009#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1010
1011#include <utility> // For ::std::pair.
1012
1013// The compiler used in Symbian has a bug that prevents us from declaring the
1014// tuple template as a friend (it complains that tuple is redefined). This
f67539c2 1015// bypasses the bug by declaring the members that should otherwise be
7c673cae
FG
1016// private as public.
1017// Sun Studio versions < 12 also have the above bug.
1018#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
1019# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
1020#else
1021# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
1022 template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
1023 private:
1024#endif
1025
1026// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
1027// with our own definitions. Therefore using our own tuple does not work on
1028// those compilers.
1029#if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */
1030# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
1031GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
1032#endif
1033
1034// GTEST_n_TUPLE_(T) is the type of an n-tuple.
1035#define GTEST_0_TUPLE_(T) tuple<>
1036#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
1037 void, void, void>
1038#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
1039 void, void, void>
1040#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
1041 void, void, void>
1042#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
1043 void, void, void>
1044#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
1045 void, void, void>
1046#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
1047 void, void, void>
1048#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1049 void, void, void>
1050#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1051 T##7, void, void>
1052#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1053 T##7, T##8, void>
1054#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1055 T##7, T##8, T##9>
1056
1057// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
1058#define GTEST_0_TYPENAMES_(T)
1059#define GTEST_1_TYPENAMES_(T) typename T##0
1060#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
1061#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
1062#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1063 typename T##3
1064#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1065 typename T##3, typename T##4
1066#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1067 typename T##3, typename T##4, typename T##5
1068#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1069 typename T##3, typename T##4, typename T##5, typename T##6
1070#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1071 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
1072#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1073 typename T##3, typename T##4, typename T##5, typename T##6, \
1074 typename T##7, typename T##8
1075#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1076 typename T##3, typename T##4, typename T##5, typename T##6, \
1077 typename T##7, typename T##8, typename T##9
1078
1079// In theory, defining stuff in the ::std namespace is undefined
1080// behavior. We can do this as we are playing the role of a standard
1081// library vendor.
1082namespace std {
1083namespace tr1 {
1084
1085template <typename T0 = void, typename T1 = void, typename T2 = void,
1086 typename T3 = void, typename T4 = void, typename T5 = void,
1087 typename T6 = void, typename T7 = void, typename T8 = void,
1088 typename T9 = void>
1089class tuple;
1090
1091// Anything in namespace gtest_internal is Google Test's INTERNAL
1092// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
1093namespace gtest_internal {
1094
1095// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
1096template <typename T>
1097struct ByRef { typedef const T& type; }; // NOLINT
1098template <typename T>
1099struct ByRef<T&> { typedef T& type; }; // NOLINT
1100
1101// A handy wrapper for ByRef.
1102#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
1103
1104// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
1105// is the same as tr1::add_reference<T>::type.
1106template <typename T>
1107struct AddRef { typedef T& type; }; // NOLINT
1108template <typename T>
1109struct AddRef<T&> { typedef T& type; }; // NOLINT
1110
1111// A handy wrapper for AddRef.
1112#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
1113
1114// A helper for implementing get<k>().
1115template <int k> class Get;
1116
1117// A helper for implementing tuple_element<k, T>. kIndexValid is true
1118// iff k < the number of fields in tuple type T.
1119template <bool kIndexValid, int kIndex, class Tuple>
1120struct TupleElement;
1121
1122template <GTEST_10_TYPENAMES_(T)>
1123struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
1124 typedef T0 type;
1125};
1126
1127template <GTEST_10_TYPENAMES_(T)>
1128struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
1129 typedef T1 type;
1130};
1131
1132template <GTEST_10_TYPENAMES_(T)>
1133struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
1134 typedef T2 type;
1135};
1136
1137template <GTEST_10_TYPENAMES_(T)>
1138struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
1139 typedef T3 type;
1140};
1141
1142template <GTEST_10_TYPENAMES_(T)>
1143struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
1144 typedef T4 type;
1145};
1146
1147template <GTEST_10_TYPENAMES_(T)>
1148struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
1149 typedef T5 type;
1150};
1151
1152template <GTEST_10_TYPENAMES_(T)>
1153struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
1154 typedef T6 type;
1155};
1156
1157template <GTEST_10_TYPENAMES_(T)>
1158struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
1159 typedef T7 type;
1160};
1161
1162template <GTEST_10_TYPENAMES_(T)>
1163struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
1164 typedef T8 type;
1165};
1166
1167template <GTEST_10_TYPENAMES_(T)>
1168struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
1169 typedef T9 type;
1170};
1171
1172} // namespace gtest_internal
1173
1174template <>
1175class tuple<> {
1176 public:
1177 tuple() {}
1178 tuple(const tuple& /* t */) {}
1179 tuple& operator=(const tuple& /* t */) { return *this; }
1180};
1181
1182template <GTEST_1_TYPENAMES_(T)>
1183class GTEST_1_TUPLE_(T) {
1184 public:
1185 template <int k> friend class gtest_internal::Get;
1186
1187 tuple() : f0_() {}
1188
1189 explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
1190
1191 tuple(const tuple& t) : f0_(t.f0_) {}
1192
1193 template <GTEST_1_TYPENAMES_(U)>
1194 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
1195
1196 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1197
1198 template <GTEST_1_TYPENAMES_(U)>
1199 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
1200 return CopyFrom(t);
1201 }
1202
1203 GTEST_DECLARE_TUPLE_AS_FRIEND_
1204
1205 template <GTEST_1_TYPENAMES_(U)>
1206 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
1207 f0_ = t.f0_;
1208 return *this;
1209 }
1210
1211 T0 f0_;
1212};
1213
1214template <GTEST_2_TYPENAMES_(T)>
1215class GTEST_2_TUPLE_(T) {
1216 public:
1217 template <int k> friend class gtest_internal::Get;
1218
1219 tuple() : f0_(), f1_() {}
1220
1221 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
1222 f1_(f1) {}
1223
1224 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
1225
1226 template <GTEST_2_TYPENAMES_(U)>
1227 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
1228 template <typename U0, typename U1>
1229 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
1230
1231 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1232
1233 template <GTEST_2_TYPENAMES_(U)>
1234 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
1235 return CopyFrom(t);
1236 }
1237 template <typename U0, typename U1>
1238 tuple& operator=(const ::std::pair<U0, U1>& p) {
1239 f0_ = p.first;
1240 f1_ = p.second;
1241 return *this;
1242 }
1243
1244 GTEST_DECLARE_TUPLE_AS_FRIEND_
1245
1246 template <GTEST_2_TYPENAMES_(U)>
1247 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
1248 f0_ = t.f0_;
1249 f1_ = t.f1_;
1250 return *this;
1251 }
1252
1253 T0 f0_;
1254 T1 f1_;
1255};
1256
1257template <GTEST_3_TYPENAMES_(T)>
1258class GTEST_3_TUPLE_(T) {
1259 public:
1260 template <int k> friend class gtest_internal::Get;
1261
1262 tuple() : f0_(), f1_(), f2_() {}
1263
1264 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1265 GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
1266
1267 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1268
1269 template <GTEST_3_TYPENAMES_(U)>
1270 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1271
1272 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1273
1274 template <GTEST_3_TYPENAMES_(U)>
1275 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
1276 return CopyFrom(t);
1277 }
1278
1279 GTEST_DECLARE_TUPLE_AS_FRIEND_
1280
1281 template <GTEST_3_TYPENAMES_(U)>
1282 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
1283 f0_ = t.f0_;
1284 f1_ = t.f1_;
1285 f2_ = t.f2_;
1286 return *this;
1287 }
1288
1289 T0 f0_;
1290 T1 f1_;
1291 T2 f2_;
1292};
1293
1294template <GTEST_4_TYPENAMES_(T)>
1295class GTEST_4_TUPLE_(T) {
1296 public:
1297 template <int k> friend class gtest_internal::Get;
1298
1299 tuple() : f0_(), f1_(), f2_(), f3_() {}
1300
1301 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1302 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
1303 f3_(f3) {}
1304
1305 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
1306
1307 template <GTEST_4_TYPENAMES_(U)>
1308 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1309 f3_(t.f3_) {}
1310
1311 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1312
1313 template <GTEST_4_TYPENAMES_(U)>
1314 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
1315 return CopyFrom(t);
1316 }
1317
1318 GTEST_DECLARE_TUPLE_AS_FRIEND_
1319
1320 template <GTEST_4_TYPENAMES_(U)>
1321 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
1322 f0_ = t.f0_;
1323 f1_ = t.f1_;
1324 f2_ = t.f2_;
1325 f3_ = t.f3_;
1326 return *this;
1327 }
1328
1329 T0 f0_;
1330 T1 f1_;
1331 T2 f2_;
1332 T3 f3_;
1333};
1334
1335template <GTEST_5_TYPENAMES_(T)>
1336class GTEST_5_TUPLE_(T) {
1337 public:
1338 template <int k> friend class gtest_internal::Get;
1339
1340 tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1341
1342 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1343 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1344 GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1345
1346 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1347 f4_(t.f4_) {}
1348
1349 template <GTEST_5_TYPENAMES_(U)>
1350 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1351 f3_(t.f3_), f4_(t.f4_) {}
1352
1353 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1354
1355 template <GTEST_5_TYPENAMES_(U)>
1356 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1357 return CopyFrom(t);
1358 }
1359
1360 GTEST_DECLARE_TUPLE_AS_FRIEND_
1361
1362 template <GTEST_5_TYPENAMES_(U)>
1363 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1364 f0_ = t.f0_;
1365 f1_ = t.f1_;
1366 f2_ = t.f2_;
1367 f3_ = t.f3_;
1368 f4_ = t.f4_;
1369 return *this;
1370 }
1371
1372 T0 f0_;
1373 T1 f1_;
1374 T2 f2_;
1375 T3 f3_;
1376 T4 f4_;
1377};
1378
1379template <GTEST_6_TYPENAMES_(T)>
1380class GTEST_6_TUPLE_(T) {
1381 public:
1382 template <int k> friend class gtest_internal::Get;
1383
1384 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1385
1386 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1387 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1388 GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1389 f5_(f5) {}
1390
1391 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1392 f4_(t.f4_), f5_(t.f5_) {}
1393
1394 template <GTEST_6_TYPENAMES_(U)>
1395 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1396 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1397
1398 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1399
1400 template <GTEST_6_TYPENAMES_(U)>
1401 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1402 return CopyFrom(t);
1403 }
1404
1405 GTEST_DECLARE_TUPLE_AS_FRIEND_
1406
1407 template <GTEST_6_TYPENAMES_(U)>
1408 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1409 f0_ = t.f0_;
1410 f1_ = t.f1_;
1411 f2_ = t.f2_;
1412 f3_ = t.f3_;
1413 f4_ = t.f4_;
1414 f5_ = t.f5_;
1415 return *this;
1416 }
1417
1418 T0 f0_;
1419 T1 f1_;
1420 T2 f2_;
1421 T3 f3_;
1422 T4 f4_;
1423 T5 f5_;
1424};
1425
1426template <GTEST_7_TYPENAMES_(T)>
1427class GTEST_7_TUPLE_(T) {
1428 public:
1429 template <int k> friend class gtest_internal::Get;
1430
1431 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1432
1433 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1434 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1435 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1436 f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1437
1438 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1439 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1440
1441 template <GTEST_7_TYPENAMES_(U)>
1442 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1443 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1444
1445 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1446
1447 template <GTEST_7_TYPENAMES_(U)>
1448 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1449 return CopyFrom(t);
1450 }
1451
1452 GTEST_DECLARE_TUPLE_AS_FRIEND_
1453
1454 template <GTEST_7_TYPENAMES_(U)>
1455 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1456 f0_ = t.f0_;
1457 f1_ = t.f1_;
1458 f2_ = t.f2_;
1459 f3_ = t.f3_;
1460 f4_ = t.f4_;
1461 f5_ = t.f5_;
1462 f6_ = t.f6_;
1463 return *this;
1464 }
1465
1466 T0 f0_;
1467 T1 f1_;
1468 T2 f2_;
1469 T3 f3_;
1470 T4 f4_;
1471 T5 f5_;
1472 T6 f6_;
1473};
1474
1475template <GTEST_8_TYPENAMES_(T)>
1476class GTEST_8_TUPLE_(T) {
1477 public:
1478 template <int k> friend class gtest_internal::Get;
1479
1480 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1481
1482 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1483 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1484 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1485 GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1486 f5_(f5), f6_(f6), f7_(f7) {}
1487
1488 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1489 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1490
1491 template <GTEST_8_TYPENAMES_(U)>
1492 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1493 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1494
1495 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1496
1497 template <GTEST_8_TYPENAMES_(U)>
1498 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1499 return CopyFrom(t);
1500 }
1501
1502 GTEST_DECLARE_TUPLE_AS_FRIEND_
1503
1504 template <GTEST_8_TYPENAMES_(U)>
1505 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1506 f0_ = t.f0_;
1507 f1_ = t.f1_;
1508 f2_ = t.f2_;
1509 f3_ = t.f3_;
1510 f4_ = t.f4_;
1511 f5_ = t.f5_;
1512 f6_ = t.f6_;
1513 f7_ = t.f7_;
1514 return *this;
1515 }
1516
1517 T0 f0_;
1518 T1 f1_;
1519 T2 f2_;
1520 T3 f3_;
1521 T4 f4_;
1522 T5 f5_;
1523 T6 f6_;
1524 T7 f7_;
1525};
1526
1527template <GTEST_9_TYPENAMES_(T)>
1528class GTEST_9_TUPLE_(T) {
1529 public:
1530 template <int k> friend class gtest_internal::Get;
1531
1532 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1533
1534 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1535 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1536 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1537 GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1538 f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1539
1540 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1541 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1542
1543 template <GTEST_9_TYPENAMES_(U)>
1544 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1545 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1546
1547 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1548
1549 template <GTEST_9_TYPENAMES_(U)>
1550 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1551 return CopyFrom(t);
1552 }
1553
1554 GTEST_DECLARE_TUPLE_AS_FRIEND_
1555
1556 template <GTEST_9_TYPENAMES_(U)>
1557 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1558 f0_ = t.f0_;
1559 f1_ = t.f1_;
1560 f2_ = t.f2_;
1561 f3_ = t.f3_;
1562 f4_ = t.f4_;
1563 f5_ = t.f5_;
1564 f6_ = t.f6_;
1565 f7_ = t.f7_;
1566 f8_ = t.f8_;
1567 return *this;
1568 }
1569
1570 T0 f0_;
1571 T1 f1_;
1572 T2 f2_;
1573 T3 f3_;
1574 T4 f4_;
1575 T5 f5_;
1576 T6 f6_;
1577 T7 f7_;
1578 T8 f8_;
1579};
1580
1581template <GTEST_10_TYPENAMES_(T)>
1582class tuple {
1583 public:
1584 template <int k> friend class gtest_internal::Get;
1585
1586 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1587 f9_() {}
1588
1589 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1590 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1591 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1592 GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1593 f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1594
1595 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1596 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1597
1598 template <GTEST_10_TYPENAMES_(U)>
1599 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1600 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1601 f9_(t.f9_) {}
1602
1603 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1604
1605 template <GTEST_10_TYPENAMES_(U)>
1606 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1607 return CopyFrom(t);
1608 }
1609
1610 GTEST_DECLARE_TUPLE_AS_FRIEND_
1611
1612 template <GTEST_10_TYPENAMES_(U)>
1613 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1614 f0_ = t.f0_;
1615 f1_ = t.f1_;
1616 f2_ = t.f2_;
1617 f3_ = t.f3_;
1618 f4_ = t.f4_;
1619 f5_ = t.f5_;
1620 f6_ = t.f6_;
1621 f7_ = t.f7_;
1622 f8_ = t.f8_;
1623 f9_ = t.f9_;
1624 return *this;
1625 }
1626
1627 T0 f0_;
1628 T1 f1_;
1629 T2 f2_;
1630 T3 f3_;
1631 T4 f4_;
1632 T5 f5_;
1633 T6 f6_;
1634 T7 f7_;
1635 T8 f8_;
1636 T9 f9_;
1637};
1638
1639// 6.1.3.2 Tuple creation functions.
1640
1641// Known limitations: we don't support passing an
1642// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
1643// implement tie().
1644
1645inline tuple<> make_tuple() { return tuple<>(); }
1646
1647template <GTEST_1_TYPENAMES_(T)>
1648inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1649 return GTEST_1_TUPLE_(T)(f0);
1650}
1651
1652template <GTEST_2_TYPENAMES_(T)>
1653inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1654 return GTEST_2_TUPLE_(T)(f0, f1);
1655}
1656
1657template <GTEST_3_TYPENAMES_(T)>
1658inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1659 return GTEST_3_TUPLE_(T)(f0, f1, f2);
1660}
1661
1662template <GTEST_4_TYPENAMES_(T)>
1663inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1664 const T3& f3) {
1665 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1666}
1667
1668template <GTEST_5_TYPENAMES_(T)>
1669inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1670 const T3& f3, const T4& f4) {
1671 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1672}
1673
1674template <GTEST_6_TYPENAMES_(T)>
1675inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1676 const T3& f3, const T4& f4, const T5& f5) {
1677 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1678}
1679
1680template <GTEST_7_TYPENAMES_(T)>
1681inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1682 const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1683 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1684}
1685
1686template <GTEST_8_TYPENAMES_(T)>
1687inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1688 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1689 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1690}
1691
1692template <GTEST_9_TYPENAMES_(T)>
1693inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1694 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1695 const T8& f8) {
1696 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1697}
1698
1699template <GTEST_10_TYPENAMES_(T)>
1700inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1701 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1702 const T8& f8, const T9& f9) {
1703 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1704}
1705
1706// 6.1.3.3 Tuple helper classes.
1707
1708template <typename Tuple> struct tuple_size;
1709
1710template <GTEST_0_TYPENAMES_(T)>
1711struct tuple_size<GTEST_0_TUPLE_(T) > {
1712 static const int value = 0;
1713};
1714
1715template <GTEST_1_TYPENAMES_(T)>
1716struct tuple_size<GTEST_1_TUPLE_(T) > {
1717 static const int value = 1;
1718};
1719
1720template <GTEST_2_TYPENAMES_(T)>
1721struct tuple_size<GTEST_2_TUPLE_(T) > {
1722 static const int value = 2;
1723};
1724
1725template <GTEST_3_TYPENAMES_(T)>
1726struct tuple_size<GTEST_3_TUPLE_(T) > {
1727 static const int value = 3;
1728};
1729
1730template <GTEST_4_TYPENAMES_(T)>
1731struct tuple_size<GTEST_4_TUPLE_(T) > {
1732 static const int value = 4;
1733};
1734
1735template <GTEST_5_TYPENAMES_(T)>
1736struct tuple_size<GTEST_5_TUPLE_(T) > {
1737 static const int value = 5;
1738};
1739
1740template <GTEST_6_TYPENAMES_(T)>
1741struct tuple_size<GTEST_6_TUPLE_(T) > {
1742 static const int value = 6;
1743};
1744
1745template <GTEST_7_TYPENAMES_(T)>
1746struct tuple_size<GTEST_7_TUPLE_(T) > {
1747 static const int value = 7;
1748};
1749
1750template <GTEST_8_TYPENAMES_(T)>
1751struct tuple_size<GTEST_8_TUPLE_(T) > {
1752 static const int value = 8;
1753};
1754
1755template <GTEST_9_TYPENAMES_(T)>
1756struct tuple_size<GTEST_9_TUPLE_(T) > {
1757 static const int value = 9;
1758};
1759
1760template <GTEST_10_TYPENAMES_(T)>
1761struct tuple_size<GTEST_10_TUPLE_(T) > {
1762 static const int value = 10;
1763};
1764
1765template <int k, class Tuple>
1766struct tuple_element {
1767 typedef typename gtest_internal::TupleElement<
1768 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1769};
1770
1771#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1772
1773// 6.1.3.4 Element access.
1774
1775namespace gtest_internal {
1776
1777template <>
1778class Get<0> {
1779 public:
1780 template <class Tuple>
1781 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1782 Field(Tuple& t) { return t.f0_; } // NOLINT
1783
1784 template <class Tuple>
1785 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1786 ConstField(const Tuple& t) { return t.f0_; }
1787};
1788
1789template <>
1790class Get<1> {
1791 public:
1792 template <class Tuple>
1793 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1794 Field(Tuple& t) { return t.f1_; } // NOLINT
1795
1796 template <class Tuple>
1797 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1798 ConstField(const Tuple& t) { return t.f1_; }
1799};
1800
1801template <>
1802class Get<2> {
1803 public:
1804 template <class Tuple>
1805 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1806 Field(Tuple& t) { return t.f2_; } // NOLINT
1807
1808 template <class Tuple>
1809 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1810 ConstField(const Tuple& t) { return t.f2_; }
1811};
1812
1813template <>
1814class Get<3> {
1815 public:
1816 template <class Tuple>
1817 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1818 Field(Tuple& t) { return t.f3_; } // NOLINT
1819
1820 template <class Tuple>
1821 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1822 ConstField(const Tuple& t) { return t.f3_; }
1823};
1824
1825template <>
1826class Get<4> {
1827 public:
1828 template <class Tuple>
1829 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1830 Field(Tuple& t) { return t.f4_; } // NOLINT
1831
1832 template <class Tuple>
1833 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1834 ConstField(const Tuple& t) { return t.f4_; }
1835};
1836
1837template <>
1838class Get<5> {
1839 public:
1840 template <class Tuple>
1841 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1842 Field(Tuple& t) { return t.f5_; } // NOLINT
1843
1844 template <class Tuple>
1845 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1846 ConstField(const Tuple& t) { return t.f5_; }
1847};
1848
1849template <>
1850class Get<6> {
1851 public:
1852 template <class Tuple>
1853 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1854 Field(Tuple& t) { return t.f6_; } // NOLINT
1855
1856 template <class Tuple>
1857 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1858 ConstField(const Tuple& t) { return t.f6_; }
1859};
1860
1861template <>
1862class Get<7> {
1863 public:
1864 template <class Tuple>
1865 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1866 Field(Tuple& t) { return t.f7_; } // NOLINT
1867
1868 template <class Tuple>
1869 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1870 ConstField(const Tuple& t) { return t.f7_; }
1871};
1872
1873template <>
1874class Get<8> {
1875 public:
1876 template <class Tuple>
1877 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1878 Field(Tuple& t) { return t.f8_; } // NOLINT
1879
1880 template <class Tuple>
1881 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1882 ConstField(const Tuple& t) { return t.f8_; }
1883};
1884
1885template <>
1886class Get<9> {
1887 public:
1888 template <class Tuple>
1889 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1890 Field(Tuple& t) { return t.f9_; } // NOLINT
1891
1892 template <class Tuple>
1893 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1894 ConstField(const Tuple& t) { return t.f9_; }
1895};
1896
1897} // namespace gtest_internal
1898
1899template <int k, GTEST_10_TYPENAMES_(T)>
1900GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1901get(GTEST_10_TUPLE_(T)& t) {
1902 return gtest_internal::Get<k>::Field(t);
1903}
1904
1905template <int k, GTEST_10_TYPENAMES_(T)>
1906GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1907get(const GTEST_10_TUPLE_(T)& t) {
1908 return gtest_internal::Get<k>::ConstField(t);
1909}
1910
1911// 6.1.3.5 Relational operators
1912
1913// We only implement == and !=, as we don't have a need for the rest yet.
1914
1915namespace gtest_internal {
1916
1917// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1918// first k fields of t1 equals the first k fields of t2.
1919// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1920// k1 != k2.
1921template <int kSize1, int kSize2>
1922struct SameSizeTuplePrefixComparator;
1923
1924template <>
1925struct SameSizeTuplePrefixComparator<0, 0> {
1926 template <class Tuple1, class Tuple2>
1927 static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1928 return true;
1929 }
1930};
1931
1932template <int k>
1933struct SameSizeTuplePrefixComparator<k, k> {
1934 template <class Tuple1, class Tuple2>
1935 static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1936 return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1937 ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1938 }
1939};
1940
1941} // namespace gtest_internal
1942
1943template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1944inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1945 const GTEST_10_TUPLE_(U)& u) {
1946 return gtest_internal::SameSizeTuplePrefixComparator<
1947 tuple_size<GTEST_10_TUPLE_(T) >::value,
1948 tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1949}
1950
1951template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1952inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1953 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1954
1955// 6.1.4 Pairs.
1956// Unimplemented.
1957
1958} // namespace tr1
1959} // namespace std
1960
1961#undef GTEST_0_TUPLE_
1962#undef GTEST_1_TUPLE_
1963#undef GTEST_2_TUPLE_
1964#undef GTEST_3_TUPLE_
1965#undef GTEST_4_TUPLE_
1966#undef GTEST_5_TUPLE_
1967#undef GTEST_6_TUPLE_
1968#undef GTEST_7_TUPLE_
1969#undef GTEST_8_TUPLE_
1970#undef GTEST_9_TUPLE_
1971#undef GTEST_10_TUPLE_
1972
1973#undef GTEST_0_TYPENAMES_
1974#undef GTEST_1_TYPENAMES_
1975#undef GTEST_2_TYPENAMES_
1976#undef GTEST_3_TYPENAMES_
1977#undef GTEST_4_TYPENAMES_
1978#undef GTEST_5_TYPENAMES_
1979#undef GTEST_6_TYPENAMES_
1980#undef GTEST_7_TYPENAMES_
1981#undef GTEST_8_TYPENAMES_
1982#undef GTEST_9_TYPENAMES_
1983#undef GTEST_10_TYPENAMES_
1984
1985#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1986#undef GTEST_BY_REF_
1987#undef GTEST_ADD_REF_
1988#undef GTEST_TUPLE_ELEMENT_
1989
1990#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
7c673cae
FG
1991# elif GTEST_OS_SYMBIAN
1992
1993// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1994// use STLport's tuple implementation, which unfortunately doesn't
1995// work as the copy of STLport distributed with Symbian is incomplete.
1996// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1997// use its own tuple implementation.
1998# ifdef BOOST_HAS_TR1_TUPLE
1999# undef BOOST_HAS_TR1_TUPLE
2000# endif // BOOST_HAS_TR1_TUPLE
2001
2002// This prevents <boost/tr1/detail/config.hpp>, which defines
2003// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
2004# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
2005# include <tuple> // IWYU pragma: export // NOLINT
2006
2007# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
2008// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
2009// not conform to the TR1 spec, which requires the header to be <tuple>.
2010
2011# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2012// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
2013// which is #included by <tr1/tuple>, to not compile when RTTI is
2014// disabled. _TR1_FUNCTIONAL is the header guard for
f67539c2 2015// <tr1/functional>. Hence the following #define is used to prevent
7c673cae
FG
2016// <tr1/functional> from being included.
2017# define _TR1_FUNCTIONAL 1
2018# include <tr1/tuple>
2019# undef _TR1_FUNCTIONAL // Allows the user to #include
f67539c2 2020 // <tr1/functional> if they choose to.
7c673cae
FG
2021# else
2022# include <tr1/tuple> // NOLINT
2023# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2024
f67539c2
TL
2025// VS 2010 now has tr1 support.
2026# elif _MSC_VER >= 1600
7c673cae 2027# include <tuple> // IWYU pragma: export // NOLINT
f67539c2
TL
2028
2029# else // GTEST_USE_OWN_TR1_TUPLE
2030# include <tr1/tuple> // IWYU pragma: export // NOLINT
7c673cae
FG
2031# endif // GTEST_USE_OWN_TR1_TUPLE
2032
2033#endif // GTEST_HAS_TR1_TUPLE
2034
2035// Determines whether clone(2) is supported.
2036// Usually it will only be available on Linux, excluding
2037// Linux on the Itanium architecture.
2038// Also see http://linux.die.net/man/2/clone.
2039#ifndef GTEST_HAS_CLONE
2040// The user didn't tell us, so we need to figure it out.
2041
2042# if GTEST_OS_LINUX && !defined(__ia64__)
2043# if GTEST_OS_LINUX_ANDROID
f67539c2
TL
2044// On Android, clone() became available at different API levels for each 32-bit
2045// architecture.
2046# if defined(__LP64__) || \
2047 (defined(__arm__) && __ANDROID_API__ >= 9) || \
2048 (defined(__mips__) && __ANDROID_API__ >= 12) || \
2049 (defined(__i386__) && __ANDROID_API__ >= 17)
7c673cae
FG
2050# define GTEST_HAS_CLONE 1
2051# else
2052# define GTEST_HAS_CLONE 0
2053# endif
2054# else
2055# define GTEST_HAS_CLONE 1
2056# endif
2057# else
2058# define GTEST_HAS_CLONE 0
2059# endif // GTEST_OS_LINUX && !defined(__ia64__)
2060
2061#endif // GTEST_HAS_CLONE
2062
2063// Determines whether to support stream redirection. This is used to test
2064// output correctness and to implement death tests.
2065#ifndef GTEST_HAS_STREAM_REDIRECTION
2066// By default, we assume that stream redirection is supported on all
2067// platforms except known mobile ones.
2068# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
2069 GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2070# define GTEST_HAS_STREAM_REDIRECTION 0
2071# else
2072# define GTEST_HAS_STREAM_REDIRECTION 1
2073# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
2074#endif // GTEST_HAS_STREAM_REDIRECTION
2075
2076// Determines whether to support death tests.
2077// Google Test does not support death tests for VC 7.1 and earlier as
2078// abort() in a VC 7.1 application compiled as GUI in debug config
2079// pops up a dialog window that cannot be suppressed programmatically.
f67539c2
TL
2080#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
2081 (GTEST_OS_MAC && !GTEST_OS_IOS) || \
2082 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
7c673cae 2083 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
f67539c2
TL
2084 GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \
2085 GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
7c673cae 2086# define GTEST_HAS_DEATH_TEST 1
7c673cae
FG
2087#endif
2088
7c673cae
FG
2089// Determines whether to support type-driven tests.
2090
2091// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
2092// Sun Pro CC, IBM Visual Age, and HP aCC support.
2093#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
2094 defined(__IBMCPP__) || defined(__HP_aCC)
2095# define GTEST_HAS_TYPED_TEST 1
2096# define GTEST_HAS_TYPED_TEST_P 1
2097#endif
2098
2099// Determines whether to support Combine(). This only makes sense when
2100// value-parameterized tests are enabled. The implementation doesn't
2101// work on Sun Studio since it doesn't understand templated conversion
2102// operators.
f67539c2 2103#if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
7c673cae
FG
2104# define GTEST_HAS_COMBINE 1
2105#endif
2106
2107// Determines whether the system compiler uses UTF-16 for encoding wide strings.
2108#define GTEST_WIDE_STRING_USES_UTF16_ \
2109 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
2110
2111// Determines whether test results can be streamed to a socket.
2112#if GTEST_OS_LINUX
2113# define GTEST_CAN_STREAM_RESULTS_ 1
2114#endif
2115
2116// Defines some utility macros.
2117
2118// The GNU compiler emits a warning if nested "if" statements are followed by
2119// an "else" statement and braces are not used to explicitly disambiguate the
2120// "else" binding. This leads to problems with code like:
2121//
2122// if (gate)
2123// ASSERT_*(condition) << "Some message";
2124//
2125// The "switch (0) case 0:" idiom is used to suppress this.
2126#ifdef __INTEL_COMPILER
2127# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
2128#else
2129# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
2130#endif
2131
2132// Use this annotation at the end of a struct/class definition to
2133// prevent the compiler from optimizing away instances that are never
2134// used. This is useful when all interesting logic happens inside the
2135// c'tor and / or d'tor. Example:
2136//
2137// struct Foo {
2138// Foo() { ... }
2139// } GTEST_ATTRIBUTE_UNUSED_;
2140//
2141// Also use it after a variable or parameter declaration to tell the
2142// compiler the variable/parameter does not have to be used.
2143#if defined(__GNUC__) && !defined(COMPILER_ICC)
2144# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2145#elif defined(__clang__)
2146# if __has_attribute(unused)
2147# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2148# endif
2149#endif
2150#ifndef GTEST_ATTRIBUTE_UNUSED_
2151# define GTEST_ATTRIBUTE_UNUSED_
2152#endif
2153
f67539c2
TL
2154#if GTEST_LANG_CXX11
2155# define GTEST_CXX11_EQUALS_DELETE_ = delete
2156#else // GTEST_LANG_CXX11
2157# define GTEST_CXX11_EQUALS_DELETE_
2158#endif // GTEST_LANG_CXX11
2159
2160// Use this annotation before a function that takes a printf format string.
2161#if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
2162# if defined(__MINGW_PRINTF_FORMAT)
2163// MinGW has two different printf implementations. Ensure the format macro
2164// matches the selected implementation. See
2165// https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.
2166# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
2167 __attribute__((__format__(__MINGW_PRINTF_FORMAT, string_index, \
2168 first_to_check)))
2169# else
2170# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
2171 __attribute__((__format__(__printf__, string_index, first_to_check)))
2172# endif
2173#else
2174# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
2175#endif
2176
2177
7c673cae
FG
2178// A macro to disallow operator=
2179// This should be used in the private: declarations for a class.
f67539c2
TL
2180#define GTEST_DISALLOW_ASSIGN_(type) \
2181 void operator=(type const &) GTEST_CXX11_EQUALS_DELETE_
7c673cae
FG
2182
2183// A macro to disallow copy constructor and operator=
2184// This should be used in the private: declarations for a class.
f67539c2
TL
2185#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
2186 type(type const &) GTEST_CXX11_EQUALS_DELETE_; \
7c673cae
FG
2187 GTEST_DISALLOW_ASSIGN_(type)
2188
2189// Tell the compiler to warn about unused return values for functions declared
2190// with this macro. The macro should be used on function declarations
2191// following the argument list:
2192//
2193// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
2194#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
2195# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
2196#else
2197# define GTEST_MUST_USE_RESULT_
2198#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
2199
2200// MS C++ compiler emits warning when a conditional expression is compile time
2201// constant. In some contexts this warning is false positive and needs to be
2202// suppressed. Use the following two macros in such cases:
2203//
2204// GTEST_INTENTIONAL_CONST_COND_PUSH_()
2205// while (true) {
2206// GTEST_INTENTIONAL_CONST_COND_POP_()
2207// }
2208# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
2209 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
2210# define GTEST_INTENTIONAL_CONST_COND_POP_() \
2211 GTEST_DISABLE_MSC_WARNINGS_POP_()
2212
2213// Determine whether the compiler supports Microsoft's Structured Exception
2214// Handling. This is supported by several Windows compilers but generally
2215// does not exist on any other system.
2216#ifndef GTEST_HAS_SEH
2217// The user didn't tell us, so we need to figure it out.
2218
2219# if defined(_MSC_VER) || defined(__BORLANDC__)
2220// These two compilers are known to support SEH.
2221# define GTEST_HAS_SEH 1
2222# else
2223// Assume no SEH.
2224# define GTEST_HAS_SEH 0
2225# endif
2226
2227#define GTEST_IS_THREADSAFE \
f67539c2 2228 (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
7c673cae
FG
2229 || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
2230 || GTEST_HAS_PTHREAD)
2231
2232#endif // GTEST_HAS_SEH
2233
f67539c2
TL
2234// GTEST_API_ qualifies all symbols that must be exported. The definitions below
2235// are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
2236// gtest/internal/custom/gtest-port.h
2237#ifndef GTEST_API_
7c673cae 2238
f67539c2 2239#ifdef _MSC_VER
7c673cae
FG
2240# if GTEST_LINKED_AS_SHARED_LIBRARY
2241# define GTEST_API_ __declspec(dllimport)
2242# elif GTEST_CREATE_SHARED_LIBRARY
2243# define GTEST_API_ __declspec(dllexport)
2244# endif
f67539c2
TL
2245#elif __GNUC__ >= 4 || defined(__clang__)
2246# define GTEST_API_ __attribute__((visibility ("default")))
7c673cae
FG
2247#endif // _MSC_VER
2248
f67539c2
TL
2249#endif // GTEST_API_
2250
7c673cae
FG
2251#ifndef GTEST_API_
2252# define GTEST_API_
f67539c2
TL
2253#endif // GTEST_API_
2254
2255#ifndef GTEST_DEFAULT_DEATH_TEST_STYLE
2256# define GTEST_DEFAULT_DEATH_TEST_STYLE "fast"
2257#endif // GTEST_DEFAULT_DEATH_TEST_STYLE
7c673cae
FG
2258
2259#ifdef __GNUC__
2260// Ask the compiler to never inline a given function.
2261# define GTEST_NO_INLINE_ __attribute__((noinline))
2262#else
2263# define GTEST_NO_INLINE_
2264#endif
2265
2266// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
f67539c2
TL
2267#if !defined(GTEST_HAS_CXXABI_H_)
2268# if defined(__GLIBCXX__) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))
2269# define GTEST_HAS_CXXABI_H_ 1
2270# else
2271# define GTEST_HAS_CXXABI_H_ 0
2272# endif
7c673cae
FG
2273#endif
2274
2275// A function level attribute to disable checking for use of uninitialized
2276// memory when built with MemorySanitizer.
2277#if defined(__clang__)
2278# if __has_feature(memory_sanitizer)
2279# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
2280 __attribute__((no_sanitize_memory))
2281# else
2282# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2283# endif // __has_feature(memory_sanitizer)
2284#else
2285# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2286#endif // __clang__
2287
2288// A function level attribute to disable AddressSanitizer instrumentation.
2289#if defined(__clang__)
2290# if __has_feature(address_sanitizer)
2291# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
2292 __attribute__((no_sanitize_address))
2293# else
2294# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2295# endif // __has_feature(address_sanitizer)
2296#else
2297# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2298#endif // __clang__
2299
2300// A function level attribute to disable ThreadSanitizer instrumentation.
2301#if defined(__clang__)
2302# if __has_feature(thread_sanitizer)
2303# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
2304 __attribute__((no_sanitize_thread))
2305# else
2306# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2307# endif // __has_feature(thread_sanitizer)
2308#else
2309# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2310#endif // __clang__
2311
2312namespace testing {
2313
2314class Message;
2315
2316#if defined(GTEST_TUPLE_NAMESPACE_)
2317// Import tuple and friends into the ::testing namespace.
2318// It is part of our interface, having them in ::testing allows us to change
2319// their types as needed.
2320using GTEST_TUPLE_NAMESPACE_::get;
2321using GTEST_TUPLE_NAMESPACE_::make_tuple;
2322using GTEST_TUPLE_NAMESPACE_::tuple;
2323using GTEST_TUPLE_NAMESPACE_::tuple_size;
2324using GTEST_TUPLE_NAMESPACE_::tuple_element;
2325#endif // defined(GTEST_TUPLE_NAMESPACE_)
2326
2327namespace internal {
2328
2329// A secret type that Google Test users don't know about. It has no
2330// definition on purpose. Therefore it's impossible to create a
2331// Secret object, which is what we want.
2332class Secret;
2333
2334// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
2335// expression is true. For example, you could use it to verify the
2336// size of a static array:
2337//
2338// GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
2339// names_incorrect_size);
2340//
2341// or to make sure a struct is smaller than a certain size:
2342//
2343// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
2344//
2345// The second argument to the macro is the name of the variable. If
2346// the expression is false, most compilers will issue a warning/error
2347// containing the name of the variable.
2348
2349#if GTEST_LANG_CXX11
2350# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
2351#else // !GTEST_LANG_CXX11
2352template <bool>
2353 struct CompileAssert {
2354};
2355
2356# define GTEST_COMPILE_ASSERT_(expr, msg) \
2357 typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
2358 msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
2359#endif // !GTEST_LANG_CXX11
2360
2361// Implementation details of GTEST_COMPILE_ASSERT_:
2362//
2363// (In C++11, we simply use static_assert instead of the following)
2364//
2365// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
2366// elements (and thus is invalid) when the expression is false.
2367//
2368// - The simpler definition
2369//
2370// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
2371//
2372// does not work, as gcc supports variable-length arrays whose sizes
2373// are determined at run-time (this is gcc's extension and not part
2374// of the C++ standard). As a result, gcc fails to reject the
2375// following code with the simple definition:
2376//
2377// int foo;
2378// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
2379// // not a compile-time constant.
2380//
2381// - By using the type CompileAssert<(bool(expr))>, we ensures that
2382// expr is a compile-time constant. (Template arguments must be
2383// determined at compile-time.)
2384//
2385// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
2386// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
2387//
2388// CompileAssert<bool(expr)>
2389//
2390// instead, these compilers will refuse to compile
2391//
2392// GTEST_COMPILE_ASSERT_(5 > 0, some_message);
2393//
2394// (They seem to think the ">" in "5 > 0" marks the end of the
2395// template argument list.)
2396//
2397// - The array size is (bool(expr) ? 1 : -1), instead of simply
2398//
2399// ((expr) ? 1 : -1).
2400//
2401// This is to avoid running into a bug in MS VC 7.1, which
2402// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
2403
2404// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
2405//
2406// This template is declared, but intentionally undefined.
2407template <typename T1, typename T2>
2408struct StaticAssertTypeEqHelper;
2409
2410template <typename T>
2411struct StaticAssertTypeEqHelper<T, T> {
2412 enum { value = true };
2413};
2414
f67539c2
TL
2415// Same as std::is_same<>.
2416template <typename T, typename U>
2417struct IsSame {
2418 enum { value = false };
2419};
2420template <typename T>
2421struct IsSame<T, T> {
2422 enum { value = true };
2423};
2424
7c673cae
FG
2425// Evaluates to the number of elements in 'array'.
2426#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
2427
2428#if GTEST_HAS_GLOBAL_STRING
2429typedef ::string string;
2430#else
2431typedef ::std::string string;
2432#endif // GTEST_HAS_GLOBAL_STRING
2433
2434#if GTEST_HAS_GLOBAL_WSTRING
2435typedef ::wstring wstring;
2436#elif GTEST_HAS_STD_WSTRING
2437typedef ::std::wstring wstring;
2438#endif // GTEST_HAS_GLOBAL_WSTRING
2439
2440// A helper for suppressing warnings on constant condition. It just
2441// returns 'condition'.
2442GTEST_API_ bool IsTrue(bool condition);
2443
2444// Defines scoped_ptr.
2445
1e59de90
TL
2446// RocksDB: use unique_ptr to work around some clang-analyze false reports
2447template <typename T>
2448using scoped_ptr = std::unique_ptr<T>;
2449/*
7c673cae
FG
2450// This implementation of scoped_ptr is PARTIAL - it only contains
2451// enough stuff to satisfy Google Test's need.
2452template <typename T>
2453class scoped_ptr {
2454 public:
2455 typedef T element_type;
2456
2457 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2458 ~scoped_ptr() { reset(); }
2459
2460 T& operator*() const { return *ptr_; }
2461 T* operator->() const { return ptr_; }
2462 T* get() const { return ptr_; }
2463
2464 T* release() {
2465 T* const ptr = ptr_;
2466 ptr_ = NULL;
2467 return ptr;
2468 }
2469
2470 void reset(T* p = NULL) {
2471 if (p != ptr_) {
2472 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
2473 delete ptr_;
2474 }
2475 ptr_ = p;
2476 }
2477 }
2478
2479 friend void swap(scoped_ptr& a, scoped_ptr& b) {
2480 using std::swap;
2481 swap(a.ptr_, b.ptr_);
2482 }
2483
2484 private:
2485 T* ptr_;
2486
2487 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2488};
1e59de90 2489*/
7c673cae
FG
2490
2491// Defines RE.
2492
f67539c2
TL
2493#if GTEST_USES_PCRE
2494// if used, PCRE is injected by custom/gtest-port.h
2495#elif GTEST_USES_POSIX_RE || GTEST_USES_SIMPLE_RE
2496
7c673cae
FG
2497// A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
2498// Regular Expression syntax.
2499class GTEST_API_ RE {
2500 public:
2501 // A copy constructor is required by the Standard to initialize object
2502 // references from r-values.
2503 RE(const RE& other) { Init(other.pattern()); }
2504
2505 // Constructs an RE from a string.
2506 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
2507
f67539c2 2508# if GTEST_HAS_GLOBAL_STRING
7c673cae
FG
2509
2510 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
2511
f67539c2 2512# endif // GTEST_HAS_GLOBAL_STRING
7c673cae
FG
2513
2514 RE(const char* regex) { Init(regex); } // NOLINT
2515 ~RE();
2516
2517 // Returns the string representation of the regex.
2518 const char* pattern() const { return pattern_; }
2519
2520 // FullMatch(str, re) returns true iff regular expression re matches
2521 // the entire str.
2522 // PartialMatch(str, re) returns true iff regular expression re
2523 // matches a substring of str (including str itself).
2524 //
f67539c2 2525 // FIXME: make FullMatch() and PartialMatch() work
7c673cae
FG
2526 // when str contains NUL characters.
2527 static bool FullMatch(const ::std::string& str, const RE& re) {
2528 return FullMatch(str.c_str(), re);
2529 }
2530 static bool PartialMatch(const ::std::string& str, const RE& re) {
2531 return PartialMatch(str.c_str(), re);
2532 }
2533
f67539c2 2534# if GTEST_HAS_GLOBAL_STRING
7c673cae
FG
2535
2536 static bool FullMatch(const ::string& str, const RE& re) {
2537 return FullMatch(str.c_str(), re);
2538 }
2539 static bool PartialMatch(const ::string& str, const RE& re) {
2540 return PartialMatch(str.c_str(), re);
2541 }
2542
f67539c2 2543# endif // GTEST_HAS_GLOBAL_STRING
7c673cae
FG
2544
2545 static bool FullMatch(const char* str, const RE& re);
2546 static bool PartialMatch(const char* str, const RE& re);
2547
2548 private:
2549 void Init(const char* regex);
2550
2551 // We use a const char* instead of an std::string, as Google Test used to be
f67539c2 2552 // used where std::string is not available. FIXME: change to
7c673cae
FG
2553 // std::string.
2554 const char* pattern_;
2555 bool is_valid_;
2556
f67539c2 2557# if GTEST_USES_POSIX_RE
7c673cae
FG
2558
2559 regex_t full_regex_; // For FullMatch().
2560 regex_t partial_regex_; // For PartialMatch().
2561
f67539c2 2562# else // GTEST_USES_SIMPLE_RE
7c673cae
FG
2563
2564 const char* full_pattern_; // For FullMatch();
2565
f67539c2 2566# endif
7c673cae
FG
2567
2568 GTEST_DISALLOW_ASSIGN_(RE);
2569};
2570
f67539c2
TL
2571#endif // GTEST_USES_PCRE
2572
7c673cae
FG
2573// Formats a source file path and a line number as they would appear
2574// in an error message from the compiler used to compile this code.
2575GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2576
2577// Formats a file location for compiler-independent XML output.
2578// Although this function is not platform dependent, we put it next to
2579// FormatFileLocation in order to contrast the two functions.
2580GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2581 int line);
2582
2583// Defines logging utilities:
2584// GTEST_LOG_(severity) - logs messages at the specified severity level. The
2585// message itself is streamed into the macro.
2586// LogToStderr() - directs all log messages to stderr.
2587// FlushInfoLog() - flushes informational log messages.
2588
2589enum GTestLogSeverity {
2590 GTEST_INFO,
2591 GTEST_WARNING,
2592 GTEST_ERROR,
2593 GTEST_FATAL
2594};
2595
2596// Formats log entry severity, provides a stream object for streaming the
2597// log message, and terminates the message with a newline when going out of
2598// scope.
2599class GTEST_API_ GTestLog {
2600 public:
2601 GTestLog(GTestLogSeverity severity, const char* file, int line);
2602
2603 // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2604 ~GTestLog();
2605
2606 ::std::ostream& GetStream() { return ::std::cerr; }
2607
2608 private:
2609 const GTestLogSeverity severity_;
2610
2611 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2612};
2613
f67539c2
TL
2614#if !defined(GTEST_LOG_)
2615
2616# define GTEST_LOG_(severity) \
7c673cae
FG
2617 ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2618 __FILE__, __LINE__).GetStream()
2619
2620inline void LogToStderr() {}
2621inline void FlushInfoLog() { fflush(NULL); }
2622
f67539c2
TL
2623#endif // !defined(GTEST_LOG_)
2624
2625#if !defined(GTEST_CHECK_)
7c673cae
FG
2626// INTERNAL IMPLEMENTATION - DO NOT USE.
2627//
2628// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2629// is not satisfied.
2630// Synopsys:
2631// GTEST_CHECK_(boolean_condition);
2632// or
2633// GTEST_CHECK_(boolean_condition) << "Additional message";
2634//
2635// This checks the condition and if the condition is not satisfied
2636// it prints message about the condition violation, including the
2637// condition itself, plus additional message streamed into it, if any,
2638// and then it aborts the program. It aborts the program irrespective of
2639// whether it is built in the debug mode or not.
f67539c2 2640# define GTEST_CHECK_(condition) \
7c673cae
FG
2641 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2642 if (::testing::internal::IsTrue(condition)) \
2643 ; \
2644 else \
2645 GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
f67539c2 2646#endif // !defined(GTEST_CHECK_)
7c673cae
FG
2647
2648// An all-mode assert to verify that the given POSIX-style function
2649// call returns 0 (indicating success). Known limitation: this
2650// doesn't expand to a balanced 'if' statement, so enclose the macro
2651// in {} if you need to use it as the only statement in an 'if'
2652// branch.
2653#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2654 if (const int gtest_error = (posix_call)) \
2655 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2656 << gtest_error
2657
f67539c2
TL
2658// Adds reference to a type if it is not a reference type,
2659// otherwise leaves it unchanged. This is the same as
2660// tr1::add_reference, which is not widely available yet.
2661template <typename T>
2662struct AddReference { typedef T& type; }; // NOLINT
2663template <typename T>
2664struct AddReference<T&> { typedef T& type; }; // NOLINT
2665
2666// A handy wrapper around AddReference that works when the argument T
2667// depends on template parameters.
2668#define GTEST_ADD_REFERENCE_(T) \
2669 typename ::testing::internal::AddReference<T>::type
2670
2671// Transforms "T" into "const T&" according to standard reference collapsing
2672// rules (this is only needed as a backport for C++98 compilers that do not
2673// support reference collapsing). Specifically, it transforms:
2674//
2675// char ==> const char&
2676// const char ==> const char&
2677// char& ==> char&
2678// const char& ==> const char&
2679//
2680// Note that the non-const reference will not have "const" added. This is
2681// standard, and necessary so that "T" can always bind to "const T&".
2682template <typename T>
2683struct ConstRef { typedef const T& type; };
2684template <typename T>
2685struct ConstRef<T&> { typedef T& type; };
2686
2687// The argument T must depend on some template parameters.
2688#define GTEST_REFERENCE_TO_CONST_(T) \
2689 typename ::testing::internal::ConstRef<T>::type
2690
7c673cae 2691#if GTEST_HAS_STD_MOVE_
f67539c2 2692using std::forward;
7c673cae 2693using std::move;
f67539c2
TL
2694
2695template <typename T>
2696struct RvalueRef {
2697 typedef T&& type;
2698};
7c673cae
FG
2699#else // GTEST_HAS_STD_MOVE_
2700template <typename T>
2701const T& move(const T& t) {
2702 return t;
2703}
f67539c2
TL
2704template <typename T>
2705GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
2706
2707template <typename T>
2708struct RvalueRef {
2709 typedef const T& type;
2710};
7c673cae
FG
2711#endif // GTEST_HAS_STD_MOVE_
2712
2713// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2714//
2715// Use ImplicitCast_ as a safe version of static_cast for upcasting in
2716// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2717// const Foo*). When you use ImplicitCast_, the compiler checks that
2718// the cast is safe. Such explicit ImplicitCast_s are necessary in
2719// surprisingly many situations where C++ demands an exact type match
2720// instead of an argument type convertable to a target type.
2721//
2722// The syntax for using ImplicitCast_ is the same as for static_cast:
2723//
2724// ImplicitCast_<ToType>(expr)
2725//
2726// ImplicitCast_ would have been part of the C++ standard library,
2727// but the proposal was submitted too late. It will probably make
2728// its way into the language in the future.
2729//
2730// This relatively ugly name is intentional. It prevents clashes with
2731// similar functions users may have (e.g., implicit_cast). The internal
2732// namespace alone is not enough because the function can be found by ADL.
2733template<typename To>
f67539c2 2734inline To ImplicitCast_(To x) { return x; }
7c673cae
FG
2735
2736// When you upcast (that is, cast a pointer from type Foo to type
2737// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2738// always succeed. When you downcast (that is, cast a pointer from
2739// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2740// how do you know the pointer is really of type SubclassOfFoo? It
2741// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
2742// when you downcast, you should use this macro. In debug mode, we
2743// use dynamic_cast<> to double-check the downcast is legal (we die
2744// if it's not). In normal mode, we do the efficient static_cast<>
2745// instead. Thus, it's important to test in debug mode to make sure
2746// the cast is legal!
2747// This is the only place in the code we should use dynamic_cast<>.
2748// In particular, you SHOULDN'T be using dynamic_cast<> in order to
2749// do RTTI (eg code like this:
2750// if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2751// if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2752// You should design the code some other way not to need this.
2753//
2754// This relatively ugly name is intentional. It prevents clashes with
2755// similar functions users may have (e.g., down_cast). The internal
2756// namespace alone is not enough because the function can be found by ADL.
2757template<typename To, typename From> // use like this: DownCast_<T*>(foo);
2758inline To DownCast_(From* f) { // so we only accept pointers
2759 // Ensures that To is a sub-type of From *. This test is here only
2760 // for compile-time type checking, and has no overhead in an
2761 // optimized build at run-time, as it will be optimized away
2762 // completely.
2763 GTEST_INTENTIONAL_CONST_COND_PUSH_()
2764 if (false) {
2765 GTEST_INTENTIONAL_CONST_COND_POP_()
2766 const To to = NULL;
2767 ::testing::internal::ImplicitCast_<From*>(to);
2768 }
2769
2770#if GTEST_HAS_RTTI
2771 // RTTI: debug mode only!
2772 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2773#endif
2774 return static_cast<To>(f);
2775}
2776
2777// Downcasts the pointer of type Base to Derived.
2778// Derived must be a subclass of Base. The parameter MUST
2779// point to a class of type Derived, not any subclass of it.
2780// When RTTI is available, the function performs a runtime
2781// check to enforce this.
2782template <class Derived, class Base>
2783Derived* CheckedDowncastToActualType(Base* base) {
2784#if GTEST_HAS_RTTI
2785 GTEST_CHECK_(typeid(*base) == typeid(Derived));
f67539c2
TL
2786#endif
2787
2788#if GTEST_HAS_DOWNCAST_
2789 return ::down_cast<Derived*>(base);
2790#elif GTEST_HAS_RTTI
7c673cae
FG
2791 return dynamic_cast<Derived*>(base); // NOLINT
2792#else
2793 return static_cast<Derived*>(base); // Poor man's downcast.
2794#endif
2795}
2796
2797#if GTEST_HAS_STREAM_REDIRECTION
2798
2799// Defines the stderr capturer:
2800// CaptureStdout - starts capturing stdout.
2801// GetCapturedStdout - stops capturing stdout and returns the captured string.
2802// CaptureStderr - starts capturing stderr.
2803// GetCapturedStderr - stops capturing stderr and returns the captured string.
2804//
2805GTEST_API_ void CaptureStdout();
2806GTEST_API_ std::string GetCapturedStdout();
2807GTEST_API_ void CaptureStderr();
2808GTEST_API_ std::string GetCapturedStderr();
2809
2810#endif // GTEST_HAS_STREAM_REDIRECTION
f67539c2
TL
2811// Returns the size (in bytes) of a file.
2812GTEST_API_ size_t GetFileSize(FILE* file);
7c673cae 2813
f67539c2
TL
2814// Reads the entire content of a file as a string.
2815GTEST_API_ std::string ReadEntireFile(FILE* file);
7c673cae 2816
f67539c2
TL
2817// All command line arguments.
2818GTEST_API_ std::vector<std::string> GetArgvs();
7c673cae 2819
f67539c2 2820#if GTEST_HAS_DEATH_TEST
7c673cae 2821
f67539c2
TL
2822std::vector<std::string> GetInjectableArgvs();
2823// Deprecated: pass the args vector by value instead.
2824void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
2825void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
2826#if GTEST_HAS_GLOBAL_STRING
2827void SetInjectableArgvs(const std::vector< ::string>& new_argvs);
2828#endif // GTEST_HAS_GLOBAL_STRING
2829void ClearInjectableArgvs();
7c673cae
FG
2830
2831#endif // GTEST_HAS_DEATH_TEST
2832
2833// Defines synchronization primitives.
2834#if GTEST_IS_THREADSAFE
2835# if GTEST_HAS_PTHREAD
2836// Sleeps for (roughly) n milliseconds. This function is only for testing
2837// Google Test's own constructs. Don't use it in user tests, either
2838// directly or indirectly.
2839inline void SleepMilliseconds(int n) {
2840 const timespec time = {
2841 0, // 0 seconds.
2842 n * 1000L * 1000L, // And n ms.
2843 };
2844 nanosleep(&time, NULL);
2845}
2846# endif // GTEST_HAS_PTHREAD
2847
f67539c2
TL
2848# if GTEST_HAS_NOTIFICATION_
2849// Notification has already been imported into the namespace.
2850// Nothing to do here.
2851
7c673cae
FG
2852# elif GTEST_HAS_PTHREAD
2853// Allows a controller thread to pause execution of newly created
2854// threads until notified. Instances of this class must be created
2855// and destroyed in the controller thread.
2856//
2857// This class is only for testing Google Test's own constructs. Do not
2858// use it in user tests, either directly or indirectly.
2859class Notification {
2860 public:
2861 Notification() : notified_(false) {
2862 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2863 }
2864 ~Notification() {
2865 pthread_mutex_destroy(&mutex_);
2866 }
2867
2868 // Notifies all threads created with this notification to start. Must
2869 // be called from the controller thread.
2870 void Notify() {
2871 pthread_mutex_lock(&mutex_);
2872 notified_ = true;
2873 pthread_mutex_unlock(&mutex_);
2874 }
2875
2876 // Blocks until the controller thread notifies. Must be called from a test
2877 // thread.
2878 void WaitForNotification() {
2879 for (;;) {
2880 pthread_mutex_lock(&mutex_);
2881 const bool notified = notified_;
2882 pthread_mutex_unlock(&mutex_);
2883 if (notified)
2884 break;
2885 SleepMilliseconds(10);
2886 }
2887 }
2888
2889 private:
2890 pthread_mutex_t mutex_;
2891 bool notified_;
2892
2893 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2894};
2895
2896# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
2897
2898GTEST_API_ void SleepMilliseconds(int n);
2899
2900// Provides leak-safe Windows kernel handle ownership.
2901// Used in death tests and in threading support.
2902class GTEST_API_ AutoHandle {
2903 public:
2904 // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
2905 // avoid including <windows.h> in this header file. Including <windows.h> is
2906 // undesirable because it defines a lot of symbols and macros that tend to
2907 // conflict with client code. This assumption is verified by
2908 // WindowsTypesTest.HANDLEIsVoidStar.
2909 typedef void* Handle;
2910 AutoHandle();
2911 explicit AutoHandle(Handle handle);
2912
2913 ~AutoHandle();
2914
2915 Handle Get() const;
2916 void Reset();
2917 void Reset(Handle handle);
2918
2919 private:
2920 // Returns true iff the handle is a valid handle object that can be closed.
2921 bool IsCloseable() const;
2922
2923 Handle handle_;
2924
2925 GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
2926};
2927
2928// Allows a controller thread to pause execution of newly created
2929// threads until notified. Instances of this class must be created
2930// and destroyed in the controller thread.
2931//
2932// This class is only for testing Google Test's own constructs. Do not
2933// use it in user tests, either directly or indirectly.
2934class GTEST_API_ Notification {
2935 public:
2936 Notification();
2937 void Notify();
2938 void WaitForNotification();
2939
2940 private:
2941 AutoHandle event_;
2942
2943 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2944};
f67539c2 2945# endif // GTEST_HAS_NOTIFICATION_
7c673cae
FG
2946
2947// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
2948// defined, but we don't want to use MinGW's pthreads implementation, which
2949// has conformance problems with some versions of the POSIX standard.
2950# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
2951
2952// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2953// Consequently, it cannot select a correct instantiation of ThreadWithParam
2954// in order to call its Run(). Introducing ThreadWithParamBase as a
2955// non-templated base class for ThreadWithParam allows us to bypass this
2956// problem.
2957class ThreadWithParamBase {
2958 public:
2959 virtual ~ThreadWithParamBase() {}
2960 virtual void Run() = 0;
2961};
2962
2963// pthread_create() accepts a pointer to a function type with the C linkage.
2964// According to the Standard (7.5/1), function types with different linkages
2965// are different even if they are otherwise identical. Some compilers (for
2966// example, SunStudio) treat them as different types. Since class methods
2967// cannot be defined with C-linkage we need to define a free C-function to
2968// pass into pthread_create().
2969extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2970 static_cast<ThreadWithParamBase*>(thread)->Run();
2971 return NULL;
2972}
2973
2974// Helper class for testing Google Test's multi-threading constructs.
2975// To use it, write:
2976//
2977// void ThreadFunc(int param) { /* Do things with param */ }
2978// Notification thread_can_start;
2979// ...
2980// // The thread_can_start parameter is optional; you can supply NULL.
2981// ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2982// thread_can_start.Notify();
2983//
2984// These classes are only for testing Google Test's own constructs. Do
2985// not use them in user tests, either directly or indirectly.
2986template <typename T>
2987class ThreadWithParam : public ThreadWithParamBase {
2988 public:
2989 typedef void UserThreadFunc(T);
2990
2991 ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
2992 : func_(func),
2993 param_(param),
2994 thread_can_start_(thread_can_start),
2995 finished_(false) {
2996 ThreadWithParamBase* const base = this;
2997 // The thread can be created only after all fields except thread_
2998 // have been initialized.
2999 GTEST_CHECK_POSIX_SUCCESS_(
3000 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
3001 }
3002 ~ThreadWithParam() { Join(); }
3003
3004 void Join() {
3005 if (!finished_) {
3006 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
3007 finished_ = true;
3008 }
3009 }
3010
3011 virtual void Run() {
3012 if (thread_can_start_ != NULL)
3013 thread_can_start_->WaitForNotification();
3014 func_(param_);
3015 }
3016
3017 private:
3018 UserThreadFunc* const func_; // User-supplied thread function.
3019 const T param_; // User-supplied parameter to the thread function.
3020 // When non-NULL, used to block execution until the controller thread
3021 // notifies.
3022 Notification* const thread_can_start_;
3023 bool finished_; // true iff we know that the thread function has finished.
3024 pthread_t thread_; // The native thread object.
3025
3026 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
3027};
f67539c2
TL
3028# endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
3029 // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3030
3031# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3032// Mutex and ThreadLocal have already been imported into the namespace.
3033// Nothing to do here.
7c673cae 3034
7c673cae
FG
3035# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
3036
3037// Mutex implements mutex on Windows platforms. It is used in conjunction
3038// with class MutexLock:
3039//
3040// Mutex mutex;
3041// ...
3042// MutexLock lock(&mutex); // Acquires the mutex and releases it at the
3043// // end of the current scope.
3044//
3045// A static Mutex *must* be defined or declared using one of the following
3046// macros:
3047// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
3048// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
3049//
3050// (A non-static Mutex is defined/declared in the usual way).
3051class GTEST_API_ Mutex {
3052 public:
3053 enum MutexType { kStatic = 0, kDynamic = 1 };
3054 // We rely on kStaticMutex being 0 as it is to what the linker initializes
3055 // type_ in static mutexes. critical_section_ will be initialized lazily
3056 // in ThreadSafeLazyInit().
3057 enum StaticConstructorSelector { kStaticMutex = 0 };
3058
3059 // This constructor intentionally does nothing. It relies on type_ being
3060 // statically initialized to 0 (effectively setting it to kStatic) and on
3061 // ThreadSafeLazyInit() to lazily initialize the rest of the members.
3062 explicit Mutex(StaticConstructorSelector /*dummy*/) {}
3063
3064 Mutex();
3065 ~Mutex();
3066
3067 void Lock();
3068
3069 void Unlock();
3070
3071 // Does nothing if the current thread holds the mutex. Otherwise, crashes
3072 // with high probability.
3073 void AssertHeld();
3074
3075 private:
3076 // Initializes owner_thread_id_ and critical_section_ in static mutexes.
3077 void ThreadSafeLazyInit();
3078
f67539c2 3079 // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,
7c673cae
FG
3080 // we assume that 0 is an invalid value for thread IDs.
3081 unsigned int owner_thread_id_;
3082
3083 // For static mutexes, we rely on these members being initialized to zeros
3084 // by the linker.
3085 MutexType type_;
3086 long critical_section_init_phase_; // NOLINT
f67539c2 3087 GTEST_CRITICAL_SECTION* critical_section_;
7c673cae
FG
3088
3089 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
3090};
3091
3092# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3093 extern ::testing::internal::Mutex mutex
3094
3095# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
3096 ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
3097
3098// We cannot name this class MutexLock because the ctor declaration would
3099// conflict with a macro named MutexLock, which is defined on some
3100// platforms. That macro is used as a defensive measure to prevent against
3101// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3102// "MutexLock l(&mu)". Hence the typedef trick below.
3103class GTestMutexLock {
3104 public:
3105 explicit GTestMutexLock(Mutex* mutex)
3106 : mutex_(mutex) { mutex_->Lock(); }
3107
3108 ~GTestMutexLock() { mutex_->Unlock(); }
3109
3110 private:
3111 Mutex* const mutex_;
3112
3113 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3114};
3115
3116typedef GTestMutexLock MutexLock;
3117
3118// Base class for ValueHolder<T>. Allows a caller to hold and delete a value
3119// without knowing its type.
3120class ThreadLocalValueHolderBase {
3121 public:
3122 virtual ~ThreadLocalValueHolderBase() {}
3123};
3124
3125// Provides a way for a thread to send notifications to a ThreadLocal
3126// regardless of its parameter type.
3127class ThreadLocalBase {
3128 public:
3129 // Creates a new ValueHolder<T> object holding a default value passed to
3130 // this ThreadLocal<T>'s constructor and returns it. It is the caller's
3131 // responsibility not to call this when the ThreadLocal<T> instance already
3132 // has a value on the current thread.
3133 virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
3134
3135 protected:
3136 ThreadLocalBase() {}
3137 virtual ~ThreadLocalBase() {}
3138
3139 private:
3140 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
3141};
3142
3143// Maps a thread to a set of ThreadLocals that have values instantiated on that
3144// thread and notifies them when the thread exits. A ThreadLocal instance is
3145// expected to persist until all threads it has values on have terminated.
3146class GTEST_API_ ThreadLocalRegistry {
3147 public:
3148 // Registers thread_local_instance as having value on the current thread.
3149 // Returns a value that can be used to identify the thread from other threads.
3150 static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
3151 const ThreadLocalBase* thread_local_instance);
3152
3153 // Invoked when a ThreadLocal instance is destroyed.
3154 static void OnThreadLocalDestroyed(
3155 const ThreadLocalBase* thread_local_instance);
3156};
3157
3158class GTEST_API_ ThreadWithParamBase {
3159 public:
3160 void Join();
3161
3162 protected:
3163 class Runnable {
3164 public:
3165 virtual ~Runnable() {}
3166 virtual void Run() = 0;
3167 };
3168
3169 ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
3170 virtual ~ThreadWithParamBase();
3171
3172 private:
3173 AutoHandle thread_;
3174};
3175
3176// Helper class for testing Google Test's multi-threading constructs.
3177template <typename T>
3178class ThreadWithParam : public ThreadWithParamBase {
3179 public:
3180 typedef void UserThreadFunc(T);
3181
3182 ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
3183 : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
3184 }
3185 virtual ~ThreadWithParam() {}
3186
3187 private:
3188 class RunnableImpl : public Runnable {
3189 public:
3190 RunnableImpl(UserThreadFunc* func, T param)
3191 : func_(func),
3192 param_(param) {
3193 }
3194 virtual ~RunnableImpl() {}
3195 virtual void Run() {
3196 func_(param_);
3197 }
3198
3199 private:
3200 UserThreadFunc* const func_;
3201 const T param_;
3202
3203 GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
3204 };
3205
3206 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
3207};
3208
3209// Implements thread-local storage on Windows systems.
3210//
3211// // Thread 1
3212// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
3213//
3214// // Thread 2
3215// tl.set(150); // Changes the value for thread 2 only.
3216// EXPECT_EQ(150, tl.get());
3217//
3218// // Thread 1
3219// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
3220// tl.set(200);
3221// EXPECT_EQ(200, tl.get());
3222//
3223// The template type argument T must have a public copy constructor.
3224// In addition, the default ThreadLocal constructor requires T to have
3225// a public default constructor.
3226//
3227// The users of a TheadLocal instance have to make sure that all but one
3228// threads (including the main one) using that instance have exited before
3229// destroying it. Otherwise, the per-thread objects managed for them by the
3230// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
3231//
3232// Google Test only uses global ThreadLocal objects. That means they
3233// will die after main() has returned. Therefore, no per-thread
3234// object managed by Google Test will be leaked as long as all threads
3235// using Google Test have exited when main() returns.
3236template <typename T>
3237class ThreadLocal : public ThreadLocalBase {
3238 public:
f67539c2
TL
3239 ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
3240 explicit ThreadLocal(const T& value)
3241 : default_factory_(new InstanceValueHolderFactory(value)) {}
7c673cae
FG
3242
3243 ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
3244
3245 T* pointer() { return GetOrCreateValue(); }
3246 const T* pointer() const { return GetOrCreateValue(); }
3247 const T& get() const { return *pointer(); }
3248 void set(const T& value) { *pointer() = value; }
3249
3250 private:
3251 // Holds a value of T. Can be deleted via its base class without the caller
3252 // knowing the type of T.
3253 class ValueHolder : public ThreadLocalValueHolderBase {
3254 public:
f67539c2 3255 ValueHolder() : value_() {}
7c673cae
FG
3256 explicit ValueHolder(const T& value) : value_(value) {}
3257
3258 T* pointer() { return &value_; }
3259
3260 private:
3261 T value_;
3262 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3263 };
3264
3265
3266 T* GetOrCreateValue() const {
3267 return static_cast<ValueHolder*>(
3268 ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
3269 }
3270
3271 virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
f67539c2 3272 return default_factory_->MakeNewHolder();
7c673cae
FG
3273 }
3274
f67539c2
TL
3275 class ValueHolderFactory {
3276 public:
3277 ValueHolderFactory() {}
3278 virtual ~ValueHolderFactory() {}
3279 virtual ValueHolder* MakeNewHolder() const = 0;
3280
3281 private:
3282 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3283 };
3284
3285 class DefaultValueHolderFactory : public ValueHolderFactory {
3286 public:
3287 DefaultValueHolderFactory() {}
3288 virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3289
3290 private:
3291 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3292 };
3293
3294 class InstanceValueHolderFactory : public ValueHolderFactory {
3295 public:
3296 explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3297 virtual ValueHolder* MakeNewHolder() const {
3298 return new ValueHolder(value_);
3299 }
3300
3301 private:
3302 const T value_; // The value for each thread.
3303
3304 GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3305 };
3306
3307 scoped_ptr<ValueHolderFactory> default_factory_;
7c673cae
FG
3308
3309 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3310};
3311
3312# elif GTEST_HAS_PTHREAD
3313
3314// MutexBase and Mutex implement mutex on pthreads-based platforms.
3315class MutexBase {
3316 public:
3317 // Acquires this mutex.
3318 void Lock() {
3319 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
3320 owner_ = pthread_self();
3321 has_owner_ = true;
3322 }
3323
3324 // Releases this mutex.
3325 void Unlock() {
3326 // Since the lock is being released the owner_ field should no longer be
3327 // considered valid. We don't protect writing to has_owner_ here, as it's
3328 // the caller's responsibility to ensure that the current thread holds the
3329 // mutex when this is called.
3330 has_owner_ = false;
3331 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
3332 }
3333
3334 // Does nothing if the current thread holds the mutex. Otherwise, crashes
3335 // with high probability.
3336 void AssertHeld() const {
3337 GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
3338 << "The current thread is not holding the mutex @" << this;
3339 }
3340
3341 // A static mutex may be used before main() is entered. It may even
3342 // be used before the dynamic initialization stage. Therefore we
3343 // must be able to initialize a static mutex object at link time.
3344 // This means MutexBase has to be a POD and its member variables
3345 // have to be public.
3346 public:
3347 pthread_mutex_t mutex_; // The underlying pthread mutex.
3348 // has_owner_ indicates whether the owner_ field below contains a valid thread
3349 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
3350 // accesses to the owner_ field should be protected by a check of this field.
3351 // An alternative might be to memset() owner_ to all zeros, but there's no
3352 // guarantee that a zero'd pthread_t is necessarily invalid or even different
3353 // from pthread_self().
3354 bool has_owner_;
3355 pthread_t owner_; // The thread holding the mutex.
3356};
3357
3358// Forward-declares a static mutex.
3359# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3360 extern ::testing::internal::MutexBase mutex
3361
3362// Defines and statically (i.e. at link time) initializes a static mutex.
3363// The initialization list here does not explicitly initialize each field,
3364// instead relying on default initialization for the unspecified fields. In
3365// particular, the owner_ field (a pthread_t) is not explicitly initialized.
3366// This allows initialization to work whether pthread_t is a scalar or struct.
3367// The flag -Wmissing-field-initializers must not be specified for this to work.
f67539c2
TL
3368#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
3369 ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}
7c673cae
FG
3370
3371// The Mutex class can only be used for mutexes created at runtime. It
3372// shares its API with MutexBase otherwise.
3373class Mutex : public MutexBase {
3374 public:
3375 Mutex() {
3376 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
3377 has_owner_ = false;
3378 }
3379 ~Mutex() {
3380 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
3381 }
3382
3383 private:
3384 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
3385};
3386
3387// We cannot name this class MutexLock because the ctor declaration would
3388// conflict with a macro named MutexLock, which is defined on some
3389// platforms. That macro is used as a defensive measure to prevent against
3390// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3391// "MutexLock l(&mu)". Hence the typedef trick below.
3392class GTestMutexLock {
3393 public:
3394 explicit GTestMutexLock(MutexBase* mutex)
3395 : mutex_(mutex) { mutex_->Lock(); }
3396
3397 ~GTestMutexLock() { mutex_->Unlock(); }
3398
3399 private:
3400 MutexBase* const mutex_;
3401
3402 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3403};
3404
3405typedef GTestMutexLock MutexLock;
3406
3407// Helpers for ThreadLocal.
3408
3409// pthread_key_create() requires DeleteThreadLocalValue() to have
3410// C-linkage. Therefore it cannot be templatized to access
3411// ThreadLocal<T>. Hence the need for class
3412// ThreadLocalValueHolderBase.
3413class ThreadLocalValueHolderBase {
3414 public:
3415 virtual ~ThreadLocalValueHolderBase() {}
3416};
3417
3418// Called by pthread to delete thread-local data stored by
3419// pthread_setspecific().
3420extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
3421 delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
3422}
3423
3424// Implements thread-local storage on pthreads-based systems.
3425template <typename T>
f67539c2 3426class GTEST_API_ ThreadLocal {
7c673cae 3427 public:
f67539c2
TL
3428 ThreadLocal()
3429 : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
3430 explicit ThreadLocal(const T& value)
3431 : key_(CreateKey()),
3432 default_factory_(new InstanceValueHolderFactory(value)) {}
7c673cae
FG
3433
3434 ~ThreadLocal() {
3435 // Destroys the managed object for the current thread, if any.
3436 DeleteThreadLocalValue(pthread_getspecific(key_));
3437
3438 // Releases resources associated with the key. This will *not*
3439 // delete managed objects for other threads.
3440 GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
3441 }
3442
3443 T* pointer() { return GetOrCreateValue(); }
3444 const T* pointer() const { return GetOrCreateValue(); }
3445 const T& get() const { return *pointer(); }
3446 void set(const T& value) { *pointer() = value; }
3447
3448 private:
3449 // Holds a value of type T.
3450 class ValueHolder : public ThreadLocalValueHolderBase {
3451 public:
f67539c2 3452 ValueHolder() : value_() {}
7c673cae
FG
3453 explicit ValueHolder(const T& value) : value_(value) {}
3454
3455 T* pointer() { return &value_; }
3456
3457 private:
3458 T value_;
3459 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3460 };
3461
3462 static pthread_key_t CreateKey() {
3463 pthread_key_t key;
3464 // When a thread exits, DeleteThreadLocalValue() will be called on
3465 // the object managed for that thread.
3466 GTEST_CHECK_POSIX_SUCCESS_(
3467 pthread_key_create(&key, &DeleteThreadLocalValue));
3468 return key;
3469 }
3470
3471 T* GetOrCreateValue() const {
3472 ThreadLocalValueHolderBase* const holder =
3473 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
3474 if (holder != NULL) {
3475 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
3476 }
3477
f67539c2 3478 ValueHolder* const new_holder = default_factory_->MakeNewHolder();
7c673cae
FG
3479 ThreadLocalValueHolderBase* const holder_base = new_holder;
3480 GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
3481 return new_holder->pointer();
3482 }
3483
f67539c2
TL
3484 class ValueHolderFactory {
3485 public:
3486 ValueHolderFactory() {}
3487 virtual ~ValueHolderFactory() {}
3488 virtual ValueHolder* MakeNewHolder() const = 0;
3489
3490 private:
3491 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3492 };
3493
3494 class DefaultValueHolderFactory : public ValueHolderFactory {
3495 public:
3496 DefaultValueHolderFactory() {}
3497 virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3498
3499 private:
3500 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3501 };
3502
3503 class InstanceValueHolderFactory : public ValueHolderFactory {
3504 public:
3505 explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3506 virtual ValueHolder* MakeNewHolder() const {
3507 return new ValueHolder(value_);
3508 }
3509
3510 private:
3511 const T value_; // The value for each thread.
3512
3513 GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3514 };
3515
7c673cae
FG
3516 // A key pthreads uses for looking up per-thread values.
3517 const pthread_key_t key_;
f67539c2 3518 scoped_ptr<ValueHolderFactory> default_factory_;
7c673cae
FG
3519
3520 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3521};
3522
f67539c2 3523# endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
7c673cae
FG
3524
3525#else // GTEST_IS_THREADSAFE
3526
3527// A dummy implementation of synchronization primitives (mutex, lock,
3528// and thread-local variable). Necessary for compiling Google Test where
3529// mutex is not supported - using Google Test in multiple threads is not
3530// supported on such platforms.
3531
3532class Mutex {
3533 public:
3534 Mutex() {}
3535 void Lock() {}
3536 void Unlock() {}
3537 void AssertHeld() const {}
3538};
3539
3540# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3541 extern ::testing::internal::Mutex mutex
3542
3543# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
3544
3545// We cannot name this class MutexLock because the ctor declaration would
3546// conflict with a macro named MutexLock, which is defined on some
3547// platforms. That macro is used as a defensive measure to prevent against
3548// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3549// "MutexLock l(&mu)". Hence the typedef trick below.
3550class GTestMutexLock {
3551 public:
3552 explicit GTestMutexLock(Mutex*) {} // NOLINT
3553};
3554
3555typedef GTestMutexLock MutexLock;
3556
3557template <typename T>
f67539c2 3558class GTEST_API_ ThreadLocal {
7c673cae
FG
3559 public:
3560 ThreadLocal() : value_() {}
3561 explicit ThreadLocal(const T& value) : value_(value) {}
3562 T* pointer() { return &value_; }
3563 const T* pointer() const { return &value_; }
3564 const T& get() const { return value_; }
3565 void set(const T& value) { value_ = value; }
3566 private:
3567 T value_;
3568};
3569
3570#endif // GTEST_IS_THREADSAFE
3571
3572// Returns the number of threads running in the process, or 0 to indicate that
3573// we cannot detect it.
3574GTEST_API_ size_t GetThreadCount();
3575
3576// Passing non-POD classes through ellipsis (...) crashes the ARM
f67539c2 3577// compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
7c673cae
FG
3578// and the IBM XL C/C++ compiler try to instantiate a copy constructor
3579// for objects passed through ellipsis (...), failing for uncopyable
3580// objects. We define this to ensure that only POD is passed through
3581// ellipsis on these systems.
f67539c2
TL
3582#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
3583 (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
7c673cae
FG
3584// We lose support for NULL detection where the compiler doesn't like
3585// passing non-POD classes through ellipsis (...).
3586# define GTEST_ELLIPSIS_NEEDS_POD_ 1
3587#else
3588# define GTEST_CAN_COMPARE_NULL 1
3589#endif
3590
3591// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
3592// const T& and const T* in a function template. These compilers
3593// _can_ decide between class template specializations for T and T*,
3594// so a tr1::type_traits-like is_pointer works.
3595#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
3596# define GTEST_NEEDS_IS_POINTER_ 1
3597#endif
3598
3599template <bool bool_value>
3600struct bool_constant {
3601 typedef bool_constant<bool_value> type;
3602 static const bool value = bool_value;
3603};
3604template <bool bool_value> const bool bool_constant<bool_value>::value;
3605
3606typedef bool_constant<false> false_type;
3607typedef bool_constant<true> true_type;
3608
f67539c2
TL
3609template <typename T, typename U>
3610struct is_same : public false_type {};
3611
3612template <typename T>
3613struct is_same<T, T> : public true_type {};
3614
3615
7c673cae
FG
3616template <typename T>
3617struct is_pointer : public false_type {};
3618
3619template <typename T>
3620struct is_pointer<T*> : public true_type {};
3621
3622template <typename Iterator>
3623struct IteratorTraits {
3624 typedef typename Iterator::value_type value_type;
3625};
3626
f67539c2 3627
7c673cae
FG
3628template <typename T>
3629struct IteratorTraits<T*> {
3630 typedef T value_type;
3631};
3632
3633template <typename T>
3634struct IteratorTraits<const T*> {
3635 typedef T value_type;
3636};
3637
3638#if GTEST_OS_WINDOWS
3639# define GTEST_PATH_SEP_ "\\"
3640# define GTEST_HAS_ALT_PATH_SEP_ 1
3641// The biggest signed integer type the compiler supports.
3642typedef __int64 BiggestInt;
3643#else
3644# define GTEST_PATH_SEP_ "/"
3645# define GTEST_HAS_ALT_PATH_SEP_ 0
3646typedef long long BiggestInt; // NOLINT
3647#endif // GTEST_OS_WINDOWS
3648
3649// Utilities for char.
3650
3651// isspace(int ch) and friends accept an unsigned char or EOF. char
3652// may be signed, depending on the compiler (or compiler flags).
3653// Therefore we need to cast a char to unsigned char before calling
3654// isspace(), etc.
3655
3656inline bool IsAlpha(char ch) {
3657 return isalpha(static_cast<unsigned char>(ch)) != 0;
3658}
3659inline bool IsAlNum(char ch) {
3660 return isalnum(static_cast<unsigned char>(ch)) != 0;
3661}
3662inline bool IsDigit(char ch) {
3663 return isdigit(static_cast<unsigned char>(ch)) != 0;
3664}
3665inline bool IsLower(char ch) {
3666 return islower(static_cast<unsigned char>(ch)) != 0;
3667}
3668inline bool IsSpace(char ch) {
3669 return isspace(static_cast<unsigned char>(ch)) != 0;
3670}
3671inline bool IsUpper(char ch) {
3672 return isupper(static_cast<unsigned char>(ch)) != 0;
3673}
3674inline bool IsXDigit(char ch) {
3675 return isxdigit(static_cast<unsigned char>(ch)) != 0;
3676}
3677inline bool IsXDigit(wchar_t ch) {
3678 const unsigned char low_byte = static_cast<unsigned char>(ch);
3679 return ch == low_byte && isxdigit(low_byte) != 0;
3680}
3681
3682inline char ToLower(char ch) {
3683 return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
3684}
3685inline char ToUpper(char ch) {
3686 return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
3687}
3688
3689inline std::string StripTrailingSpaces(std::string str) {
3690 std::string::iterator it = str.end();
3691 while (it != str.begin() && IsSpace(*--it))
3692 it = str.erase(it);
3693 return str;
3694}
3695
3696// The testing::internal::posix namespace holds wrappers for common
3697// POSIX functions. These wrappers hide the differences between
3698// Windows/MSVC and POSIX systems. Since some compilers define these
3699// standard functions as macros, the wrapper cannot have the same name
3700// as the wrapped function.
3701
3702namespace posix {
3703
3704// Functions with a different name on Windows.
3705
3706#if GTEST_OS_WINDOWS
3707
3708typedef struct _stat StatStruct;
3709
3710# ifdef __BORLANDC__
3711inline int IsATTY(int fd) { return isatty(fd); }
3712inline int StrCaseCmp(const char* s1, const char* s2) {
3713 return stricmp(s1, s2);
3714}
3715inline char* StrDup(const char* src) { return strdup(src); }
3716# else // !__BORLANDC__
3717# if GTEST_OS_WINDOWS_MOBILE
3718inline int IsATTY(int /* fd */) { return 0; }
3719# else
3720inline int IsATTY(int fd) { return _isatty(fd); }
3721# endif // GTEST_OS_WINDOWS_MOBILE
3722inline int StrCaseCmp(const char* s1, const char* s2) {
3723 return _stricmp(s1, s2);
3724}
3725inline char* StrDup(const char* src) { return _strdup(src); }
3726# endif // __BORLANDC__
3727
3728# if GTEST_OS_WINDOWS_MOBILE
3729inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
3730// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
3731// time and thus not defined there.
3732# else
3733inline int FileNo(FILE* file) { return _fileno(file); }
3734inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
3735inline int RmDir(const char* dir) { return _rmdir(dir); }
3736inline bool IsDir(const StatStruct& st) {
3737 return (_S_IFDIR & st.st_mode) != 0;
3738}
3739# endif // GTEST_OS_WINDOWS_MOBILE
3740
3741#else
3742
3743typedef struct stat StatStruct;
3744
3745inline int FileNo(FILE* file) { return fileno(file); }
3746inline int IsATTY(int fd) { return isatty(fd); }
3747inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
3748inline int StrCaseCmp(const char* s1, const char* s2) {
3749 return strcasecmp(s1, s2);
3750}
3751inline char* StrDup(const char* src) { return strdup(src); }
3752inline int RmDir(const char* dir) { return rmdir(dir); }
3753inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
3754
3755#endif // GTEST_OS_WINDOWS
3756
3757// Functions deprecated by MSVC 8.0.
3758
f67539c2
TL
3759GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
3760
3761inline const char* StrNCpy(char* dest, const char* src, size_t n) {
3762 return strncpy(dest, src, n);
3763}
7c673cae 3764
7c673cae
FG
3765// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
3766// StrError() aren't needed on Windows CE at this time and thus not
3767// defined there.
3768
3769#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
3770inline int ChDir(const char* dir) { return chdir(dir); }
3771#endif
3772inline FILE* FOpen(const char* path, const char* mode) {
3773 return fopen(path, mode);
3774}
3775#if !GTEST_OS_WINDOWS_MOBILE
3776inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
3777 return freopen(path, mode, stream);
3778}
3779inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
3780#endif
3781inline int FClose(FILE* fp) { return fclose(fp); }
3782#if !GTEST_OS_WINDOWS_MOBILE
3783inline int Read(int fd, void* buf, unsigned int count) {
3784 return static_cast<int>(read(fd, buf, count));
3785}
3786inline int Write(int fd, const void* buf, unsigned int count) {
3787 return static_cast<int>(write(fd, buf, count));
3788}
3789inline int Close(int fd) { return close(fd); }
3790inline const char* StrError(int errnum) { return strerror(errnum); }
3791#endif
3792inline const char* GetEnv(const char* name) {
f67539c2 3793#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
7c673cae
FG
3794 // We are on Windows CE, which has no environment variables.
3795 static_cast<void>(name); // To prevent 'unused argument' warning.
3796 return NULL;
3797#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
3798 // Environment variables which we programmatically clear will be set to the
3799 // empty string rather than unset (NULL). Handle that case.
3800 const char* const env = getenv(name);
3801 return (env != NULL && env[0] != '\0') ? env : NULL;
3802#else
3803 return getenv(name);
3804#endif
3805}
3806
f67539c2 3807GTEST_DISABLE_MSC_DEPRECATED_POP_()
7c673cae
FG
3808
3809#if GTEST_OS_WINDOWS_MOBILE
3810// Windows CE has no C library. The abort() function is used in
3811// several places in Google Test. This implementation provides a reasonable
3812// imitation of standard behaviour.
3813void Abort();
3814#else
3815inline void Abort() { abort(); }
3816#endif // GTEST_OS_WINDOWS_MOBILE
3817
3818} // namespace posix
3819
3820// MSVC "deprecates" snprintf and issues warnings wherever it is used. In
3821// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
3822// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
3823// function in order to achieve that. We use macro definition here because
3824// snprintf is a variadic function.
3825#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
3826// MSVC 2005 and above support variadic macros.
3827# define GTEST_SNPRINTF_(buffer, size, format, ...) \
3828 _snprintf_s(buffer, size, size, format, __VA_ARGS__)
3829#elif defined(_MSC_VER)
3830// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
3831// complain about _snprintf.
3832# define GTEST_SNPRINTF_ _snprintf
3833#else
3834# define GTEST_SNPRINTF_ snprintf
3835#endif
3836
3837// The maximum number a BiggestInt can represent. This definition
3838// works no matter BiggestInt is represented in one's complement or
3839// two's complement.
3840//
3841// We cannot rely on numeric_limits in STL, as __int64 and long long
3842// are not part of standard C++ and numeric_limits doesn't need to be
3843// defined for them.
3844const BiggestInt kMaxBiggestInt =
3845 ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
3846
3847// This template class serves as a compile-time function from size to
3848// type. It maps a size in bytes to a primitive type with that
3849// size. e.g.
3850//
3851// TypeWithSize<4>::UInt
3852//
3853// is typedef-ed to be unsigned int (unsigned integer made up of 4
3854// bytes).
3855//
3856// Such functionality should belong to STL, but I cannot find it
3857// there.
3858//
3859// Google Test uses this class in the implementation of floating-point
3860// comparison.
3861//
3862// For now it only handles UInt (unsigned int) as that's all Google Test
3863// needs. Other types can be easily added in the future if need
3864// arises.
3865template <size_t size>
3866class TypeWithSize {
3867 public:
3868 // This prevents the user from using TypeWithSize<N> with incorrect
3869 // values of N.
3870 typedef void UInt;
3871};
3872
3873// The specialization for size 4.
3874template <>
3875class TypeWithSize<4> {
3876 public:
3877 // unsigned int has size 4 in both gcc and MSVC.
3878 //
3879 // As base/basictypes.h doesn't compile on Windows, we cannot use
3880 // uint32, uint64, and etc here.
3881 typedef int Int;
3882 typedef unsigned int UInt;
3883};
3884
3885// The specialization for size 8.
3886template <>
3887class TypeWithSize<8> {
3888 public:
3889#if GTEST_OS_WINDOWS
3890 typedef __int64 Int;
3891 typedef unsigned __int64 UInt;
3892#else
3893 typedef long long Int; // NOLINT
3894 typedef unsigned long long UInt; // NOLINT
3895#endif // GTEST_OS_WINDOWS
3896};
3897
3898// Integer types of known sizes.
3899typedef TypeWithSize<4>::Int Int32;
3900typedef TypeWithSize<4>::UInt UInt32;
3901typedef TypeWithSize<8>::Int Int64;
3902typedef TypeWithSize<8>::UInt UInt64;
3903typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
3904
3905// Utilities for command line flags and environment variables.
3906
3907// Macro for referencing flags.
f67539c2
TL
3908#if !defined(GTEST_FLAG)
3909# define GTEST_FLAG(name) FLAGS_gtest_##name
3910#endif // !defined(GTEST_FLAG)
3911
3912#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3913# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
3914#endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3915
3916#if !defined(GTEST_DECLARE_bool_)
3917# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
7c673cae
FG
3918
3919// Macros for declaring flags.
f67539c2
TL
3920# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3921# define GTEST_DECLARE_int32_(name) \
7c673cae 3922 GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
f67539c2 3923# define GTEST_DECLARE_string_(name) \
7c673cae
FG
3924 GTEST_API_ extern ::std::string GTEST_FLAG(name)
3925
3926// Macros for defining flags.
f67539c2 3927# define GTEST_DEFINE_bool_(name, default_val, doc) \
7c673cae 3928 GTEST_API_ bool GTEST_FLAG(name) = (default_val)
f67539c2 3929# define GTEST_DEFINE_int32_(name, default_val, doc) \
7c673cae 3930 GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
f67539c2 3931# define GTEST_DEFINE_string_(name, default_val, doc) \
7c673cae
FG
3932 GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3933
f67539c2
TL
3934#endif // !defined(GTEST_DECLARE_bool_)
3935
7c673cae 3936// Thread annotations
f67539c2
TL
3937#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
3938# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3939# define GTEST_LOCK_EXCLUDED_(locks)
3940#endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
7c673cae
FG
3941
3942// Parses 'str' for a 32-bit signed integer. If successful, writes the result
3943// to *value and returns true; otherwise leaves *value unchanged and returns
3944// false.
f67539c2 3945// FIXME: Find a better way to refactor flag and environment parsing
7c673cae
FG
3946// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3947// function.
3948bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3949
3950// Parses a bool/Int32/string from the environment variable
3951// corresponding to the given Google Test flag.
3952bool BoolFromGTestEnv(const char* flag, bool default_val);
3953GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
f67539c2 3954std::string OutputFlagAlsoCheckEnvVar();
7c673cae
FG
3955const char* StringFromGTestEnv(const char* flag, const char* default_val);
3956
3957} // namespace internal
3958} // namespace testing
3959
3960#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3961
7c673cae
FG
3962#if GTEST_OS_LINUX
3963# include <stdlib.h>
3964# include <sys/types.h>
3965# include <sys/wait.h>
3966# include <unistd.h>
3967#endif // GTEST_OS_LINUX
3968
3969#if GTEST_HAS_EXCEPTIONS
3970# include <stdexcept>
3971#endif
3972
3973#include <ctype.h>
3974#include <float.h>
3975#include <string.h>
3976#include <iomanip>
3977#include <limits>
f67539c2 3978#include <map>
7c673cae
FG
3979#include <set>
3980#include <string>
3981#include <vector>
3982
3983// Copyright 2005, Google Inc.
3984// All rights reserved.
3985//
3986// Redistribution and use in source and binary forms, with or without
3987// modification, are permitted provided that the following conditions are
3988// met:
3989//
3990// * Redistributions of source code must retain the above copyright
3991// notice, this list of conditions and the following disclaimer.
3992// * Redistributions in binary form must reproduce the above
3993// copyright notice, this list of conditions and the following disclaimer
3994// in the documentation and/or other materials provided with the
3995// distribution.
3996// * Neither the name of Google Inc. nor the names of its
3997// contributors may be used to endorse or promote products derived from
3998// this software without specific prior written permission.
3999//
4000// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4001// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4002// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4003// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4004// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4005// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4006// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4007// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4008// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4009// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4010// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 4011
7c673cae 4012//
f67539c2 4013// The Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
4014//
4015// This header file defines the Message class.
4016//
4017// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
4018// leave some internal implementation details in this header file.
4019// They are clearly marked by comments like this:
4020//
4021// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
4022//
4023// Such code is NOT meant to be used by a user directly, and is subject
4024// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
4025// program!
4026
f67539c2
TL
4027// GOOGLETEST_CM0001 DO NOT DELETE
4028
7c673cae
FG
4029#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4030#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4031
4032#include <limits>
4033
4034
f67539c2
TL
4035GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
4036/* class A needs to have dll-interface to be used by clients of class B */)
4037
7c673cae
FG
4038// Ensures that there is at least one operator<< in the global namespace.
4039// See Message& operator<<(...) below for why.
4040void operator<<(const testing::internal::Secret&, int);
4041
4042namespace testing {
4043
4044// The Message class works like an ostream repeater.
4045//
4046// Typical usage:
4047//
4048// 1. You stream a bunch of values to a Message object.
4049// It will remember the text in a stringstream.
4050// 2. Then you stream the Message object to an ostream.
4051// This causes the text in the Message to be streamed
4052// to the ostream.
4053//
4054// For example;
4055//
4056// testing::Message foo;
4057// foo << 1 << " != " << 2;
4058// std::cout << foo;
4059//
4060// will print "1 != 2".
4061//
4062// Message is not intended to be inherited from. In particular, its
4063// destructor is not virtual.
4064//
4065// Note that stringstream behaves differently in gcc and in MSVC. You
4066// can stream a NULL char pointer to it in the former, but not in the
4067// latter (it causes an access violation if you do). The Message
4068// class hides this difference by treating a NULL char pointer as
4069// "(null)".
4070class GTEST_API_ Message {
4071 private:
4072 // The type of basic IO manipulators (endl, ends, and flush) for
4073 // narrow streams.
4074 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
4075
4076 public:
4077 // Constructs an empty Message.
4078 Message();
4079
4080 // Copy constructor.
4081 Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
4082 *ss_ << msg.GetString();
4083 }
4084
4085 // Constructs a Message from a C-string.
4086 explicit Message(const char* str) : ss_(new ::std::stringstream) {
4087 *ss_ << str;
4088 }
4089
4090#if GTEST_OS_SYMBIAN
4091 // Streams a value (either a pointer or not) to this object.
4092 template <typename T>
4093 inline Message& operator <<(const T& value) {
4094 StreamHelper(typename internal::is_pointer<T>::type(), value);
4095 return *this;
4096 }
4097#else
4098 // Streams a non-pointer value to this object.
4099 template <typename T>
4100 inline Message& operator <<(const T& val) {
4101 // Some libraries overload << for STL containers. These
4102 // overloads are defined in the global namespace instead of ::std.
4103 //
4104 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
4105 // overloads are visible in either the std namespace or the global
4106 // namespace, but not other namespaces, including the testing
4107 // namespace which Google Test's Message class is in.
4108 //
4109 // To allow STL containers (and other types that has a << operator
4110 // defined in the global namespace) to be used in Google Test
4111 // assertions, testing::Message must access the custom << operator
4112 // from the global namespace. With this using declaration,
4113 // overloads of << defined in the global namespace and those
4114 // visible via Koenig lookup are both exposed in this function.
4115 using ::operator <<;
4116 *ss_ << val;
4117 return *this;
4118 }
4119
4120 // Streams a pointer value to this object.
4121 //
4122 // This function is an overload of the previous one. When you
4123 // stream a pointer to a Message, this definition will be used as it
4124 // is more specialized. (The C++ Standard, section
4125 // [temp.func.order].) If you stream a non-pointer, then the
4126 // previous definition will be used.
4127 //
4128 // The reason for this overload is that streaming a NULL pointer to
4129 // ostream is undefined behavior. Depending on the compiler, you
4130 // may get "0", "(nil)", "(null)", or an access violation. To
4131 // ensure consistent result across compilers, we always treat NULL
4132 // as "(null)".
4133 template <typename T>
4134 inline Message& operator <<(T* const& pointer) { // NOLINT
4135 if (pointer == NULL) {
4136 *ss_ << "(null)";
4137 } else {
4138 *ss_ << pointer;
4139 }
4140 return *this;
4141 }
4142#endif // GTEST_OS_SYMBIAN
4143
4144 // Since the basic IO manipulators are overloaded for both narrow
4145 // and wide streams, we have to provide this specialized definition
4146 // of operator <<, even though its body is the same as the
4147 // templatized version above. Without this definition, streaming
4148 // endl or other basic IO manipulators to Message will confuse the
4149 // compiler.
4150 Message& operator <<(BasicNarrowIoManip val) {
4151 *ss_ << val;
4152 return *this;
4153 }
4154
4155 // Instead of 1/0, we want to see true/false for bool values.
4156 Message& operator <<(bool b) {
4157 return *this << (b ? "true" : "false");
4158 }
4159
4160 // These two overloads allow streaming a wide C string to a Message
4161 // using the UTF-8 encoding.
4162 Message& operator <<(const wchar_t* wide_c_str);
4163 Message& operator <<(wchar_t* wide_c_str);
4164
4165#if GTEST_HAS_STD_WSTRING
4166 // Converts the given wide string to a narrow string using the UTF-8
4167 // encoding, and streams the result to this Message object.
4168 Message& operator <<(const ::std::wstring& wstr);
4169#endif // GTEST_HAS_STD_WSTRING
4170
4171#if GTEST_HAS_GLOBAL_WSTRING
4172 // Converts the given wide string to a narrow string using the UTF-8
4173 // encoding, and streams the result to this Message object.
4174 Message& operator <<(const ::wstring& wstr);
4175#endif // GTEST_HAS_GLOBAL_WSTRING
4176
4177 // Gets the text streamed to this object so far as an std::string.
4178 // Each '\0' character in the buffer is replaced with "\\0".
4179 //
4180 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
4181 std::string GetString() const;
4182
4183 private:
7c673cae
FG
4184#if GTEST_OS_SYMBIAN
4185 // These are needed as the Nokia Symbian Compiler cannot decide between
4186 // const T& and const T* in a function template. The Nokia compiler _can_
4187 // decide between class template specializations for T and T*, so a
4188 // tr1::type_traits-like is_pointer works, and we can overload on that.
4189 template <typename T>
4190 inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
4191 if (pointer == NULL) {
4192 *ss_ << "(null)";
4193 } else {
4194 *ss_ << pointer;
4195 }
4196 }
4197 template <typename T>
4198 inline void StreamHelper(internal::false_type /*is_pointer*/,
4199 const T& value) {
4200 // See the comments in Message& operator <<(const T&) above for why
4201 // we need this using statement.
4202 using ::operator <<;
4203 *ss_ << value;
4204 }
4205#endif // GTEST_OS_SYMBIAN
4206
4207 // We'll hold the text streamed to this object here.
4208 const internal::scoped_ptr< ::std::stringstream> ss_;
4209
4210 // We declare (but don't implement) this to prevent the compiler
4211 // from implementing the assignment operator.
4212 void operator=(const Message&);
4213};
4214
4215// Streams a Message to an ostream.
4216inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
4217 return os << sb.GetString();
4218}
4219
4220namespace internal {
4221
4222// Converts a streamable value to an std::string. A NULL pointer is
4223// converted to "(null)". When the input value is a ::string,
4224// ::std::string, ::wstring, or ::std::wstring object, each NUL
4225// character in it is replaced with "\\0".
4226template <typename T>
4227std::string StreamableToString(const T& streamable) {
4228 return (Message() << streamable).GetString();
4229}
4230
4231} // namespace internal
4232} // namespace testing
4233
f67539c2
TL
4234GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
4235
7c673cae 4236#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
f67539c2 4237// Copyright 2008, Google Inc.
7c673cae
FG
4238// All rights reserved.
4239//
4240// Redistribution and use in source and binary forms, with or without
4241// modification, are permitted provided that the following conditions are
4242// met:
4243//
4244// * Redistributions of source code must retain the above copyright
4245// notice, this list of conditions and the following disclaimer.
4246// * Redistributions in binary form must reproduce the above
4247// copyright notice, this list of conditions and the following disclaimer
4248// in the documentation and/or other materials provided with the
4249// distribution.
4250// * Neither the name of Google Inc. nor the names of its
4251// contributors may be used to endorse or promote products derived from
4252// this software without specific prior written permission.
4253//
4254// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4255// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4256// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4257// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4258// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4259// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4260// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4261// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4262// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4263// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4264// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4265//
f67539c2 4266// Google Test filepath utilities
7c673cae 4267//
f67539c2
TL
4268// This header file declares classes and functions used internally by
4269// Google Test. They are subject to change without notice.
7c673cae 4270//
f67539c2
TL
4271// This file is #included in gtest/internal/gtest-internal.h.
4272// Do not include this header file separately!
7c673cae 4273
f67539c2 4274// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae 4275
f67539c2
TL
4276#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4277#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4278
4279// Copyright 2005, Google Inc.
4280// All rights reserved.
4281//
4282// Redistribution and use in source and binary forms, with or without
4283// modification, are permitted provided that the following conditions are
4284// met:
4285//
4286// * Redistributions of source code must retain the above copyright
4287// notice, this list of conditions and the following disclaimer.
4288// * Redistributions in binary form must reproduce the above
4289// copyright notice, this list of conditions and the following disclaimer
4290// in the documentation and/or other materials provided with the
4291// distribution.
4292// * Neither the name of Google Inc. nor the names of its
4293// contributors may be used to endorse or promote products derived from
4294// this software without specific prior written permission.
4295//
4296// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4297// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4298// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4299// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4300// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4301// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4302// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4303// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4304// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4305// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4306// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4307//
4308// The Google C++ Testing and Mocking Framework (Google Test)
4309//
4310// This header file declares the String class and functions used internally by
4311// Google Test. They are subject to change without notice. They should not used
4312// by code external to Google Test.
4313//
4314// This header file is #included by gtest-internal.h.
4315// It should not be #included by other files.
4316
4317// GOOGLETEST_CM0001 DO NOT DELETE
4318
4319#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4320#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4321
4322#ifdef __BORLANDC__
7c673cae
FG
4323// string.h is not guaranteed to provide strcpy on C++ Builder.
4324# include <mem.h>
4325#endif
4326
4327#include <string.h>
4328#include <string>
4329
4330
4331namespace testing {
4332namespace internal {
4333
4334// String - an abstract class holding static string utilities.
4335class GTEST_API_ String {
4336 public:
4337 // Static utility methods
4338
4339 // Clones a 0-terminated C string, allocating memory using new. The
4340 // caller is responsible for deleting the return value using
4341 // delete[]. Returns the cloned string, or NULL if the input is
4342 // NULL.
4343 //
4344 // This is different from strdup() in string.h, which allocates
4345 // memory using malloc().
4346 static const char* CloneCString(const char* c_str);
4347
4348#if GTEST_OS_WINDOWS_MOBILE
4349 // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
4350 // able to pass strings to Win32 APIs on CE we need to convert them
4351 // to 'Unicode', UTF-16.
4352
4353 // Creates a UTF-16 wide string from the given ANSI string, allocating
4354 // memory using new. The caller is responsible for deleting the return
4355 // value using delete[]. Returns the wide string, or NULL if the
4356 // input is NULL.
4357 //
4358 // The wide string is created using the ANSI codepage (CP_ACP) to
4359 // match the behaviour of the ANSI versions of Win32 calls and the
4360 // C runtime.
4361 static LPCWSTR AnsiToUtf16(const char* c_str);
4362
4363 // Creates an ANSI string from the given wide string, allocating
4364 // memory using new. The caller is responsible for deleting the return
4365 // value using delete[]. Returns the ANSI string, or NULL if the
4366 // input is NULL.
4367 //
4368 // The returned string is created using the ANSI codepage (CP_ACP) to
4369 // match the behaviour of the ANSI versions of Win32 calls and the
4370 // C runtime.
4371 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
4372#endif
4373
4374 // Compares two C strings. Returns true iff they have the same content.
4375 //
4376 // Unlike strcmp(), this function can handle NULL argument(s). A
4377 // NULL C string is considered different to any non-NULL C string,
4378 // including the empty string.
4379 static bool CStringEquals(const char* lhs, const char* rhs);
4380
4381 // Converts a wide C string to a String using the UTF-8 encoding.
4382 // NULL will be converted to "(null)". If an error occurred during
4383 // the conversion, "(failed to convert from wide string)" is
4384 // returned.
4385 static std::string ShowWideCString(const wchar_t* wide_c_str);
4386
4387 // Compares two wide C strings. Returns true iff they have the same
4388 // content.
4389 //
4390 // Unlike wcscmp(), this function can handle NULL argument(s). A
4391 // NULL C string is considered different to any non-NULL C string,
4392 // including the empty string.
4393 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
4394
4395 // Compares two C strings, ignoring case. Returns true iff they
4396 // have the same content.
4397 //
4398 // Unlike strcasecmp(), this function can handle NULL argument(s).
4399 // A NULL C string is considered different to any non-NULL C string,
4400 // including the empty string.
4401 static bool CaseInsensitiveCStringEquals(const char* lhs,
4402 const char* rhs);
4403
4404 // Compares two wide C strings, ignoring case. Returns true iff they
4405 // have the same content.
4406 //
4407 // Unlike wcscasecmp(), this function can handle NULL argument(s).
4408 // A NULL C string is considered different to any non-NULL wide C string,
4409 // including the empty string.
4410 // NB: The implementations on different platforms slightly differ.
4411 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
4412 // environment variable. On GNU platform this method uses wcscasecmp
4413 // which compares according to LC_CTYPE category of the current locale.
4414 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
4415 // current locale.
4416 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
4417 const wchar_t* rhs);
4418
4419 // Returns true iff the given string ends with the given suffix, ignoring
4420 // case. Any string is considered to end with an empty suffix.
4421 static bool EndsWithCaseInsensitive(
4422 const std::string& str, const std::string& suffix);
4423
4424 // Formats an int value as "%02d".
4425 static std::string FormatIntWidth2(int value); // "%02d" for width == 2
4426
4427 // Formats an int value as "%X".
4428 static std::string FormatHexInt(int value);
4429
4430 // Formats a byte as "%02X".
4431 static std::string FormatByte(unsigned char value);
4432
4433 private:
4434 String(); // Not meant to be instantiated.
4435}; // class String
4436
4437// Gets the content of the stringstream's buffer as an std::string. Each '\0'
4438// character in the buffer is replaced with "\\0".
4439GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
4440
4441} // namespace internal
4442} // namespace testing
4443
4444#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
7c673cae 4445
f67539c2
TL
4446GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
4447/* class A needs to have dll-interface to be used by clients of class B */)
7c673cae
FG
4448
4449namespace testing {
4450namespace internal {
4451
4452// FilePath - a class for file and directory pathname manipulation which
4453// handles platform-specific conventions (like the pathname separator).
4454// Used for helper functions for naming files in a directory for xml output.
4455// Except for Set methods, all methods are const or static, which provides an
4456// "immutable value object" -- useful for peace of mind.
4457// A FilePath with a value ending in a path separator ("like/this/") represents
4458// a directory, otherwise it is assumed to represent a file. In either case,
4459// it may or may not represent an actual file or directory in the file system.
4460// Names are NOT checked for syntax correctness -- no checking for illegal
4461// characters, malformed paths, etc.
4462
4463class GTEST_API_ FilePath {
4464 public:
4465 FilePath() : pathname_("") { }
4466 FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
4467
4468 explicit FilePath(const std::string& pathname) : pathname_(pathname) {
4469 Normalize();
4470 }
4471
4472 FilePath& operator=(const FilePath& rhs) {
4473 Set(rhs);
4474 return *this;
4475 }
4476
4477 void Set(const FilePath& rhs) {
4478 pathname_ = rhs.pathname_;
4479 }
4480
4481 const std::string& string() const { return pathname_; }
4482 const char* c_str() const { return pathname_.c_str(); }
4483
4484 // Returns the current working directory, or "" if unsuccessful.
4485 static FilePath GetCurrentDir();
4486
4487 // Given directory = "dir", base_name = "test", number = 0,
4488 // extension = "xml", returns "dir/test.xml". If number is greater
4489 // than zero (e.g., 12), returns "dir/test_12.xml".
4490 // On Windows platform, uses \ as the separator rather than /.
4491 static FilePath MakeFileName(const FilePath& directory,
4492 const FilePath& base_name,
4493 int number,
4494 const char* extension);
4495
4496 // Given directory = "dir", relative_path = "test.xml",
4497 // returns "dir/test.xml".
4498 // On Windows, uses \ as the separator rather than /.
4499 static FilePath ConcatPaths(const FilePath& directory,
4500 const FilePath& relative_path);
4501
4502 // Returns a pathname for a file that does not currently exist. The pathname
4503 // will be directory/base_name.extension or
4504 // directory/base_name_<number>.extension if directory/base_name.extension
4505 // already exists. The number will be incremented until a pathname is found
4506 // that does not already exist.
4507 // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
4508 // There could be a race condition if two or more processes are calling this
4509 // function at the same time -- they could both pick the same filename.
4510 static FilePath GenerateUniqueFileName(const FilePath& directory,
4511 const FilePath& base_name,
4512 const char* extension);
4513
4514 // Returns true iff the path is "".
4515 bool IsEmpty() const { return pathname_.empty(); }
4516
4517 // If input name has a trailing separator character, removes it and returns
4518 // the name, otherwise return the name string unmodified.
4519 // On Windows platform, uses \ as the separator, other platforms use /.
4520 FilePath RemoveTrailingPathSeparator() const;
4521
4522 // Returns a copy of the FilePath with the directory part removed.
4523 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
4524 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
4525 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
4526 // returns an empty FilePath ("").
4527 // On Windows platform, '\' is the path separator, otherwise it is '/'.
4528 FilePath RemoveDirectoryName() const;
4529
4530 // RemoveFileName returns the directory path with the filename removed.
4531 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
4532 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
4533 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
4534 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
4535 // On Windows platform, '\' is the path separator, otherwise it is '/'.
4536 FilePath RemoveFileName() const;
4537
4538 // Returns a copy of the FilePath with the case-insensitive extension removed.
4539 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
4540 // FilePath("dir/file"). If a case-insensitive extension is not
4541 // found, returns a copy of the original FilePath.
4542 FilePath RemoveExtension(const char* extension) const;
4543
4544 // Creates directories so that path exists. Returns true if successful or if
4545 // the directories already exist; returns false if unable to create
4546 // directories for any reason. Will also return false if the FilePath does
4547 // not represent a directory (that is, it doesn't end with a path separator).
4548 bool CreateDirectoriesRecursively() const;
4549
4550 // Create the directory so that path exists. Returns true if successful or
4551 // if the directory already exists; returns false if unable to create the
4552 // directory for any reason, including if the parent directory does not
4553 // exist. Not named "CreateDirectory" because that's a macro on Windows.
4554 bool CreateFolder() const;
4555
4556 // Returns true if FilePath describes something in the file-system,
4557 // either a file, directory, or whatever, and that something exists.
4558 bool FileOrDirectoryExists() const;
4559
4560 // Returns true if pathname describes a directory in the file-system
4561 // that exists.
4562 bool DirectoryExists() const;
4563
4564 // Returns true if FilePath ends with a path separator, which indicates that
4565 // it is intended to represent a directory. Returns false otherwise.
4566 // This does NOT check that a directory (or file) actually exists.
4567 bool IsDirectory() const;
4568
4569 // Returns true if pathname describes a root directory. (Windows has one
4570 // root directory per disk drive.)
4571 bool IsRootDirectory() const;
4572
4573 // Returns true if pathname describes an absolute path.
4574 bool IsAbsolutePath() const;
4575
4576 private:
4577 // Replaces multiple consecutive separators with a single separator.
4578 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
4579 // redundancies that might be in a pathname involving "." or "..".
4580 //
4581 // A pathname with multiple consecutive separators may occur either through
4582 // user error or as a result of some scripts or APIs that generate a pathname
4583 // with a trailing separator. On other platforms the same API or script
4584 // may NOT generate a pathname with a trailing "/". Then elsewhere that
4585 // pathname may have another "/" and pathname components added to it,
4586 // without checking for the separator already being there.
4587 // The script language and operating system may allow paths like "foo//bar"
4588 // but some of the functions in FilePath will not handle that correctly. In
4589 // particular, RemoveTrailingPathSeparator() only removes one separator, and
4590 // it is called in CreateDirectoriesRecursively() assuming that it will change
4591 // a pathname from directory syntax (trailing separator) to filename syntax.
4592 //
4593 // On Windows this method also replaces the alternate path separator '/' with
4594 // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
4595 // "bar\\foo".
4596
4597 void Normalize();
4598
4599 // Returns a pointer to the last occurence of a valid path separator in
4600 // the FilePath. On Windows, for example, both '/' and '\' are valid path
4601 // separators. Returns NULL if no path separator was found.
4602 const char* FindLastPathSeparator() const;
4603
4604 std::string pathname_;
4605}; // class FilePath
4606
4607} // namespace internal
4608} // namespace testing
4609
f67539c2
TL
4610GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
4611
7c673cae
FG
4612#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4613// This file was GENERATED by command:
4614// pump.py gtest-type-util.h.pump
4615// DO NOT EDIT BY HAND!!!
4616
4617// Copyright 2008 Google Inc.
4618// All Rights Reserved.
4619//
4620// Redistribution and use in source and binary forms, with or without
4621// modification, are permitted provided that the following conditions are
4622// met:
4623//
4624// * Redistributions of source code must retain the above copyright
4625// notice, this list of conditions and the following disclaimer.
4626// * Redistributions in binary form must reproduce the above
4627// copyright notice, this list of conditions and the following disclaimer
4628// in the documentation and/or other materials provided with the
4629// distribution.
4630// * Neither the name of Google Inc. nor the names of its
4631// contributors may be used to endorse or promote products derived from
4632// this software without specific prior written permission.
4633//
4634// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4635// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4636// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4637// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4638// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4639// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4640// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4641// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4642// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4643// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4644// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 4645
7c673cae
FG
4646
4647// Type utilities needed for implementing typed and type-parameterized
4648// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
4649//
4650// Currently we support at most 50 types in a list, and at most 50
4651// type-parameterized tests in one type-parameterized test case.
4652// Please contact googletestframework@googlegroups.com if you need
4653// more.
4654
f67539c2
TL
4655// GOOGLETEST_CM0001 DO NOT DELETE
4656
7c673cae
FG
4657#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4658#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4659
4660
4661// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
4662// libstdc++ (which is where cxxabi.h comes from).
4663# if GTEST_HAS_CXXABI_H_
4664# include <cxxabi.h>
4665# elif defined(__HP_aCC)
4666# include <acxx_demangle.h>
4667# endif // GTEST_HASH_CXXABI_H_
4668
4669namespace testing {
4670namespace internal {
4671
f67539c2
TL
4672// Canonicalizes a given name with respect to the Standard C++ Library.
4673// This handles removing the inline namespace within `std` that is
4674// used by various standard libraries (e.g., `std::__1`). Names outside
4675// of namespace std are returned unmodified.
4676inline std::string CanonicalizeForStdLibVersioning(std::string s) {
4677 static const char prefix[] = "std::__";
4678 if (s.compare(0, strlen(prefix), prefix) == 0) {
4679 std::string::size_type end = s.find("::", strlen(prefix));
4680 if (end != s.npos) {
4681 // Erase everything between the initial `std` and the second `::`.
4682 s.erase(strlen("std"), end - strlen("std"));
4683 }
4684 }
4685 return s;
4686}
4687
7c673cae
FG
4688// GetTypeName<T>() returns a human-readable name of type T.
4689// NB: This function is also used in Google Mock, so don't move it inside of
4690// the typed-test-only section below.
4691template <typename T>
4692std::string GetTypeName() {
4693# if GTEST_HAS_RTTI
4694
4695 const char* const name = typeid(T).name();
4696# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
4697 int status = 0;
4698 // gcc's implementation of typeid(T).name() mangles the type name,
4699 // so we have to demangle it.
4700# if GTEST_HAS_CXXABI_H_
4701 using abi::__cxa_demangle;
4702# endif // GTEST_HAS_CXXABI_H_
4703 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
4704 const std::string name_str(status == 0 ? readable_name : name);
4705 free(readable_name);
f67539c2 4706 return CanonicalizeForStdLibVersioning(name_str);
7c673cae
FG
4707# else
4708 return name;
4709# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
4710
4711# else
4712
4713 return "<type>";
4714
4715# endif // GTEST_HAS_RTTI
4716}
4717
4718#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
4719
4720// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
4721// type. This can be used as a compile-time assertion to ensure that
4722// two types are equal.
4723
4724template <typename T1, typename T2>
4725struct AssertTypeEq;
4726
4727template <typename T>
4728struct AssertTypeEq<T, T> {
4729 typedef bool type;
4730};
4731
4732// A unique type used as the default value for the arguments of class
4733// template Types. This allows us to simulate variadic templates
4734// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
4735// support directly.
4736struct None {};
4737
4738// The following family of struct and struct templates are used to
4739// represent type lists. In particular, TypesN<T1, T2, ..., TN>
4740// represents a type list with N types (T1, T2, ..., and TN) in it.
4741// Except for Types0, every struct in the family has two member types:
4742// Head for the first type in the list, and Tail for the rest of the
4743// list.
4744
4745// The empty type list.
4746struct Types0 {};
4747
4748// Type lists of length 1, 2, 3, and so on.
4749
4750template <typename T1>
4751struct Types1 {
4752 typedef T1 Head;
4753 typedef Types0 Tail;
4754};
4755template <typename T1, typename T2>
4756struct Types2 {
4757 typedef T1 Head;
4758 typedef Types1<T2> Tail;
4759};
4760
4761template <typename T1, typename T2, typename T3>
4762struct Types3 {
4763 typedef T1 Head;
4764 typedef Types2<T2, T3> Tail;
4765};
4766
4767template <typename T1, typename T2, typename T3, typename T4>
4768struct Types4 {
4769 typedef T1 Head;
4770 typedef Types3<T2, T3, T4> Tail;
4771};
4772
4773template <typename T1, typename T2, typename T3, typename T4, typename T5>
4774struct Types5 {
4775 typedef T1 Head;
4776 typedef Types4<T2, T3, T4, T5> Tail;
4777};
4778
4779template <typename T1, typename T2, typename T3, typename T4, typename T5,
4780 typename T6>
4781struct Types6 {
4782 typedef T1 Head;
4783 typedef Types5<T2, T3, T4, T5, T6> Tail;
4784};
4785
4786template <typename T1, typename T2, typename T3, typename T4, typename T5,
4787 typename T6, typename T7>
4788struct Types7 {
4789 typedef T1 Head;
4790 typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
4791};
4792
4793template <typename T1, typename T2, typename T3, typename T4, typename T5,
4794 typename T6, typename T7, typename T8>
4795struct Types8 {
4796 typedef T1 Head;
4797 typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
4798};
4799
4800template <typename T1, typename T2, typename T3, typename T4, typename T5,
4801 typename T6, typename T7, typename T8, typename T9>
4802struct Types9 {
4803 typedef T1 Head;
4804 typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
4805};
4806
4807template <typename T1, typename T2, typename T3, typename T4, typename T5,
4808 typename T6, typename T7, typename T8, typename T9, typename T10>
4809struct Types10 {
4810 typedef T1 Head;
4811 typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
4812};
4813
4814template <typename T1, typename T2, typename T3, typename T4, typename T5,
4815 typename T6, typename T7, typename T8, typename T9, typename T10,
4816 typename T11>
4817struct Types11 {
4818 typedef T1 Head;
4819 typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
4820};
4821
4822template <typename T1, typename T2, typename T3, typename T4, typename T5,
4823 typename T6, typename T7, typename T8, typename T9, typename T10,
4824 typename T11, typename T12>
4825struct Types12 {
4826 typedef T1 Head;
4827 typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
4828};
4829
4830template <typename T1, typename T2, typename T3, typename T4, typename T5,
4831 typename T6, typename T7, typename T8, typename T9, typename T10,
4832 typename T11, typename T12, typename T13>
4833struct Types13 {
4834 typedef T1 Head;
4835 typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
4836};
4837
4838template <typename T1, typename T2, typename T3, typename T4, typename T5,
4839 typename T6, typename T7, typename T8, typename T9, typename T10,
4840 typename T11, typename T12, typename T13, typename T14>
4841struct Types14 {
4842 typedef T1 Head;
4843 typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
4844};
4845
4846template <typename T1, typename T2, typename T3, typename T4, typename T5,
4847 typename T6, typename T7, typename T8, typename T9, typename T10,
4848 typename T11, typename T12, typename T13, typename T14, typename T15>
4849struct Types15 {
4850 typedef T1 Head;
4851 typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4852 T15> Tail;
4853};
4854
4855template <typename T1, typename T2, typename T3, typename T4, typename T5,
4856 typename T6, typename T7, typename T8, typename T9, typename T10,
4857 typename T11, typename T12, typename T13, typename T14, typename T15,
4858 typename T16>
4859struct Types16 {
4860 typedef T1 Head;
4861 typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4862 T16> Tail;
4863};
4864
4865template <typename T1, typename T2, typename T3, typename T4, typename T5,
4866 typename T6, typename T7, typename T8, typename T9, typename T10,
4867 typename T11, typename T12, typename T13, typename T14, typename T15,
4868 typename T16, typename T17>
4869struct Types17 {
4870 typedef T1 Head;
4871 typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4872 T16, T17> Tail;
4873};
4874
4875template <typename T1, typename T2, typename T3, typename T4, typename T5,
4876 typename T6, typename T7, typename T8, typename T9, typename T10,
4877 typename T11, typename T12, typename T13, typename T14, typename T15,
4878 typename T16, typename T17, typename T18>
4879struct Types18 {
4880 typedef T1 Head;
4881 typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4882 T16, T17, T18> Tail;
4883};
4884
4885template <typename T1, typename T2, typename T3, typename T4, typename T5,
4886 typename T6, typename T7, typename T8, typename T9, typename T10,
4887 typename T11, typename T12, typename T13, typename T14, typename T15,
4888 typename T16, typename T17, typename T18, typename T19>
4889struct Types19 {
4890 typedef T1 Head;
4891 typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4892 T16, T17, T18, T19> Tail;
4893};
4894
4895template <typename T1, typename T2, typename T3, typename T4, typename T5,
4896 typename T6, typename T7, typename T8, typename T9, typename T10,
4897 typename T11, typename T12, typename T13, typename T14, typename T15,
4898 typename T16, typename T17, typename T18, typename T19, typename T20>
4899struct Types20 {
4900 typedef T1 Head;
4901 typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4902 T16, T17, T18, T19, T20> Tail;
4903};
4904
4905template <typename T1, typename T2, typename T3, typename T4, typename T5,
4906 typename T6, typename T7, typename T8, typename T9, typename T10,
4907 typename T11, typename T12, typename T13, typename T14, typename T15,
4908 typename T16, typename T17, typename T18, typename T19, typename T20,
4909 typename T21>
4910struct Types21 {
4911 typedef T1 Head;
4912 typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4913 T16, T17, T18, T19, T20, T21> Tail;
4914};
4915
4916template <typename T1, typename T2, typename T3, typename T4, typename T5,
4917 typename T6, typename T7, typename T8, typename T9, typename T10,
4918 typename T11, typename T12, typename T13, typename T14, typename T15,
4919 typename T16, typename T17, typename T18, typename T19, typename T20,
4920 typename T21, typename T22>
4921struct Types22 {
4922 typedef T1 Head;
4923 typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4924 T16, T17, T18, T19, T20, T21, T22> Tail;
4925};
4926
4927template <typename T1, typename T2, typename T3, typename T4, typename T5,
4928 typename T6, typename T7, typename T8, typename T9, typename T10,
4929 typename T11, typename T12, typename T13, typename T14, typename T15,
4930 typename T16, typename T17, typename T18, typename T19, typename T20,
4931 typename T21, typename T22, typename T23>
4932struct Types23 {
4933 typedef T1 Head;
4934 typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4935 T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4936};
4937
4938template <typename T1, typename T2, typename T3, typename T4, typename T5,
4939 typename T6, typename T7, typename T8, typename T9, typename T10,
4940 typename T11, typename T12, typename T13, typename T14, typename T15,
4941 typename T16, typename T17, typename T18, typename T19, typename T20,
4942 typename T21, typename T22, typename T23, typename T24>
4943struct Types24 {
4944 typedef T1 Head;
4945 typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4946 T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4947};
4948
4949template <typename T1, typename T2, typename T3, typename T4, typename T5,
4950 typename T6, typename T7, typename T8, typename T9, typename T10,
4951 typename T11, typename T12, typename T13, typename T14, typename T15,
4952 typename T16, typename T17, typename T18, typename T19, typename T20,
4953 typename T21, typename T22, typename T23, typename T24, typename T25>
4954struct Types25 {
4955 typedef T1 Head;
4956 typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4957 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4958};
4959
4960template <typename T1, typename T2, typename T3, typename T4, typename T5,
4961 typename T6, typename T7, typename T8, typename T9, typename T10,
4962 typename T11, typename T12, typename T13, typename T14, typename T15,
4963 typename T16, typename T17, typename T18, typename T19, typename T20,
4964 typename T21, typename T22, typename T23, typename T24, typename T25,
4965 typename T26>
4966struct Types26 {
4967 typedef T1 Head;
4968 typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4969 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4970};
4971
4972template <typename T1, typename T2, typename T3, typename T4, typename T5,
4973 typename T6, typename T7, typename T8, typename T9, typename T10,
4974 typename T11, typename T12, typename T13, typename T14, typename T15,
4975 typename T16, typename T17, typename T18, typename T19, typename T20,
4976 typename T21, typename T22, typename T23, typename T24, typename T25,
4977 typename T26, typename T27>
4978struct Types27 {
4979 typedef T1 Head;
4980 typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4981 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4982};
4983
4984template <typename T1, typename T2, typename T3, typename T4, typename T5,
4985 typename T6, typename T7, typename T8, typename T9, typename T10,
4986 typename T11, typename T12, typename T13, typename T14, typename T15,
4987 typename T16, typename T17, typename T18, typename T19, typename T20,
4988 typename T21, typename T22, typename T23, typename T24, typename T25,
4989 typename T26, typename T27, typename T28>
4990struct Types28 {
4991 typedef T1 Head;
4992 typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4993 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4994};
4995
4996template <typename T1, typename T2, typename T3, typename T4, typename T5,
4997 typename T6, typename T7, typename T8, typename T9, typename T10,
4998 typename T11, typename T12, typename T13, typename T14, typename T15,
4999 typename T16, typename T17, typename T18, typename T19, typename T20,
5000 typename T21, typename T22, typename T23, typename T24, typename T25,
5001 typename T26, typename T27, typename T28, typename T29>
5002struct Types29 {
5003 typedef T1 Head;
5004 typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5005 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5006 T29> Tail;
5007};
5008
5009template <typename T1, typename T2, typename T3, typename T4, typename T5,
5010 typename T6, typename T7, typename T8, typename T9, typename T10,
5011 typename T11, typename T12, typename T13, typename T14, typename T15,
5012 typename T16, typename T17, typename T18, typename T19, typename T20,
5013 typename T21, typename T22, typename T23, typename T24, typename T25,
5014 typename T26, typename T27, typename T28, typename T29, typename T30>
5015struct Types30 {
5016 typedef T1 Head;
5017 typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5018 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5019 T30> Tail;
5020};
5021
5022template <typename T1, typename T2, typename T3, typename T4, typename T5,
5023 typename T6, typename T7, typename T8, typename T9, typename T10,
5024 typename T11, typename T12, typename T13, typename T14, typename T15,
5025 typename T16, typename T17, typename T18, typename T19, typename T20,
5026 typename T21, typename T22, typename T23, typename T24, typename T25,
5027 typename T26, typename T27, typename T28, typename T29, typename T30,
5028 typename T31>
5029struct Types31 {
5030 typedef T1 Head;
5031 typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5032 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5033 T30, T31> Tail;
5034};
5035
5036template <typename T1, typename T2, typename T3, typename T4, typename T5,
5037 typename T6, typename T7, typename T8, typename T9, typename T10,
5038 typename T11, typename T12, typename T13, typename T14, typename T15,
5039 typename T16, typename T17, typename T18, typename T19, typename T20,
5040 typename T21, typename T22, typename T23, typename T24, typename T25,
5041 typename T26, typename T27, typename T28, typename T29, typename T30,
5042 typename T31, typename T32>
5043struct Types32 {
5044 typedef T1 Head;
5045 typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5046 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5047 T30, T31, T32> Tail;
5048};
5049
5050template <typename T1, typename T2, typename T3, typename T4, typename T5,
5051 typename T6, typename T7, typename T8, typename T9, typename T10,
5052 typename T11, typename T12, typename T13, typename T14, typename T15,
5053 typename T16, typename T17, typename T18, typename T19, typename T20,
5054 typename T21, typename T22, typename T23, typename T24, typename T25,
5055 typename T26, typename T27, typename T28, typename T29, typename T30,
5056 typename T31, typename T32, typename T33>
5057struct Types33 {
5058 typedef T1 Head;
5059 typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5060 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5061 T30, T31, T32, T33> Tail;
5062};
5063
5064template <typename T1, typename T2, typename T3, typename T4, typename T5,
5065 typename T6, typename T7, typename T8, typename T9, typename T10,
5066 typename T11, typename T12, typename T13, typename T14, typename T15,
5067 typename T16, typename T17, typename T18, typename T19, typename T20,
5068 typename T21, typename T22, typename T23, typename T24, typename T25,
5069 typename T26, typename T27, typename T28, typename T29, typename T30,
5070 typename T31, typename T32, typename T33, typename T34>
5071struct Types34 {
5072 typedef T1 Head;
5073 typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5074 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5075 T30, T31, T32, T33, T34> Tail;
5076};
5077
5078template <typename T1, typename T2, typename T3, typename T4, typename T5,
5079 typename T6, typename T7, typename T8, typename T9, typename T10,
5080 typename T11, typename T12, typename T13, typename T14, typename T15,
5081 typename T16, typename T17, typename T18, typename T19, typename T20,
5082 typename T21, typename T22, typename T23, typename T24, typename T25,
5083 typename T26, typename T27, typename T28, typename T29, typename T30,
5084 typename T31, typename T32, typename T33, typename T34, typename T35>
5085struct Types35 {
5086 typedef T1 Head;
5087 typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5088 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5089 T30, T31, T32, T33, T34, T35> Tail;
5090};
5091
5092template <typename T1, typename T2, typename T3, typename T4, typename T5,
5093 typename T6, typename T7, typename T8, typename T9, typename T10,
5094 typename T11, typename T12, typename T13, typename T14, typename T15,
5095 typename T16, typename T17, typename T18, typename T19, typename T20,
5096 typename T21, typename T22, typename T23, typename T24, typename T25,
5097 typename T26, typename T27, typename T28, typename T29, typename T30,
5098 typename T31, typename T32, typename T33, typename T34, typename T35,
5099 typename T36>
5100struct Types36 {
5101 typedef T1 Head;
5102 typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5103 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5104 T30, T31, T32, T33, T34, T35, T36> Tail;
5105};
5106
5107template <typename T1, typename T2, typename T3, typename T4, typename T5,
5108 typename T6, typename T7, typename T8, typename T9, typename T10,
5109 typename T11, typename T12, typename T13, typename T14, typename T15,
5110 typename T16, typename T17, typename T18, typename T19, typename T20,
5111 typename T21, typename T22, typename T23, typename T24, typename T25,
5112 typename T26, typename T27, typename T28, typename T29, typename T30,
5113 typename T31, typename T32, typename T33, typename T34, typename T35,
5114 typename T36, typename T37>
5115struct Types37 {
5116 typedef T1 Head;
5117 typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5118 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5119 T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5120};
5121
5122template <typename T1, typename T2, typename T3, typename T4, typename T5,
5123 typename T6, typename T7, typename T8, typename T9, typename T10,
5124 typename T11, typename T12, typename T13, typename T14, typename T15,
5125 typename T16, typename T17, typename T18, typename T19, typename T20,
5126 typename T21, typename T22, typename T23, typename T24, typename T25,
5127 typename T26, typename T27, typename T28, typename T29, typename T30,
5128 typename T31, typename T32, typename T33, typename T34, typename T35,
5129 typename T36, typename T37, typename T38>
5130struct Types38 {
5131 typedef T1 Head;
5132 typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5133 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5134 T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5135};
5136
5137template <typename T1, typename T2, typename T3, typename T4, typename T5,
5138 typename T6, typename T7, typename T8, typename T9, typename T10,
5139 typename T11, typename T12, typename T13, typename T14, typename T15,
5140 typename T16, typename T17, typename T18, typename T19, typename T20,
5141 typename T21, typename T22, typename T23, typename T24, typename T25,
5142 typename T26, typename T27, typename T28, typename T29, typename T30,
5143 typename T31, typename T32, typename T33, typename T34, typename T35,
5144 typename T36, typename T37, typename T38, typename T39>
5145struct Types39 {
5146 typedef T1 Head;
5147 typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5148 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5149 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5150};
5151
5152template <typename T1, typename T2, typename T3, typename T4, typename T5,
5153 typename T6, typename T7, typename T8, typename T9, typename T10,
5154 typename T11, typename T12, typename T13, typename T14, typename T15,
5155 typename T16, typename T17, typename T18, typename T19, typename T20,
5156 typename T21, typename T22, typename T23, typename T24, typename T25,
5157 typename T26, typename T27, typename T28, typename T29, typename T30,
5158 typename T31, typename T32, typename T33, typename T34, typename T35,
5159 typename T36, typename T37, typename T38, typename T39, typename T40>
5160struct Types40 {
5161 typedef T1 Head;
5162 typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5163 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5164 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5165};
5166
5167template <typename T1, typename T2, typename T3, typename T4, typename T5,
5168 typename T6, typename T7, typename T8, typename T9, typename T10,
5169 typename T11, typename T12, typename T13, typename T14, typename T15,
5170 typename T16, typename T17, typename T18, typename T19, typename T20,
5171 typename T21, typename T22, typename T23, typename T24, typename T25,
5172 typename T26, typename T27, typename T28, typename T29, typename T30,
5173 typename T31, typename T32, typename T33, typename T34, typename T35,
5174 typename T36, typename T37, typename T38, typename T39, typename T40,
5175 typename T41>
5176struct Types41 {
5177 typedef T1 Head;
5178 typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5179 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5180 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5181};
5182
5183template <typename T1, typename T2, typename T3, typename T4, typename T5,
5184 typename T6, typename T7, typename T8, typename T9, typename T10,
5185 typename T11, typename T12, typename T13, typename T14, typename T15,
5186 typename T16, typename T17, typename T18, typename T19, typename T20,
5187 typename T21, typename T22, typename T23, typename T24, typename T25,
5188 typename T26, typename T27, typename T28, typename T29, typename T30,
5189 typename T31, typename T32, typename T33, typename T34, typename T35,
5190 typename T36, typename T37, typename T38, typename T39, typename T40,
5191 typename T41, typename T42>
5192struct Types42 {
5193 typedef T1 Head;
5194 typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5195 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5196 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
5197};
5198
5199template <typename T1, typename T2, typename T3, typename T4, typename T5,
5200 typename T6, typename T7, typename T8, typename T9, typename T10,
5201 typename T11, typename T12, typename T13, typename T14, typename T15,
5202 typename T16, typename T17, typename T18, typename T19, typename T20,
5203 typename T21, typename T22, typename T23, typename T24, typename T25,
5204 typename T26, typename T27, typename T28, typename T29, typename T30,
5205 typename T31, typename T32, typename T33, typename T34, typename T35,
5206 typename T36, typename T37, typename T38, typename T39, typename T40,
5207 typename T41, typename T42, typename T43>
5208struct Types43 {
5209 typedef T1 Head;
5210 typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5211 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5212 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5213 T43> Tail;
5214};
5215
5216template <typename T1, typename T2, typename T3, typename T4, typename T5,
5217 typename T6, typename T7, typename T8, typename T9, typename T10,
5218 typename T11, typename T12, typename T13, typename T14, typename T15,
5219 typename T16, typename T17, typename T18, typename T19, typename T20,
5220 typename T21, typename T22, typename T23, typename T24, typename T25,
5221 typename T26, typename T27, typename T28, typename T29, typename T30,
5222 typename T31, typename T32, typename T33, typename T34, typename T35,
5223 typename T36, typename T37, typename T38, typename T39, typename T40,
5224 typename T41, typename T42, typename T43, typename T44>
5225struct Types44 {
5226 typedef T1 Head;
5227 typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5228 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5229 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5230 T44> Tail;
5231};
5232
5233template <typename T1, typename T2, typename T3, typename T4, typename T5,
5234 typename T6, typename T7, typename T8, typename T9, typename T10,
5235 typename T11, typename T12, typename T13, typename T14, typename T15,
5236 typename T16, typename T17, typename T18, typename T19, typename T20,
5237 typename T21, typename T22, typename T23, typename T24, typename T25,
5238 typename T26, typename T27, typename T28, typename T29, typename T30,
5239 typename T31, typename T32, typename T33, typename T34, typename T35,
5240 typename T36, typename T37, typename T38, typename T39, typename T40,
5241 typename T41, typename T42, typename T43, typename T44, typename T45>
5242struct Types45 {
5243 typedef T1 Head;
5244 typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5245 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5246 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5247 T44, T45> Tail;
5248};
5249
5250template <typename T1, typename T2, typename T3, typename T4, typename T5,
5251 typename T6, typename T7, typename T8, typename T9, typename T10,
5252 typename T11, typename T12, typename T13, typename T14, typename T15,
5253 typename T16, typename T17, typename T18, typename T19, typename T20,
5254 typename T21, typename T22, typename T23, typename T24, typename T25,
5255 typename T26, typename T27, typename T28, typename T29, typename T30,
5256 typename T31, typename T32, typename T33, typename T34, typename T35,
5257 typename T36, typename T37, typename T38, typename T39, typename T40,
5258 typename T41, typename T42, typename T43, typename T44, typename T45,
5259 typename T46>
5260struct Types46 {
5261 typedef T1 Head;
5262 typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5263 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5264 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5265 T44, T45, T46> Tail;
5266};
5267
5268template <typename T1, typename T2, typename T3, typename T4, typename T5,
5269 typename T6, typename T7, typename T8, typename T9, typename T10,
5270 typename T11, typename T12, typename T13, typename T14, typename T15,
5271 typename T16, typename T17, typename T18, typename T19, typename T20,
5272 typename T21, typename T22, typename T23, typename T24, typename T25,
5273 typename T26, typename T27, typename T28, typename T29, typename T30,
5274 typename T31, typename T32, typename T33, typename T34, typename T35,
5275 typename T36, typename T37, typename T38, typename T39, typename T40,
5276 typename T41, typename T42, typename T43, typename T44, typename T45,
5277 typename T46, typename T47>
5278struct Types47 {
5279 typedef T1 Head;
5280 typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5281 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5282 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5283 T44, T45, T46, T47> Tail;
5284};
5285
5286template <typename T1, typename T2, typename T3, typename T4, typename T5,
5287 typename T6, typename T7, typename T8, typename T9, typename T10,
5288 typename T11, typename T12, typename T13, typename T14, typename T15,
5289 typename T16, typename T17, typename T18, typename T19, typename T20,
5290 typename T21, typename T22, typename T23, typename T24, typename T25,
5291 typename T26, typename T27, typename T28, typename T29, typename T30,
5292 typename T31, typename T32, typename T33, typename T34, typename T35,
5293 typename T36, typename T37, typename T38, typename T39, typename T40,
5294 typename T41, typename T42, typename T43, typename T44, typename T45,
5295 typename T46, typename T47, typename T48>
5296struct Types48 {
5297 typedef T1 Head;
5298 typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5299 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5300 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5301 T44, T45, T46, T47, T48> Tail;
5302};
5303
5304template <typename T1, typename T2, typename T3, typename T4, typename T5,
5305 typename T6, typename T7, typename T8, typename T9, typename T10,
5306 typename T11, typename T12, typename T13, typename T14, typename T15,
5307 typename T16, typename T17, typename T18, typename T19, typename T20,
5308 typename T21, typename T22, typename T23, typename T24, typename T25,
5309 typename T26, typename T27, typename T28, typename T29, typename T30,
5310 typename T31, typename T32, typename T33, typename T34, typename T35,
5311 typename T36, typename T37, typename T38, typename T39, typename T40,
5312 typename T41, typename T42, typename T43, typename T44, typename T45,
5313 typename T46, typename T47, typename T48, typename T49>
5314struct Types49 {
5315 typedef T1 Head;
5316 typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5317 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5318 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5319 T44, T45, T46, T47, T48, T49> Tail;
5320};
5321
5322template <typename T1, typename T2, typename T3, typename T4, typename T5,
5323 typename T6, typename T7, typename T8, typename T9, typename T10,
5324 typename T11, typename T12, typename T13, typename T14, typename T15,
5325 typename T16, typename T17, typename T18, typename T19, typename T20,
5326 typename T21, typename T22, typename T23, typename T24, typename T25,
5327 typename T26, typename T27, typename T28, typename T29, typename T30,
5328 typename T31, typename T32, typename T33, typename T34, typename T35,
5329 typename T36, typename T37, typename T38, typename T39, typename T40,
5330 typename T41, typename T42, typename T43, typename T44, typename T45,
5331 typename T46, typename T47, typename T48, typename T49, typename T50>
5332struct Types50 {
5333 typedef T1 Head;
5334 typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5335 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5336 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5337 T44, T45, T46, T47, T48, T49, T50> Tail;
5338};
5339
5340
5341} // namespace internal
5342
5343// We don't want to require the users to write TypesN<...> directly,
5344// as that would require them to count the length. Types<...> is much
5345// easier to write, but generates horrible messages when there is a
5346// compiler error, as gcc insists on printing out each template
5347// argument, even if it has the default value (this means Types<int>
5348// will appear as Types<int, None, None, ..., None> in the compiler
5349// errors).
5350//
5351// Our solution is to combine the best part of the two approaches: a
5352// user would write Types<T1, ..., TN>, and Google Test will translate
5353// that to TypesN<T1, ..., TN> internally to make error messages
5354// readable. The translation is done by the 'type' member of the
5355// Types template.
5356template <typename T1 = internal::None, typename T2 = internal::None,
5357 typename T3 = internal::None, typename T4 = internal::None,
5358 typename T5 = internal::None, typename T6 = internal::None,
5359 typename T7 = internal::None, typename T8 = internal::None,
5360 typename T9 = internal::None, typename T10 = internal::None,
5361 typename T11 = internal::None, typename T12 = internal::None,
5362 typename T13 = internal::None, typename T14 = internal::None,
5363 typename T15 = internal::None, typename T16 = internal::None,
5364 typename T17 = internal::None, typename T18 = internal::None,
5365 typename T19 = internal::None, typename T20 = internal::None,
5366 typename T21 = internal::None, typename T22 = internal::None,
5367 typename T23 = internal::None, typename T24 = internal::None,
5368 typename T25 = internal::None, typename T26 = internal::None,
5369 typename T27 = internal::None, typename T28 = internal::None,
5370 typename T29 = internal::None, typename T30 = internal::None,
5371 typename T31 = internal::None, typename T32 = internal::None,
5372 typename T33 = internal::None, typename T34 = internal::None,
5373 typename T35 = internal::None, typename T36 = internal::None,
5374 typename T37 = internal::None, typename T38 = internal::None,
5375 typename T39 = internal::None, typename T40 = internal::None,
5376 typename T41 = internal::None, typename T42 = internal::None,
5377 typename T43 = internal::None, typename T44 = internal::None,
5378 typename T45 = internal::None, typename T46 = internal::None,
5379 typename T47 = internal::None, typename T48 = internal::None,
5380 typename T49 = internal::None, typename T50 = internal::None>
5381struct Types {
5382 typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5383 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5384 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5385 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5386};
5387
5388template <>
5389struct Types<internal::None, internal::None, internal::None, internal::None,
5390 internal::None, internal::None, internal::None, internal::None,
5391 internal::None, internal::None, internal::None, internal::None,
5392 internal::None, internal::None, internal::None, internal::None,
5393 internal::None, internal::None, internal::None, internal::None,
5394 internal::None, internal::None, internal::None, internal::None,
5395 internal::None, internal::None, internal::None, internal::None,
5396 internal::None, internal::None, internal::None, internal::None,
5397 internal::None, internal::None, internal::None, internal::None,
5398 internal::None, internal::None, internal::None, internal::None,
5399 internal::None, internal::None, internal::None, internal::None,
5400 internal::None, internal::None, internal::None, internal::None,
5401 internal::None, internal::None> {
5402 typedef internal::Types0 type;
5403};
5404template <typename T1>
5405struct Types<T1, internal::None, internal::None, internal::None,
5406 internal::None, internal::None, internal::None, internal::None,
5407 internal::None, internal::None, internal::None, internal::None,
5408 internal::None, internal::None, internal::None, internal::None,
5409 internal::None, internal::None, internal::None, internal::None,
5410 internal::None, internal::None, internal::None, internal::None,
5411 internal::None, internal::None, internal::None, internal::None,
5412 internal::None, internal::None, internal::None, internal::None,
5413 internal::None, internal::None, internal::None, internal::None,
5414 internal::None, internal::None, internal::None, internal::None,
5415 internal::None, internal::None, internal::None, internal::None,
5416 internal::None, internal::None, internal::None, internal::None,
5417 internal::None, internal::None> {
5418 typedef internal::Types1<T1> type;
5419};
5420template <typename T1, typename T2>
5421struct Types<T1, T2, internal::None, internal::None, internal::None,
5422 internal::None, internal::None, internal::None, internal::None,
5423 internal::None, internal::None, internal::None, internal::None,
5424 internal::None, internal::None, internal::None, internal::None,
5425 internal::None, internal::None, internal::None, internal::None,
5426 internal::None, internal::None, internal::None, internal::None,
5427 internal::None, internal::None, internal::None, internal::None,
5428 internal::None, internal::None, internal::None, internal::None,
5429 internal::None, internal::None, internal::None, internal::None,
5430 internal::None, internal::None, internal::None, internal::None,
5431 internal::None, internal::None, internal::None, internal::None,
5432 internal::None, internal::None, internal::None, internal::None,
5433 internal::None> {
5434 typedef internal::Types2<T1, T2> type;
5435};
5436template <typename T1, typename T2, typename T3>
5437struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
5438 internal::None, internal::None, internal::None, internal::None,
5439 internal::None, internal::None, internal::None, internal::None,
5440 internal::None, internal::None, internal::None, internal::None,
5441 internal::None, internal::None, internal::None, internal::None,
5442 internal::None, internal::None, internal::None, internal::None,
5443 internal::None, internal::None, internal::None, internal::None,
5444 internal::None, internal::None, internal::None, internal::None,
5445 internal::None, internal::None, internal::None, internal::None,
5446 internal::None, internal::None, internal::None, internal::None,
5447 internal::None, internal::None, internal::None, internal::None,
5448 internal::None, internal::None, internal::None, internal::None> {
5449 typedef internal::Types3<T1, T2, T3> type;
5450};
5451template <typename T1, typename T2, typename T3, typename T4>
5452struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
5453 internal::None, internal::None, internal::None, internal::None,
5454 internal::None, internal::None, internal::None, internal::None,
5455 internal::None, internal::None, internal::None, internal::None,
5456 internal::None, internal::None, internal::None, internal::None,
5457 internal::None, internal::None, internal::None, internal::None,
5458 internal::None, internal::None, internal::None, internal::None,
5459 internal::None, internal::None, internal::None, internal::None,
5460 internal::None, internal::None, internal::None, internal::None,
5461 internal::None, internal::None, internal::None, internal::None,
5462 internal::None, internal::None, internal::None, internal::None,
5463 internal::None, internal::None, internal::None> {
5464 typedef internal::Types4<T1, T2, T3, T4> type;
5465};
5466template <typename T1, typename T2, typename T3, typename T4, typename T5>
5467struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
5468 internal::None, internal::None, internal::None, internal::None,
5469 internal::None, internal::None, internal::None, internal::None,
5470 internal::None, internal::None, internal::None, internal::None,
5471 internal::None, internal::None, internal::None, internal::None,
5472 internal::None, internal::None, internal::None, internal::None,
5473 internal::None, internal::None, internal::None, internal::None,
5474 internal::None, internal::None, internal::None, internal::None,
5475 internal::None, internal::None, internal::None, internal::None,
5476 internal::None, internal::None, internal::None, internal::None,
5477 internal::None, internal::None, internal::None, internal::None,
5478 internal::None, internal::None, internal::None> {
5479 typedef internal::Types5<T1, T2, T3, T4, T5> type;
5480};
5481template <typename T1, typename T2, typename T3, typename T4, typename T5,
5482 typename T6>
5483struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
5484 internal::None, internal::None, internal::None, internal::None,
5485 internal::None, internal::None, internal::None, internal::None,
5486 internal::None, internal::None, internal::None, internal::None,
5487 internal::None, internal::None, internal::None, internal::None,
5488 internal::None, internal::None, internal::None, internal::None,
5489 internal::None, internal::None, internal::None, internal::None,
5490 internal::None, internal::None, internal::None, internal::None,
5491 internal::None, internal::None, internal::None, internal::None,
5492 internal::None, internal::None, internal::None, internal::None,
5493 internal::None, internal::None, internal::None, internal::None,
5494 internal::None, internal::None> {
5495 typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
5496};
5497template <typename T1, typename T2, typename T3, typename T4, typename T5,
5498 typename T6, typename T7>
5499struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
5500 internal::None, internal::None, internal::None, internal::None,
5501 internal::None, internal::None, internal::None, internal::None,
5502 internal::None, internal::None, internal::None, internal::None,
5503 internal::None, internal::None, internal::None, internal::None,
5504 internal::None, internal::None, internal::None, internal::None,
5505 internal::None, internal::None, internal::None, internal::None,
5506 internal::None, internal::None, internal::None, internal::None,
5507 internal::None, internal::None, internal::None, internal::None,
5508 internal::None, internal::None, internal::None, internal::None,
5509 internal::None, internal::None, internal::None, internal::None,
5510 internal::None> {
5511 typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
5512};
5513template <typename T1, typename T2, typename T3, typename T4, typename T5,
5514 typename T6, typename T7, typename T8>
5515struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
5516 internal::None, internal::None, internal::None, internal::None,
5517 internal::None, internal::None, internal::None, internal::None,
5518 internal::None, internal::None, internal::None, internal::None,
5519 internal::None, internal::None, internal::None, internal::None,
5520 internal::None, internal::None, internal::None, internal::None,
5521 internal::None, internal::None, internal::None, internal::None,
5522 internal::None, internal::None, internal::None, internal::None,
5523 internal::None, internal::None, internal::None, internal::None,
5524 internal::None, internal::None, internal::None, internal::None,
5525 internal::None, internal::None, internal::None, internal::None> {
5526 typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
5527};
5528template <typename T1, typename T2, typename T3, typename T4, typename T5,
5529 typename T6, typename T7, typename T8, typename T9>
5530struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
5531 internal::None, internal::None, internal::None, internal::None,
5532 internal::None, internal::None, internal::None, internal::None,
5533 internal::None, internal::None, internal::None, internal::None,
5534 internal::None, internal::None, internal::None, internal::None,
5535 internal::None, internal::None, internal::None, internal::None,
5536 internal::None, internal::None, internal::None, internal::None,
5537 internal::None, internal::None, internal::None, internal::None,
5538 internal::None, internal::None, internal::None, internal::None,
5539 internal::None, internal::None, internal::None, internal::None,
5540 internal::None, internal::None, internal::None, internal::None> {
5541 typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
5542};
5543template <typename T1, typename T2, typename T3, typename T4, typename T5,
5544 typename T6, typename T7, typename T8, typename T9, typename T10>
5545struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
5546 internal::None, internal::None, internal::None, internal::None,
5547 internal::None, internal::None, internal::None, internal::None,
5548 internal::None, internal::None, internal::None, internal::None,
5549 internal::None, internal::None, internal::None, internal::None,
5550 internal::None, internal::None, internal::None, internal::None,
5551 internal::None, internal::None, internal::None, internal::None,
5552 internal::None, internal::None, internal::None, internal::None,
5553 internal::None, internal::None, internal::None, internal::None,
5554 internal::None, internal::None, internal::None, internal::None,
5555 internal::None, internal::None, internal::None> {
5556 typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
5557};
5558template <typename T1, typename T2, typename T3, typename T4, typename T5,
5559 typename T6, typename T7, typename T8, typename T9, typename T10,
5560 typename T11>
5561struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
5562 internal::None, internal::None, internal::None, internal::None,
5563 internal::None, internal::None, internal::None, internal::None,
5564 internal::None, internal::None, internal::None, internal::None,
5565 internal::None, internal::None, internal::None, internal::None,
5566 internal::None, internal::None, internal::None, internal::None,
5567 internal::None, internal::None, internal::None, internal::None,
5568 internal::None, internal::None, internal::None, internal::None,
5569 internal::None, internal::None, internal::None, internal::None,
5570 internal::None, internal::None, internal::None, internal::None,
5571 internal::None, internal::None> {
5572 typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
5573};
5574template <typename T1, typename T2, typename T3, typename T4, typename T5,
5575 typename T6, typename T7, typename T8, typename T9, typename T10,
5576 typename T11, typename T12>
5577struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
5578 internal::None, internal::None, internal::None, internal::None,
5579 internal::None, internal::None, internal::None, internal::None,
5580 internal::None, internal::None, internal::None, internal::None,
5581 internal::None, internal::None, internal::None, internal::None,
5582 internal::None, internal::None, internal::None, internal::None,
5583 internal::None, internal::None, internal::None, internal::None,
5584 internal::None, internal::None, internal::None, internal::None,
5585 internal::None, internal::None, internal::None, internal::None,
5586 internal::None, internal::None, internal::None, internal::None,
5587 internal::None> {
5588 typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
5589 T12> type;
5590};
5591template <typename T1, typename T2, typename T3, typename T4, typename T5,
5592 typename T6, typename T7, typename T8, typename T9, typename T10,
5593 typename T11, typename T12, typename T13>
5594struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5595 internal::None, internal::None, internal::None, internal::None,
5596 internal::None, internal::None, internal::None, internal::None,
5597 internal::None, internal::None, internal::None, internal::None,
5598 internal::None, internal::None, internal::None, internal::None,
5599 internal::None, internal::None, internal::None, internal::None,
5600 internal::None, internal::None, internal::None, internal::None,
5601 internal::None, internal::None, internal::None, internal::None,
5602 internal::None, internal::None, internal::None, internal::None,
5603 internal::None, internal::None, internal::None, internal::None,
5604 internal::None> {
5605 typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5606 T13> type;
5607};
5608template <typename T1, typename T2, typename T3, typename T4, typename T5,
5609 typename T6, typename T7, typename T8, typename T9, typename T10,
5610 typename T11, typename T12, typename T13, typename T14>
5611struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5612 internal::None, internal::None, internal::None, internal::None,
5613 internal::None, internal::None, internal::None, internal::None,
5614 internal::None, internal::None, internal::None, internal::None,
5615 internal::None, internal::None, internal::None, internal::None,
5616 internal::None, internal::None, internal::None, internal::None,
5617 internal::None, internal::None, internal::None, internal::None,
5618 internal::None, internal::None, internal::None, internal::None,
5619 internal::None, internal::None, internal::None, internal::None,
5620 internal::None, internal::None, internal::None, internal::None> {
5621 typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5622 T13, T14> type;
5623};
5624template <typename T1, typename T2, typename T3, typename T4, typename T5,
5625 typename T6, typename T7, typename T8, typename T9, typename T10,
5626 typename T11, typename T12, typename T13, typename T14, typename T15>
5627struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5628 internal::None, internal::None, internal::None, internal::None,
5629 internal::None, internal::None, internal::None, internal::None,
5630 internal::None, internal::None, internal::None, internal::None,
5631 internal::None, internal::None, internal::None, internal::None,
5632 internal::None, internal::None, internal::None, internal::None,
5633 internal::None, internal::None, internal::None, internal::None,
5634 internal::None, internal::None, internal::None, internal::None,
5635 internal::None, internal::None, internal::None, internal::None,
5636 internal::None, internal::None, internal::None> {
5637 typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5638 T13, T14, T15> type;
5639};
5640template <typename T1, typename T2, typename T3, typename T4, typename T5,
5641 typename T6, typename T7, typename T8, typename T9, typename T10,
5642 typename T11, typename T12, typename T13, typename T14, typename T15,
5643 typename T16>
5644struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5645 T16, internal::None, internal::None, internal::None, internal::None,
5646 internal::None, internal::None, internal::None, internal::None,
5647 internal::None, internal::None, internal::None, internal::None,
5648 internal::None, internal::None, internal::None, internal::None,
5649 internal::None, internal::None, internal::None, internal::None,
5650 internal::None, internal::None, internal::None, internal::None,
5651 internal::None, internal::None, internal::None, internal::None,
5652 internal::None, internal::None, internal::None, internal::None,
5653 internal::None, internal::None> {
5654 typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5655 T13, T14, T15, T16> type;
5656};
5657template <typename T1, typename T2, typename T3, typename T4, typename T5,
5658 typename T6, typename T7, typename T8, typename T9, typename T10,
5659 typename T11, typename T12, typename T13, typename T14, typename T15,
5660 typename T16, typename T17>
5661struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5662 T16, T17, internal::None, internal::None, internal::None, internal::None,
5663 internal::None, internal::None, internal::None, internal::None,
5664 internal::None, internal::None, internal::None, internal::None,
5665 internal::None, internal::None, internal::None, internal::None,
5666 internal::None, internal::None, internal::None, internal::None,
5667 internal::None, internal::None, internal::None, internal::None,
5668 internal::None, internal::None, internal::None, internal::None,
5669 internal::None, internal::None, internal::None, internal::None,
5670 internal::None> {
5671 typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5672 T13, T14, T15, T16, T17> type;
5673};
5674template <typename T1, typename T2, typename T3, typename T4, typename T5,
5675 typename T6, typename T7, typename T8, typename T9, typename T10,
5676 typename T11, typename T12, typename T13, typename T14, typename T15,
5677 typename T16, typename T17, typename T18>
5678struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5679 T16, T17, T18, internal::None, internal::None, internal::None,
5680 internal::None, internal::None, internal::None, internal::None,
5681 internal::None, internal::None, internal::None, internal::None,
5682 internal::None, internal::None, internal::None, internal::None,
5683 internal::None, internal::None, internal::None, internal::None,
5684 internal::None, internal::None, internal::None, internal::None,
5685 internal::None, internal::None, internal::None, internal::None,
5686 internal::None, internal::None, internal::None, internal::None,
5687 internal::None> {
5688 typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5689 T13, T14, T15, T16, T17, T18> type;
5690};
5691template <typename T1, typename T2, typename T3, typename T4, typename T5,
5692 typename T6, typename T7, typename T8, typename T9, typename T10,
5693 typename T11, typename T12, typename T13, typename T14, typename T15,
5694 typename T16, typename T17, typename T18, typename T19>
5695struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5696 T16, T17, T18, T19, internal::None, internal::None, internal::None,
5697 internal::None, internal::None, internal::None, internal::None,
5698 internal::None, internal::None, internal::None, internal::None,
5699 internal::None, internal::None, internal::None, internal::None,
5700 internal::None, internal::None, internal::None, internal::None,
5701 internal::None, internal::None, internal::None, internal::None,
5702 internal::None, internal::None, internal::None, internal::None,
5703 internal::None, internal::None, internal::None, internal::None> {
5704 typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5705 T13, T14, T15, T16, T17, T18, T19> type;
5706};
5707template <typename T1, typename T2, typename T3, typename T4, typename T5,
5708 typename T6, typename T7, typename T8, typename T9, typename T10,
5709 typename T11, typename T12, typename T13, typename T14, typename T15,
5710 typename T16, typename T17, typename T18, typename T19, typename T20>
5711struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5712 T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
5713 internal::None, internal::None, internal::None, internal::None,
5714 internal::None, internal::None, internal::None, internal::None,
5715 internal::None, internal::None, internal::None, internal::None,
5716 internal::None, internal::None, internal::None, internal::None,
5717 internal::None, internal::None, internal::None, internal::None,
5718 internal::None, internal::None, internal::None, internal::None,
5719 internal::None, internal::None, internal::None> {
5720 typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5721 T13, T14, T15, T16, T17, T18, T19, T20> type;
5722};
5723template <typename T1, typename T2, typename T3, typename T4, typename T5,
5724 typename T6, typename T7, typename T8, typename T9, typename T10,
5725 typename T11, typename T12, typename T13, typename T14, typename T15,
5726 typename T16, typename T17, typename T18, typename T19, typename T20,
5727 typename T21>
5728struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5729 T16, T17, T18, T19, T20, T21, internal::None, internal::None,
5730 internal::None, internal::None, internal::None, internal::None,
5731 internal::None, internal::None, internal::None, internal::None,
5732 internal::None, internal::None, internal::None, internal::None,
5733 internal::None, internal::None, internal::None, internal::None,
5734 internal::None, internal::None, internal::None, internal::None,
5735 internal::None, internal::None, internal::None, internal::None,
5736 internal::None, internal::None, internal::None> {
5737 typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5738 T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
5739};
5740template <typename T1, typename T2, typename T3, typename T4, typename T5,
5741 typename T6, typename T7, typename T8, typename T9, typename T10,
5742 typename T11, typename T12, typename T13, typename T14, typename T15,
5743 typename T16, typename T17, typename T18, typename T19, typename T20,
5744 typename T21, typename T22>
5745struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5746 T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
5747 internal::None, internal::None, internal::None, internal::None,
5748 internal::None, internal::None, internal::None, internal::None,
5749 internal::None, internal::None, internal::None, internal::None,
5750 internal::None, internal::None, internal::None, internal::None,
5751 internal::None, internal::None, internal::None, internal::None,
5752 internal::None, internal::None, internal::None, internal::None,
5753 internal::None, internal::None> {
5754 typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5755 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
5756};
5757template <typename T1, typename T2, typename T3, typename T4, typename T5,
5758 typename T6, typename T7, typename T8, typename T9, typename T10,
5759 typename T11, typename T12, typename T13, typename T14, typename T15,
5760 typename T16, typename T17, typename T18, typename T19, typename T20,
5761 typename T21, typename T22, typename T23>
5762struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5763 T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
5764 internal::None, internal::None, internal::None, internal::None,
5765 internal::None, internal::None, internal::None, internal::None,
5766 internal::None, internal::None, internal::None, internal::None,
5767 internal::None, internal::None, internal::None, internal::None,
5768 internal::None, internal::None, internal::None, internal::None,
5769 internal::None, internal::None, internal::None, internal::None,
5770 internal::None> {
5771 typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5772 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
5773};
5774template <typename T1, typename T2, typename T3, typename T4, typename T5,
5775 typename T6, typename T7, typename T8, typename T9, typename T10,
5776 typename T11, typename T12, typename T13, typename T14, typename T15,
5777 typename T16, typename T17, typename T18, typename T19, typename T20,
5778 typename T21, typename T22, typename T23, typename T24>
5779struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5780 T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
5781 internal::None, internal::None, internal::None, internal::None,
5782 internal::None, internal::None, internal::None, internal::None,
5783 internal::None, internal::None, internal::None, internal::None,
5784 internal::None, internal::None, internal::None, internal::None,
5785 internal::None, internal::None, internal::None, internal::None,
5786 internal::None, internal::None, internal::None, internal::None,
5787 internal::None> {
5788 typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5789 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
5790};
5791template <typename T1, typename T2, typename T3, typename T4, typename T5,
5792 typename T6, typename T7, typename T8, typename T9, typename T10,
5793 typename T11, typename T12, typename T13, typename T14, typename T15,
5794 typename T16, typename T17, typename T18, typename T19, typename T20,
5795 typename T21, typename T22, typename T23, typename T24, typename T25>
5796struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5797 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
5798 internal::None, internal::None, internal::None, internal::None,
5799 internal::None, internal::None, internal::None, internal::None,
5800 internal::None, internal::None, internal::None, internal::None,
5801 internal::None, internal::None, internal::None, internal::None,
5802 internal::None, internal::None, internal::None, internal::None,
5803 internal::None, internal::None, internal::None, internal::None> {
5804 typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5805 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
5806};
5807template <typename T1, typename T2, typename T3, typename T4, typename T5,
5808 typename T6, typename T7, typename T8, typename T9, typename T10,
5809 typename T11, typename T12, typename T13, typename T14, typename T15,
5810 typename T16, typename T17, typename T18, typename T19, typename T20,
5811 typename T21, typename T22, typename T23, typename T24, typename T25,
5812 typename T26>
5813struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5814 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
5815 internal::None, internal::None, internal::None, internal::None,
5816 internal::None, internal::None, internal::None, internal::None,
5817 internal::None, internal::None, internal::None, internal::None,
5818 internal::None, internal::None, internal::None, internal::None,
5819 internal::None, internal::None, internal::None, internal::None,
5820 internal::None, internal::None, internal::None> {
5821 typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5822 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
5823 T26> type;
5824};
5825template <typename T1, typename T2, typename T3, typename T4, typename T5,
5826 typename T6, typename T7, typename T8, typename T9, typename T10,
5827 typename T11, typename T12, typename T13, typename T14, typename T15,
5828 typename T16, typename T17, typename T18, typename T19, typename T20,
5829 typename T21, typename T22, typename T23, typename T24, typename T25,
5830 typename T26, typename T27>
5831struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5832 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
5833 internal::None, internal::None, internal::None, internal::None,
5834 internal::None, internal::None, internal::None, internal::None,
5835 internal::None, internal::None, internal::None, internal::None,
5836 internal::None, internal::None, internal::None, internal::None,
5837 internal::None, internal::None, internal::None, internal::None,
5838 internal::None, internal::None> {
5839 typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5840 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5841 T27> type;
5842};
5843template <typename T1, typename T2, typename T3, typename T4, typename T5,
5844 typename T6, typename T7, typename T8, typename T9, typename T10,
5845 typename T11, typename T12, typename T13, typename T14, typename T15,
5846 typename T16, typename T17, typename T18, typename T19, typename T20,
5847 typename T21, typename T22, typename T23, typename T24, typename T25,
5848 typename T26, typename T27, typename T28>
5849struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5850 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5851 internal::None, internal::None, internal::None, internal::None,
5852 internal::None, internal::None, internal::None, internal::None,
5853 internal::None, internal::None, internal::None, internal::None,
5854 internal::None, internal::None, internal::None, internal::None,
5855 internal::None, internal::None, internal::None, internal::None,
5856 internal::None, internal::None> {
5857 typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5858 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5859 T27, T28> type;
5860};
5861template <typename T1, typename T2, typename T3, typename T4, typename T5,
5862 typename T6, typename T7, typename T8, typename T9, typename T10,
5863 typename T11, typename T12, typename T13, typename T14, typename T15,
5864 typename T16, typename T17, typename T18, typename T19, typename T20,
5865 typename T21, typename T22, typename T23, typename T24, typename T25,
5866 typename T26, typename T27, typename T28, typename T29>
5867struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5868 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5869 internal::None, internal::None, internal::None, internal::None,
5870 internal::None, internal::None, internal::None, internal::None,
5871 internal::None, internal::None, internal::None, internal::None,
5872 internal::None, internal::None, internal::None, internal::None,
5873 internal::None, internal::None, internal::None, internal::None,
5874 internal::None> {
5875 typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5876 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5877 T27, T28, T29> type;
5878};
5879template <typename T1, typename T2, typename T3, typename T4, typename T5,
5880 typename T6, typename T7, typename T8, typename T9, typename T10,
5881 typename T11, typename T12, typename T13, typename T14, typename T15,
5882 typename T16, typename T17, typename T18, typename T19, typename T20,
5883 typename T21, typename T22, typename T23, typename T24, typename T25,
5884 typename T26, typename T27, typename T28, typename T29, typename T30>
5885struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5886 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5887 internal::None, internal::None, internal::None, internal::None,
5888 internal::None, internal::None, internal::None, internal::None,
5889 internal::None, internal::None, internal::None, internal::None,
5890 internal::None, internal::None, internal::None, internal::None,
5891 internal::None, internal::None, internal::None, internal::None> {
5892 typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5893 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5894 T27, T28, T29, T30> type;
5895};
5896template <typename T1, typename T2, typename T3, typename T4, typename T5,
5897 typename T6, typename T7, typename T8, typename T9, typename T10,
5898 typename T11, typename T12, typename T13, typename T14, typename T15,
5899 typename T16, typename T17, typename T18, typename T19, typename T20,
5900 typename T21, typename T22, typename T23, typename T24, typename T25,
5901 typename T26, typename T27, typename T28, typename T29, typename T30,
5902 typename T31>
5903struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5904 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5905 T31, internal::None, internal::None, internal::None, internal::None,
5906 internal::None, internal::None, internal::None, internal::None,
5907 internal::None, internal::None, internal::None, internal::None,
5908 internal::None, internal::None, internal::None, internal::None,
5909 internal::None, internal::None, internal::None> {
5910 typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5911 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5912 T27, T28, T29, T30, T31> type;
5913};
5914template <typename T1, typename T2, typename T3, typename T4, typename T5,
5915 typename T6, typename T7, typename T8, typename T9, typename T10,
5916 typename T11, typename T12, typename T13, typename T14, typename T15,
5917 typename T16, typename T17, typename T18, typename T19, typename T20,
5918 typename T21, typename T22, typename T23, typename T24, typename T25,
5919 typename T26, typename T27, typename T28, typename T29, typename T30,
5920 typename T31, typename T32>
5921struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5922 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5923 T31, T32, internal::None, internal::None, internal::None, internal::None,
5924 internal::None, internal::None, internal::None, internal::None,
5925 internal::None, internal::None, internal::None, internal::None,
5926 internal::None, internal::None, internal::None, internal::None,
5927 internal::None, internal::None> {
5928 typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5929 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5930 T27, T28, T29, T30, T31, T32> type;
5931};
5932template <typename T1, typename T2, typename T3, typename T4, typename T5,
5933 typename T6, typename T7, typename T8, typename T9, typename T10,
5934 typename T11, typename T12, typename T13, typename T14, typename T15,
5935 typename T16, typename T17, typename T18, typename T19, typename T20,
5936 typename T21, typename T22, typename T23, typename T24, typename T25,
5937 typename T26, typename T27, typename T28, typename T29, typename T30,
5938 typename T31, typename T32, typename T33>
5939struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5940 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5941 T31, T32, T33, internal::None, internal::None, internal::None,
5942 internal::None, internal::None, internal::None, internal::None,
5943 internal::None, internal::None, internal::None, internal::None,
5944 internal::None, internal::None, internal::None, internal::None,
5945 internal::None, internal::None> {
5946 typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5947 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5948 T27, T28, T29, T30, T31, T32, T33> type;
5949};
5950template <typename T1, typename T2, typename T3, typename T4, typename T5,
5951 typename T6, typename T7, typename T8, typename T9, typename T10,
5952 typename T11, typename T12, typename T13, typename T14, typename T15,
5953 typename T16, typename T17, typename T18, typename T19, typename T20,
5954 typename T21, typename T22, typename T23, typename T24, typename T25,
5955 typename T26, typename T27, typename T28, typename T29, typename T30,
5956 typename T31, typename T32, typename T33, typename T34>
5957struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5958 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5959 T31, T32, T33, T34, internal::None, internal::None, internal::None,
5960 internal::None, internal::None, internal::None, internal::None,
5961 internal::None, internal::None, internal::None, internal::None,
5962 internal::None, internal::None, internal::None, internal::None,
5963 internal::None> {
5964 typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5965 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5966 T27, T28, T29, T30, T31, T32, T33, T34> type;
5967};
5968template <typename T1, typename T2, typename T3, typename T4, typename T5,
5969 typename T6, typename T7, typename T8, typename T9, typename T10,
5970 typename T11, typename T12, typename T13, typename T14, typename T15,
5971 typename T16, typename T17, typename T18, typename T19, typename T20,
5972 typename T21, typename T22, typename T23, typename T24, typename T25,
5973 typename T26, typename T27, typename T28, typename T29, typename T30,
5974 typename T31, typename T32, typename T33, typename T34, typename T35>
5975struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5976 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5977 T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5978 internal::None, internal::None, internal::None, internal::None,
5979 internal::None, internal::None, internal::None, internal::None,
5980 internal::None, internal::None, internal::None, internal::None> {
5981 typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5982 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5983 T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5984};
5985template <typename T1, typename T2, typename T3, typename T4, typename T5,
5986 typename T6, typename T7, typename T8, typename T9, typename T10,
5987 typename T11, typename T12, typename T13, typename T14, typename T15,
5988 typename T16, typename T17, typename T18, typename T19, typename T20,
5989 typename T21, typename T22, typename T23, typename T24, typename T25,
5990 typename T26, typename T27, typename T28, typename T29, typename T30,
5991 typename T31, typename T32, typename T33, typename T34, typename T35,
5992 typename T36>
5993struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5994 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5995 T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5996 internal::None, internal::None, internal::None, internal::None,
5997 internal::None, internal::None, internal::None, internal::None,
5998 internal::None, internal::None, internal::None, internal::None> {
5999 typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6000 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6001 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6002};
6003template <typename T1, typename T2, typename T3, typename T4, typename T5,
6004 typename T6, typename T7, typename T8, typename T9, typename T10,
6005 typename T11, typename T12, typename T13, typename T14, typename T15,
6006 typename T16, typename T17, typename T18, typename T19, typename T20,
6007 typename T21, typename T22, typename T23, typename T24, typename T25,
6008 typename T26, typename T27, typename T28, typename T29, typename T30,
6009 typename T31, typename T32, typename T33, typename T34, typename T35,
6010 typename T36, typename T37>
6011struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6012 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6013 T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
6014 internal::None, internal::None, internal::None, internal::None,
6015 internal::None, internal::None, internal::None, internal::None,
6016 internal::None, internal::None, internal::None> {
6017 typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6018 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6019 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6020};
6021template <typename T1, typename T2, typename T3, typename T4, typename T5,
6022 typename T6, typename T7, typename T8, typename T9, typename T10,
6023 typename T11, typename T12, typename T13, typename T14, typename T15,
6024 typename T16, typename T17, typename T18, typename T19, typename T20,
6025 typename T21, typename T22, typename T23, typename T24, typename T25,
6026 typename T26, typename T27, typename T28, typename T29, typename T30,
6027 typename T31, typename T32, typename T33, typename T34, typename T35,
6028 typename T36, typename T37, typename T38>
6029struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6030 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6031 T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
6032 internal::None, internal::None, internal::None, internal::None,
6033 internal::None, internal::None, internal::None, internal::None,
6034 internal::None, internal::None> {
6035 typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6036 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6037 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6038};
6039template <typename T1, typename T2, typename T3, typename T4, typename T5,
6040 typename T6, typename T7, typename T8, typename T9, typename T10,
6041 typename T11, typename T12, typename T13, typename T14, typename T15,
6042 typename T16, typename T17, typename T18, typename T19, typename T20,
6043 typename T21, typename T22, typename T23, typename T24, typename T25,
6044 typename T26, typename T27, typename T28, typename T29, typename T30,
6045 typename T31, typename T32, typename T33, typename T34, typename T35,
6046 typename T36, typename T37, typename T38, typename T39>
6047struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6048 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6049 T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
6050 internal::None, internal::None, internal::None, internal::None,
6051 internal::None, internal::None, internal::None, internal::None,
6052 internal::None, internal::None> {
6053 typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6054 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6055 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6056};
6057template <typename T1, typename T2, typename T3, typename T4, typename T5,
6058 typename T6, typename T7, typename T8, typename T9, typename T10,
6059 typename T11, typename T12, typename T13, typename T14, typename T15,
6060 typename T16, typename T17, typename T18, typename T19, typename T20,
6061 typename T21, typename T22, typename T23, typename T24, typename T25,
6062 typename T26, typename T27, typename T28, typename T29, typename T30,
6063 typename T31, typename T32, typename T33, typename T34, typename T35,
6064 typename T36, typename T37, typename T38, typename T39, typename T40>
6065struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6066 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6067 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
6068 internal::None, internal::None, internal::None, internal::None,
6069 internal::None, internal::None, internal::None, internal::None,
6070 internal::None> {
6071 typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6072 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6073 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
6074 T40> type;
6075};
6076template <typename T1, typename T2, typename T3, typename T4, typename T5,
6077 typename T6, typename T7, typename T8, typename T9, typename T10,
6078 typename T11, typename T12, typename T13, typename T14, typename T15,
6079 typename T16, typename T17, typename T18, typename T19, typename T20,
6080 typename T21, typename T22, typename T23, typename T24, typename T25,
6081 typename T26, typename T27, typename T28, typename T29, typename T30,
6082 typename T31, typename T32, typename T33, typename T34, typename T35,
6083 typename T36, typename T37, typename T38, typename T39, typename T40,
6084 typename T41>
6085struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6086 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6087 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
6088 internal::None, internal::None, internal::None, internal::None,
6089 internal::None, internal::None, internal::None, internal::None> {
6090 typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6091 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6092 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6093 T41> type;
6094};
6095template <typename T1, typename T2, typename T3, typename T4, typename T5,
6096 typename T6, typename T7, typename T8, typename T9, typename T10,
6097 typename T11, typename T12, typename T13, typename T14, typename T15,
6098 typename T16, typename T17, typename T18, typename T19, typename T20,
6099 typename T21, typename T22, typename T23, typename T24, typename T25,
6100 typename T26, typename T27, typename T28, typename T29, typename T30,
6101 typename T31, typename T32, typename T33, typename T34, typename T35,
6102 typename T36, typename T37, typename T38, typename T39, typename T40,
6103 typename T41, typename T42>
6104struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6105 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6106 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
6107 internal::None, internal::None, internal::None, internal::None,
6108 internal::None, internal::None, internal::None> {
6109 typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6110 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6111 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6112 T41, T42> type;
6113};
6114template <typename T1, typename T2, typename T3, typename T4, typename T5,
6115 typename T6, typename T7, typename T8, typename T9, typename T10,
6116 typename T11, typename T12, typename T13, typename T14, typename T15,
6117 typename T16, typename T17, typename T18, typename T19, typename T20,
6118 typename T21, typename T22, typename T23, typename T24, typename T25,
6119 typename T26, typename T27, typename T28, typename T29, typename T30,
6120 typename T31, typename T32, typename T33, typename T34, typename T35,
6121 typename T36, typename T37, typename T38, typename T39, typename T40,
6122 typename T41, typename T42, typename T43>
6123struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6124 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6125 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6126 internal::None, internal::None, internal::None, internal::None,
6127 internal::None, internal::None, internal::None> {
6128 typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6129 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6130 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6131 T41, T42, T43> type;
6132};
6133template <typename T1, typename T2, typename T3, typename T4, typename T5,
6134 typename T6, typename T7, typename T8, typename T9, typename T10,
6135 typename T11, typename T12, typename T13, typename T14, typename T15,
6136 typename T16, typename T17, typename T18, typename T19, typename T20,
6137 typename T21, typename T22, typename T23, typename T24, typename T25,
6138 typename T26, typename T27, typename T28, typename T29, typename T30,
6139 typename T31, typename T32, typename T33, typename T34, typename T35,
6140 typename T36, typename T37, typename T38, typename T39, typename T40,
6141 typename T41, typename T42, typename T43, typename T44>
6142struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6143 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6144 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6145 internal::None, internal::None, internal::None, internal::None,
6146 internal::None, internal::None> {
6147 typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6148 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6149 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6150 T41, T42, T43, T44> type;
6151};
6152template <typename T1, typename T2, typename T3, typename T4, typename T5,
6153 typename T6, typename T7, typename T8, typename T9, typename T10,
6154 typename T11, typename T12, typename T13, typename T14, typename T15,
6155 typename T16, typename T17, typename T18, typename T19, typename T20,
6156 typename T21, typename T22, typename T23, typename T24, typename T25,
6157 typename T26, typename T27, typename T28, typename T29, typename T30,
6158 typename T31, typename T32, typename T33, typename T34, typename T35,
6159 typename T36, typename T37, typename T38, typename T39, typename T40,
6160 typename T41, typename T42, typename T43, typename T44, typename T45>
6161struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6162 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6163 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6164 internal::None, internal::None, internal::None, internal::None,
6165 internal::None> {
6166 typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6167 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6168 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6169 T41, T42, T43, T44, T45> type;
6170};
6171template <typename T1, typename T2, typename T3, typename T4, typename T5,
6172 typename T6, typename T7, typename T8, typename T9, typename T10,
6173 typename T11, typename T12, typename T13, typename T14, typename T15,
6174 typename T16, typename T17, typename T18, typename T19, typename T20,
6175 typename T21, typename T22, typename T23, typename T24, typename T25,
6176 typename T26, typename T27, typename T28, typename T29, typename T30,
6177 typename T31, typename T32, typename T33, typename T34, typename T35,
6178 typename T36, typename T37, typename T38, typename T39, typename T40,
6179 typename T41, typename T42, typename T43, typename T44, typename T45,
6180 typename T46>
6181struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6182 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6183 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6184 T46, internal::None, internal::None, internal::None, internal::None> {
6185 typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6186 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6187 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6188 T41, T42, T43, T44, T45, T46> type;
6189};
6190template <typename T1, typename T2, typename T3, typename T4, typename T5,
6191 typename T6, typename T7, typename T8, typename T9, typename T10,
6192 typename T11, typename T12, typename T13, typename T14, typename T15,
6193 typename T16, typename T17, typename T18, typename T19, typename T20,
6194 typename T21, typename T22, typename T23, typename T24, typename T25,
6195 typename T26, typename T27, typename T28, typename T29, typename T30,
6196 typename T31, typename T32, typename T33, typename T34, typename T35,
6197 typename T36, typename T37, typename T38, typename T39, typename T40,
6198 typename T41, typename T42, typename T43, typename T44, typename T45,
6199 typename T46, typename T47>
6200struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6201 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6202 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6203 T46, T47, internal::None, internal::None, internal::None> {
6204 typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6205 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6206 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6207 T41, T42, T43, T44, T45, T46, T47> type;
6208};
6209template <typename T1, typename T2, typename T3, typename T4, typename T5,
6210 typename T6, typename T7, typename T8, typename T9, typename T10,
6211 typename T11, typename T12, typename T13, typename T14, typename T15,
6212 typename T16, typename T17, typename T18, typename T19, typename T20,
6213 typename T21, typename T22, typename T23, typename T24, typename T25,
6214 typename T26, typename T27, typename T28, typename T29, typename T30,
6215 typename T31, typename T32, typename T33, typename T34, typename T35,
6216 typename T36, typename T37, typename T38, typename T39, typename T40,
6217 typename T41, typename T42, typename T43, typename T44, typename T45,
6218 typename T46, typename T47, typename T48>
6219struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6220 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6221 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6222 T46, T47, T48, internal::None, internal::None> {
6223 typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6224 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6225 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6226 T41, T42, T43, T44, T45, T46, T47, T48> type;
6227};
6228template <typename T1, typename T2, typename T3, typename T4, typename T5,
6229 typename T6, typename T7, typename T8, typename T9, typename T10,
6230 typename T11, typename T12, typename T13, typename T14, typename T15,
6231 typename T16, typename T17, typename T18, typename T19, typename T20,
6232 typename T21, typename T22, typename T23, typename T24, typename T25,
6233 typename T26, typename T27, typename T28, typename T29, typename T30,
6234 typename T31, typename T32, typename T33, typename T34, typename T35,
6235 typename T36, typename T37, typename T38, typename T39, typename T40,
6236 typename T41, typename T42, typename T43, typename T44, typename T45,
6237 typename T46, typename T47, typename T48, typename T49>
6238struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6239 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6240 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6241 T46, T47, T48, T49, internal::None> {
6242 typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6243 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6244 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6245 T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
6246};
6247
6248namespace internal {
6249
6250# define GTEST_TEMPLATE_ template <typename T> class
6251
6252// The template "selector" struct TemplateSel<Tmpl> is used to
6253// represent Tmpl, which must be a class template with one type
6254// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
6255// as the type Tmpl<T>. This allows us to actually instantiate the
6256// template "selected" by TemplateSel<Tmpl>.
6257//
6258// This trick is necessary for simulating typedef for class templates,
6259// which C++ doesn't support directly.
6260template <GTEST_TEMPLATE_ Tmpl>
6261struct TemplateSel {
6262 template <typename T>
6263 struct Bind {
6264 typedef Tmpl<T> type;
6265 };
6266};
6267
6268# define GTEST_BIND_(TmplSel, T) \
6269 TmplSel::template Bind<T>::type
6270
6271// A unique struct template used as the default value for the
6272// arguments of class template Templates. This allows us to simulate
6273// variadic templates (e.g. Templates<int>, Templates<int, double>,
6274// and etc), which C++ doesn't support directly.
6275template <typename T>
6276struct NoneT {};
6277
6278// The following family of struct and struct templates are used to
6279// represent template lists. In particular, TemplatesN<T1, T2, ...,
6280// TN> represents a list of N templates (T1, T2, ..., and TN). Except
6281// for Templates0, every struct in the family has two member types:
6282// Head for the selector of the first template in the list, and Tail
6283// for the rest of the list.
6284
6285// The empty template list.
6286struct Templates0 {};
6287
6288// Template lists of length 1, 2, 3, and so on.
6289
6290template <GTEST_TEMPLATE_ T1>
6291struct Templates1 {
6292 typedef TemplateSel<T1> Head;
6293 typedef Templates0 Tail;
6294};
6295template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6296struct Templates2 {
6297 typedef TemplateSel<T1> Head;
6298 typedef Templates1<T2> Tail;
6299};
6300
6301template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6302struct Templates3 {
6303 typedef TemplateSel<T1> Head;
6304 typedef Templates2<T2, T3> Tail;
6305};
6306
6307template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6308 GTEST_TEMPLATE_ T4>
6309struct Templates4 {
6310 typedef TemplateSel<T1> Head;
6311 typedef Templates3<T2, T3, T4> Tail;
6312};
6313
6314template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6315 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6316struct Templates5 {
6317 typedef TemplateSel<T1> Head;
6318 typedef Templates4<T2, T3, T4, T5> Tail;
6319};
6320
6321template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6322 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6323struct Templates6 {
6324 typedef TemplateSel<T1> Head;
6325 typedef Templates5<T2, T3, T4, T5, T6> Tail;
6326};
6327
6328template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6329 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6330 GTEST_TEMPLATE_ T7>
6331struct Templates7 {
6332 typedef TemplateSel<T1> Head;
6333 typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
6334};
6335
6336template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6337 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6338 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6339struct Templates8 {
6340 typedef TemplateSel<T1> Head;
6341 typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
6342};
6343
6344template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6345 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6346 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6347struct Templates9 {
6348 typedef TemplateSel<T1> Head;
6349 typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
6350};
6351
6352template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6353 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6354 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6355 GTEST_TEMPLATE_ T10>
6356struct Templates10 {
6357 typedef TemplateSel<T1> Head;
6358 typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
6359};
6360
6361template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6362 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6363 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6364 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6365struct Templates11 {
6366 typedef TemplateSel<T1> Head;
6367 typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
6368};
6369
6370template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6371 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6372 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6373 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6374struct Templates12 {
6375 typedef TemplateSel<T1> Head;
6376 typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
6377};
6378
6379template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6380 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6381 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6382 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6383 GTEST_TEMPLATE_ T13>
6384struct Templates13 {
6385 typedef TemplateSel<T1> Head;
6386 typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
6387};
6388
6389template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6390 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6391 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6392 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6393 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6394struct Templates14 {
6395 typedef TemplateSel<T1> Head;
6396 typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6397 T14> Tail;
6398};
6399
6400template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6401 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6402 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6403 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6404 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6405struct Templates15 {
6406 typedef TemplateSel<T1> Head;
6407 typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6408 T15> Tail;
6409};
6410
6411template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6412 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6413 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6414 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6415 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6416 GTEST_TEMPLATE_ T16>
6417struct Templates16 {
6418 typedef TemplateSel<T1> Head;
6419 typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6420 T15, T16> Tail;
6421};
6422
6423template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6424 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6425 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6426 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6427 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6428 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6429struct Templates17 {
6430 typedef TemplateSel<T1> Head;
6431 typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6432 T15, T16, T17> Tail;
6433};
6434
6435template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6436 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6437 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6438 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6439 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6440 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6441struct Templates18 {
6442 typedef TemplateSel<T1> Head;
6443 typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6444 T15, T16, T17, T18> Tail;
6445};
6446
6447template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6448 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6449 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6450 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6451 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6452 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6453 GTEST_TEMPLATE_ T19>
6454struct Templates19 {
6455 typedef TemplateSel<T1> Head;
6456 typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6457 T15, T16, T17, T18, T19> Tail;
6458};
6459
6460template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6461 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6462 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6463 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6464 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6465 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6466 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6467struct Templates20 {
6468 typedef TemplateSel<T1> Head;
6469 typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6470 T15, T16, T17, T18, T19, T20> Tail;
6471};
6472
6473template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6474 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6475 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6476 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6477 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6478 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6479 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6480struct Templates21 {
6481 typedef TemplateSel<T1> Head;
6482 typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6483 T15, T16, T17, T18, T19, T20, T21> Tail;
6484};
6485
6486template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6487 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6488 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6489 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6490 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6491 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6492 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6493 GTEST_TEMPLATE_ T22>
6494struct Templates22 {
6495 typedef TemplateSel<T1> Head;
6496 typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6497 T15, T16, T17, T18, T19, T20, T21, T22> Tail;
6498};
6499
6500template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6501 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6502 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6503 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6504 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6505 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6506 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6507 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6508struct Templates23 {
6509 typedef TemplateSel<T1> Head;
6510 typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6511 T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
6512};
6513
6514template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6515 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6516 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6517 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6518 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6519 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6520 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6521 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6522struct Templates24 {
6523 typedef TemplateSel<T1> Head;
6524 typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6525 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
6526};
6527
6528template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6529 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6530 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6531 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6532 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6533 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6534 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6535 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6536 GTEST_TEMPLATE_ T25>
6537struct Templates25 {
6538 typedef TemplateSel<T1> Head;
6539 typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6540 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
6541};
6542
6543template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6544 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6545 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6546 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6547 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6548 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6549 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6550 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6551 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6552struct Templates26 {
6553 typedef TemplateSel<T1> Head;
6554 typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6555 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
6556};
6557
6558template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6559 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6560 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6561 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6562 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6563 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6564 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6565 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6566 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6567struct Templates27 {
6568 typedef TemplateSel<T1> Head;
6569 typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6570 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
6571};
6572
6573template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6574 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6575 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6576 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6577 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6578 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6579 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6580 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6581 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6582 GTEST_TEMPLATE_ T28>
6583struct Templates28 {
6584 typedef TemplateSel<T1> Head;
6585 typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6586 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6587 T28> Tail;
6588};
6589
6590template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6591 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6592 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6593 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6594 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6595 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6596 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6597 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6598 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6599 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6600struct Templates29 {
6601 typedef TemplateSel<T1> Head;
6602 typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6603 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6604 T29> Tail;
6605};
6606
6607template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6608 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6609 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6610 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6611 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6612 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6613 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6614 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6615 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6616 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6617struct Templates30 {
6618 typedef TemplateSel<T1> Head;
6619 typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6620 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6621 T29, T30> Tail;
6622};
6623
6624template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6625 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6626 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6627 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6628 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6629 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6630 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6631 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6632 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6633 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6634 GTEST_TEMPLATE_ T31>
6635struct Templates31 {
6636 typedef TemplateSel<T1> Head;
6637 typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6638 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6639 T29, T30, T31> Tail;
6640};
6641
6642template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6643 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6644 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6645 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6646 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6647 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6648 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6649 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6650 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6651 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6652 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6653struct Templates32 {
6654 typedef TemplateSel<T1> Head;
6655 typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6656 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6657 T29, T30, T31, T32> Tail;
6658};
6659
6660template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6661 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6662 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6663 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6664 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6665 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6666 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6667 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6668 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6669 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6670 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6671struct Templates33 {
6672 typedef TemplateSel<T1> Head;
6673 typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6674 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6675 T29, T30, T31, T32, T33> Tail;
6676};
6677
6678template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6679 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6680 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6681 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6682 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6683 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6684 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6685 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6686 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6687 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6688 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6689 GTEST_TEMPLATE_ T34>
6690struct Templates34 {
6691 typedef TemplateSel<T1> Head;
6692 typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6693 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6694 T29, T30, T31, T32, T33, T34> Tail;
6695};
6696
6697template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6698 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6699 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6700 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6701 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6702 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6703 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6704 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6705 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6706 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6707 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6708 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6709struct Templates35 {
6710 typedef TemplateSel<T1> Head;
6711 typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6712 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6713 T29, T30, T31, T32, T33, T34, T35> Tail;
6714};
6715
6716template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6717 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6718 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6719 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6720 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6721 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6722 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6723 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6724 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6725 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6726 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6727 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6728struct Templates36 {
6729 typedef TemplateSel<T1> Head;
6730 typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6731 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6732 T29, T30, T31, T32, T33, T34, T35, T36> Tail;
6733};
6734
6735template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6736 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6737 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6738 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6739 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6740 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6741 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6742 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6743 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6744 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6745 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6746 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6747 GTEST_TEMPLATE_ T37>
6748struct Templates37 {
6749 typedef TemplateSel<T1> Head;
6750 typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6751 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6752 T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
6753};
6754
6755template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6756 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6757 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6758 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6759 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6760 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6761 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6762 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6763 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6764 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6765 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6766 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6767 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6768struct Templates38 {
6769 typedef TemplateSel<T1> Head;
6770 typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6771 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6772 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
6773};
6774
6775template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6776 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6777 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6778 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6779 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6780 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6781 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6782 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6783 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6784 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6785 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6786 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6787 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6788struct Templates39 {
6789 typedef TemplateSel<T1> Head;
6790 typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6791 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6792 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
6793};
6794
6795template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6796 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6797 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6798 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6799 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6800 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6801 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6802 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6803 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6804 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6805 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6806 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6807 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6808 GTEST_TEMPLATE_ T40>
6809struct Templates40 {
6810 typedef TemplateSel<T1> Head;
6811 typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6812 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6813 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
6814};
6815
6816template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6817 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6818 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6819 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6820 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6821 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6822 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6823 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6824 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6825 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6826 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6827 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6828 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6829 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6830struct Templates41 {
6831 typedef TemplateSel<T1> Head;
6832 typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6833 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6834 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
6835};
6836
6837template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6838 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6839 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6840 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6841 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6842 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6843 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6844 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6845 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6846 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6847 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6848 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6849 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6850 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6851struct Templates42 {
6852 typedef TemplateSel<T1> Head;
6853 typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6854 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6855 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6856 T42> Tail;
6857};
6858
6859template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6860 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6861 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6862 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6863 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6864 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6865 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6866 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6867 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6868 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6869 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6870 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6871 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6872 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6873 GTEST_TEMPLATE_ T43>
6874struct Templates43 {
6875 typedef TemplateSel<T1> Head;
6876 typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6877 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6878 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6879 T43> Tail;
6880};
6881
6882template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6883 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6884 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6885 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6886 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6887 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6888 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6889 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6890 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6891 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6892 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6893 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6894 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6895 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6896 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6897struct Templates44 {
6898 typedef TemplateSel<T1> Head;
6899 typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6900 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6901 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6902 T43, T44> Tail;
6903};
6904
6905template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6906 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6907 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6908 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6909 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6910 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6911 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6912 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6913 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6914 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6915 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6916 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6917 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6918 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6919 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6920struct Templates45 {
6921 typedef TemplateSel<T1> Head;
6922 typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6923 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6924 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6925 T43, T44, T45> Tail;
6926};
6927
6928template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6929 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6930 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6931 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6932 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6933 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6934 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6935 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6936 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6937 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6938 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6939 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6940 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6941 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6942 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6943 GTEST_TEMPLATE_ T46>
6944struct Templates46 {
6945 typedef TemplateSel<T1> Head;
6946 typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6947 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6948 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6949 T43, T44, T45, T46> Tail;
6950};
6951
6952template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6953 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6954 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6955 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6956 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6957 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6958 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6959 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6960 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6961 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6962 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6963 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6964 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6965 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6966 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6967 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6968struct Templates47 {
6969 typedef TemplateSel<T1> Head;
6970 typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6971 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6972 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6973 T43, T44, T45, T46, T47> Tail;
6974};
6975
6976template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6977 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6978 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6979 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6980 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6981 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6982 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6983 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6984 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6985 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6986 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6987 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6988 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6989 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6990 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6991 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6992struct Templates48 {
6993 typedef TemplateSel<T1> Head;
6994 typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6995 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6996 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6997 T43, T44, T45, T46, T47, T48> Tail;
6998};
6999
7000template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7001 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7002 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7003 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7004 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7005 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7006 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7007 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7008 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7009 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7010 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7011 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7012 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7013 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7014 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7015 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7016 GTEST_TEMPLATE_ T49>
7017struct Templates49 {
7018 typedef TemplateSel<T1> Head;
7019 typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7020 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7021 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
7022 T43, T44, T45, T46, T47, T48, T49> Tail;
7023};
7024
7025template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7026 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7027 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7028 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7029 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7030 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7031 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7032 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7033 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7034 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7035 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7036 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7037 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7038 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7039 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7040 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7041 GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
7042struct Templates50 {
7043 typedef TemplateSel<T1> Head;
7044 typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7045 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7046 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
7047 T43, T44, T45, T46, T47, T48, T49, T50> Tail;
7048};
7049
7050
7051// We don't want to require the users to write TemplatesN<...> directly,
7052// as that would require them to count the length. Templates<...> is much
7053// easier to write, but generates horrible messages when there is a
7054// compiler error, as gcc insists on printing out each template
7055// argument, even if it has the default value (this means Templates<list>
7056// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
7057// errors).
7058//
7059// Our solution is to combine the best part of the two approaches: a
7060// user would write Templates<T1, ..., TN>, and Google Test will translate
7061// that to TemplatesN<T1, ..., TN> internally to make error messages
7062// readable. The translation is done by the 'type' member of the
7063// Templates template.
7064template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
7065 GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
7066 GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
7067 GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
7068 GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
7069 GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
7070 GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
7071 GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
7072 GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
7073 GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
7074 GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
7075 GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
7076 GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
7077 GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
7078 GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
7079 GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
7080 GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
7081 GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
7082 GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
7083 GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
7084 GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
7085 GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
7086 GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
7087 GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
7088 GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
7089struct Templates {
7090 typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7091 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7092 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7093 T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
7094};
7095
7096template <>
7097struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7098 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7099 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7100 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7101 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7102 NoneT> {
7103 typedef Templates0 type;
7104};
7105template <GTEST_TEMPLATE_ T1>
7106struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7107 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7108 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7109 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7110 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7111 NoneT> {
7112 typedef Templates1<T1> type;
7113};
7114template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
7115struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7116 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7117 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7118 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7119 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7120 NoneT> {
7121 typedef Templates2<T1, T2> type;
7122};
7123template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
7124struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7125 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7126 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7127 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7128 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7129 typedef Templates3<T1, T2, T3> type;
7130};
7131template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7132 GTEST_TEMPLATE_ T4>
7133struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7134 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7135 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7136 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7137 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7138 typedef Templates4<T1, T2, T3, T4> type;
7139};
7140template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7141 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
7142struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7143 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7144 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7145 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7146 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7147 typedef Templates5<T1, T2, T3, T4, T5> type;
7148};
7149template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7150 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
7151struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
7152 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7153 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7154 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7155 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7156 typedef Templates6<T1, T2, T3, T4, T5, T6> type;
7157};
7158template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7159 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7160 GTEST_TEMPLATE_ T7>
7161struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
7162 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7163 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7164 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7165 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7166 typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
7167};
7168template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7169 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7170 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
7171struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
7172 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7173 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7174 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7175 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7176 typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
7177};
7178template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7179 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7180 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
7181struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
7182 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7183 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7184 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7185 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7186 typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
7187};
7188template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7189 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7190 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7191 GTEST_TEMPLATE_ T10>
7192struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
7193 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7194 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7195 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7196 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7197 typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
7198};
7199template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7200 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7201 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7202 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
7203struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
7204 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7205 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7206 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7207 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7208 typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
7209};
7210template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7211 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7212 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7213 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
7214struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
7215 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7216 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7217 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7218 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7219 typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
7220};
7221template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7222 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7223 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7224 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7225 GTEST_TEMPLATE_ T13>
7226struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
7227 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7228 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7229 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7230 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7231 typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7232 T13> type;
7233};
7234template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7235 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7236 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7237 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7238 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
7239struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7240 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7241 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7242 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7243 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7244 typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7245 T14> type;
7246};
7247template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7248 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7249 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7250 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7251 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
7252struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7253 T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7254 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7255 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7256 NoneT, NoneT, NoneT, NoneT, NoneT> {
7257 typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7258 T14, T15> type;
7259};
7260template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7261 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7262 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7263 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7264 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7265 GTEST_TEMPLATE_ T16>
7266struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7267 T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7268 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7269 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7270 NoneT, NoneT, NoneT, NoneT, NoneT> {
7271 typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7272 T14, T15, T16> type;
7273};
7274template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7275 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7276 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7277 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7278 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7279 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
7280struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7281 T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7282 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7283 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7284 NoneT, NoneT, NoneT, NoneT, NoneT> {
7285 typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7286 T14, T15, T16, T17> type;
7287};
7288template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7289 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7290 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7291 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7292 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7293 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
7294struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7295 T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7296 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7297 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7298 NoneT, NoneT, NoneT, NoneT> {
7299 typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7300 T14, T15, T16, T17, T18> type;
7301};
7302template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7303 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7304 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7305 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7306 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7307 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7308 GTEST_TEMPLATE_ T19>
7309struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7310 T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7311 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7312 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7313 NoneT, NoneT, NoneT, NoneT> {
7314 typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7315 T14, T15, T16, T17, T18, T19> type;
7316};
7317template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7318 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7319 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7320 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7321 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7322 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7323 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
7324struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7325 T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7326 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7327 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7328 NoneT, NoneT, NoneT, NoneT> {
7329 typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7330 T14, T15, T16, T17, T18, T19, T20> type;
7331};
7332template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7333 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7334 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7335 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7336 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7337 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7338 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
7339struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7340 T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
7341 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7342 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7343 NoneT, NoneT, NoneT, NoneT> {
7344 typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7345 T14, T15, T16, T17, T18, T19, T20, T21> type;
7346};
7347template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7348 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7349 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7350 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7351 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7352 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7353 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7354 GTEST_TEMPLATE_ T22>
7355struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7356 T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
7357 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7358 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7359 NoneT, NoneT, NoneT> {
7360 typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7361 T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
7362};
7363template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7364 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7365 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7366 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7367 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7368 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7369 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7370 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
7371struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7372 T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
7373 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7374 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7375 NoneT, NoneT, NoneT> {
7376 typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7377 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
7378};
7379template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7380 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7381 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7382 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7383 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7384 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7385 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7386 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
7387struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7388 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
7389 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7390 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7391 NoneT, NoneT, NoneT> {
7392 typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7393 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
7394};
7395template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7396 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7397 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7398 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7399 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7400 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7401 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7402 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7403 GTEST_TEMPLATE_ T25>
7404struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7405 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
7406 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7407 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7408 NoneT, NoneT> {
7409 typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7410 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
7411};
7412template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7413 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7414 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7415 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7416 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7417 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7418 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7419 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7420 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
7421struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7422 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
7423 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7424 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7425 NoneT, NoneT> {
7426 typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7427 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
7428};
7429template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7430 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7431 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7432 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7433 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7434 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7435 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7436 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7437 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
7438struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7439 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
7440 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7441 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7442 NoneT, NoneT> {
7443 typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7444 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7445 T27> type;
7446};
7447template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7448 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7449 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7450 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7451 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7452 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7453 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7454 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7455 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7456 GTEST_TEMPLATE_ T28>
7457struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7458 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7459 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7460 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7461 NoneT, NoneT> {
7462 typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7463 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7464 T28> type;
7465};
7466template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7467 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7468 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7469 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7470 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7471 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7472 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7473 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7474 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7475 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
7476struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7477 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7478 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7479 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7480 NoneT> {
7481 typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7482 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7483 T28, T29> type;
7484};
7485template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7486 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7487 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7488 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7489 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7490 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7491 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7492 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7493 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7494 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
7495struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7496 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7497 T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7498 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7499 typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7500 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7501 T28, T29, T30> type;
7502};
7503template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7504 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7505 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7506 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7507 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7508 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7509 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7510 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7511 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7512 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7513 GTEST_TEMPLATE_ T31>
7514struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7515 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7516 T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7517 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7518 typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7519 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7520 T28, T29, T30, T31> type;
7521};
7522template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7523 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7524 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7525 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7526 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7527 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7528 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7529 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7530 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7531 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7532 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
7533struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7534 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7535 T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7536 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7537 typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7538 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7539 T28, T29, T30, T31, T32> type;
7540};
7541template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7542 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7543 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7544 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7545 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7546 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7547 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7548 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7549 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7550 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7551 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
7552struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7553 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7554 T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7555 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7556 typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7557 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7558 T28, T29, T30, T31, T32, T33> type;
7559};
7560template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7561 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7562 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7563 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7564 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7565 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7566 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7567 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7568 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7569 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7570 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7571 GTEST_TEMPLATE_ T34>
7572struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7573 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7574 T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7575 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7576 typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7577 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7578 T28, T29, T30, T31, T32, T33, T34> type;
7579};
7580template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7581 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7582 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7583 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7584 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7585 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7586 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7587 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7588 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7589 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7590 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7591 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
7592struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7593 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7594 T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7595 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7596 typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7597 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7598 T28, T29, T30, T31, T32, T33, T34, T35> type;
7599};
7600template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7601 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7602 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7603 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7604 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7605 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7606 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7607 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7608 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7609 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7610 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7611 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
7612struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7613 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7614 T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
7615 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7616 typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7617 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7618 T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
7619};
7620template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7621 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7622 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7623 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7624 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7625 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7626 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7627 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7628 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7629 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7630 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7631 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7632 GTEST_TEMPLATE_ T37>
7633struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7634 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7635 T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
7636 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7637 typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7638 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7639 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
7640};
7641template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7642 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7643 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7644 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7645 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7646 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7647 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7648 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7649 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7650 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7651 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7652 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7653 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
7654struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7655 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7656 T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
7657 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7658 typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7659 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7660 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
7661};
7662template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7663 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7664 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7665 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7666 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7667 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7668 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7669 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7670 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7671 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7672 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7673 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7674 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
7675struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7676 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7677 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
7678 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7679 typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7680 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7681 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
7682};
7683template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7684 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7685 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7686 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7687 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7688 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7689 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7690 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7691 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7692 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7693 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7694 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7695 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7696 GTEST_TEMPLATE_ T40>
7697struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7698 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7699 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
7700 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7701 typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7702 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7703 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
7704};
7705template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7706 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7707 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7708 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7709 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7710 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7711 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7712 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7713 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7714 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7715 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7716 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7717 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7718 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
7719struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7720 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7721 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
7722 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7723 typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7724 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7725 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7726 T41> type;
7727};
7728template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7729 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7730 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7731 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7732 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7733 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7734 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7735 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7736 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7737 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7738 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7739 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7740 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7741 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
7742struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7743 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7744 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
7745 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7746 typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7747 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7748 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7749 T42> type;
7750};
7751template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7752 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7753 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7754 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7755 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7756 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7757 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7758 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7759 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7760 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7761 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7762 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7763 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7764 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7765 GTEST_TEMPLATE_ T43>
7766struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7767 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7768 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7769 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7770 typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7771 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7772 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7773 T42, T43> type;
7774};
7775template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7776 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7777 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7778 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7779 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7780 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7781 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7782 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7783 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7784 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7785 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7786 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7787 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7788 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7789 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
7790struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7791 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7792 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7793 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7794 typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7795 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7796 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7797 T42, T43, T44> type;
7798};
7799template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7800 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7801 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7802 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7803 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7804 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7805 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7806 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7807 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7808 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7809 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7810 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7811 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7812 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7813 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
7814struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7815 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7816 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7817 T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
7818 typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7819 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7820 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7821 T42, T43, T44, T45> type;
7822};
7823template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7824 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7825 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7826 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7827 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7828 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7829 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7830 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7831 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7832 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7833 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7834 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7835 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7836 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7837 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7838 GTEST_TEMPLATE_ T46>
7839struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7840 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7841 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7842 T45, T46, NoneT, NoneT, NoneT, NoneT> {
7843 typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7844 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7845 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7846 T42, T43, T44, T45, T46> type;
7847};
7848template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7849 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7850 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7851 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7852 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7853 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7854 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7855 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7856 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7857 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7858 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7859 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7860 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7861 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7862 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7863 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
7864struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7865 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7866 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7867 T45, T46, T47, NoneT, NoneT, NoneT> {
7868 typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7869 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7870 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7871 T42, T43, T44, T45, T46, T47> type;
7872};
7873template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7874 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7875 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7876 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7877 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7878 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7879 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7880 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7881 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7882 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7883 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7884 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7885 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7886 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7887 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7888 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
7889struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7890 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7891 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7892 T45, T46, T47, T48, NoneT, NoneT> {
7893 typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7894 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7895 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7896 T42, T43, T44, T45, T46, T47, T48> type;
7897};
7898template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7899 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7900 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7901 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7902 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7903 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7904 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7905 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7906 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7907 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7908 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7909 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7910 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7911 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7912 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7913 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7914 GTEST_TEMPLATE_ T49>
7915struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7916 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7917 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7918 T45, T46, T47, T48, T49, NoneT> {
7919 typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7920 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7921 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7922 T42, T43, T44, T45, T46, T47, T48, T49> type;
7923};
7924
7925// The TypeList template makes it possible to use either a single type
7926// or a Types<...> list in TYPED_TEST_CASE() and
7927// INSTANTIATE_TYPED_TEST_CASE_P().
7928
7929template <typename T>
7930struct TypeList {
7931 typedef Types1<T> type;
7932};
7933
7934template <typename T1, typename T2, typename T3, typename T4, typename T5,
7935 typename T6, typename T7, typename T8, typename T9, typename T10,
7936 typename T11, typename T12, typename T13, typename T14, typename T15,
7937 typename T16, typename T17, typename T18, typename T19, typename T20,
7938 typename T21, typename T22, typename T23, typename T24, typename T25,
7939 typename T26, typename T27, typename T28, typename T29, typename T30,
7940 typename T31, typename T32, typename T33, typename T34, typename T35,
7941 typename T36, typename T37, typename T38, typename T39, typename T40,
7942 typename T41, typename T42, typename T43, typename T44, typename T45,
7943 typename T46, typename T47, typename T48, typename T49, typename T50>
7944struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7945 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7946 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7947 T44, T45, T46, T47, T48, T49, T50> > {
7948 typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7949 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7950 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7951 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7952};
7953
7954#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7955
7956} // namespace internal
7957} // namespace testing
7958
7959#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7960
7961// Due to C++ preprocessor weirdness, we need double indirection to
7962// concatenate two tokens when one of them is __LINE__. Writing
7963//
7964// foo ## __LINE__
7965//
7966// will result in the token foo__LINE__, instead of foo followed by
7967// the current line number. For more details, see
7968// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7969#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7970#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7971
f67539c2
TL
7972// Stringifies its argument.
7973#define GTEST_STRINGIFY_(name) #name
7974
7c673cae
FG
7975class ProtocolMessage;
7976namespace proto2 { class Message; }
7977
7978namespace testing {
7979
7980// Forward declarations.
7981
7982class AssertionResult; // Result of an assertion.
7983class Message; // Represents a failure message.
7984class Test; // Represents a test.
7985class TestInfo; // Information about a test.
7986class TestPartResult; // Result of a test part.
7987class UnitTest; // A collection of test cases.
7988
7989template <typename T>
7990::std::string PrintToString(const T& value);
7991
7992namespace internal {
7993
7994struct TraceInfo; // Information about a trace point.
7c673cae
FG
7995class TestInfoImpl; // Opaque implementation of TestInfo
7996class UnitTestImpl; // Opaque implementation of UnitTest
7997
7c673cae
FG
7998// The text used in failure messages to indicate the start of the
7999// stack trace.
8000GTEST_API_ extern const char kStackTraceMarker[];
8001
8002// Two overloaded helpers for checking at compile time whether an
8003// expression is a null pointer literal (i.e. NULL or any 0-valued
8004// compile-time integral constant). Their return values have
8005// different sizes, so we can use sizeof() to test which version is
8006// picked by the compiler. These helpers have no implementations, as
8007// we only need their signatures.
8008//
8009// Given IsNullLiteralHelper(x), the compiler will pick the first
8010// version if x can be implicitly converted to Secret*, and pick the
8011// second version otherwise. Since Secret is a secret and incomplete
8012// type, the only expression a user can write that has type Secret* is
8013// a null pointer literal. Therefore, we know that x is a null
8014// pointer literal if and only if the first version is picked by the
8015// compiler.
8016char IsNullLiteralHelper(Secret* p);
8017char (&IsNullLiteralHelper(...))[2]; // NOLINT
8018
8019// A compile-time bool constant that is true if and only if x is a
8020// null pointer literal (i.e. NULL or any 0-valued compile-time
8021// integral constant).
8022#ifdef GTEST_ELLIPSIS_NEEDS_POD_
8023// We lose support for NULL detection where the compiler doesn't like
8024// passing non-POD classes through ellipsis (...).
8025# define GTEST_IS_NULL_LITERAL_(x) false
8026#else
8027# define GTEST_IS_NULL_LITERAL_(x) \
8028 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
8029#endif // GTEST_ELLIPSIS_NEEDS_POD_
8030
8031// Appends the user-supplied message to the Google-Test-generated message.
8032GTEST_API_ std::string AppendUserMessage(
8033 const std::string& gtest_msg, const Message& user_msg);
8034
8035#if GTEST_HAS_EXCEPTIONS
8036
f67539c2
TL
8037GTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \
8038/* an exported class was derived from a class that was not exported */)
8039
7c673cae
FG
8040// This exception is thrown by (and only by) a failed Google Test
8041// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
8042// are enabled). We derive it from std::runtime_error, which is for
8043// errors presumably detectable only at run time. Since
8044// std::runtime_error inherits from std::exception, many testing
8045// frameworks know how to extract and print the message inside it.
8046class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
8047 public:
8048 explicit GoogleTestFailureException(const TestPartResult& failure);
8049};
8050
f67539c2 8051GTEST_DISABLE_MSC_WARNINGS_POP_() // 4275
7c673cae 8052
f67539c2 8053#endif // GTEST_HAS_EXCEPTIONS
7c673cae
FG
8054
8055namespace edit_distance {
8056// Returns the optimal edits to go from 'left' to 'right'.
8057// All edits cost the same, with replace having lower priority than
8058// add/remove.
8059// Simple implementation of the Wagner-Fischer algorithm.
8060// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
8061enum EditType { kMatch, kAdd, kRemove, kReplace };
8062GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
8063 const std::vector<size_t>& left, const std::vector<size_t>& right);
8064
8065// Same as above, but the input is represented as strings.
8066GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
8067 const std::vector<std::string>& left,
8068 const std::vector<std::string>& right);
8069
8070// Create a diff of the input strings in Unified diff format.
8071GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
8072 const std::vector<std::string>& right,
8073 size_t context = 2);
8074
8075} // namespace edit_distance
8076
8077// Calculate the diff between 'left' and 'right' and return it in unified diff
8078// format.
8079// If not null, stores in 'total_line_count' the total number of lines found
8080// in left + right.
8081GTEST_API_ std::string DiffStrings(const std::string& left,
8082 const std::string& right,
8083 size_t* total_line_count);
8084
8085// Constructs and returns the message for an equality assertion
8086// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
8087//
8088// The first four parameters are the expressions used in the assertion
8089// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
8090// where foo is 5 and bar is 6, we have:
8091//
8092// expected_expression: "foo"
8093// actual_expression: "bar"
8094// expected_value: "5"
8095// actual_value: "6"
8096//
8097// The ignoring_case parameter is true iff the assertion is a
8098// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
8099// be inserted into the message.
8100GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
8101 const char* actual_expression,
8102 const std::string& expected_value,
8103 const std::string& actual_value,
8104 bool ignoring_case);
8105
8106// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
8107GTEST_API_ std::string GetBoolAssertionFailureMessage(
8108 const AssertionResult& assertion_result,
8109 const char* expression_text,
8110 const char* actual_predicate_value,
8111 const char* expected_predicate_value);
8112
8113// This template class represents an IEEE floating-point number
8114// (either single-precision or double-precision, depending on the
8115// template parameters).
8116//
8117// The purpose of this class is to do more sophisticated number
8118// comparison. (Due to round-off error, etc, it's very unlikely that
8119// two floating-points will be equal exactly. Hence a naive
8120// comparison by the == operation often doesn't work.)
8121//
8122// Format of IEEE floating-point:
8123//
8124// The most-significant bit being the leftmost, an IEEE
8125// floating-point looks like
8126//
8127// sign_bit exponent_bits fraction_bits
8128//
8129// Here, sign_bit is a single bit that designates the sign of the
8130// number.
8131//
8132// For float, there are 8 exponent bits and 23 fraction bits.
8133//
8134// For double, there are 11 exponent bits and 52 fraction bits.
8135//
8136// More details can be found at
8137// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
8138//
8139// Template parameter:
8140//
8141// RawType: the raw floating-point type (either float or double)
8142template <typename RawType>
8143class FloatingPoint {
8144 public:
8145 // Defines the unsigned integer type that has the same size as the
8146 // floating point number.
8147 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
8148
8149 // Constants.
8150
8151 // # of bits in a number.
8152 static const size_t kBitCount = 8*sizeof(RawType);
8153
8154 // # of fraction bits in a number.
8155 static const size_t kFractionBitCount =
8156 std::numeric_limits<RawType>::digits - 1;
8157
8158 // # of exponent bits in a number.
8159 static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
8160
8161 // The mask for the sign bit.
8162 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
8163
8164 // The mask for the fraction bits.
8165 static const Bits kFractionBitMask =
8166 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
8167
8168 // The mask for the exponent bits.
8169 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
8170
8171 // How many ULP's (Units in the Last Place) we want to tolerate when
8172 // comparing two numbers. The larger the value, the more error we
8173 // allow. A 0 value means that two numbers must be exactly the same
8174 // to be considered equal.
8175 //
8176 // The maximum error of a single floating-point operation is 0.5
8177 // units in the last place. On Intel CPU's, all floating-point
8178 // calculations are done with 80-bit precision, while double has 64
8179 // bits. Therefore, 4 should be enough for ordinary use.
8180 //
8181 // See the following article for more details on ULP:
8182 // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
8183 static const size_t kMaxUlps = 4;
8184
8185 // Constructs a FloatingPoint from a raw floating-point number.
8186 //
8187 // On an Intel CPU, passing a non-normalized NAN (Not a Number)
8188 // around may change its bits, although the new value is guaranteed
8189 // to be also a NAN. Therefore, don't expect this constructor to
8190 // preserve the bits in x when x is a NAN.
8191 explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
8192
8193 // Static methods
8194
8195 // Reinterprets a bit pattern as a floating-point number.
8196 //
8197 // This function is needed to test the AlmostEquals() method.
8198 static RawType ReinterpretBits(const Bits bits) {
8199 FloatingPoint fp(0);
8200 fp.u_.bits_ = bits;
8201 return fp.u_.value_;
8202 }
8203
8204 // Returns the floating-point number that represent positive infinity.
8205 static RawType Infinity() {
8206 return ReinterpretBits(kExponentBitMask);
8207 }
8208
8209 // Returns the maximum representable finite floating-point number.
8210 static RawType Max();
8211
8212 // Non-static methods
8213
8214 // Returns the bits that represents this number.
8215 const Bits &bits() const { return u_.bits_; }
8216
8217 // Returns the exponent bits of this number.
8218 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
8219
8220 // Returns the fraction bits of this number.
8221 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
8222
8223 // Returns the sign bit of this number.
8224 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
8225
8226 // Returns true iff this is NAN (not a number).
8227 bool is_nan() const {
8228 // It's a NAN if the exponent bits are all ones and the fraction
8229 // bits are not entirely zeros.
8230 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
8231 }
8232
8233 // Returns true iff this number is at most kMaxUlps ULP's away from
8234 // rhs. In particular, this function:
8235 //
8236 // - returns false if either number is (or both are) NAN.
8237 // - treats really large numbers as almost equal to infinity.
8238 // - thinks +0.0 and -0.0 are 0 DLP's apart.
8239 bool AlmostEquals(const FloatingPoint& rhs) const {
8240 // The IEEE standard says that any comparison operation involving
8241 // a NAN must return false.
8242 if (is_nan() || rhs.is_nan()) return false;
8243
8244 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
8245 <= kMaxUlps;
8246 }
8247
8248 private:
8249 // The data type used to store the actual floating-point number.
8250 union FloatingPointUnion {
8251 RawType value_; // The raw floating-point number.
8252 Bits bits_; // The bits that represent the number.
8253 };
8254
8255 // Converts an integer from the sign-and-magnitude representation to
8256 // the biased representation. More precisely, let N be 2 to the
8257 // power of (kBitCount - 1), an integer x is represented by the
8258 // unsigned number x + N.
8259 //
8260 // For instance,
8261 //
8262 // -N + 1 (the most negative number representable using
8263 // sign-and-magnitude) is represented by 1;
8264 // 0 is represented by N; and
8265 // N - 1 (the biggest number representable using
8266 // sign-and-magnitude) is represented by 2N - 1.
8267 //
8268 // Read http://en.wikipedia.org/wiki/Signed_number_representations
8269 // for more details on signed number representations.
8270 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
8271 if (kSignBitMask & sam) {
8272 // sam represents a negative number.
8273 return ~sam + 1;
8274 } else {
8275 // sam represents a positive number.
8276 return kSignBitMask | sam;
8277 }
8278 }
8279
8280 // Given two numbers in the sign-and-magnitude representation,
8281 // returns the distance between them as an unsigned number.
8282 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
8283 const Bits &sam2) {
8284 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
8285 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
8286 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
8287 }
8288
8289 FloatingPointUnion u_;
8290};
8291
8292// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
8293// macro defined by <windows.h>.
8294template <>
8295inline float FloatingPoint<float>::Max() { return FLT_MAX; }
8296template <>
8297inline double FloatingPoint<double>::Max() { return DBL_MAX; }
8298
8299// Typedefs the instances of the FloatingPoint template class that we
8300// care to use.
8301typedef FloatingPoint<float> Float;
8302typedef FloatingPoint<double> Double;
8303
8304// In order to catch the mistake of putting tests that use different
8305// test fixture classes in the same test case, we need to assign
8306// unique IDs to fixture classes and compare them. The TypeId type is
8307// used to hold such IDs. The user should treat TypeId as an opaque
8308// type: the only operation allowed on TypeId values is to compare
8309// them for equality using the == operator.
8310typedef const void* TypeId;
8311
8312template <typename T>
8313class TypeIdHelper {
8314 public:
8315 // dummy_ must not have a const type. Otherwise an overly eager
8316 // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
8317 // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
8318 static bool dummy_;
8319};
8320
8321template <typename T>
8322bool TypeIdHelper<T>::dummy_ = false;
8323
8324// GetTypeId<T>() returns the ID of type T. Different values will be
8325// returned for different types. Calling the function twice with the
8326// same type argument is guaranteed to return the same ID.
8327template <typename T>
8328TypeId GetTypeId() {
8329 // The compiler is required to allocate a different
8330 // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
8331 // the template. Therefore, the address of dummy_ is guaranteed to
8332 // be unique.
8333 return &(TypeIdHelper<T>::dummy_);
8334}
8335
8336// Returns the type ID of ::testing::Test. Always call this instead
8337// of GetTypeId< ::testing::Test>() to get the type ID of
8338// ::testing::Test, as the latter may give the wrong result due to a
8339// suspected linker bug when compiling Google Test as a Mac OS X
8340// framework.
8341GTEST_API_ TypeId GetTestTypeId();
8342
8343// Defines the abstract factory interface that creates instances
8344// of a Test object.
8345class TestFactoryBase {
8346 public:
8347 virtual ~TestFactoryBase() {}
8348
8349 // Creates a test instance to run. The instance is both created and destroyed
8350 // within TestInfoImpl::Run()
8351 virtual Test* CreateTest() = 0;
8352
8353 protected:
8354 TestFactoryBase() {}
8355
8356 private:
8357 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
8358};
8359
8360// This class provides implementation of TeastFactoryBase interface.
8361// It is used in TEST and TEST_F macros.
8362template <class TestClass>
8363class TestFactoryImpl : public TestFactoryBase {
8364 public:
8365 virtual Test* CreateTest() { return new TestClass; }
8366};
8367
8368#if GTEST_OS_WINDOWS
8369
8370// Predicate-formatters for implementing the HRESULT checking macros
8371// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
8372// We pass a long instead of HRESULT to avoid causing an
8373// include dependency for the HRESULT type.
8374GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
8375 long hr); // NOLINT
8376GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
8377 long hr); // NOLINT
8378
8379#endif // GTEST_OS_WINDOWS
8380
8381// Types of SetUpTestCase() and TearDownTestCase() functions.
8382typedef void (*SetUpTestCaseFunc)();
8383typedef void (*TearDownTestCaseFunc)();
8384
f67539c2
TL
8385struct CodeLocation {
8386 CodeLocation(const std::string& a_file, int a_line)
8387 : file(a_file), line(a_line) {}
8388
8389 std::string file;
8390 int line;
8391};
8392
7c673cae
FG
8393// Creates a new TestInfo object and registers it with Google Test;
8394// returns the created object.
8395//
8396// Arguments:
8397//
8398// test_case_name: name of the test case
8399// name: name of the test
8400// type_param the name of the test's type parameter, or NULL if
8401// this is not a typed or a type-parameterized test.
8402// value_param text representation of the test's value parameter,
8403// or NULL if this is not a type-parameterized test.
f67539c2 8404// code_location: code location where the test is defined
7c673cae
FG
8405// fixture_class_id: ID of the test fixture class
8406// set_up_tc: pointer to the function that sets up the test case
8407// tear_down_tc: pointer to the function that tears down the test case
8408// factory: pointer to the factory that creates a test object.
8409// The newly created TestInfo instance will assume
8410// ownership of the factory object.
8411GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
8412 const char* test_case_name,
8413 const char* name,
8414 const char* type_param,
8415 const char* value_param,
f67539c2 8416 CodeLocation code_location,
7c673cae
FG
8417 TypeId fixture_class_id,
8418 SetUpTestCaseFunc set_up_tc,
8419 TearDownTestCaseFunc tear_down_tc,
8420 TestFactoryBase* factory);
8421
8422// If *pstr starts with the given prefix, modifies *pstr to be right
8423// past the prefix and returns true; otherwise leaves *pstr unchanged
8424// and returns false. None of pstr, *pstr, and prefix can be NULL.
8425GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
8426
8427#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8428
f67539c2
TL
8429GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
8430/* class A needs to have dll-interface to be used by clients of class B */)
8431
7c673cae
FG
8432// State of the definition of a type-parameterized test case.
8433class GTEST_API_ TypedTestCasePState {
8434 public:
8435 TypedTestCasePState() : registered_(false) {}
8436
8437 // Adds the given test name to defined_test_names_ and return true
8438 // if the test case hasn't been registered; otherwise aborts the
8439 // program.
8440 bool AddTestName(const char* file, int line, const char* case_name,
8441 const char* test_name) {
8442 if (registered_) {
8443 fprintf(stderr, "%s Test %s must be defined before "
8444 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
8445 FormatFileLocation(file, line).c_str(), test_name, case_name);
8446 fflush(stderr);
8447 posix::Abort();
8448 }
f67539c2
TL
8449 registered_tests_.insert(
8450 ::std::make_pair(test_name, CodeLocation(file, line)));
7c673cae
FG
8451 return true;
8452 }
8453
f67539c2
TL
8454 bool TestExists(const std::string& test_name) const {
8455 return registered_tests_.count(test_name) > 0;
8456 }
8457
8458 const CodeLocation& GetCodeLocation(const std::string& test_name) const {
8459 RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
8460 GTEST_CHECK_(it != registered_tests_.end());
8461 return it->second;
8462 }
8463
7c673cae
FG
8464 // Verifies that registered_tests match the test names in
8465 // defined_test_names_; returns registered_tests if successful, or
8466 // aborts the program otherwise.
8467 const char* VerifyRegisteredTestNames(
8468 const char* file, int line, const char* registered_tests);
8469
8470 private:
f67539c2
TL
8471 typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
8472
7c673cae 8473 bool registered_;
f67539c2 8474 RegisteredTestsMap registered_tests_;
7c673cae
FG
8475};
8476
f67539c2
TL
8477GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
8478
7c673cae
FG
8479// Skips to the first non-space char after the first comma in 'str';
8480// returns NULL if no comma is found in 'str'.
8481inline const char* SkipComma(const char* str) {
8482 const char* comma = strchr(str, ',');
8483 if (comma == NULL) {
8484 return NULL;
8485 }
8486 while (IsSpace(*(++comma))) {}
8487 return comma;
8488}
8489
8490// Returns the prefix of 'str' before the first comma in it; returns
8491// the entire string if it contains no comma.
8492inline std::string GetPrefixUntilComma(const char* str) {
8493 const char* comma = strchr(str, ',');
8494 return comma == NULL ? str : std::string(str, comma);
8495}
8496
f67539c2
TL
8497// Splits a given string on a given delimiter, populating a given
8498// vector with the fields.
8499void SplitString(const ::std::string& str, char delimiter,
8500 ::std::vector< ::std::string>* dest);
8501
8502// The default argument to the template below for the case when the user does
8503// not provide a name generator.
8504struct DefaultNameGenerator {
8505 template <typename T>
8506 static std::string GetName(int i) {
8507 return StreamableToString(i);
8508 }
8509};
8510
8511template <typename Provided = DefaultNameGenerator>
8512struct NameGeneratorSelector {
8513 typedef Provided type;
8514};
8515
8516template <typename NameGenerator>
8517void GenerateNamesRecursively(Types0, std::vector<std::string>*, int) {}
8518
8519template <typename NameGenerator, typename Types>
8520void GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {
8521 result->push_back(NameGenerator::template GetName<typename Types::Head>(i));
8522 GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,
8523 i + 1);
8524}
8525
8526template <typename NameGenerator, typename Types>
8527std::vector<std::string> GenerateNames() {
8528 std::vector<std::string> result;
8529 GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);
8530 return result;
8531}
8532
7c673cae
FG
8533// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
8534// registers a list of type-parameterized tests with Google Test. The
8535// return value is insignificant - we just need to return something
8536// such that we can call this function in a namespace scope.
8537//
8538// Implementation note: The GTEST_TEMPLATE_ macro declares a template
8539// template parameter. It's defined in gtest-type-util.h.
8540template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
8541class TypeParameterizedTest {
8542 public:
8543 // 'index' is the index of the test in the type list 'Types'
8544 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
8545 // Types). Valid values for 'index' are [0, N - 1] where N is the
8546 // length of Types.
f67539c2
TL
8547 static bool Register(const char* prefix, const CodeLocation& code_location,
8548 const char* case_name, const char* test_names, int index,
8549 const std::vector<std::string>& type_names =
8550 GenerateNames<DefaultNameGenerator, Types>()) {
7c673cae
FG
8551 typedef typename Types::Head Type;
8552 typedef Fixture<Type> FixtureClass;
8553 typedef typename GTEST_BIND_(TestSel, Type) TestClass;
8554
8555 // First, registers the first type-parameterized test in the type
8556 // list.
8557 MakeAndRegisterTestInfo(
f67539c2
TL
8558 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
8559 "/" + type_names[index])
8560 .c_str(),
7c673cae
FG
8561 StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
8562 GetTypeName<Type>().c_str(),
8563 NULL, // No value parameter.
f67539c2
TL
8564 code_location, GetTypeId<FixtureClass>(), TestClass::SetUpTestCase,
8565 TestClass::TearDownTestCase, new TestFactoryImpl<TestClass>);
7c673cae
FG
8566
8567 // Next, recurses (at compile time) with the tail of the type list.
f67539c2
TL
8568 return TypeParameterizedTest<Fixture, TestSel,
8569 typename Types::Tail>::Register(prefix,
8570 code_location,
8571 case_name,
8572 test_names,
8573 index + 1,
8574 type_names);
7c673cae
FG
8575 }
8576};
8577
8578// The base case for the compile time recursion.
8579template <GTEST_TEMPLATE_ Fixture, class TestSel>
8580class TypeParameterizedTest<Fixture, TestSel, Types0> {
8581 public:
f67539c2
TL
8582 static bool Register(const char* /*prefix*/, const CodeLocation&,
8583 const char* /*case_name*/, const char* /*test_names*/,
8584 int /*index*/,
8585 const std::vector<std::string>& =
8586 std::vector<std::string>() /*type_names*/) {
7c673cae
FG
8587 return true;
8588 }
8589};
8590
8591// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
8592// registers *all combinations* of 'Tests' and 'Types' with Google
8593// Test. The return value is insignificant - we just need to return
8594// something such that we can call this function in a namespace scope.
8595template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
8596class TypeParameterizedTestCase {
8597 public:
f67539c2
TL
8598 static bool Register(const char* prefix, CodeLocation code_location,
8599 const TypedTestCasePState* state, const char* case_name,
8600 const char* test_names,
8601 const std::vector<std::string>& type_names =
8602 GenerateNames<DefaultNameGenerator, Types>()) {
8603 std::string test_name = StripTrailingSpaces(
8604 GetPrefixUntilComma(test_names));
8605 if (!state->TestExists(test_name)) {
8606 fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
8607 case_name, test_name.c_str(),
8608 FormatFileLocation(code_location.file.c_str(),
8609 code_location.line).c_str());
8610 fflush(stderr);
8611 posix::Abort();
8612 }
8613 const CodeLocation& test_location = state->GetCodeLocation(test_name);
8614
7c673cae
FG
8615 typedef typename Tests::Head Head;
8616
8617 // First, register the first test in 'Test' for each type in 'Types'.
8618 TypeParameterizedTest<Fixture, Head, Types>::Register(
f67539c2 8619 prefix, test_location, case_name, test_names, 0, type_names);
7c673cae
FG
8620
8621 // Next, recurses (at compile time) with the tail of the test list.
f67539c2
TL
8622 return TypeParameterizedTestCase<Fixture, typename Tests::Tail,
8623 Types>::Register(prefix, code_location,
8624 state, case_name,
8625 SkipComma(test_names),
8626 type_names);
7c673cae
FG
8627 }
8628};
8629
8630// The base case for the compile time recursion.
8631template <GTEST_TEMPLATE_ Fixture, typename Types>
8632class TypeParameterizedTestCase<Fixture, Templates0, Types> {
8633 public:
f67539c2
TL
8634 static bool Register(const char* /*prefix*/, const CodeLocation&,
8635 const TypedTestCasePState* /*state*/,
8636 const char* /*case_name*/, const char* /*test_names*/,
8637 const std::vector<std::string>& =
8638 std::vector<std::string>() /*type_names*/) {
7c673cae
FG
8639 return true;
8640 }
8641};
8642
8643#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8644
8645// Returns the current OS stack trace as an std::string.
8646//
8647// The maximum number of stack frames to be included is specified by
8648// the gtest_stack_trace_depth flag. The skip_count parameter
8649// specifies the number of top frames to be skipped, which doesn't
8650// count against the number of frames to be included.
8651//
8652// For example, if Foo() calls Bar(), which in turn calls
8653// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
8654// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
8655GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
8656 UnitTest* unit_test, int skip_count);
8657
8658// Helpers for suppressing warnings on unreachable code or constant
8659// condition.
8660
8661// Always returns true.
8662GTEST_API_ bool AlwaysTrue();
8663
8664// Always returns false.
8665inline bool AlwaysFalse() { return !AlwaysTrue(); }
8666
8667// Helper for suppressing false warning from Clang on a const char*
8668// variable declared in a conditional expression always being NULL in
8669// the else branch.
8670struct GTEST_API_ ConstCharPtr {
8671 ConstCharPtr(const char* str) : value(str) {}
8672 operator bool() const { return true; }
8673 const char* value;
8674};
8675
8676// A simple Linear Congruential Generator for generating random
8677// numbers with a uniform distribution. Unlike rand() and srand(), it
8678// doesn't use global state (and therefore can't interfere with user
8679// code). Unlike rand_r(), it's portable. An LCG isn't very random,
8680// but it's good enough for our purposes.
8681class GTEST_API_ Random {
8682 public:
8683 static const UInt32 kMaxRange = 1u << 31;
8684
8685 explicit Random(UInt32 seed) : state_(seed) {}
8686
8687 void Reseed(UInt32 seed) { state_ = seed; }
8688
8689 // Generates a random number from [0, range). Crashes if 'range' is
8690 // 0 or greater than kMaxRange.
8691 UInt32 Generate(UInt32 range);
8692
8693 private:
8694 UInt32 state_;
8695 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
8696};
8697
8698// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
8699// compiler error iff T1 and T2 are different types.
8700template <typename T1, typename T2>
8701struct CompileAssertTypesEqual;
8702
8703template <typename T>
8704struct CompileAssertTypesEqual<T, T> {
8705};
8706
8707// Removes the reference from a type if it is a reference type,
8708// otherwise leaves it unchanged. This is the same as
8709// tr1::remove_reference, which is not widely available yet.
8710template <typename T>
8711struct RemoveReference { typedef T type; }; // NOLINT
8712template <typename T>
8713struct RemoveReference<T&> { typedef T type; }; // NOLINT
8714
8715// A handy wrapper around RemoveReference that works when the argument
8716// T depends on template parameters.
8717#define GTEST_REMOVE_REFERENCE_(T) \
8718 typename ::testing::internal::RemoveReference<T>::type
8719
8720// Removes const from a type if it is a const type, otherwise leaves
8721// it unchanged. This is the same as tr1::remove_const, which is not
8722// widely available yet.
8723template <typename T>
8724struct RemoveConst { typedef T type; }; // NOLINT
8725template <typename T>
8726struct RemoveConst<const T> { typedef T type; }; // NOLINT
8727
8728// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
8729// definition to fail to remove the const in 'const int[3]' and 'const
8730// char[3][4]'. The following specialization works around the bug.
8731template <typename T, size_t N>
8732struct RemoveConst<const T[N]> {
8733 typedef typename RemoveConst<T>::type type[N];
8734};
8735
8736#if defined(_MSC_VER) && _MSC_VER < 1400
8737// This is the only specialization that allows VC++ 7.1 to remove const in
8738// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
8739// and thus needs to be conditionally compiled.
8740template <typename T, size_t N>
8741struct RemoveConst<T[N]> {
8742 typedef typename RemoveConst<T>::type type[N];
8743};
8744#endif
8745
8746// A handy wrapper around RemoveConst that works when the argument
8747// T depends on template parameters.
8748#define GTEST_REMOVE_CONST_(T) \
8749 typename ::testing::internal::RemoveConst<T>::type
8750
8751// Turns const U&, U&, const U, and U all into U.
8752#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
8753 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
8754
7c673cae
FG
8755// ImplicitlyConvertible<From, To>::value is a compile-time bool
8756// constant that's true iff type From can be implicitly converted to
8757// type To.
8758template <typename From, typename To>
8759class ImplicitlyConvertible {
8760 private:
8761 // We need the following helper functions only for their types.
8762 // They have no implementations.
8763
8764 // MakeFrom() is an expression whose type is From. We cannot simply
8765 // use From(), as the type From may not have a public default
8766 // constructor.
8767 static typename AddReference<From>::type MakeFrom();
8768
8769 // These two functions are overloaded. Given an expression
8770 // Helper(x), the compiler will pick the first version if x can be
8771 // implicitly converted to type To; otherwise it will pick the
8772 // second version.
8773 //
8774 // The first version returns a value of size 1, and the second
8775 // version returns a value of size 2. Therefore, by checking the
8776 // size of Helper(x), which can be done at compile time, we can tell
8777 // which version of Helper() is used, and hence whether x can be
8778 // implicitly converted to type To.
8779 static char Helper(To);
8780 static char (&Helper(...))[2]; // NOLINT
8781
8782 // We have to put the 'public' section after the 'private' section,
8783 // or MSVC refuses to compile the code.
8784 public:
8785#if defined(__BORLANDC__)
8786 // C++Builder cannot use member overload resolution during template
8787 // instantiation. The simplest workaround is to use its C++0x type traits
8788 // functions (C++Builder 2009 and above only).
8789 static const bool value = __is_convertible(From, To);
8790#else
8791 // MSVC warns about implicitly converting from double to int for
8792 // possible loss of data, so we need to temporarily disable the
8793 // warning.
8794 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
8795 static const bool value =
8796 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
8797 GTEST_DISABLE_MSC_WARNINGS_POP_()
8798#endif // __BORLANDC__
8799};
8800template <typename From, typename To>
8801const bool ImplicitlyConvertible<From, To>::value;
8802
8803// IsAProtocolMessage<T>::value is a compile-time bool constant that's
8804// true iff T is type ProtocolMessage, proto2::Message, or a subclass
8805// of those.
8806template <typename T>
8807struct IsAProtocolMessage
8808 : public bool_constant<
8809 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
8810 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
8811};
8812
8813// When the compiler sees expression IsContainerTest<C>(0), if C is an
8814// STL-style container class, the first overload of IsContainerTest
8815// will be viable (since both C::iterator* and C::const_iterator* are
8816// valid types and NULL can be implicitly converted to them). It will
8817// be picked over the second overload as 'int' is a perfect match for
8818// the type of argument 0. If C::iterator or C::const_iterator is not
8819// a valid type, the first overload is not viable, and the second
8820// overload will be picked. Therefore, we can determine whether C is
8821// a container class by checking the type of IsContainerTest<C>(0).
8822// The value of the expression is insignificant.
8823//
f67539c2
TL
8824// In C++11 mode we check the existence of a const_iterator and that an
8825// iterator is properly implemented for the container.
8826//
8827// For pre-C++11 that we look for both C::iterator and C::const_iterator.
8828// The reason is that C++ injects the name of a class as a member of the
7c673cae
FG
8829// class itself (e.g. you can refer to class iterator as either
8830// 'iterator' or 'iterator::iterator'). If we look for C::iterator
8831// only, for example, we would mistakenly think that a class named
8832// iterator is an STL container.
8833//
8834// Also note that the simpler approach of overloading
8835// IsContainerTest(typename C::const_iterator*) and
8836// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
8837typedef int IsContainer;
f67539c2
TL
8838#if GTEST_LANG_CXX11
8839template <class C,
8840 class Iterator = decltype(::std::declval<const C&>().begin()),
8841 class = decltype(::std::declval<const C&>().end()),
8842 class = decltype(++::std::declval<Iterator&>()),
8843 class = decltype(*::std::declval<Iterator>()),
8844 class = typename C::const_iterator>
8845IsContainer IsContainerTest(int /* dummy */) {
8846 return 0;
8847}
8848#else
7c673cae
FG
8849template <class C>
8850IsContainer IsContainerTest(int /* dummy */,
8851 typename C::iterator* /* it */ = NULL,
8852 typename C::const_iterator* /* const_it */ = NULL) {
8853 return 0;
8854}
f67539c2 8855#endif // GTEST_LANG_CXX11
7c673cae
FG
8856
8857typedef char IsNotContainer;
8858template <class C>
8859IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
8860
f67539c2
TL
8861// Trait to detect whether a type T is a hash table.
8862// The heuristic used is that the type contains an inner type `hasher` and does
8863// not contain an inner type `reverse_iterator`.
8864// If the container is iterable in reverse, then order might actually matter.
8865template <typename T>
8866struct IsHashTable {
8867 private:
8868 template <typename U>
8869 static char test(typename U::hasher*, typename U::reverse_iterator*);
8870 template <typename U>
8871 static int test(typename U::hasher*, ...);
8872 template <typename U>
8873 static char test(...);
8874
8875 public:
8876 static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);
8877};
8878
8879template <typename T>
8880const bool IsHashTable<T>::value;
8881
8882template<typename T>
8883struct VoidT {
8884 typedef void value_type;
8885};
8886
8887template <typename T, typename = void>
8888struct HasValueType : false_type {};
8889template <typename T>
8890struct HasValueType<T, VoidT<typename T::value_type> > : true_type {
8891};
8892
8893template <typename C,
8894 bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),
8895 bool = HasValueType<C>::value>
8896struct IsRecursiveContainerImpl;
8897
8898template <typename C, bool HV>
8899struct IsRecursiveContainerImpl<C, false, HV> : public false_type {};
8900
8901// Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
8902// obey the same inconsistencies as the IsContainerTest, namely check if
8903// something is a container is relying on only const_iterator in C++11 and
8904// is relying on both const_iterator and iterator otherwise
8905template <typename C>
8906struct IsRecursiveContainerImpl<C, true, false> : public false_type {};
8907
8908template <typename C>
8909struct IsRecursiveContainerImpl<C, true, true> {
8910 #if GTEST_LANG_CXX11
8911 typedef typename IteratorTraits<typename C::const_iterator>::value_type
8912 value_type;
8913#else
8914 typedef typename IteratorTraits<typename C::iterator>::value_type value_type;
8915#endif
8916 typedef is_same<value_type, C> type;
8917};
8918
8919// IsRecursiveContainer<Type> is a unary compile-time predicate that
8920// evaluates whether C is a recursive container type. A recursive container
8921// type is a container type whose value_type is equal to the container type
8922// itself. An example for a recursive container type is
8923// boost::filesystem::path, whose iterator has a value_type that is equal to
8924// boost::filesystem::path.
8925template <typename C>
8926struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
8927
7c673cae
FG
8928// EnableIf<condition>::type is void when 'Cond' is true, and
8929// undefined when 'Cond' is false. To use SFINAE to make a function
8930// overload only apply when a particular expression is true, add
8931// "typename EnableIf<expression>::type* = 0" as the last parameter.
8932template<bool> struct EnableIf;
8933template<> struct EnableIf<true> { typedef void type; }; // NOLINT
8934
8935// Utilities for native arrays.
8936
8937// ArrayEq() compares two k-dimensional native arrays using the
8938// elements' operator==, where k can be any integer >= 0. When k is
8939// 0, ArrayEq() degenerates into comparing a single pair of values.
8940
8941template <typename T, typename U>
8942bool ArrayEq(const T* lhs, size_t size, const U* rhs);
8943
8944// This generic version is used when k is 0.
8945template <typename T, typename U>
8946inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
8947
8948// This overload is used when k >= 1.
8949template <typename T, typename U, size_t N>
8950inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
8951 return internal::ArrayEq(lhs, N, rhs);
8952}
8953
8954// This helper reduces code bloat. If we instead put its logic inside
8955// the previous ArrayEq() function, arrays with different sizes would
8956// lead to different copies of the template code.
8957template <typename T, typename U>
8958bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
8959 for (size_t i = 0; i != size; i++) {
8960 if (!internal::ArrayEq(lhs[i], rhs[i]))
8961 return false;
8962 }
8963 return true;
8964}
8965
8966// Finds the first element in the iterator range [begin, end) that
8967// equals elem. Element may be a native array type itself.
8968template <typename Iter, typename Element>
8969Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
8970 for (Iter it = begin; it != end; ++it) {
8971 if (internal::ArrayEq(*it, elem))
8972 return it;
8973 }
8974 return end;
8975}
8976
8977// CopyArray() copies a k-dimensional native array using the elements'
8978// operator=, where k can be any integer >= 0. When k is 0,
8979// CopyArray() degenerates into copying a single value.
8980
8981template <typename T, typename U>
8982void CopyArray(const T* from, size_t size, U* to);
8983
8984// This generic version is used when k is 0.
8985template <typename T, typename U>
8986inline void CopyArray(const T& from, U* to) { *to = from; }
8987
8988// This overload is used when k >= 1.
8989template <typename T, typename U, size_t N>
8990inline void CopyArray(const T(&from)[N], U(*to)[N]) {
8991 internal::CopyArray(from, N, *to);
8992}
8993
8994// This helper reduces code bloat. If we instead put its logic inside
8995// the previous CopyArray() function, arrays with different sizes
8996// would lead to different copies of the template code.
8997template <typename T, typename U>
8998void CopyArray(const T* from, size_t size, U* to) {
8999 for (size_t i = 0; i != size; i++) {
9000 internal::CopyArray(from[i], to + i);
9001 }
9002}
9003
9004// The relation between an NativeArray object (see below) and the
9005// native array it represents.
9006// We use 2 different structs to allow non-copyable types to be used, as long
9007// as RelationToSourceReference() is passed.
9008struct RelationToSourceReference {};
9009struct RelationToSourceCopy {};
9010
9011// Adapts a native array to a read-only STL-style container. Instead
9012// of the complete STL container concept, this adaptor only implements
9013// members useful for Google Mock's container matchers. New members
9014// should be added as needed. To simplify the implementation, we only
9015// support Element being a raw type (i.e. having no top-level const or
9016// reference modifier). It's the client's responsibility to satisfy
9017// this requirement. Element can be an array type itself (hence
9018// multi-dimensional arrays are supported).
9019template <typename Element>
9020class NativeArray {
9021 public:
9022 // STL-style container typedefs.
9023 typedef Element value_type;
9024 typedef Element* iterator;
9025 typedef const Element* const_iterator;
9026
9027 // Constructs from a native array. References the source.
9028 NativeArray(const Element* array, size_t count, RelationToSourceReference) {
9029 InitRef(array, count);
9030 }
9031
9032 // Constructs from a native array. Copies the source.
9033 NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
9034 InitCopy(array, count);
9035 }
9036
9037 // Copy constructor.
9038 NativeArray(const NativeArray& rhs) {
9039 (this->*rhs.clone_)(rhs.array_, rhs.size_);
9040 }
9041
9042 ~NativeArray() {
9043 if (clone_ != &NativeArray::InitRef)
9044 delete[] array_;
9045 }
9046
9047 // STL-style container methods.
9048 size_t size() const { return size_; }
9049 const_iterator begin() const { return array_; }
9050 const_iterator end() const { return array_ + size_; }
9051 bool operator==(const NativeArray& rhs) const {
9052 return size() == rhs.size() &&
9053 ArrayEq(begin(), size(), rhs.begin());
9054 }
9055
9056 private:
9057 enum {
9058 kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
f67539c2 9059 Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value
7c673cae
FG
9060 };
9061
9062 // Initializes this object with a copy of the input.
9063 void InitCopy(const Element* array, size_t a_size) {
9064 Element* const copy = new Element[a_size];
9065 CopyArray(array, a_size, copy);
9066 array_ = copy;
9067 size_ = a_size;
9068 clone_ = &NativeArray::InitCopy;
9069 }
9070
9071 // Initializes this object with a reference of the input.
9072 void InitRef(const Element* array, size_t a_size) {
9073 array_ = array;
9074 size_ = a_size;
9075 clone_ = &NativeArray::InitRef;
9076 }
9077
9078 const Element* array_;
9079 size_t size_;
9080 void (NativeArray::*clone_)(const Element*, size_t);
9081
9082 GTEST_DISALLOW_ASSIGN_(NativeArray);
9083};
9084
9085} // namespace internal
9086} // namespace testing
9087
9088#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
9089 ::testing::internal::AssertHelper(result_type, file, line, message) \
9090 = ::testing::Message()
9091
9092#define GTEST_MESSAGE_(message, result_type) \
9093 GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
9094
9095#define GTEST_FATAL_FAILURE_(message) \
9096 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
9097
9098#define GTEST_NONFATAL_FAILURE_(message) \
9099 GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
9100
9101#define GTEST_SUCCESS_(message) \
9102 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
9103
f67539c2 9104// Suppress MSVC warning 4702 (unreachable code) for the code following
7c673cae
FG
9105// statement if it returns or throws (or doesn't return or throw in some
9106// situations).
9107#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
9108 if (::testing::internal::AlwaysTrue()) { statement; }
9109
9110#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
9111 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9112 if (::testing::internal::ConstCharPtr gtest_msg = "") { \
9113 bool gtest_caught_expected = false; \
9114 try { \
9115 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9116 } \
9117 catch (expected_exception const&) { \
9118 gtest_caught_expected = true; \
9119 } \
9120 catch (...) { \
9121 gtest_msg.value = \
9122 "Expected: " #statement " throws an exception of type " \
9123 #expected_exception ".\n Actual: it throws a different type."; \
9124 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
9125 } \
9126 if (!gtest_caught_expected) { \
9127 gtest_msg.value = \
9128 "Expected: " #statement " throws an exception of type " \
9129 #expected_exception ".\n Actual: it throws nothing."; \
9130 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
9131 } \
9132 } else \
9133 GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
9134 fail(gtest_msg.value)
9135
9136#define GTEST_TEST_NO_THROW_(statement, fail) \
9137 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9138 if (::testing::internal::AlwaysTrue()) { \
9139 try { \
9140 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9141 } \
9142 catch (...) { \
9143 goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
9144 } \
9145 } else \
9146 GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
9147 fail("Expected: " #statement " doesn't throw an exception.\n" \
9148 " Actual: it throws.")
9149
9150#define GTEST_TEST_ANY_THROW_(statement, fail) \
9151 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9152 if (::testing::internal::AlwaysTrue()) { \
9153 bool gtest_caught_any = false; \
9154 try { \
9155 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9156 } \
9157 catch (...) { \
9158 gtest_caught_any = true; \
9159 } \
9160 if (!gtest_caught_any) { \
9161 goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
9162 } \
9163 } else \
9164 GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
9165 fail("Expected: " #statement " throws an exception.\n" \
9166 " Actual: it doesn't.")
9167
9168
9169// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
9170// either a boolean expression or an AssertionResult. text is a textual
9171// represenation of expression as it was passed into the EXPECT_TRUE.
9172#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
9173 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9174 if (const ::testing::AssertionResult gtest_ar_ = \
9175 ::testing::AssertionResult(expression)) \
9176 ; \
9177 else \
9178 fail(::testing::internal::GetBoolAssertionFailureMessage(\
9179 gtest_ar_, text, #actual, #expected).c_str())
9180
9181#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
9182 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9183 if (::testing::internal::AlwaysTrue()) { \
9184 ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
9185 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9186 if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
9187 goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
9188 } \
9189 } else \
9190 GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
9191 fail("Expected: " #statement " doesn't generate new fatal " \
9192 "failures in the current thread.\n" \
9193 " Actual: it does.")
9194
9195// Expands to the name of the class that implements the given test.
9196#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
9197 test_case_name##_##test_name##_Test
9198
9199// Helper macro for defining tests.
9200#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
9201class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
9202 public:\
9203 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
9204 private:\
9205 virtual void TestBody();\
9206 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
9207 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
9208 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
9209};\
9210\
9211::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
9212 ::test_info_ =\
9213 ::testing::internal::MakeAndRegisterTestInfo(\
9214 #test_case_name, #test_name, NULL, NULL, \
f67539c2 9215 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
7c673cae
FG
9216 (parent_id), \
9217 parent_class::SetUpTestCase, \
9218 parent_class::TearDownTestCase, \
9219 new ::testing::internal::TestFactoryImpl<\
9220 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
9221void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
9222
9223#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
7c673cae
FG
9224// Copyright 2005, Google Inc.
9225// All rights reserved.
9226//
9227// Redistribution and use in source and binary forms, with or without
9228// modification, are permitted provided that the following conditions are
9229// met:
9230//
9231// * Redistributions of source code must retain the above copyright
9232// notice, this list of conditions and the following disclaimer.
9233// * Redistributions in binary form must reproduce the above
9234// copyright notice, this list of conditions and the following disclaimer
9235// in the documentation and/or other materials provided with the
9236// distribution.
9237// * Neither the name of Google Inc. nor the names of its
9238// contributors may be used to endorse or promote products derived from
9239// this software without specific prior written permission.
9240//
9241// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9242// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9243// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9244// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9245// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9246// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9247// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9248// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9249// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9250// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9251// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 9252
7c673cae 9253//
f67539c2 9254// The Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
9255//
9256// This header file defines the public API for death tests. It is
9257// #included by gtest.h so a user doesn't need to include this
9258// directly.
f67539c2 9259// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae
FG
9260
9261#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9262#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9263
9264// Copyright 2005, Google Inc.
9265// All rights reserved.
9266//
9267// Redistribution and use in source and binary forms, with or without
9268// modification, are permitted provided that the following conditions are
9269// met:
9270//
9271// * Redistributions of source code must retain the above copyright
9272// notice, this list of conditions and the following disclaimer.
9273// * Redistributions in binary form must reproduce the above
9274// copyright notice, this list of conditions and the following disclaimer
9275// in the documentation and/or other materials provided with the
9276// distribution.
9277// * Neither the name of Google Inc. nor the names of its
9278// contributors may be used to endorse or promote products derived from
9279// this software without specific prior written permission.
9280//
9281// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9282// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9283// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9284// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9285// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9286// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9287// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9288// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9289// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9290// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9291// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9292//
f67539c2 9293// The Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
9294//
9295// This header file defines internal utilities needed for implementing
9296// death tests. They are subject to change without notice.
f67539c2 9297// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae
FG
9298
9299#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9300#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9301
9302
9303#include <stdio.h>
9304
9305namespace testing {
9306namespace internal {
9307
9308GTEST_DECLARE_string_(internal_run_death_test);
9309
9310// Names of the flags (needed for parsing Google Test flags).
9311const char kDeathTestStyleFlag[] = "death_test_style";
9312const char kDeathTestUseFork[] = "death_test_use_fork";
9313const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
9314
9315#if GTEST_HAS_DEATH_TEST
9316
f67539c2
TL
9317GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
9318/* class A needs to have dll-interface to be used by clients of class B */)
9319
7c673cae
FG
9320// DeathTest is a class that hides much of the complexity of the
9321// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
9322// returns a concrete class that depends on the prevailing death test
9323// style, as defined by the --gtest_death_test_style and/or
9324// --gtest_internal_run_death_test flags.
9325
9326// In describing the results of death tests, these terms are used with
9327// the corresponding definitions:
9328//
9329// exit status: The integer exit information in the format specified
9330// by wait(2)
9331// exit code: The integer code passed to exit(3), _exit(2), or
9332// returned from main()
9333class GTEST_API_ DeathTest {
9334 public:
9335 // Create returns false if there was an error determining the
9336 // appropriate action to take for the current death test; for example,
9337 // if the gtest_death_test_style flag is set to an invalid value.
9338 // The LastMessage method will return a more detailed message in that
9339 // case. Otherwise, the DeathTest pointer pointed to by the "test"
9340 // argument is set. If the death test should be skipped, the pointer
9341 // is set to NULL; otherwise, it is set to the address of a new concrete
9342 // DeathTest object that controls the execution of the current test.
9343 static bool Create(const char* statement, const RE* regex,
9344 const char* file, int line, DeathTest** test);
9345 DeathTest();
9346 virtual ~DeathTest() { }
9347
9348 // A helper class that aborts a death test when it's deleted.
9349 class ReturnSentinel {
9350 public:
9351 explicit ReturnSentinel(DeathTest* test) : test_(test) { }
9352 ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
9353 private:
9354 DeathTest* const test_;
9355 GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
9356 } GTEST_ATTRIBUTE_UNUSED_;
9357
9358 // An enumeration of possible roles that may be taken when a death
9359 // test is encountered. EXECUTE means that the death test logic should
9360 // be executed immediately. OVERSEE means that the program should prepare
9361 // the appropriate environment for a child process to execute the death
9362 // test, then wait for it to complete.
9363 enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
9364
9365 // An enumeration of the three reasons that a test might be aborted.
9366 enum AbortReason {
9367 TEST_ENCOUNTERED_RETURN_STATEMENT,
9368 TEST_THREW_EXCEPTION,
9369 TEST_DID_NOT_DIE
9370 };
9371
9372 // Assumes one of the above roles.
9373 virtual TestRole AssumeRole() = 0;
9374
9375 // Waits for the death test to finish and returns its status.
9376 virtual int Wait() = 0;
9377
9378 // Returns true if the death test passed; that is, the test process
9379 // exited during the test, its exit status matches a user-supplied
9380 // predicate, and its stderr output matches a user-supplied regular
9381 // expression.
9382 // The user-supplied predicate may be a macro expression rather
9383 // than a function pointer or functor, or else Wait and Passed could
9384 // be combined.
9385 virtual bool Passed(bool exit_status_ok) = 0;
9386
9387 // Signals that the death test did not die as expected.
9388 virtual void Abort(AbortReason reason) = 0;
9389
9390 // Returns a human-readable outcome message regarding the outcome of
9391 // the last death test.
9392 static const char* LastMessage();
9393
9394 static void set_last_death_test_message(const std::string& message);
9395
9396 private:
9397 // A string containing a description of the outcome of the last death test.
9398 static std::string last_death_test_message_;
9399
9400 GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
9401};
9402
f67539c2
TL
9403GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
9404
7c673cae
FG
9405// Factory interface for death tests. May be mocked out for testing.
9406class DeathTestFactory {
9407 public:
9408 virtual ~DeathTestFactory() { }
9409 virtual bool Create(const char* statement, const RE* regex,
9410 const char* file, int line, DeathTest** test) = 0;
9411};
9412
9413// A concrete DeathTestFactory implementation for normal use.
9414class DefaultDeathTestFactory : public DeathTestFactory {
9415 public:
9416 virtual bool Create(const char* statement, const RE* regex,
9417 const char* file, int line, DeathTest** test);
9418};
9419
9420// Returns true if exit_status describes a process that was terminated
9421// by a signal, or exited normally with a nonzero exit code.
9422GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
9423
9424// Traps C++ exceptions escaping statement and reports them as test
9425// failures. Note that trapping SEH exceptions is not implemented here.
9426# if GTEST_HAS_EXCEPTIONS
9427# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9428 try { \
9429 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9430 } catch (const ::std::exception& gtest_exception) { \
9431 fprintf(\
9432 stderr, \
9433 "\n%s: Caught std::exception-derived exception escaping the " \
9434 "death test statement. Exception message: %s\n", \
9435 ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
9436 gtest_exception.what()); \
9437 fflush(stderr); \
9438 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9439 } catch (...) { \
9440 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9441 }
9442
9443# else
9444# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9445 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
9446
9447# endif
9448
9449// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
9450// ASSERT_EXIT*, and EXPECT_EXIT*.
9451# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
9452 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9453 if (::testing::internal::AlwaysTrue()) { \
9454 const ::testing::internal::RE& gtest_regex = (regex); \
9455 ::testing::internal::DeathTest* gtest_dt; \
9456 if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
9457 __FILE__, __LINE__, &gtest_dt)) { \
9458 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9459 } \
9460 if (gtest_dt != NULL) { \
9461 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
9462 gtest_dt_ptr(gtest_dt); \
9463 switch (gtest_dt->AssumeRole()) { \
9464 case ::testing::internal::DeathTest::OVERSEE_TEST: \
9465 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
9466 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9467 } \
9468 break; \
9469 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
9470 ::testing::internal::DeathTest::ReturnSentinel \
9471 gtest_sentinel(gtest_dt); \
9472 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
9473 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
9474 break; \
9475 } \
9476 default: \
9477 break; \
9478 } \
9479 } \
9480 } else \
9481 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
9482 fail(::testing::internal::DeathTest::LastMessage())
9483// The symbol "fail" here expands to something into which a message
9484// can be streamed.
9485
9486// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
f67539c2
TL
9487// NDEBUG mode. In this case we need the statements to be executed and the macro
9488// must accept a streamed message even though the message is never printed.
9489// The regex object is not evaluated, but it is used to prevent "unused"
9490// warnings and to avoid an expression that doesn't compile in debug mode.
9491#define GTEST_EXECUTE_STATEMENT_(statement, regex) \
9492 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9493 if (::testing::internal::AlwaysTrue()) { \
9494 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9495 } else if (!::testing::internal::AlwaysTrue()) { \
9496 const ::testing::internal::RE& gtest_regex = (regex); \
9497 static_cast<void>(gtest_regex); \
9498 } else \
7c673cae
FG
9499 ::testing::Message()
9500
9501// A class representing the parsed contents of the
9502// --gtest_internal_run_death_test flag, as it existed when
9503// RUN_ALL_TESTS was called.
9504class InternalRunDeathTestFlag {
9505 public:
9506 InternalRunDeathTestFlag(const std::string& a_file,
9507 int a_line,
9508 int an_index,
9509 int a_write_fd)
9510 : file_(a_file), line_(a_line), index_(an_index),
9511 write_fd_(a_write_fd) {}
9512
9513 ~InternalRunDeathTestFlag() {
9514 if (write_fd_ >= 0)
9515 posix::Close(write_fd_);
9516 }
9517
9518 const std::string& file() const { return file_; }
9519 int line() const { return line_; }
9520 int index() const { return index_; }
9521 int write_fd() const { return write_fd_; }
9522
9523 private:
9524 std::string file_;
9525 int line_;
9526 int index_;
9527 int write_fd_;
9528
9529 GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
9530};
9531
9532// Returns a newly created InternalRunDeathTestFlag object with fields
9533// initialized from the GTEST_FLAG(internal_run_death_test) flag if
9534// the flag is specified; otherwise returns NULL.
9535InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
9536
7c673cae
FG
9537#endif // GTEST_HAS_DEATH_TEST
9538
9539} // namespace internal
9540} // namespace testing
9541
9542#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9543
9544namespace testing {
9545
9546// This flag controls the style of death tests. Valid values are "threadsafe",
9547// meaning that the death test child process will re-execute the test binary
9548// from the start, running only a single death test, or "fast",
9549// meaning that the child process will execute the test logic immediately
9550// after forking.
9551GTEST_DECLARE_string_(death_test_style);
9552
9553#if GTEST_HAS_DEATH_TEST
9554
9555namespace internal {
9556
9557// Returns a Boolean value indicating whether the caller is currently
9558// executing in the context of the death test child process. Tools such as
9559// Valgrind heap checkers may need this to modify their behavior in death
9560// tests. IMPORTANT: This is an internal utility. Using it may break the
9561// implementation of death tests. User code MUST NOT use it.
9562GTEST_API_ bool InDeathTestChild();
9563
9564} // namespace internal
9565
9566// The following macros are useful for writing death tests.
9567
9568// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
9569// executed:
9570//
9571// 1. It generates a warning if there is more than one active
9572// thread. This is because it's safe to fork() or clone() only
9573// when there is a single thread.
9574//
9575// 2. The parent process clone()s a sub-process and runs the death
9576// test in it; the sub-process exits with code 0 at the end of the
9577// death test, if it hasn't exited already.
9578//
9579// 3. The parent process waits for the sub-process to terminate.
9580//
9581// 4. The parent process checks the exit code and error message of
9582// the sub-process.
9583//
9584// Examples:
9585//
9586// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
9587// for (int i = 0; i < 5; i++) {
9588// EXPECT_DEATH(server.ProcessRequest(i),
9589// "Invalid request .* in ProcessRequest()")
9590// << "Failed to die on request " << i;
9591// }
9592//
9593// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
9594//
9595// bool KilledBySIGHUP(int exit_code) {
9596// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
9597// }
9598//
9599// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
9600//
9601// On the regular expressions used in death tests:
9602//
f67539c2 9603// GOOGLETEST_CM0005 DO NOT DELETE
7c673cae
FG
9604// On POSIX-compliant systems (*nix), we use the <regex.h> library,
9605// which uses the POSIX extended regex syntax.
9606//
f67539c2 9607// On other platforms (e.g. Windows or Mac), we only support a simple regex
7c673cae
FG
9608// syntax implemented as part of Google Test. This limited
9609// implementation should be enough most of the time when writing
9610// death tests; though it lacks many features you can find in PCRE
9611// or POSIX extended regex syntax. For example, we don't support
9612// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
9613// repetition count ("x{5,7}"), among others.
9614//
9615// Below is the syntax that we do support. We chose it to be a
9616// subset of both PCRE and POSIX extended regex, so it's easy to
9617// learn wherever you come from. In the following: 'A' denotes a
9618// literal character, period (.), or a single \\ escape sequence;
9619// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
9620// natural numbers.
9621//
9622// c matches any literal character c
9623// \\d matches any decimal digit
9624// \\D matches any character that's not a decimal digit
9625// \\f matches \f
9626// \\n matches \n
9627// \\r matches \r
9628// \\s matches any ASCII whitespace, including \n
9629// \\S matches any character that's not a whitespace
9630// \\t matches \t
9631// \\v matches \v
9632// \\w matches any letter, _, or decimal digit
9633// \\W matches any character that \\w doesn't match
9634// \\c matches any literal character c, which must be a punctuation
9635// . matches any single character except \n
9636// A? matches 0 or 1 occurrences of A
9637// A* matches 0 or many occurrences of A
9638// A+ matches 1 or many occurrences of A
9639// ^ matches the beginning of a string (not that of each line)
9640// $ matches the end of a string (not that of each line)
9641// xy matches x followed by y
9642//
9643// If you accidentally use PCRE or POSIX extended regex features
9644// not implemented by us, you will get a run-time failure. In that
9645// case, please try to rewrite your regular expression within the
9646// above syntax.
9647//
9648// This implementation is *not* meant to be as highly tuned or robust
9649// as a compiled regex library, but should perform well enough for a
9650// death test, which already incurs significant overhead by launching
9651// a child process.
9652//
9653// Known caveats:
9654//
9655// A "threadsafe" style death test obtains the path to the test
9656// program from argv[0] and re-executes it in the sub-process. For
9657// simplicity, the current implementation doesn't search the PATH
9658// when launching the sub-process. This means that the user must
9659// invoke the test program via a path that contains at least one
9660// path separator (e.g. path/to/foo_test and
9661// /absolute/path/to/bar_test are fine, but foo_test is not). This
9662// is rarely a problem as people usually don't put the test binary
9663// directory in PATH.
9664//
f67539c2 9665// FIXME: make thread-safe death tests search the PATH.
7c673cae
FG
9666
9667// Asserts that a given statement causes the program to exit, with an
9668// integer exit status that satisfies predicate, and emitting error output
9669// that matches regex.
9670# define ASSERT_EXIT(statement, predicate, regex) \
9671 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
9672
9673// Like ASSERT_EXIT, but continues on to successive tests in the
9674// test case, if any:
9675# define EXPECT_EXIT(statement, predicate, regex) \
9676 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
9677
9678// Asserts that a given statement causes the program to exit, either by
9679// explicitly exiting with a nonzero exit code or being killed by a
9680// signal, and emitting error output that matches regex.
9681# define ASSERT_DEATH(statement, regex) \
9682 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9683
9684// Like ASSERT_DEATH, but continues on to successive tests in the
9685// test case, if any:
9686# define EXPECT_DEATH(statement, regex) \
9687 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9688
9689// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
9690
9691// Tests that an exit code describes a normal exit with a given exit code.
9692class GTEST_API_ ExitedWithCode {
9693 public:
9694 explicit ExitedWithCode(int exit_code);
9695 bool operator()(int exit_status) const;
9696 private:
9697 // No implementation - assignment is unsupported.
9698 void operator=(const ExitedWithCode& other);
9699
9700 const int exit_code_;
9701};
9702
f67539c2 9703# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
7c673cae
FG
9704// Tests that an exit code describes an exit due to termination by a
9705// given signal.
f67539c2 9706// GOOGLETEST_CM0006 DO NOT DELETE
7c673cae
FG
9707class GTEST_API_ KilledBySignal {
9708 public:
9709 explicit KilledBySignal(int signum);
9710 bool operator()(int exit_status) const;
9711 private:
9712 const int signum_;
9713};
9714# endif // !GTEST_OS_WINDOWS
9715
9716// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
9717// The death testing framework causes this to have interesting semantics,
9718// since the sideeffects of the call are only visible in opt mode, and not
9719// in debug mode.
9720//
9721// In practice, this can be used to test functions that utilize the
9722// LOG(DFATAL) macro using the following style:
9723//
9724// int DieInDebugOr12(int* sideeffect) {
9725// if (sideeffect) {
9726// *sideeffect = 12;
9727// }
9728// LOG(DFATAL) << "death";
9729// return 12;
9730// }
9731//
9732// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
9733// int sideeffect = 0;
9734// // Only asserts in dbg.
9735// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
9736//
9737// #ifdef NDEBUG
9738// // opt-mode has sideeffect visible.
9739// EXPECT_EQ(12, sideeffect);
9740// #else
9741// // dbg-mode no visible sideeffect.
9742// EXPECT_EQ(0, sideeffect);
9743// #endif
9744// }
9745//
9746// This will assert that DieInDebugReturn12InOpt() crashes in debug
9747// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
9748// appropriate fallback value (12 in this case) in opt mode. If you
9749// need to test that a function has appropriate side-effects in opt
9750// mode, include assertions against the side-effects. A general
9751// pattern for this is:
9752//
9753// EXPECT_DEBUG_DEATH({
9754// // Side-effects here will have an effect after this statement in
9755// // opt mode, but none in debug mode.
9756// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
9757// }, "death");
9758//
9759# ifdef NDEBUG
9760
9761# define EXPECT_DEBUG_DEATH(statement, regex) \
9762 GTEST_EXECUTE_STATEMENT_(statement, regex)
9763
9764# define ASSERT_DEBUG_DEATH(statement, regex) \
9765 GTEST_EXECUTE_STATEMENT_(statement, regex)
9766
9767# else
9768
9769# define EXPECT_DEBUG_DEATH(statement, regex) \
9770 EXPECT_DEATH(statement, regex)
9771
9772# define ASSERT_DEBUG_DEATH(statement, regex) \
9773 ASSERT_DEATH(statement, regex)
9774
9775# endif // NDEBUG for EXPECT_DEBUG_DEATH
9776#endif // GTEST_HAS_DEATH_TEST
9777
f67539c2
TL
9778// This macro is used for implementing macros such as
9779// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
9780// death tests are not supported. Those macros must compile on such systems
9781// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
9782// systems that support death tests. This allows one to write such a macro
9783// on a system that does not support death tests and be sure that it will
9784// compile on a death-test supporting system. It is exposed publicly so that
9785// systems that have death-tests with stricter requirements than
9786// GTEST_HAS_DEATH_TEST can write their own equivalent of
9787// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED.
9788//
9789// Parameters:
9790// statement - A statement that a macro such as EXPECT_DEATH would test
9791// for program termination. This macro has to make sure this
9792// statement is compiled but not executed, to ensure that
9793// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
9794// parameter iff EXPECT_DEATH compiles with it.
9795// regex - A regex that a macro such as EXPECT_DEATH would use to test
9796// the output of statement. This parameter has to be
9797// compiled but not evaluated by this macro, to ensure that
9798// this macro only accepts expressions that a macro such as
9799// EXPECT_DEATH would accept.
9800// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
9801// and a return statement for ASSERT_DEATH_IF_SUPPORTED.
9802// This ensures that ASSERT_DEATH_IF_SUPPORTED will not
9803// compile inside functions where ASSERT_DEATH doesn't
9804// compile.
9805//
9806// The branch that has an always false condition is used to ensure that
9807// statement and regex are compiled (and thus syntactically correct) but
9808// never executed. The unreachable code macro protects the terminator
9809// statement from generating an 'unreachable code' warning in case
9810// statement unconditionally returns or throws. The Message constructor at
9811// the end allows the syntax of streaming additional messages into the
9812// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
9813# define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \
9814 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9815 if (::testing::internal::AlwaysTrue()) { \
9816 GTEST_LOG_(WARNING) \
9817 << "Death tests are not supported on this platform.\n" \
9818 << "Statement '" #statement "' cannot be verified."; \
9819 } else if (::testing::internal::AlwaysFalse()) { \
9820 ::testing::internal::RE::PartialMatch(".*", (regex)); \
9821 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9822 terminator; \
9823 } else \
9824 ::testing::Message()
9825
9826// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
9827// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
9828// death tests are supported; otherwise they just issue a warning. This is
9829// useful when you are combining death test assertions with normal test
9830// assertions in one test.
9831#if GTEST_HAS_DEATH_TEST
9832# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
9833 EXPECT_DEATH(statement, regex)
9834# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
7c673cae
FG
9835 ASSERT_DEATH(statement, regex)
9836#else
9837# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
f67539c2 9838 GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
7c673cae 9839# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
f67539c2 9840 GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return)
7c673cae
FG
9841#endif
9842
9843} // namespace testing
9844
9845#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9846// This file was GENERATED by command:
9847// pump.py gtest-param-test.h.pump
9848// DO NOT EDIT BY HAND!!!
9849
9850// Copyright 2008, Google Inc.
9851// All rights reserved.
9852//
9853// Redistribution and use in source and binary forms, with or without
9854// modification, are permitted provided that the following conditions are
9855// met:
9856//
9857// * Redistributions of source code must retain the above copyright
9858// notice, this list of conditions and the following disclaimer.
9859// * Redistributions in binary form must reproduce the above
9860// copyright notice, this list of conditions and the following disclaimer
9861// in the documentation and/or other materials provided with the
9862// distribution.
9863// * Neither the name of Google Inc. nor the names of its
9864// contributors may be used to endorse or promote products derived from
9865// this software without specific prior written permission.
9866//
9867// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9868// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9869// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9870// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9871// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9872// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9873// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9874// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9875// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9876// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9877// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9878//
7c673cae 9879// Macros and functions for implementing parameterized tests
f67539c2 9880// in Google C++ Testing and Mocking Framework (Google Test)
7c673cae
FG
9881//
9882// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
9883//
f67539c2 9884// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae
FG
9885#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9886#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9887
9888
9889// Value-parameterized tests allow you to test your code with different
9890// parameters without writing multiple copies of the same test.
9891//
9892// Here is how you use value-parameterized tests:
9893
9894#if 0
9895
9896// To write value-parameterized tests, first you should define a fixture
9897// class. It is usually derived from testing::TestWithParam<T> (see below for
9898// another inheritance scheme that's sometimes useful in more complicated
9899// class hierarchies), where the type of your parameter values.
9900// TestWithParam<T> is itself derived from testing::Test. T can be any
9901// copyable type. If it's a raw pointer, you are responsible for managing the
9902// lifespan of the pointed values.
9903
9904class FooTest : public ::testing::TestWithParam<const char*> {
9905 // You can implement all the usual class fixture members here.
9906};
9907
9908// Then, use the TEST_P macro to define as many parameterized tests
9909// for this fixture as you want. The _P suffix is for "parameterized"
9910// or "pattern", whichever you prefer to think.
9911
9912TEST_P(FooTest, DoesBlah) {
9913 // Inside a test, access the test parameter with the GetParam() method
9914 // of the TestWithParam<T> class:
9915 EXPECT_TRUE(foo.Blah(GetParam()));
9916 ...
9917}
9918
9919TEST_P(FooTest, HasBlahBlah) {
9920 ...
9921}
9922
9923// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
9924// case with any set of parameters you want. Google Test defines a number
9925// of functions for generating test parameters. They return what we call
f67539c2 9926// (surprise!) parameter generators. Here is a summary of them, which
7c673cae
FG
9927// are all in the testing namespace:
9928//
9929//
9930// Range(begin, end [, step]) - Yields values {begin, begin+step,
9931// begin+step+step, ...}. The values do not
9932// include end. step defaults to 1.
9933// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
9934// ValuesIn(container) - Yields values from a C-style array, an STL
9935// ValuesIn(begin,end) container, or an iterator range [begin, end).
9936// Bool() - Yields sequence {false, true}.
9937// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
9938// for the math savvy) of the values generated
9939// by the N generators.
9940//
9941// For more details, see comments at the definitions of these functions below
9942// in this file.
9943//
9944// The following statement will instantiate tests from the FooTest test case
9945// each with parameter values "meeny", "miny", and "moe".
9946
9947INSTANTIATE_TEST_CASE_P(InstantiationName,
9948 FooTest,
9949 Values("meeny", "miny", "moe"));
9950
9951// To distinguish different instances of the pattern, (yes, you
9952// can instantiate it more then once) the first argument to the
9953// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
9954// actual test case name. Remember to pick unique prefixes for different
9955// instantiations. The tests from the instantiation above will have
9956// these names:
9957//
9958// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
9959// * InstantiationName/FooTest.DoesBlah/1 for "miny"
9960// * InstantiationName/FooTest.DoesBlah/2 for "moe"
9961// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
9962// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
9963// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
9964//
9965// You can use these names in --gtest_filter.
9966//
9967// This statement will instantiate all tests from FooTest again, each
9968// with parameter values "cat" and "dog":
9969
9970const char* pets[] = {"cat", "dog"};
9971INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
9972
9973// The tests from the instantiation above will have these names:
9974//
9975// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
9976// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
9977// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
9978// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
9979//
9980// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
9981// in the given test case, whether their definitions come before or
9982// AFTER the INSTANTIATE_TEST_CASE_P statement.
9983//
9984// Please also note that generator expressions (including parameters to the
9985// generators) are evaluated in InitGoogleTest(), after main() has started.
9986// This allows the user on one hand, to adjust generator parameters in order
9987// to dynamically determine a set of tests to run and on the other hand,
9988// give the user a chance to inspect the generated tests with Google Test
9989// reflection API before RUN_ALL_TESTS() is executed.
9990//
9991// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
9992// for more examples.
9993//
9994// In the future, we plan to publish the API for defining new parameter
9995// generators. But for now this interface remains part of the internal
9996// implementation and is subject to change.
9997//
9998//
9999// A parameterized test fixture must be derived from testing::Test and from
10000// testing::WithParamInterface<T>, where T is the type of the parameter
10001// values. Inheriting from TestWithParam<T> satisfies that requirement because
10002// TestWithParam<T> inherits from both Test and WithParamInterface. In more
10003// complicated hierarchies, however, it is occasionally useful to inherit
10004// separately from Test and WithParamInterface. For example:
10005
10006class BaseTest : public ::testing::Test {
10007 // You can inherit all the usual members for a non-parameterized test
10008 // fixture here.
10009};
10010
10011class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
10012 // The usual test fixture members go here too.
10013};
10014
10015TEST_F(BaseTest, HasFoo) {
10016 // This is an ordinary non-parameterized test.
10017}
10018
10019TEST_P(DerivedTest, DoesBlah) {
10020 // GetParam works just the same here as if you inherit from TestWithParam.
10021 EXPECT_TRUE(foo.Blah(GetParam()));
10022}
10023
10024#endif // 0
10025
10026
10027#if !GTEST_OS_SYMBIAN
10028# include <utility>
10029#endif
10030
7c673cae
FG
10031// Copyright 2008 Google Inc.
10032// All Rights Reserved.
10033//
10034// Redistribution and use in source and binary forms, with or without
10035// modification, are permitted provided that the following conditions are
10036// met:
10037//
10038// * Redistributions of source code must retain the above copyright
10039// notice, this list of conditions and the following disclaimer.
10040// * Redistributions in binary form must reproduce the above
10041// copyright notice, this list of conditions and the following disclaimer
10042// in the documentation and/or other materials provided with the
10043// distribution.
10044// * Neither the name of Google Inc. nor the names of its
10045// contributors may be used to endorse or promote products derived from
10046// this software without specific prior written permission.
10047//
10048// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10049// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10050// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10051// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10052// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10053// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10054// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10055// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10056// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10057// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10058// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 10059
7c673cae
FG
10060
10061// Type and function utilities for implementing parameterized tests.
10062
f67539c2
TL
10063// GOOGLETEST_CM0001 DO NOT DELETE
10064
7c673cae
FG
10065#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10066#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10067
f67539c2
TL
10068#include <ctype.h>
10069
7c673cae 10070#include <iterator>
f67539c2 10071#include <set>
7c673cae
FG
10072#include <utility>
10073#include <vector>
10074
7c673cae
FG
10075// Copyright 2003 Google Inc.
10076// All rights reserved.
10077//
10078// Redistribution and use in source and binary forms, with or without
10079// modification, are permitted provided that the following conditions are
10080// met:
10081//
10082// * Redistributions of source code must retain the above copyright
10083// notice, this list of conditions and the following disclaimer.
10084// * Redistributions in binary form must reproduce the above
10085// copyright notice, this list of conditions and the following disclaimer
10086// in the documentation and/or other materials provided with the
10087// distribution.
10088// * Neither the name of Google Inc. nor the names of its
10089// contributors may be used to endorse or promote products derived from
10090// this software without specific prior written permission.
10091//
10092// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10093// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10094// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10095// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10096// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10097// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10098// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10099// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10100// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10101// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10102// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10103//
7c673cae
FG
10104// A "smart" pointer type with reference tracking. Every pointer to a
10105// particular object is kept on a circular linked list. When the last pointer
10106// to an object is destroyed or reassigned, the object is deleted.
10107//
10108// Used properly, this deletes the object when the last reference goes away.
10109// There are several caveats:
10110// - Like all reference counting schemes, cycles lead to leaks.
10111// - Each smart pointer is actually two pointers (8 bytes instead of 4).
10112// - Every time a pointer is assigned, the entire list of pointers to that
10113// object is traversed. This class is therefore NOT SUITABLE when there
10114// will often be more than two or three pointers to a particular object.
10115// - References are only tracked as long as linked_ptr<> objects are copied.
10116// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
10117// will happen (double deletion).
10118//
10119// A good use of this class is storing object references in STL containers.
10120// You can safely put linked_ptr<> in a vector<>.
10121// Other uses may not be as good.
10122//
10123// Note: If you use an incomplete type with linked_ptr<>, the class
10124// *containing* linked_ptr<> must have a constructor and destructor (even
10125// if they do nothing!).
10126//
10127// Bill Gibbons suggested we use something like this.
10128//
10129// Thread Safety:
10130// Unlike other linked_ptr implementations, in this implementation
10131// a linked_ptr object is thread-safe in the sense that:
10132// - it's safe to copy linked_ptr objects concurrently,
10133// - it's safe to copy *from* a linked_ptr and read its underlying
10134// raw pointer (e.g. via get()) concurrently, and
10135// - it's safe to write to two linked_ptrs that point to the same
10136// shared object concurrently.
f67539c2 10137// FIXME: rename this to safe_linked_ptr to avoid
7c673cae
FG
10138// confusion with normal linked_ptr.
10139
f67539c2
TL
10140// GOOGLETEST_CM0001 DO NOT DELETE
10141
7c673cae
FG
10142#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10143#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10144
10145#include <stdlib.h>
10146#include <assert.h>
10147
10148
10149namespace testing {
10150namespace internal {
10151
10152// Protects copying of all linked_ptr objects.
10153GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
10154
10155// This is used internally by all instances of linked_ptr<>. It needs to be
10156// a non-template class because different types of linked_ptr<> can refer to
10157// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
10158// So, it needs to be possible for different types of linked_ptr to participate
10159// in the same circular linked list, so we need a single class type here.
10160//
10161// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
10162class linked_ptr_internal {
10163 public:
10164 // Create a new circle that includes only this instance.
10165 void join_new() {
10166 next_ = this;
10167 }
10168
10169 // Many linked_ptr operations may change p.link_ for some linked_ptr
10170 // variable p in the same circle as this object. Therefore we need
10171 // to prevent two such operations from occurring concurrently.
10172 //
10173 // Note that different types of linked_ptr objects can coexist in a
10174 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
10175 // linked_ptr<Derived2>). Therefore we must use a single mutex to
10176 // protect all linked_ptr objects. This can create serious
10177 // contention in production code, but is acceptable in a testing
10178 // framework.
10179
10180 // Join an existing circle.
10181 void join(linked_ptr_internal const* ptr)
10182 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
10183 MutexLock lock(&g_linked_ptr_mutex);
10184
10185 linked_ptr_internal const* p = ptr;
10186 while (p->next_ != ptr) {
10187 assert(p->next_ != this &&
10188 "Trying to join() a linked ring we are already in. "
10189 "Is GMock thread safety enabled?");
10190 p = p->next_;
10191 }
10192 p->next_ = this;
10193 next_ = ptr;
10194 }
10195
10196 // Leave whatever circle we're part of. Returns true if we were the
10197 // last member of the circle. Once this is done, you can join() another.
10198 bool depart()
10199 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
10200 MutexLock lock(&g_linked_ptr_mutex);
10201
10202 if (next_ == this) return true;
10203 linked_ptr_internal const* p = next_;
10204 while (p->next_ != this) {
10205 assert(p->next_ != next_ &&
10206 "Trying to depart() a linked ring we are not in. "
10207 "Is GMock thread safety enabled?");
10208 p = p->next_;
10209 }
10210 p->next_ = next_;
10211 return false;
10212 }
10213
10214 private:
10215 mutable linked_ptr_internal const* next_;
10216};
10217
10218template <typename T>
10219class linked_ptr {
10220 public:
10221 typedef T element_type;
10222
10223 // Take over ownership of a raw pointer. This should happen as soon as
10224 // possible after the object is created.
10225 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
10226 ~linked_ptr() { depart(); }
10227
10228 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
10229 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
10230 linked_ptr(linked_ptr const& ptr) { // NOLINT
10231 assert(&ptr != this);
10232 copy(&ptr);
10233 }
10234
10235 // Assignment releases the old value and acquires the new.
10236 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
10237 depart();
10238 copy(&ptr);
10239 return *this;
10240 }
10241
10242 linked_ptr& operator=(linked_ptr const& ptr) {
10243 if (&ptr != this) {
10244 depart();
10245 copy(&ptr);
10246 }
10247 return *this;
10248 }
10249
10250 // Smart pointer members.
10251 void reset(T* ptr = NULL) {
10252 depart();
10253 capture(ptr);
10254 }
10255 T* get() const { return value_; }
10256 T* operator->() const { return value_; }
10257 T& operator*() const { return *value_; }
10258
10259 bool operator==(T* p) const { return value_ == p; }
10260 bool operator!=(T* p) const { return value_ != p; }
10261 template <typename U>
10262 bool operator==(linked_ptr<U> const& ptr) const {
10263 return value_ == ptr.get();
10264 }
10265 template <typename U>
10266 bool operator!=(linked_ptr<U> const& ptr) const {
10267 return value_ != ptr.get();
10268 }
10269
10270 private:
10271 template <typename U>
10272 friend class linked_ptr;
10273
10274 T* value_;
10275 linked_ptr_internal link_;
10276
10277 void depart() {
10278 if (link_.depart()) delete value_;
10279 }
10280
10281 void capture(T* ptr) {
10282 value_ = ptr;
10283 link_.join_new();
10284 }
10285
10286 template <typename U> void copy(linked_ptr<U> const* ptr) {
10287 value_ = ptr->get();
10288 if (value_)
10289 link_.join(&ptr->link_);
10290 else
10291 link_.join_new();
10292 }
10293};
10294
10295template<typename T> inline
10296bool operator==(T* ptr, const linked_ptr<T>& x) {
10297 return ptr == x.get();
10298}
10299
10300template<typename T> inline
10301bool operator!=(T* ptr, const linked_ptr<T>& x) {
10302 return ptr != x.get();
10303}
10304
10305// A function to convert T* into linked_ptr<T>
10306// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
10307// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
10308template <typename T>
10309linked_ptr<T> make_linked_ptr(T* ptr) {
10310 return linked_ptr<T>(ptr);
10311}
10312
10313} // namespace internal
10314} // namespace testing
10315
10316#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10317// Copyright 2007, Google Inc.
10318// All rights reserved.
10319//
10320// Redistribution and use in source and binary forms, with or without
10321// modification, are permitted provided that the following conditions are
10322// met:
10323//
10324// * Redistributions of source code must retain the above copyright
10325// notice, this list of conditions and the following disclaimer.
10326// * Redistributions in binary form must reproduce the above
10327// copyright notice, this list of conditions and the following disclaimer
10328// in the documentation and/or other materials provided with the
10329// distribution.
10330// * Neither the name of Google Inc. nor the names of its
10331// contributors may be used to endorse or promote products derived from
10332// this software without specific prior written permission.
10333//
10334// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10335// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10336// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10337// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10338// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10339// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10340// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10341// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10342// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10343// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10344// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7c673cae 10345
f67539c2
TL
10346
10347// Google Test - The Google C++ Testing and Mocking Framework
7c673cae
FG
10348//
10349// This file implements a universal value printer that can print a
10350// value of any type T:
10351//
10352// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
10353//
10354// A user can teach this function how to print a class type T by
10355// defining either operator<<() or PrintTo() in the namespace that
10356// defines T. More specifically, the FIRST defined function in the
10357// following list will be used (assuming T is defined in namespace
10358// foo):
10359//
10360// 1. foo::PrintTo(const T&, ostream*)
10361// 2. operator<<(ostream&, const T&) defined in either foo or the
10362// global namespace.
10363//
f67539c2
TL
10364// However if T is an STL-style container then it is printed element-wise
10365// unless foo::PrintTo(const T&, ostream*) is defined. Note that
10366// operator<<() is ignored for container types.
10367//
7c673cae
FG
10368// If none of the above is defined, it will print the debug string of
10369// the value if it is a protocol buffer, or print the raw bytes in the
10370// value otherwise.
10371//
10372// To aid debugging: when T is a reference type, the address of the
10373// value is also printed; when T is a (const) char pointer, both the
10374// pointer value and the NUL-terminated string it points to are
10375// printed.
10376//
10377// We also provide some convenient wrappers:
10378//
10379// // Prints a value to a string. For a (const or not) char
10380// // pointer, the NUL-terminated string (but not the pointer) is
10381// // printed.
10382// std::string ::testing::PrintToString(const T& value);
10383//
10384// // Prints a value tersely: for a reference type, the referenced
10385// // value (but not the address) is printed; for a (const or not) char
10386// // pointer, the NUL-terminated string (but not the pointer) is
10387// // printed.
10388// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
10389//
10390// // Prints value using the type inferred by the compiler. The difference
10391// // from UniversalTersePrint() is that this function prints both the
10392// // pointer and the NUL-terminated string for a (const or not) char pointer.
10393// void ::testing::internal::UniversalPrint(const T& value, ostream*);
10394//
10395// // Prints the fields of a tuple tersely to a string vector, one
10396// // element for each field. Tuple support must be enabled in
10397// // gtest-port.h.
10398// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
10399// const Tuple& value);
10400//
10401// Known limitation:
10402//
10403// The print primitives print the elements of an STL-style container
10404// using the compiler-inferred type of *iter where iter is a
10405// const_iterator of the container. When const_iterator is an input
10406// iterator but not a forward iterator, this inferred type may not
10407// match value_type, and the print output may be incorrect. In
10408// practice, this is rarely a problem as for most containers
10409// const_iterator is a forward iterator. We'll fix this if there's an
10410// actual need for it. Note that this fix cannot rely on value_type
10411// being defined as many user-defined container types don't have
10412// value_type.
10413
f67539c2
TL
10414// GOOGLETEST_CM0001 DO NOT DELETE
10415
7c673cae
FG
10416#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10417#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10418
10419#include <ostream> // NOLINT
10420#include <sstream>
10421#include <string>
10422#include <utility>
10423#include <vector>
10424
10425#if GTEST_HAS_STD_TUPLE_
10426# include <tuple>
10427#endif
10428
f67539c2
TL
10429#if GTEST_HAS_ABSL
10430#include "absl/strings/string_view.h"
10431#include "absl/types/optional.h"
10432#include "absl/types/variant.h"
10433#endif // GTEST_HAS_ABSL
10434
7c673cae
FG
10435namespace testing {
10436
10437// Definitions in the 'internal' and 'internal2' name spaces are
10438// subject to change without notice. DO NOT USE THEM IN USER CODE!
10439namespace internal2 {
10440
10441// Prints the given number of bytes in the given object to the given
10442// ostream.
10443GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
10444 size_t count,
10445 ::std::ostream* os);
10446
10447// For selecting which printer to use when a given type has neither <<
10448// nor PrintTo().
10449enum TypeKind {
10450 kProtobuf, // a protobuf type
10451 kConvertibleToInteger, // a type implicitly convertible to BiggestInt
10452 // (e.g. a named or unnamed enum type)
f67539c2
TL
10453#if GTEST_HAS_ABSL
10454 kConvertibleToStringView, // a type implicitly convertible to
10455 // absl::string_view
10456#endif
10457 kOtherType // anything else
7c673cae
FG
10458};
10459
10460// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
10461// by the universal printer to print a value of type T when neither
10462// operator<< nor PrintTo() is defined for T, where kTypeKind is the
10463// "kind" of T as defined by enum TypeKind.
10464template <typename T, TypeKind kTypeKind>
10465class TypeWithoutFormatter {
10466 public:
10467 // This default version is called when kTypeKind is kOtherType.
10468 static void PrintValue(const T& value, ::std::ostream* os) {
f67539c2
TL
10469 PrintBytesInObjectTo(static_cast<const unsigned char*>(
10470 reinterpret_cast<const void*>(&value)),
7c673cae
FG
10471 sizeof(value), os);
10472 }
10473};
10474
10475// We print a protobuf using its ShortDebugString() when the string
10476// doesn't exceed this many characters; otherwise we print it using
10477// DebugString() for better readability.
10478const size_t kProtobufOneLinerMaxLength = 50;
10479
10480template <typename T>
10481class TypeWithoutFormatter<T, kProtobuf> {
10482 public:
10483 static void PrintValue(const T& value, ::std::ostream* os) {
f67539c2
TL
10484 std::string pretty_str = value.ShortDebugString();
10485 if (pretty_str.length() > kProtobufOneLinerMaxLength) {
10486 pretty_str = "\n" + value.DebugString();
10487 }
7c673cae
FG
10488 *os << ("<" + pretty_str + ">");
10489 }
10490};
10491
10492template <typename T>
10493class TypeWithoutFormatter<T, kConvertibleToInteger> {
10494 public:
10495 // Since T has no << operator or PrintTo() but can be implicitly
10496 // converted to BiggestInt, we print it as a BiggestInt.
10497 //
10498 // Most likely T is an enum type (either named or unnamed), in which
10499 // case printing it as an integer is the desired behavior. In case
10500 // T is not an enum, printing it as an integer is the best we can do
10501 // given that it has no user-defined printer.
10502 static void PrintValue(const T& value, ::std::ostream* os) {
10503 const internal::BiggestInt kBigInt = value;
10504 *os << kBigInt;
10505 }
10506};
10507
f67539c2
TL
10508#if GTEST_HAS_ABSL
10509template <typename T>
10510class TypeWithoutFormatter<T, kConvertibleToStringView> {
10511 public:
10512 // Since T has neither operator<< nor PrintTo() but can be implicitly
10513 // converted to absl::string_view, we print it as a absl::string_view.
10514 //
10515 // Note: the implementation is further below, as it depends on
10516 // internal::PrintTo symbol which is defined later in the file.
10517 static void PrintValue(const T& value, ::std::ostream* os);
10518};
10519#endif
10520
7c673cae
FG
10521// Prints the given value to the given ostream. If the value is a
10522// protocol message, its debug string is printed; if it's an enum or
10523// of a type implicitly convertible to BiggestInt, it's printed as an
10524// integer; otherwise the bytes in the value are printed. This is
10525// what UniversalPrinter<T>::Print() does when it knows nothing about
10526// type T and T has neither << operator nor PrintTo().
10527//
10528// A user can override this behavior for a class type Foo by defining
10529// a << operator in the namespace where Foo is defined.
10530//
10531// We put this operator in namespace 'internal2' instead of 'internal'
10532// to simplify the implementation, as much code in 'internal' needs to
10533// use << in STL, which would conflict with our own << were it defined
10534// in 'internal'.
10535//
10536// Note that this operator<< takes a generic std::basic_ostream<Char,
10537// CharTraits> type instead of the more restricted std::ostream. If
10538// we define it to take an std::ostream instead, we'll get an
10539// "ambiguous overloads" compiler error when trying to print a type
10540// Foo that supports streaming to std::basic_ostream<Char,
10541// CharTraits>, as the compiler cannot tell whether
10542// operator<<(std::ostream&, const T&) or
10543// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
10544// specific.
10545template <typename Char, typename CharTraits, typename T>
10546::std::basic_ostream<Char, CharTraits>& operator<<(
10547 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
f67539c2
TL
10548 TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value
10549 ? kProtobuf
10550 : internal::ImplicitlyConvertible<
10551 const T&, internal::BiggestInt>::value
10552 ? kConvertibleToInteger
10553 :
10554#if GTEST_HAS_ABSL
10555 internal::ImplicitlyConvertible<
10556 const T&, absl::string_view>::value
10557 ? kConvertibleToStringView
10558 :
10559#endif
10560 kOtherType)>::PrintValue(x, &os);
7c673cae
FG
10561 return os;
10562}
10563
10564} // namespace internal2
10565} // namespace testing
10566
10567// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
10568// magic needed for implementing UniversalPrinter won't work.
10569namespace testing_internal {
10570
10571// Used to print a value that is not an STL-style container when the
10572// user doesn't define PrintTo() for it.
10573template <typename T>
10574void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
10575 // With the following statement, during unqualified name lookup,
10576 // testing::internal2::operator<< appears as if it was declared in
10577 // the nearest enclosing namespace that contains both
10578 // ::testing_internal and ::testing::internal2, i.e. the global
10579 // namespace. For more details, refer to the C++ Standard section
10580 // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
10581 // testing::internal2::operator<< in case T doesn't come with a <<
10582 // operator.
10583 //
10584 // We cannot write 'using ::testing::internal2::operator<<;', which
10585 // gcc 3.3 fails to compile due to a compiler bug.
10586 using namespace ::testing::internal2; // NOLINT
10587
10588 // Assuming T is defined in namespace foo, in the next statement,
10589 // the compiler will consider all of:
10590 //
10591 // 1. foo::operator<< (thanks to Koenig look-up),
10592 // 2. ::operator<< (as the current namespace is enclosed in ::),
10593 // 3. testing::internal2::operator<< (thanks to the using statement above).
10594 //
10595 // The operator<< whose type matches T best will be picked.
10596 //
10597 // We deliberately allow #2 to be a candidate, as sometimes it's
10598 // impossible to define #1 (e.g. when foo is ::std, defining
10599 // anything in it is undefined behavior unless you are a compiler
10600 // vendor.).
10601 *os << value;
10602}
10603
10604} // namespace testing_internal
10605
10606namespace testing {
10607namespace internal {
10608
f67539c2
TL
10609// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
10610// value of type ToPrint that is an operand of a comparison assertion
10611// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
10612// the comparison, and is used to help determine the best way to
10613// format the value. In particular, when the value is a C string
10614// (char pointer) and the other operand is an STL string object, we
10615// want to format the C string as a string, since we know it is
10616// compared by value with the string object. If the value is a char
10617// pointer but the other operand is not an STL string object, we don't
10618// know whether the pointer is supposed to point to a NUL-terminated
10619// string, and thus want to print it as a pointer to be safe.
10620//
10621// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10622
10623// The default case.
10624template <typename ToPrint, typename OtherOperand>
10625class FormatForComparison {
10626 public:
10627 static ::std::string Format(const ToPrint& value) {
10628 return ::testing::PrintToString(value);
10629 }
10630};
10631
10632// Array.
10633template <typename ToPrint, size_t N, typename OtherOperand>
10634class FormatForComparison<ToPrint[N], OtherOperand> {
10635 public:
10636 static ::std::string Format(const ToPrint* value) {
10637 return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
10638 }
10639};
10640
10641// By default, print C string as pointers to be safe, as we don't know
10642// whether they actually point to a NUL-terminated string.
10643
10644#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
10645 template <typename OtherOperand> \
10646 class FormatForComparison<CharType*, OtherOperand> { \
10647 public: \
10648 static ::std::string Format(CharType* value) { \
10649 return ::testing::PrintToString(static_cast<const void*>(value)); \
10650 } \
10651 }
10652
10653GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
10654GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
10655GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
10656GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
10657
10658#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
10659
10660// If a C string is compared with an STL string object, we know it's meant
10661// to point to a NUL-terminated string, and thus can print it as a string.
10662
10663#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
10664 template <> \
10665 class FormatForComparison<CharType*, OtherStringType> { \
10666 public: \
10667 static ::std::string Format(CharType* value) { \
10668 return ::testing::PrintToString(value); \
10669 } \
10670 }
10671
10672GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
10673GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
10674
10675#if GTEST_HAS_GLOBAL_STRING
10676GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
10677GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
10678#endif
10679
10680#if GTEST_HAS_GLOBAL_WSTRING
10681GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
10682GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
10683#endif
10684
10685#if GTEST_HAS_STD_WSTRING
10686GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
10687GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
10688#endif
10689
10690#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
10691
10692// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
10693// operand to be used in a failure message. The type (but not value)
10694// of the other operand may affect the format. This allows us to
10695// print a char* as a raw pointer when it is compared against another
10696// char* or void*, and print it as a C string when it is compared
10697// against an std::string object, for example.
10698//
10699// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10700template <typename T1, typename T2>
10701std::string FormatForComparisonFailureMessage(
10702 const T1& value, const T2& /* other_operand */) {
10703 return FormatForComparison<T1, T2>::Format(value);
10704}
10705
7c673cae
FG
10706// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
10707// value to the given ostream. The caller must ensure that
10708// 'ostream_ptr' is not NULL, or the behavior is undefined.
10709//
10710// We define UniversalPrinter as a class template (as opposed to a
10711// function template), as we need to partially specialize it for
10712// reference types, which cannot be done with function templates.
10713template <typename T>
10714class UniversalPrinter;
10715
10716template <typename T>
10717void UniversalPrint(const T& value, ::std::ostream* os);
10718
f67539c2
TL
10719enum DefaultPrinterType {
10720 kPrintContainer,
10721 kPrintPointer,
10722 kPrintFunctionPointer,
10723 kPrintOther,
10724};
10725template <DefaultPrinterType type> struct WrapPrinterType {};
10726
7c673cae
FG
10727// Used to print an STL-style container when the user doesn't define
10728// a PrintTo() for it.
10729template <typename C>
f67539c2 10730void DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,
7c673cae
FG
10731 const C& container, ::std::ostream* os) {
10732 const size_t kMaxCount = 32; // The maximum number of elements to print.
10733 *os << '{';
10734 size_t count = 0;
10735 for (typename C::const_iterator it = container.begin();
10736 it != container.end(); ++it, ++count) {
10737 if (count > 0) {
10738 *os << ',';
10739 if (count == kMaxCount) { // Enough has been printed.
10740 *os << " ...";
10741 break;
10742 }
10743 }
10744 *os << ' ';
10745 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
10746 // handle *it being a native array.
10747 internal::UniversalPrint(*it, os);
10748 }
10749
10750 if (count > 0) {
10751 *os << ' ';
10752 }
10753 *os << '}';
10754}
10755
10756// Used to print a pointer that is neither a char pointer nor a member
10757// pointer, when the user doesn't define PrintTo() for it. (A member
10758// variable pointer or member function pointer doesn't really point to
10759// a location in the address space. Their representation is
10760// implementation-defined. Therefore they will be printed as raw
10761// bytes.)
10762template <typename T>
f67539c2 10763void DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,
7c673cae
FG
10764 T* p, ::std::ostream* os) {
10765 if (p == NULL) {
10766 *os << "NULL";
10767 } else {
f67539c2
TL
10768 // T is not a function type. We just call << to print p,
10769 // relying on ADL to pick up user-defined << for their pointer
10770 // types, if any.
10771 *os << p;
10772 }
10773}
10774template <typename T>
10775void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
10776 T* p, ::std::ostream* os) {
10777 if (p == NULL) {
10778 *os << "NULL";
10779 } else {
10780 // T is a function type, so '*os << p' doesn't do what we want
10781 // (it just prints p as bool). We want to print p as a const
10782 // void*.
10783 *os << reinterpret_cast<const void*>(p);
7c673cae
FG
10784 }
10785}
10786
10787// Used to print a non-container, non-pointer value when the user
10788// doesn't define PrintTo() for it.
10789template <typename T>
f67539c2 10790void DefaultPrintTo(WrapPrinterType<kPrintOther> /* dummy */,
7c673cae
FG
10791 const T& value, ::std::ostream* os) {
10792 ::testing_internal::DefaultPrintNonContainerTo(value, os);
10793}
10794
10795// Prints the given value using the << operator if it has one;
10796// otherwise prints the bytes in it. This is what
10797// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
10798// or overloaded for type T.
10799//
10800// A user can override this behavior for a class type Foo by defining
10801// an overload of PrintTo() in the namespace where Foo is defined. We
10802// give the user this option as sometimes defining a << operator for
10803// Foo is not desirable (e.g. the coding style may prevent doing it,
10804// or there is already a << operator but it doesn't do what the user
10805// wants).
10806template <typename T>
10807void PrintTo(const T& value, ::std::ostream* os) {
f67539c2
TL
10808 // DefaultPrintTo() is overloaded. The type of its first argument
10809 // determines which version will be picked.
7c673cae
FG
10810 //
10811 // Note that we check for container types here, prior to we check
10812 // for protocol message types in our operator<<. The rationale is:
10813 //
10814 // For protocol messages, we want to give people a chance to
10815 // override Google Mock's format by defining a PrintTo() or
10816 // operator<<. For STL containers, other formats can be
10817 // incompatible with Google Mock's format for the container
10818 // elements; therefore we check for container types here to ensure
10819 // that our format is used.
10820 //
f67539c2
TL
10821 // Note that MSVC and clang-cl do allow an implicit conversion from
10822 // pointer-to-function to pointer-to-object, but clang-cl warns on it.
10823 // So don't use ImplicitlyConvertible if it can be helped since it will
10824 // cause this warning, and use a separate overload of DefaultPrintTo for
10825 // function pointers so that the `*os << p` in the object pointer overload
10826 // doesn't cause that warning either.
10827 DefaultPrintTo(
10828 WrapPrinterType <
10829 (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
10830 !IsRecursiveContainer<T>::value
10831 ? kPrintContainer
10832 : !is_pointer<T>::value
10833 ? kPrintOther
10834#if GTEST_LANG_CXX11
10835 : std::is_function<typename std::remove_pointer<T>::type>::value
10836#else
10837 : !internal::ImplicitlyConvertible<T, const void*>::value
10838#endif
10839 ? kPrintFunctionPointer
10840 : kPrintPointer > (),
10841 value, os);
7c673cae
FG
10842}
10843
10844// The following list of PrintTo() overloads tells
10845// UniversalPrinter<T>::Print() how to print standard types (built-in
10846// types, strings, plain arrays, and pointers).
10847
10848// Overloads for various char types.
10849GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
10850GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
10851inline void PrintTo(char c, ::std::ostream* os) {
10852 // When printing a plain char, we always treat it as unsigned. This
10853 // way, the output won't be affected by whether the compiler thinks
10854 // char is signed or not.
10855 PrintTo(static_cast<unsigned char>(c), os);
10856}
10857
10858// Overloads for other simple built-in types.
10859inline void PrintTo(bool x, ::std::ostream* os) {
10860 *os << (x ? "true" : "false");
10861}
10862
10863// Overload for wchar_t type.
10864// Prints a wchar_t as a symbol if it is printable or as its internal
10865// code otherwise and also as its decimal code (except for L'\0').
10866// The L'\0' char is printed as "L'\\0'". The decimal code is printed
10867// as signed integer when wchar_t is implemented by the compiler
10868// as a signed type and is printed as an unsigned integer when wchar_t
10869// is implemented as an unsigned type.
10870GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
10871
10872// Overloads for C strings.
10873GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
10874inline void PrintTo(char* s, ::std::ostream* os) {
10875 PrintTo(ImplicitCast_<const char*>(s), os);
10876}
10877
10878// signed/unsigned char is often used for representing binary data, so
10879// we print pointers to it as void* to be safe.
10880inline void PrintTo(const signed char* s, ::std::ostream* os) {
10881 PrintTo(ImplicitCast_<const void*>(s), os);
10882}
10883inline void PrintTo(signed char* s, ::std::ostream* os) {
10884 PrintTo(ImplicitCast_<const void*>(s), os);
10885}
10886inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
10887 PrintTo(ImplicitCast_<const void*>(s), os);
10888}
10889inline void PrintTo(unsigned char* s, ::std::ostream* os) {
10890 PrintTo(ImplicitCast_<const void*>(s), os);
10891}
10892
10893// MSVC can be configured to define wchar_t as a typedef of unsigned
10894// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
10895// type. When wchar_t is a typedef, defining an overload for const
10896// wchar_t* would cause unsigned short* be printed as a wide string,
10897// possibly causing invalid memory accesses.
10898#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
10899// Overloads for wide C strings
10900GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
10901inline void PrintTo(wchar_t* s, ::std::ostream* os) {
10902 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
10903}
10904#endif
10905
10906// Overload for C arrays. Multi-dimensional arrays are printed
10907// properly.
10908
10909// Prints the given number of elements in an array, without printing
10910// the curly braces.
10911template <typename T>
10912void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
10913 UniversalPrint(a[0], os);
10914 for (size_t i = 1; i != count; i++) {
10915 *os << ", ";
10916 UniversalPrint(a[i], os);
10917 }
10918}
10919
10920// Overloads for ::string and ::std::string.
10921#if GTEST_HAS_GLOBAL_STRING
10922GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
10923inline void PrintTo(const ::string& s, ::std::ostream* os) {
10924 PrintStringTo(s, os);
10925}
10926#endif // GTEST_HAS_GLOBAL_STRING
10927
10928GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
10929inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
10930 PrintStringTo(s, os);
10931}
10932
10933// Overloads for ::wstring and ::std::wstring.
10934#if GTEST_HAS_GLOBAL_WSTRING
10935GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
10936inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
10937 PrintWideStringTo(s, os);
10938}
10939#endif // GTEST_HAS_GLOBAL_WSTRING
10940
10941#if GTEST_HAS_STD_WSTRING
10942GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
10943inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
10944 PrintWideStringTo(s, os);
10945}
10946#endif // GTEST_HAS_STD_WSTRING
10947
f67539c2
TL
10948#if GTEST_HAS_ABSL
10949// Overload for absl::string_view.
10950inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
10951 PrintTo(::std::string(sp), os);
10952}
10953#endif // GTEST_HAS_ABSL
10954
10955#if GTEST_LANG_CXX11
10956inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
10957#endif // GTEST_LANG_CXX11
10958
7c673cae
FG
10959#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10960// Helper function for printing a tuple. T must be instantiated with
10961// a tuple type.
10962template <typename T>
10963void PrintTupleTo(const T& t, ::std::ostream* os);
10964#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10965
10966#if GTEST_HAS_TR1_TUPLE
10967// Overload for ::std::tr1::tuple. Needed for printing function arguments,
10968// which are packed as tuples.
10969
10970// Overloaded PrintTo() for tuples of various arities. We support
10971// tuples of up-to 10 fields. The following implementation works
10972// regardless of whether tr1::tuple is implemented using the
10973// non-standard variadic template feature or not.
10974
10975inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
10976 PrintTupleTo(t, os);
10977}
10978
10979template <typename T1>
10980void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
10981 PrintTupleTo(t, os);
10982}
10983
10984template <typename T1, typename T2>
10985void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
10986 PrintTupleTo(t, os);
10987}
10988
10989template <typename T1, typename T2, typename T3>
10990void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
10991 PrintTupleTo(t, os);
10992}
10993
10994template <typename T1, typename T2, typename T3, typename T4>
10995void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
10996 PrintTupleTo(t, os);
10997}
10998
10999template <typename T1, typename T2, typename T3, typename T4, typename T5>
11000void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
11001 ::std::ostream* os) {
11002 PrintTupleTo(t, os);
11003}
11004
11005template <typename T1, typename T2, typename T3, typename T4, typename T5,
11006 typename T6>
11007void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
11008 ::std::ostream* os) {
11009 PrintTupleTo(t, os);
11010}
11011
11012template <typename T1, typename T2, typename T3, typename T4, typename T5,
11013 typename T6, typename T7>
11014void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
11015 ::std::ostream* os) {
11016 PrintTupleTo(t, os);
11017}
11018
11019template <typename T1, typename T2, typename T3, typename T4, typename T5,
11020 typename T6, typename T7, typename T8>
11021void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
11022 ::std::ostream* os) {
11023 PrintTupleTo(t, os);
11024}
11025
11026template <typename T1, typename T2, typename T3, typename T4, typename T5,
11027 typename T6, typename T7, typename T8, typename T9>
11028void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
11029 ::std::ostream* os) {
11030 PrintTupleTo(t, os);
11031}
11032
11033template <typename T1, typename T2, typename T3, typename T4, typename T5,
11034 typename T6, typename T7, typename T8, typename T9, typename T10>
11035void PrintTo(
11036 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
11037 ::std::ostream* os) {
11038 PrintTupleTo(t, os);
11039}
11040#endif // GTEST_HAS_TR1_TUPLE
11041
11042#if GTEST_HAS_STD_TUPLE_
11043template <typename... Types>
11044void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
11045 PrintTupleTo(t, os);
11046}
11047#endif // GTEST_HAS_STD_TUPLE_
11048
11049// Overload for std::pair.
11050template <typename T1, typename T2>
11051void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
11052 *os << '(';
11053 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
11054 // a reference type. The same for printing value.second.
11055 UniversalPrinter<T1>::Print(value.first, os);
11056 *os << ", ";
11057 UniversalPrinter<T2>::Print(value.second, os);
11058 *os << ')';
11059}
11060
11061// Implements printing a non-reference type T by letting the compiler
11062// pick the right overload of PrintTo() for T.
11063template <typename T>
11064class UniversalPrinter {
11065 public:
11066 // MSVC warns about adding const to a function type, so we want to
11067 // disable the warning.
11068 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
11069
11070 // Note: we deliberately don't call this PrintTo(), as that name
11071 // conflicts with ::testing::internal::PrintTo in the body of the
11072 // function.
11073 static void Print(const T& value, ::std::ostream* os) {
11074 // By default, ::testing::internal::PrintTo() is used for printing
11075 // the value.
11076 //
11077 // Thanks to Koenig look-up, if T is a class and has its own
11078 // PrintTo() function defined in its namespace, that function will
11079 // be visible here. Since it is more specific than the generic ones
11080 // in ::testing::internal, it will be picked by the compiler in the
11081 // following statement - exactly what we want.
11082 PrintTo(value, os);
11083 }
11084
11085 GTEST_DISABLE_MSC_WARNINGS_POP_()
11086};
11087
f67539c2
TL
11088#if GTEST_HAS_ABSL
11089
11090// Printer for absl::optional
11091
11092template <typename T>
11093class UniversalPrinter<::absl::optional<T>> {
11094 public:
11095 static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {
11096 *os << '(';
11097 if (!value) {
11098 *os << "nullopt";
11099 } else {
11100 UniversalPrint(*value, os);
11101 }
11102 *os << ')';
11103 }
11104};
11105
11106// Printer for absl::variant
11107
11108template <typename... T>
11109class UniversalPrinter<::absl::variant<T...>> {
11110 public:
11111 static void Print(const ::absl::variant<T...>& value, ::std::ostream* os) {
11112 *os << '(';
11113 absl::visit(Visitor{os}, value);
11114 *os << ')';
11115 }
11116
11117 private:
11118 struct Visitor {
11119 template <typename U>
11120 void operator()(const U& u) const {
11121 *os << "'" << GetTypeName<U>() << "' with value ";
11122 UniversalPrint(u, os);
11123 }
11124 ::std::ostream* os;
11125 };
11126};
11127
11128#endif // GTEST_HAS_ABSL
11129
7c673cae
FG
11130// UniversalPrintArray(begin, len, os) prints an array of 'len'
11131// elements, starting at address 'begin'.
11132template <typename T>
11133void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
11134 if (len == 0) {
11135 *os << "{}";
11136 } else {
11137 *os << "{ ";
11138 const size_t kThreshold = 18;
11139 const size_t kChunkSize = 8;
11140 // If the array has more than kThreshold elements, we'll have to
11141 // omit some details by printing only the first and the last
11142 // kChunkSize elements.
f67539c2 11143 // FIXME: let the user control the threshold using a flag.
7c673cae
FG
11144 if (len <= kThreshold) {
11145 PrintRawArrayTo(begin, len, os);
11146 } else {
11147 PrintRawArrayTo(begin, kChunkSize, os);
11148 *os << ", ..., ";
11149 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
11150 }
11151 *os << " }";
11152 }
11153}
11154// This overload prints a (const) char array compactly.
11155GTEST_API_ void UniversalPrintArray(
11156 const char* begin, size_t len, ::std::ostream* os);
11157
11158// This overload prints a (const) wchar_t array compactly.
11159GTEST_API_ void UniversalPrintArray(
11160 const wchar_t* begin, size_t len, ::std::ostream* os);
11161
11162// Implements printing an array type T[N].
11163template <typename T, size_t N>
11164class UniversalPrinter<T[N]> {
11165 public:
11166 // Prints the given array, omitting some elements when there are too
11167 // many.
11168 static void Print(const T (&a)[N], ::std::ostream* os) {
11169 UniversalPrintArray(a, N, os);
11170 }
11171};
11172
11173// Implements printing a reference type T&.
11174template <typename T>
11175class UniversalPrinter<T&> {
11176 public:
11177 // MSVC warns about adding const to a function type, so we want to
11178 // disable the warning.
11179 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
11180
11181 static void Print(const T& value, ::std::ostream* os) {
11182 // Prints the address of the value. We use reinterpret_cast here
11183 // as static_cast doesn't compile when T is a function type.
11184 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
11185
11186 // Then prints the value itself.
11187 UniversalPrint(value, os);
11188 }
11189
11190 GTEST_DISABLE_MSC_WARNINGS_POP_()
11191};
11192
11193// Prints a value tersely: for a reference type, the referenced value
11194// (but not the address) is printed; for a (const) char pointer, the
11195// NUL-terminated string (but not the pointer) is printed.
11196
11197template <typename T>
11198class UniversalTersePrinter {
11199 public:
11200 static void Print(const T& value, ::std::ostream* os) {
11201 UniversalPrint(value, os);
11202 }
11203};
11204template <typename T>
11205class UniversalTersePrinter<T&> {
11206 public:
11207 static void Print(const T& value, ::std::ostream* os) {
11208 UniversalPrint(value, os);
11209 }
11210};
11211template <typename T, size_t N>
11212class UniversalTersePrinter<T[N]> {
11213 public:
11214 static void Print(const T (&value)[N], ::std::ostream* os) {
11215 UniversalPrinter<T[N]>::Print(value, os);
11216 }
11217};
11218template <>
11219class UniversalTersePrinter<const char*> {
11220 public:
11221 static void Print(const char* str, ::std::ostream* os) {
11222 if (str == NULL) {
11223 *os << "NULL";
11224 } else {
f67539c2 11225 UniversalPrint(std::string(str), os);
7c673cae
FG
11226 }
11227 }
11228};
11229template <>
11230class UniversalTersePrinter<char*> {
11231 public:
11232 static void Print(char* str, ::std::ostream* os) {
11233 UniversalTersePrinter<const char*>::Print(str, os);
11234 }
11235};
11236
11237#if GTEST_HAS_STD_WSTRING
11238template <>
11239class UniversalTersePrinter<const wchar_t*> {
11240 public:
11241 static void Print(const wchar_t* str, ::std::ostream* os) {
11242 if (str == NULL) {
11243 *os << "NULL";
11244 } else {
11245 UniversalPrint(::std::wstring(str), os);
11246 }
11247 }
11248};
11249#endif
11250
11251template <>
11252class UniversalTersePrinter<wchar_t*> {
11253 public:
11254 static void Print(wchar_t* str, ::std::ostream* os) {
11255 UniversalTersePrinter<const wchar_t*>::Print(str, os);
11256 }
11257};
11258
11259template <typename T>
11260void UniversalTersePrint(const T& value, ::std::ostream* os) {
11261 UniversalTersePrinter<T>::Print(value, os);
11262}
11263
11264// Prints a value using the type inferred by the compiler. The
11265// difference between this and UniversalTersePrint() is that for a
11266// (const) char pointer, this prints both the pointer and the
11267// NUL-terminated string.
11268template <typename T>
11269void UniversalPrint(const T& value, ::std::ostream* os) {
11270 // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
11271 // UniversalPrinter with T directly.
11272 typedef T T1;
11273 UniversalPrinter<T1>::Print(value, os);
11274}
11275
f67539c2 11276typedef ::std::vector< ::std::string> Strings;
7c673cae
FG
11277
11278// TuplePolicy<TupleT> must provide:
11279// - tuple_size
11280// size of tuple TupleT.
11281// - get<size_t I>(const TupleT& t)
11282// static function extracting element I of tuple TupleT.
11283// - tuple_element<size_t I>::type
11284// type of element I of tuple TupleT.
11285template <typename TupleT>
11286struct TuplePolicy;
11287
11288#if GTEST_HAS_TR1_TUPLE
11289template <typename TupleT>
11290struct TuplePolicy {
11291 typedef TupleT Tuple;
11292 static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
11293
11294 template <size_t I>
f67539c2
TL
11295 struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
11296 };
7c673cae
FG
11297
11298 template <size_t I>
f67539c2
TL
11299 static typename AddReference<const typename ::std::tr1::tuple_element<
11300 static_cast<int>(I), Tuple>::type>::type
11301 get(const Tuple& tuple) {
7c673cae
FG
11302 return ::std::tr1::get<I>(tuple);
11303 }
11304};
11305template <typename TupleT>
11306const size_t TuplePolicy<TupleT>::tuple_size;
11307#endif // GTEST_HAS_TR1_TUPLE
11308
11309#if GTEST_HAS_STD_TUPLE_
11310template <typename... Types>
11311struct TuplePolicy< ::std::tuple<Types...> > {
11312 typedef ::std::tuple<Types...> Tuple;
11313 static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
11314
11315 template <size_t I>
11316 struct tuple_element : ::std::tuple_element<I, Tuple> {};
11317
11318 template <size_t I>
11319 static const typename ::std::tuple_element<I, Tuple>::type& get(
11320 const Tuple& tuple) {
11321 return ::std::get<I>(tuple);
11322 }
11323};
11324template <typename... Types>
11325const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
11326#endif // GTEST_HAS_STD_TUPLE_
11327
11328#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
11329// This helper template allows PrintTo() for tuples and
11330// UniversalTersePrintTupleFieldsToStrings() to be defined by
11331// induction on the number of tuple fields. The idea is that
11332// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
11333// fields in tuple t, and can be defined in terms of
11334// TuplePrefixPrinter<N - 1>.
11335//
11336// The inductive case.
11337template <size_t N>
11338struct TuplePrefixPrinter {
11339 // Prints the first N fields of a tuple.
11340 template <typename Tuple>
11341 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
11342 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
11343 GTEST_INTENTIONAL_CONST_COND_PUSH_()
11344 if (N > 1) {
11345 GTEST_INTENTIONAL_CONST_COND_POP_()
11346 *os << ", ";
11347 }
11348 UniversalPrinter<
11349 typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
11350 ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
11351 }
11352
11353 // Tersely prints the first N fields of a tuple to a string vector,
11354 // one element for each field.
11355 template <typename Tuple>
11356 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
11357 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
11358 ::std::stringstream ss;
11359 UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
11360 strings->push_back(ss.str());
11361 }
11362};
11363
11364// Base case.
11365template <>
11366struct TuplePrefixPrinter<0> {
11367 template <typename Tuple>
11368 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
11369
11370 template <typename Tuple>
11371 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
11372};
11373
11374// Helper function for printing a tuple.
11375// Tuple must be either std::tr1::tuple or std::tuple type.
11376template <typename Tuple>
11377void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
11378 *os << "(";
11379 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
11380 *os << ")";
11381}
11382
11383// Prints the fields of a tuple tersely to a string vector, one
11384// element for each field. See the comment before
11385// UniversalTersePrint() for how we define "tersely".
11386template <typename Tuple>
11387Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
11388 Strings result;
11389 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
11390 TersePrintPrefixToStrings(value, &result);
11391 return result;
11392}
11393#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
11394
11395} // namespace internal
11396
f67539c2
TL
11397#if GTEST_HAS_ABSL
11398namespace internal2 {
11399template <typename T>
11400void TypeWithoutFormatter<T, kConvertibleToStringView>::PrintValue(
11401 const T& value, ::std::ostream* os) {
11402 internal::PrintTo(absl::string_view(value), os);
11403}
11404} // namespace internal2
11405#endif
11406
7c673cae
FG
11407template <typename T>
11408::std::string PrintToString(const T& value) {
11409 ::std::stringstream ss;
11410 internal::UniversalTersePrinter<T>::Print(value, &ss);
11411 return ss.str();
11412}
11413
11414} // namespace testing
11415
f67539c2
TL
11416// Include any custom printer added by the local installation.
11417// We must include this header at the end to make sure it can use the
11418// declarations from this file.
11419// Copyright 2015, Google Inc.
11420// All rights reserved.
11421//
11422// Redistribution and use in source and binary forms, with or without
11423// modification, are permitted provided that the following conditions are
11424// met:
11425//
11426// * Redistributions of source code must retain the above copyright
11427// notice, this list of conditions and the following disclaimer.
11428// * Redistributions in binary form must reproduce the above
11429// copyright notice, this list of conditions and the following disclaimer
11430// in the documentation and/or other materials provided with the
11431// distribution.
11432// * Neither the name of Google Inc. nor the names of its
11433// contributors may be used to endorse or promote products derived from
11434// this software without specific prior written permission.
11435//
11436// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
11437// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11438// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
11439// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11440// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11441// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11442// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11443// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11444// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11445// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11446// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11447//
11448// This file provides an injection point for custom printers in a local
11449// installation of gTest.
11450// It will be included from gtest-printers.h and the overrides in this file
11451// will be visible to everyone.
11452//
11453// Injection point for custom user configurations. See README for details
11454//
11455// ** Custom implementation starts here **
11456
11457#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11458#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11459
11460#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
7c673cae 11461
f67539c2 11462#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
7c673cae
FG
11463
11464namespace testing {
7c673cae 11465
f67539c2
TL
11466// Input to a parameterized test name generator, describing a test parameter.
11467// Consists of the parameter value and the integer parameter index.
11468template <class ParamType>
11469struct TestParamInfo {
11470 TestParamInfo(const ParamType& a_param, size_t an_index) :
11471 param(a_param),
11472 index(an_index) {}
11473 ParamType param;
11474 size_t index;
11475};
11476
11477// A builtin parameterized test name generator which returns the result of
11478// testing::PrintToString.
11479struct PrintToStringParamName {
11480 template <class ParamType>
11481 std::string operator()(const TestParamInfo<ParamType>& info) const {
11482 return PrintToString(info.param);
11483 }
11484};
11485
11486namespace internal {
11487
11488// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11489//
7c673cae
FG
11490// Outputs a message explaining invalid registration of different
11491// fixture class for the same test case. This may happen when
11492// TEST_P macro is used to define two tests with the same name
11493// but in different namespaces.
11494GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
f67539c2 11495 CodeLocation code_location);
7c673cae
FG
11496
11497template <typename> class ParamGeneratorInterface;
11498template <typename> class ParamGenerator;
11499
11500// Interface for iterating over elements provided by an implementation
11501// of ParamGeneratorInterface<T>.
11502template <typename T>
11503class ParamIteratorInterface {
11504 public:
11505 virtual ~ParamIteratorInterface() {}
11506 // A pointer to the base generator instance.
11507 // Used only for the purposes of iterator comparison
11508 // to make sure that two iterators belong to the same generator.
11509 virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
11510 // Advances iterator to point to the next element
11511 // provided by the generator. The caller is responsible
11512 // for not calling Advance() on an iterator equal to
11513 // BaseGenerator()->End().
11514 virtual void Advance() = 0;
11515 // Clones the iterator object. Used for implementing copy semantics
11516 // of ParamIterator<T>.
11517 virtual ParamIteratorInterface* Clone() const = 0;
11518 // Dereferences the current iterator and provides (read-only) access
11519 // to the pointed value. It is the caller's responsibility not to call
11520 // Current() on an iterator equal to BaseGenerator()->End().
11521 // Used for implementing ParamGenerator<T>::operator*().
11522 virtual const T* Current() const = 0;
11523 // Determines whether the given iterator and other point to the same
11524 // element in the sequence generated by the generator.
11525 // Used for implementing ParamGenerator<T>::operator==().
11526 virtual bool Equals(const ParamIteratorInterface& other) const = 0;
11527};
11528
11529// Class iterating over elements provided by an implementation of
11530// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
11531// and implements the const forward iterator concept.
11532template <typename T>
11533class ParamIterator {
11534 public:
11535 typedef T value_type;
11536 typedef const T& reference;
11537 typedef ptrdiff_t difference_type;
11538
11539 // ParamIterator assumes ownership of the impl_ pointer.
11540 ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
11541 ParamIterator& operator=(const ParamIterator& other) {
11542 if (this != &other)
11543 impl_.reset(other.impl_->Clone());
11544 return *this;
11545 }
11546
11547 const T& operator*() const { return *impl_->Current(); }
11548 const T* operator->() const { return impl_->Current(); }
11549 // Prefix version of operator++.
11550 ParamIterator& operator++() {
11551 impl_->Advance();
11552 return *this;
11553 }
11554 // Postfix version of operator++.
11555 ParamIterator operator++(int /*unused*/) {
11556 ParamIteratorInterface<T>* clone = impl_->Clone();
11557 impl_->Advance();
11558 return ParamIterator(clone);
11559 }
11560 bool operator==(const ParamIterator& other) const {
11561 return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
11562 }
11563 bool operator!=(const ParamIterator& other) const {
11564 return !(*this == other);
11565 }
11566
11567 private:
11568 friend class ParamGenerator<T>;
11569 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
11570 scoped_ptr<ParamIteratorInterface<T> > impl_;
11571};
11572
11573// ParamGeneratorInterface<T> is the binary interface to access generators
11574// defined in other translation units.
11575template <typename T>
11576class ParamGeneratorInterface {
11577 public:
11578 typedef T ParamType;
11579
11580 virtual ~ParamGeneratorInterface() {}
11581
11582 // Generator interface definition
11583 virtual ParamIteratorInterface<T>* Begin() const = 0;
11584 virtual ParamIteratorInterface<T>* End() const = 0;
11585};
11586
11587// Wraps ParamGeneratorInterface<T> and provides general generator syntax
11588// compatible with the STL Container concept.
11589// This class implements copy initialization semantics and the contained
11590// ParamGeneratorInterface<T> instance is shared among all copies
11591// of the original object. This is possible because that instance is immutable.
11592template<typename T>
11593class ParamGenerator {
11594 public:
11595 typedef ParamIterator<T> iterator;
11596
11597 explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
11598 ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
11599
11600 ParamGenerator& operator=(const ParamGenerator& other) {
11601 impl_ = other.impl_;
11602 return *this;
11603 }
11604
11605 iterator begin() const { return iterator(impl_->Begin()); }
11606 iterator end() const { return iterator(impl_->End()); }
11607
11608 private:
11609 linked_ptr<const ParamGeneratorInterface<T> > impl_;
11610};
11611
11612// Generates values from a range of two comparable values. Can be used to
11613// generate sequences of user-defined types that implement operator+() and
11614// operator<().
11615// This class is used in the Range() function.
11616template <typename T, typename IncrementT>
11617class RangeGenerator : public ParamGeneratorInterface<T> {
11618 public:
11619 RangeGenerator(T begin, T end, IncrementT step)
11620 : begin_(begin), end_(end),
11621 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
11622 virtual ~RangeGenerator() {}
11623
11624 virtual ParamIteratorInterface<T>* Begin() const {
11625 return new Iterator(this, begin_, 0, step_);
11626 }
11627 virtual ParamIteratorInterface<T>* End() const {
11628 return new Iterator(this, end_, end_index_, step_);
11629 }
11630
11631 private:
11632 class Iterator : public ParamIteratorInterface<T> {
11633 public:
11634 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
11635 IncrementT step)
11636 : base_(base), value_(value), index_(index), step_(step) {}
11637 virtual ~Iterator() {}
11638
11639 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11640 return base_;
11641 }
11642 virtual void Advance() {
f67539c2 11643 value_ = static_cast<T>(value_ + step_);
7c673cae
FG
11644 index_++;
11645 }
11646 virtual ParamIteratorInterface<T>* Clone() const {
11647 return new Iterator(*this);
11648 }
11649 virtual const T* Current() const { return &value_; }
11650 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11651 // Having the same base generator guarantees that the other
11652 // iterator is of the same type and we can downcast.
11653 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11654 << "The program attempted to compare iterators "
11655 << "from different generators." << std::endl;
11656 const int other_index =
11657 CheckedDowncastToActualType<const Iterator>(&other)->index_;
11658 return index_ == other_index;
11659 }
11660
11661 private:
11662 Iterator(const Iterator& other)
11663 : ParamIteratorInterface<T>(),
11664 base_(other.base_), value_(other.value_), index_(other.index_),
11665 step_(other.step_) {}
11666
11667 // No implementation - assignment is unsupported.
11668 void operator=(const Iterator& other);
11669
11670 const ParamGeneratorInterface<T>* const base_;
11671 T value_;
11672 int index_;
11673 const IncrementT step_;
11674 }; // class RangeGenerator::Iterator
11675
11676 static int CalculateEndIndex(const T& begin,
11677 const T& end,
11678 const IncrementT& step) {
11679 int end_index = 0;
f67539c2 11680 for (T i = begin; i < end; i = static_cast<T>(i + step))
7c673cae
FG
11681 end_index++;
11682 return end_index;
11683 }
11684
11685 // No implementation - assignment is unsupported.
11686 void operator=(const RangeGenerator& other);
11687
11688 const T begin_;
11689 const T end_;
11690 const IncrementT step_;
11691 // The index for the end() iterator. All the elements in the generated
11692 // sequence are indexed (0-based) to aid iterator comparison.
11693 const int end_index_;
11694}; // class RangeGenerator
11695
11696
11697// Generates values from a pair of STL-style iterators. Used in the
11698// ValuesIn() function. The elements are copied from the source range
11699// since the source can be located on the stack, and the generator
11700// is likely to persist beyond that stack frame.
11701template <typename T>
11702class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
11703 public:
11704 template <typename ForwardIterator>
11705 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
11706 : container_(begin, end) {}
11707 virtual ~ValuesInIteratorRangeGenerator() {}
11708
11709 virtual ParamIteratorInterface<T>* Begin() const {
11710 return new Iterator(this, container_.begin());
11711 }
11712 virtual ParamIteratorInterface<T>* End() const {
11713 return new Iterator(this, container_.end());
11714 }
11715
11716 private:
11717 typedef typename ::std::vector<T> ContainerType;
11718
11719 class Iterator : public ParamIteratorInterface<T> {
11720 public:
11721 Iterator(const ParamGeneratorInterface<T>* base,
11722 typename ContainerType::const_iterator iterator)
11723 : base_(base), iterator_(iterator) {}
11724 virtual ~Iterator() {}
11725
11726 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11727 return base_;
11728 }
11729 virtual void Advance() {
11730 ++iterator_;
11731 value_.reset();
11732 }
11733 virtual ParamIteratorInterface<T>* Clone() const {
11734 return new Iterator(*this);
11735 }
11736 // We need to use cached value referenced by iterator_ because *iterator_
11737 // can return a temporary object (and of type other then T), so just
11738 // having "return &*iterator_;" doesn't work.
11739 // value_ is updated here and not in Advance() because Advance()
11740 // can advance iterator_ beyond the end of the range, and we cannot
11741 // detect that fact. The client code, on the other hand, is
11742 // responsible for not calling Current() on an out-of-range iterator.
11743 virtual const T* Current() const {
11744 if (value_.get() == NULL)
11745 value_.reset(new T(*iterator_));
11746 return value_.get();
11747 }
11748 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11749 // Having the same base generator guarantees that the other
11750 // iterator is of the same type and we can downcast.
11751 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11752 << "The program attempted to compare iterators "
11753 << "from different generators." << std::endl;
11754 return iterator_ ==
11755 CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
11756 }
11757
11758 private:
11759 Iterator(const Iterator& other)
11760 // The explicit constructor call suppresses a false warning
11761 // emitted by gcc when supplied with the -Wextra option.
11762 : ParamIteratorInterface<T>(),
11763 base_(other.base_),
11764 iterator_(other.iterator_) {}
11765
11766 const ParamGeneratorInterface<T>* const base_;
11767 typename ContainerType::const_iterator iterator_;
11768 // A cached value of *iterator_. We keep it here to allow access by
11769 // pointer in the wrapping iterator's operator->().
11770 // value_ needs to be mutable to be accessed in Current().
11771 // Use of scoped_ptr helps manage cached value's lifetime,
11772 // which is bound by the lifespan of the iterator itself.
11773 mutable scoped_ptr<const T> value_;
11774 }; // class ValuesInIteratorRangeGenerator::Iterator
11775
11776 // No implementation - assignment is unsupported.
11777 void operator=(const ValuesInIteratorRangeGenerator& other);
11778
11779 const ContainerType container_;
11780}; // class ValuesInIteratorRangeGenerator
11781
f67539c2
TL
11782// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11783//
11784// Default parameterized test name generator, returns a string containing the
11785// integer test parameter index.
11786template <class ParamType>
11787std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
11788 Message name_stream;
11789 name_stream << info.index;
11790 return name_stream.GetString();
11791}
11792
11793// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11794//
11795// Parameterized test name overload helpers, which help the
11796// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
11797// test name generator and user param name generator.
11798template <class ParamType, class ParamNameGenFunctor>
11799ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
11800 return func;
11801}
11802
11803template <class ParamType>
11804struct ParamNameGenFunc {
11805 typedef std::string Type(const TestParamInfo<ParamType>&);
11806};
11807
11808template <class ParamType>
11809typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
11810 return DefaultParamName;
11811}
11812
7c673cae
FG
11813// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11814//
11815// Stores a parameter value and later creates tests parameterized with that
11816// value.
11817template <class TestClass>
11818class ParameterizedTestFactory : public TestFactoryBase {
11819 public:
11820 typedef typename TestClass::ParamType ParamType;
11821 explicit ParameterizedTestFactory(ParamType parameter) :
11822 parameter_(parameter) {}
11823 virtual Test* CreateTest() {
11824 TestClass::SetParam(&parameter_);
11825 return new TestClass();
11826 }
11827
11828 private:
11829 const ParamType parameter_;
11830
11831 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
11832};
11833
11834// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11835//
11836// TestMetaFactoryBase is a base class for meta-factories that create
11837// test factories for passing into MakeAndRegisterTestInfo function.
11838template <class ParamType>
11839class TestMetaFactoryBase {
11840 public:
11841 virtual ~TestMetaFactoryBase() {}
11842
11843 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
11844};
11845
11846// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11847//
11848// TestMetaFactory creates test factories for passing into
11849// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
11850// ownership of test factory pointer, same factory object cannot be passed
11851// into that method twice. But ParameterizedTestCaseInfo is going to call
11852// it for each Test/Parameter value combination. Thus it needs meta factory
11853// creator class.
11854template <class TestCase>
11855class TestMetaFactory
11856 : public TestMetaFactoryBase<typename TestCase::ParamType> {
11857 public:
11858 typedef typename TestCase::ParamType ParamType;
11859
11860 TestMetaFactory() {}
11861
11862 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
11863 return new ParameterizedTestFactory<TestCase>(parameter);
11864 }
11865
11866 private:
11867 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
11868};
11869
11870// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11871//
11872// ParameterizedTestCaseInfoBase is a generic interface
11873// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
11874// accumulates test information provided by TEST_P macro invocations
11875// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
11876// and uses that information to register all resulting test instances
11877// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
11878// a collection of pointers to the ParameterizedTestCaseInfo objects
11879// and calls RegisterTests() on each of them when asked.
11880class ParameterizedTestCaseInfoBase {
11881 public:
11882 virtual ~ParameterizedTestCaseInfoBase() {}
11883
11884 // Base part of test case name for display purposes.
f67539c2 11885 virtual const std::string& GetTestCaseName() const = 0;
7c673cae
FG
11886 // Test case id to verify identity.
11887 virtual TypeId GetTestCaseTypeId() const = 0;
11888 // UnitTest class invokes this method to register tests in this
11889 // test case right before running them in RUN_ALL_TESTS macro.
11890 // This method should not be called more then once on any single
11891 // instance of a ParameterizedTestCaseInfoBase derived class.
11892 virtual void RegisterTests() = 0;
11893
11894 protected:
11895 ParameterizedTestCaseInfoBase() {}
11896
11897 private:
11898 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
11899};
11900
11901// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11902//
11903// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
11904// macro invocations for a particular test case and generators
11905// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
11906// test case. It registers tests with all values generated by all
11907// generators when asked.
11908template <class TestCase>
11909class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
11910 public:
11911 // ParamType and GeneratorCreationFunc are private types but are required
11912 // for declarations of public methods AddTestPattern() and
11913 // AddTestCaseInstantiation().
11914 typedef typename TestCase::ParamType ParamType;
11915 // A function that returns an instance of appropriate generator type.
11916 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
f67539c2 11917 typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
7c673cae 11918
f67539c2
TL
11919 explicit ParameterizedTestCaseInfo(
11920 const char* name, CodeLocation code_location)
11921 : test_case_name_(name), code_location_(code_location) {}
7c673cae
FG
11922
11923 // Test case base name for display purposes.
f67539c2 11924 virtual const std::string& GetTestCaseName() const { return test_case_name_; }
7c673cae
FG
11925 // Test case id to verify identity.
11926 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
11927 // TEST_P macro uses AddTestPattern() to record information
11928 // about a single test in a LocalTestInfo structure.
11929 // test_case_name is the base name of the test case (without invocation
11930 // prefix). test_base_name is the name of an individual test without
11931 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
11932 // test case base name and DoBar is test base name.
11933 void AddTestPattern(const char* test_case_name,
11934 const char* test_base_name,
11935 TestMetaFactoryBase<ParamType>* meta_factory) {
11936 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
11937 test_base_name,
11938 meta_factory)));
11939 }
11940 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
11941 // about a generator.
f67539c2 11942 int AddTestCaseInstantiation(const std::string& instantiation_name,
7c673cae 11943 GeneratorCreationFunc* func,
f67539c2
TL
11944 ParamNameGeneratorFunc* name_func,
11945 const char* file, int line) {
11946 instantiations_.push_back(
11947 InstantiationInfo(instantiation_name, func, name_func, file, line));
7c673cae
FG
11948 return 0; // Return value used only to run this method in namespace scope.
11949 }
11950 // UnitTest class invokes this method to register tests in this test case
11951 // test cases right before running tests in RUN_ALL_TESTS macro.
11952 // This method should not be called more then once on any single
11953 // instance of a ParameterizedTestCaseInfoBase derived class.
11954 // UnitTest has a guard to prevent from calling this method more then once.
11955 virtual void RegisterTests() {
11956 for (typename TestInfoContainer::iterator test_it = tests_.begin();
11957 test_it != tests_.end(); ++test_it) {
11958 linked_ptr<TestInfo> test_info = *test_it;
11959 for (typename InstantiationContainer::iterator gen_it =
11960 instantiations_.begin(); gen_it != instantiations_.end();
11961 ++gen_it) {
f67539c2
TL
11962 const std::string& instantiation_name = gen_it->name;
11963 ParamGenerator<ParamType> generator((*gen_it->generator)());
11964 ParamNameGeneratorFunc* name_func = gen_it->name_func;
11965 const char* file = gen_it->file;
11966 int line = gen_it->line;
7c673cae 11967
f67539c2 11968 std::string test_case_name;
7c673cae
FG
11969 if ( !instantiation_name.empty() )
11970 test_case_name = instantiation_name + "/";
11971 test_case_name += test_info->test_case_base_name;
11972
f67539c2
TL
11973 size_t i = 0;
11974 std::set<std::string> test_param_names;
7c673cae
FG
11975 for (typename ParamGenerator<ParamType>::iterator param_it =
11976 generator.begin();
11977 param_it != generator.end(); ++param_it, ++i) {
11978 Message test_name_stream;
f67539c2
TL
11979
11980 std::string param_name = name_func(
11981 TestParamInfo<ParamType>(*param_it, i));
11982
11983 GTEST_CHECK_(IsValidParamName(param_name))
11984 << "Parameterized test name '" << param_name
11985 << "' is invalid, in " << file
11986 << " line " << line << std::endl;
11987
11988 GTEST_CHECK_(test_param_names.count(param_name) == 0)
11989 << "Duplicate parameterized test name '" << param_name
11990 << "', in " << file << " line " << line << std::endl;
11991
11992 test_param_names.insert(param_name);
11993
11994 test_name_stream << test_info->test_base_name << "/" << param_name;
7c673cae
FG
11995 MakeAndRegisterTestInfo(
11996 test_case_name.c_str(),
11997 test_name_stream.GetString().c_str(),
11998 NULL, // No type parameter.
11999 PrintToString(*param_it).c_str(),
f67539c2 12000 code_location_,
7c673cae
FG
12001 GetTestCaseTypeId(),
12002 TestCase::SetUpTestCase,
12003 TestCase::TearDownTestCase,
12004 test_info->test_meta_factory->CreateTestFactory(*param_it));
12005 } // for param_it
12006 } // for gen_it
12007 } // for test_it
12008 } // RegisterTests
12009
12010 private:
12011 // LocalTestInfo structure keeps information about a single test registered
12012 // with TEST_P macro.
12013 struct TestInfo {
12014 TestInfo(const char* a_test_case_base_name,
12015 const char* a_test_base_name,
12016 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
12017 test_case_base_name(a_test_case_base_name),
12018 test_base_name(a_test_base_name),
12019 test_meta_factory(a_test_meta_factory) {}
12020
f67539c2
TL
12021 const std::string test_case_base_name;
12022 const std::string test_base_name;
7c673cae
FG
12023 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
12024 };
12025 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
f67539c2
TL
12026 // Records data received from INSTANTIATE_TEST_CASE_P macros:
12027 // <Instantiation name, Sequence generator creation function,
12028 // Name generator function, Source file, Source line>
12029 struct InstantiationInfo {
12030 InstantiationInfo(const std::string &name_in,
12031 GeneratorCreationFunc* generator_in,
12032 ParamNameGeneratorFunc* name_func_in,
12033 const char* file_in,
12034 int line_in)
12035 : name(name_in),
12036 generator(generator_in),
12037 name_func(name_func_in),
12038 file(file_in),
12039 line(line_in) {}
12040
12041 std::string name;
12042 GeneratorCreationFunc* generator;
12043 ParamNameGeneratorFunc* name_func;
12044 const char* file;
12045 int line;
12046 };
12047 typedef ::std::vector<InstantiationInfo> InstantiationContainer;
12048
12049 static bool IsValidParamName(const std::string& name) {
12050 // Check for empty string
12051 if (name.empty())
12052 return false;
12053
12054 // Check for invalid characters
12055 for (std::string::size_type index = 0; index < name.size(); ++index) {
12056 if (!isalnum(name[index]) && name[index] != '_')
12057 return false;
12058 }
12059
12060 return true;
12061 }
7c673cae 12062
f67539c2
TL
12063 const std::string test_case_name_;
12064 CodeLocation code_location_;
7c673cae
FG
12065 TestInfoContainer tests_;
12066 InstantiationContainer instantiations_;
12067
12068 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
12069}; // class ParameterizedTestCaseInfo
12070
12071// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
12072//
12073// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
12074// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
12075// macros use it to locate their corresponding ParameterizedTestCaseInfo
12076// descriptors.
12077class ParameterizedTestCaseRegistry {
12078 public:
12079 ParameterizedTestCaseRegistry() {}
12080 ~ParameterizedTestCaseRegistry() {
12081 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12082 it != test_case_infos_.end(); ++it) {
12083 delete *it;
12084 }
12085 }
12086
12087 // Looks up or creates and returns a structure containing information about
12088 // tests and instantiations of a particular test case.
12089 template <class TestCase>
12090 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
12091 const char* test_case_name,
f67539c2 12092 CodeLocation code_location) {
7c673cae
FG
12093 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
12094 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12095 it != test_case_infos_.end(); ++it) {
12096 if ((*it)->GetTestCaseName() == test_case_name) {
12097 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
12098 // Complain about incorrect usage of Google Test facilities
12099 // and terminate the program since we cannot guaranty correct
12100 // test case setup and tear-down in this case.
f67539c2 12101 ReportInvalidTestCaseType(test_case_name, code_location);
7c673cae
FG
12102 posix::Abort();
12103 } else {
12104 // At this point we are sure that the object we found is of the same
12105 // type we are looking for, so we downcast it to that type
12106 // without further checks.
12107 typed_test_info = CheckedDowncastToActualType<
12108 ParameterizedTestCaseInfo<TestCase> >(*it);
12109 }
12110 break;
12111 }
12112 }
12113 if (typed_test_info == NULL) {
f67539c2
TL
12114 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
12115 test_case_name, code_location);
7c673cae
FG
12116 test_case_infos_.push_back(typed_test_info);
12117 }
12118 return typed_test_info;
12119 }
12120 void RegisterTests() {
12121 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12122 it != test_case_infos_.end(); ++it) {
12123 (*it)->RegisterTests();
12124 }
12125 }
12126
12127 private:
12128 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
12129
12130 TestCaseInfoContainer test_case_infos_;
12131
12132 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
12133};
12134
12135} // namespace internal
12136} // namespace testing
12137
7c673cae
FG
12138#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
12139// This file was GENERATED by command:
12140// pump.py gtest-param-util-generated.h.pump
12141// DO NOT EDIT BY HAND!!!
12142
12143// Copyright 2008 Google Inc.
12144// All Rights Reserved.
12145//
12146// Redistribution and use in source and binary forms, with or without
12147// modification, are permitted provided that the following conditions are
12148// met:
12149//
12150// * Redistributions of source code must retain the above copyright
12151// notice, this list of conditions and the following disclaimer.
12152// * Redistributions in binary form must reproduce the above
12153// copyright notice, this list of conditions and the following disclaimer
12154// in the documentation and/or other materials provided with the
12155// distribution.
12156// * Neither the name of Google Inc. nor the names of its
12157// contributors may be used to endorse or promote products derived from
12158// this software without specific prior written permission.
12159//
12160// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12161// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
12162// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12163// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
12164// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
12165// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
12166// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12167// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12168// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12169// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
12170// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 12171
7c673cae
FG
12172
12173// Type and function utilities for implementing parameterized tests.
12174// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
12175//
12176// Currently Google Test supports at most 50 arguments in Values,
12177// and at most 10 arguments in Combine. Please contact
12178// googletestframework@googlegroups.com if you need more.
12179// Please note that the number of arguments to Combine is limited
12180// by the maximum arity of the implementation of tuple which is
12181// currently set at 10.
12182
f67539c2
TL
12183// GOOGLETEST_CM0001 DO NOT DELETE
12184
7c673cae
FG
12185#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
12186#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
12187
7c673cae
FG
12188
12189namespace testing {
12190
12191// Forward declarations of ValuesIn(), which is implemented in
12192// include/gtest/gtest-param-test.h.
12193template <typename ForwardIterator>
12194internal::ParamGenerator<
12195 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
12196ValuesIn(ForwardIterator begin, ForwardIterator end);
12197
12198template <typename T, size_t N>
12199internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
12200
12201template <class Container>
12202internal::ParamGenerator<typename Container::value_type> ValuesIn(
12203 const Container& container);
12204
12205namespace internal {
12206
12207// Used in the Values() function to provide polymorphic capabilities.
12208template <typename T1>
12209class ValueArray1 {
12210 public:
12211 explicit ValueArray1(T1 v1) : v1_(v1) {}
12212
12213 template <typename T>
f67539c2
TL
12214 operator ParamGenerator<T>() const {
12215 const T array[] = {static_cast<T>(v1_)};
12216 return ValuesIn(array);
12217 }
12218
12219 ValueArray1(const ValueArray1& other) : v1_(other.v1_) {}
7c673cae
FG
12220
12221 private:
12222 // No implementation - assignment is unsupported.
12223 void operator=(const ValueArray1& other);
12224
12225 const T1 v1_;
12226};
12227
12228template <typename T1, typename T2>
12229class ValueArray2 {
12230 public:
12231 ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
12232
12233 template <typename T>
12234 operator ParamGenerator<T>() const {
12235 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
12236 return ValuesIn(array);
12237 }
12238
f67539c2
TL
12239 ValueArray2(const ValueArray2& other) : v1_(other.v1_), v2_(other.v2_) {}
12240
7c673cae
FG
12241 private:
12242 // No implementation - assignment is unsupported.
12243 void operator=(const ValueArray2& other);
12244
12245 const T1 v1_;
12246 const T2 v2_;
12247};
12248
12249template <typename T1, typename T2, typename T3>
12250class ValueArray3 {
12251 public:
12252 ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
12253
12254 template <typename T>
12255 operator ParamGenerator<T>() const {
12256 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12257 static_cast<T>(v3_)};
12258 return ValuesIn(array);
12259 }
12260
f67539c2
TL
12261 ValueArray3(const ValueArray3& other) : v1_(other.v1_), v2_(other.v2_),
12262 v3_(other.v3_) {}
12263
7c673cae
FG
12264 private:
12265 // No implementation - assignment is unsupported.
12266 void operator=(const ValueArray3& other);
12267
12268 const T1 v1_;
12269 const T2 v2_;
12270 const T3 v3_;
12271};
12272
12273template <typename T1, typename T2, typename T3, typename T4>
12274class ValueArray4 {
12275 public:
12276 ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
12277 v4_(v4) {}
12278
12279 template <typename T>
12280 operator ParamGenerator<T>() const {
12281 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12282 static_cast<T>(v3_), static_cast<T>(v4_)};
12283 return ValuesIn(array);
12284 }
12285
f67539c2
TL
12286 ValueArray4(const ValueArray4& other) : v1_(other.v1_), v2_(other.v2_),
12287 v3_(other.v3_), v4_(other.v4_) {}
12288
7c673cae
FG
12289 private:
12290 // No implementation - assignment is unsupported.
12291 void operator=(const ValueArray4& other);
12292
12293 const T1 v1_;
12294 const T2 v2_;
12295 const T3 v3_;
12296 const T4 v4_;
12297};
12298
12299template <typename T1, typename T2, typename T3, typename T4, typename T5>
12300class ValueArray5 {
12301 public:
12302 ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
12303 v4_(v4), v5_(v5) {}
12304
12305 template <typename T>
12306 operator ParamGenerator<T>() const {
12307 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12308 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
12309 return ValuesIn(array);
12310 }
12311
f67539c2
TL
12312 ValueArray5(const ValueArray5& other) : v1_(other.v1_), v2_(other.v2_),
12313 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_) {}
12314
7c673cae
FG
12315 private:
12316 // No implementation - assignment is unsupported.
12317 void operator=(const ValueArray5& other);
12318
12319 const T1 v1_;
12320 const T2 v2_;
12321 const T3 v3_;
12322 const T4 v4_;
12323 const T5 v5_;
12324};
12325
12326template <typename T1, typename T2, typename T3, typename T4, typename T5,
12327 typename T6>
12328class ValueArray6 {
12329 public:
12330 ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
12331 v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
12332
12333 template <typename T>
12334 operator ParamGenerator<T>() const {
12335 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12336 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12337 static_cast<T>(v6_)};
12338 return ValuesIn(array);
12339 }
12340
f67539c2
TL
12341 ValueArray6(const ValueArray6& other) : v1_(other.v1_), v2_(other.v2_),
12342 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_) {}
12343
7c673cae
FG
12344 private:
12345 // No implementation - assignment is unsupported.
12346 void operator=(const ValueArray6& other);
12347
12348 const T1 v1_;
12349 const T2 v2_;
12350 const T3 v3_;
12351 const T4 v4_;
12352 const T5 v5_;
12353 const T6 v6_;
12354};
12355
12356template <typename T1, typename T2, typename T3, typename T4, typename T5,
12357 typename T6, typename T7>
12358class ValueArray7 {
12359 public:
12360 ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
12361 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
12362
12363 template <typename T>
12364 operator ParamGenerator<T>() const {
12365 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12366 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12367 static_cast<T>(v6_), static_cast<T>(v7_)};
12368 return ValuesIn(array);
12369 }
12370
f67539c2
TL
12371 ValueArray7(const ValueArray7& other) : v1_(other.v1_), v2_(other.v2_),
12372 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12373 v7_(other.v7_) {}
12374
7c673cae
FG
12375 private:
12376 // No implementation - assignment is unsupported.
12377 void operator=(const ValueArray7& other);
12378
12379 const T1 v1_;
12380 const T2 v2_;
12381 const T3 v3_;
12382 const T4 v4_;
12383 const T5 v5_;
12384 const T6 v6_;
12385 const T7 v7_;
12386};
12387
12388template <typename T1, typename T2, typename T3, typename T4, typename T5,
12389 typename T6, typename T7, typename T8>
12390class ValueArray8 {
12391 public:
12392 ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
12393 T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12394 v8_(v8) {}
12395
12396 template <typename T>
12397 operator ParamGenerator<T>() const {
12398 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12399 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12400 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
12401 return ValuesIn(array);
12402 }
12403
f67539c2
TL
12404 ValueArray8(const ValueArray8& other) : v1_(other.v1_), v2_(other.v2_),
12405 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12406 v7_(other.v7_), v8_(other.v8_) {}
12407
7c673cae
FG
12408 private:
12409 // No implementation - assignment is unsupported.
12410 void operator=(const ValueArray8& other);
12411
12412 const T1 v1_;
12413 const T2 v2_;
12414 const T3 v3_;
12415 const T4 v4_;
12416 const T5 v5_;
12417 const T6 v6_;
12418 const T7 v7_;
12419 const T8 v8_;
12420};
12421
12422template <typename T1, typename T2, typename T3, typename T4, typename T5,
12423 typename T6, typename T7, typename T8, typename T9>
12424class ValueArray9 {
12425 public:
12426 ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
12427 T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12428 v8_(v8), v9_(v9) {}
12429
12430 template <typename T>
12431 operator ParamGenerator<T>() const {
12432 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12433 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12434 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12435 static_cast<T>(v9_)};
12436 return ValuesIn(array);
12437 }
12438
f67539c2
TL
12439 ValueArray9(const ValueArray9& other) : v1_(other.v1_), v2_(other.v2_),
12440 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12441 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_) {}
12442
7c673cae
FG
12443 private:
12444 // No implementation - assignment is unsupported.
12445 void operator=(const ValueArray9& other);
12446
12447 const T1 v1_;
12448 const T2 v2_;
12449 const T3 v3_;
12450 const T4 v4_;
12451 const T5 v5_;
12452 const T6 v6_;
12453 const T7 v7_;
12454 const T8 v8_;
12455 const T9 v9_;
12456};
12457
12458template <typename T1, typename T2, typename T3, typename T4, typename T5,
12459 typename T6, typename T7, typename T8, typename T9, typename T10>
12460class ValueArray10 {
12461 public:
12462 ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12463 T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12464 v8_(v8), v9_(v9), v10_(v10) {}
12465
12466 template <typename T>
12467 operator ParamGenerator<T>() const {
12468 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12469 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12470 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12471 static_cast<T>(v9_), static_cast<T>(v10_)};
12472 return ValuesIn(array);
12473 }
12474
f67539c2
TL
12475 ValueArray10(const ValueArray10& other) : v1_(other.v1_), v2_(other.v2_),
12476 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12477 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_) {}
12478
7c673cae
FG
12479 private:
12480 // No implementation - assignment is unsupported.
12481 void operator=(const ValueArray10& other);
12482
12483 const T1 v1_;
12484 const T2 v2_;
12485 const T3 v3_;
12486 const T4 v4_;
12487 const T5 v5_;
12488 const T6 v6_;
12489 const T7 v7_;
12490 const T8 v8_;
12491 const T9 v9_;
12492 const T10 v10_;
12493};
12494
12495template <typename T1, typename T2, typename T3, typename T4, typename T5,
12496 typename T6, typename T7, typename T8, typename T9, typename T10,
12497 typename T11>
12498class ValueArray11 {
12499 public:
12500 ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12501 T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12502 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
12503
12504 template <typename T>
12505 operator ParamGenerator<T>() const {
12506 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12507 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12508 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12509 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
12510 return ValuesIn(array);
12511 }
12512
f67539c2
TL
12513 ValueArray11(const ValueArray11& other) : v1_(other.v1_), v2_(other.v2_),
12514 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12515 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12516 v11_(other.v11_) {}
12517
7c673cae
FG
12518 private:
12519 // No implementation - assignment is unsupported.
12520 void operator=(const ValueArray11& other);
12521
12522 const T1 v1_;
12523 const T2 v2_;
12524 const T3 v3_;
12525 const T4 v4_;
12526 const T5 v5_;
12527 const T6 v6_;
12528 const T7 v7_;
12529 const T8 v8_;
12530 const T9 v9_;
12531 const T10 v10_;
12532 const T11 v11_;
12533};
12534
12535template <typename T1, typename T2, typename T3, typename T4, typename T5,
12536 typename T6, typename T7, typename T8, typename T9, typename T10,
12537 typename T11, typename T12>
12538class ValueArray12 {
12539 public:
12540 ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12541 T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12542 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
12543
12544 template <typename T>
12545 operator ParamGenerator<T>() const {
12546 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12547 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12548 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12549 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12550 static_cast<T>(v12_)};
12551 return ValuesIn(array);
12552 }
12553
f67539c2
TL
12554 ValueArray12(const ValueArray12& other) : v1_(other.v1_), v2_(other.v2_),
12555 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12556 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12557 v11_(other.v11_), v12_(other.v12_) {}
12558
7c673cae
FG
12559 private:
12560 // No implementation - assignment is unsupported.
12561 void operator=(const ValueArray12& other);
12562
12563 const T1 v1_;
12564 const T2 v2_;
12565 const T3 v3_;
12566 const T4 v4_;
12567 const T5 v5_;
12568 const T6 v6_;
12569 const T7 v7_;
12570 const T8 v8_;
12571 const T9 v9_;
12572 const T10 v10_;
12573 const T11 v11_;
12574 const T12 v12_;
12575};
12576
12577template <typename T1, typename T2, typename T3, typename T4, typename T5,
12578 typename T6, typename T7, typename T8, typename T9, typename T10,
12579 typename T11, typename T12, typename T13>
12580class ValueArray13 {
12581 public:
12582 ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12583 T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12584 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12585 v12_(v12), v13_(v13) {}
12586
12587 template <typename T>
12588 operator ParamGenerator<T>() const {
12589 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12590 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12591 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12592 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12593 static_cast<T>(v12_), static_cast<T>(v13_)};
12594 return ValuesIn(array);
12595 }
12596
f67539c2
TL
12597 ValueArray13(const ValueArray13& other) : v1_(other.v1_), v2_(other.v2_),
12598 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12599 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12600 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_) {}
12601
7c673cae
FG
12602 private:
12603 // No implementation - assignment is unsupported.
12604 void operator=(const ValueArray13& other);
12605
12606 const T1 v1_;
12607 const T2 v2_;
12608 const T3 v3_;
12609 const T4 v4_;
12610 const T5 v5_;
12611 const T6 v6_;
12612 const T7 v7_;
12613 const T8 v8_;
12614 const T9 v9_;
12615 const T10 v10_;
12616 const T11 v11_;
12617 const T12 v12_;
12618 const T13 v13_;
12619};
12620
12621template <typename T1, typename T2, typename T3, typename T4, typename T5,
12622 typename T6, typename T7, typename T8, typename T9, typename T10,
12623 typename T11, typename T12, typename T13, typename T14>
12624class ValueArray14 {
12625 public:
12626 ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12627 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
12628 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12629 v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
12630
12631 template <typename T>
12632 operator ParamGenerator<T>() const {
12633 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12634 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12635 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12636 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12637 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
12638 return ValuesIn(array);
12639 }
12640
f67539c2
TL
12641 ValueArray14(const ValueArray14& other) : v1_(other.v1_), v2_(other.v2_),
12642 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12643 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12644 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_) {}
12645
7c673cae
FG
12646 private:
12647 // No implementation - assignment is unsupported.
12648 void operator=(const ValueArray14& other);
12649
12650 const T1 v1_;
12651 const T2 v2_;
12652 const T3 v3_;
12653 const T4 v4_;
12654 const T5 v5_;
12655 const T6 v6_;
12656 const T7 v7_;
12657 const T8 v8_;
12658 const T9 v9_;
12659 const T10 v10_;
12660 const T11 v11_;
12661 const T12 v12_;
12662 const T13 v13_;
12663 const T14 v14_;
12664};
12665
12666template <typename T1, typename T2, typename T3, typename T4, typename T5,
12667 typename T6, typename T7, typename T8, typename T9, typename T10,
12668 typename T11, typename T12, typename T13, typename T14, typename T15>
12669class ValueArray15 {
12670 public:
12671 ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12672 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
12673 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12674 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
12675
12676 template <typename T>
12677 operator ParamGenerator<T>() const {
12678 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12679 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12680 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12681 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12682 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12683 static_cast<T>(v15_)};
12684 return ValuesIn(array);
12685 }
12686
f67539c2
TL
12687 ValueArray15(const ValueArray15& other) : v1_(other.v1_), v2_(other.v2_),
12688 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12689 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12690 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12691 v15_(other.v15_) {}
12692
7c673cae
FG
12693 private:
12694 // No implementation - assignment is unsupported.
12695 void operator=(const ValueArray15& other);
12696
12697 const T1 v1_;
12698 const T2 v2_;
12699 const T3 v3_;
12700 const T4 v4_;
12701 const T5 v5_;
12702 const T6 v6_;
12703 const T7 v7_;
12704 const T8 v8_;
12705 const T9 v9_;
12706 const T10 v10_;
12707 const T11 v11_;
12708 const T12 v12_;
12709 const T13 v13_;
12710 const T14 v14_;
12711 const T15 v15_;
12712};
12713
12714template <typename T1, typename T2, typename T3, typename T4, typename T5,
12715 typename T6, typename T7, typename T8, typename T9, typename T10,
12716 typename T11, typename T12, typename T13, typename T14, typename T15,
12717 typename T16>
12718class ValueArray16 {
12719 public:
12720 ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12721 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
12722 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12723 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12724 v16_(v16) {}
12725
12726 template <typename T>
12727 operator ParamGenerator<T>() const {
12728 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12729 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12730 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12731 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12732 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12733 static_cast<T>(v15_), static_cast<T>(v16_)};
12734 return ValuesIn(array);
12735 }
12736
f67539c2
TL
12737 ValueArray16(const ValueArray16& other) : v1_(other.v1_), v2_(other.v2_),
12738 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12739 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12740 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12741 v15_(other.v15_), v16_(other.v16_) {}
12742
7c673cae
FG
12743 private:
12744 // No implementation - assignment is unsupported.
12745 void operator=(const ValueArray16& other);
12746
12747 const T1 v1_;
12748 const T2 v2_;
12749 const T3 v3_;
12750 const T4 v4_;
12751 const T5 v5_;
12752 const T6 v6_;
12753 const T7 v7_;
12754 const T8 v8_;
12755 const T9 v9_;
12756 const T10 v10_;
12757 const T11 v11_;
12758 const T12 v12_;
12759 const T13 v13_;
12760 const T14 v14_;
12761 const T15 v15_;
12762 const T16 v16_;
12763};
12764
12765template <typename T1, typename T2, typename T3, typename T4, typename T5,
12766 typename T6, typename T7, typename T8, typename T9, typename T10,
12767 typename T11, typename T12, typename T13, typename T14, typename T15,
12768 typename T16, typename T17>
12769class ValueArray17 {
12770 public:
12771 ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12772 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
12773 T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12774 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12775 v15_(v15), v16_(v16), v17_(v17) {}
12776
12777 template <typename T>
12778 operator ParamGenerator<T>() const {
12779 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12780 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12781 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12782 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12783 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12784 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
12785 return ValuesIn(array);
12786 }
12787
f67539c2
TL
12788 ValueArray17(const ValueArray17& other) : v1_(other.v1_), v2_(other.v2_),
12789 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12790 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12791 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12792 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_) {}
12793
7c673cae
FG
12794 private:
12795 // No implementation - assignment is unsupported.
12796 void operator=(const ValueArray17& other);
12797
12798 const T1 v1_;
12799 const T2 v2_;
12800 const T3 v3_;
12801 const T4 v4_;
12802 const T5 v5_;
12803 const T6 v6_;
12804 const T7 v7_;
12805 const T8 v8_;
12806 const T9 v9_;
12807 const T10 v10_;
12808 const T11 v11_;
12809 const T12 v12_;
12810 const T13 v13_;
12811 const T14 v14_;
12812 const T15 v15_;
12813 const T16 v16_;
12814 const T17 v17_;
12815};
12816
12817template <typename T1, typename T2, typename T3, typename T4, typename T5,
12818 typename T6, typename T7, typename T8, typename T9, typename T10,
12819 typename T11, typename T12, typename T13, typename T14, typename T15,
12820 typename T16, typename T17, typename T18>
12821class ValueArray18 {
12822 public:
12823 ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12824 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12825 T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12826 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12827 v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
12828
12829 template <typename T>
12830 operator ParamGenerator<T>() const {
12831 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12832 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12833 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12834 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12835 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12836 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12837 static_cast<T>(v18_)};
12838 return ValuesIn(array);
12839 }
12840
f67539c2
TL
12841 ValueArray18(const ValueArray18& other) : v1_(other.v1_), v2_(other.v2_),
12842 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12843 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12844 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12845 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_) {}
12846
7c673cae
FG
12847 private:
12848 // No implementation - assignment is unsupported.
12849 void operator=(const ValueArray18& other);
12850
12851 const T1 v1_;
12852 const T2 v2_;
12853 const T3 v3_;
12854 const T4 v4_;
12855 const T5 v5_;
12856 const T6 v6_;
12857 const T7 v7_;
12858 const T8 v8_;
12859 const T9 v9_;
12860 const T10 v10_;
12861 const T11 v11_;
12862 const T12 v12_;
12863 const T13 v13_;
12864 const T14 v14_;
12865 const T15 v15_;
12866 const T16 v16_;
12867 const T17 v17_;
12868 const T18 v18_;
12869};
12870
12871template <typename T1, typename T2, typename T3, typename T4, typename T5,
12872 typename T6, typename T7, typename T8, typename T9, typename T10,
12873 typename T11, typename T12, typename T13, typename T14, typename T15,
12874 typename T16, typename T17, typename T18, typename T19>
12875class ValueArray19 {
12876 public:
12877 ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12878 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12879 T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12880 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12881 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
12882
12883 template <typename T>
12884 operator ParamGenerator<T>() const {
12885 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12886 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12887 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12888 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12889 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12890 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12891 static_cast<T>(v18_), static_cast<T>(v19_)};
12892 return ValuesIn(array);
12893 }
12894
f67539c2
TL
12895 ValueArray19(const ValueArray19& other) : v1_(other.v1_), v2_(other.v2_),
12896 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12897 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12898 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12899 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
12900 v19_(other.v19_) {}
12901
7c673cae
FG
12902 private:
12903 // No implementation - assignment is unsupported.
12904 void operator=(const ValueArray19& other);
12905
12906 const T1 v1_;
12907 const T2 v2_;
12908 const T3 v3_;
12909 const T4 v4_;
12910 const T5 v5_;
12911 const T6 v6_;
12912 const T7 v7_;
12913 const T8 v8_;
12914 const T9 v9_;
12915 const T10 v10_;
12916 const T11 v11_;
12917 const T12 v12_;
12918 const T13 v13_;
12919 const T14 v14_;
12920 const T15 v15_;
12921 const T16 v16_;
12922 const T17 v17_;
12923 const T18 v18_;
12924 const T19 v19_;
12925};
12926
12927template <typename T1, typename T2, typename T3, typename T4, typename T5,
12928 typename T6, typename T7, typename T8, typename T9, typename T10,
12929 typename T11, typename T12, typename T13, typename T14, typename T15,
12930 typename T16, typename T17, typename T18, typename T19, typename T20>
12931class ValueArray20 {
12932 public:
12933 ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12934 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12935 T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12936 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12937 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12938 v19_(v19), v20_(v20) {}
12939
12940 template <typename T>
12941 operator ParamGenerator<T>() const {
12942 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12943 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12944 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12945 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12946 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12947 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12948 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
12949 return ValuesIn(array);
12950 }
12951
f67539c2
TL
12952 ValueArray20(const ValueArray20& other) : v1_(other.v1_), v2_(other.v2_),
12953 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12954 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12955 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12956 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
12957 v19_(other.v19_), v20_(other.v20_) {}
12958
7c673cae
FG
12959 private:
12960 // No implementation - assignment is unsupported.
12961 void operator=(const ValueArray20& other);
12962
12963 const T1 v1_;
12964 const T2 v2_;
12965 const T3 v3_;
12966 const T4 v4_;
12967 const T5 v5_;
12968 const T6 v6_;
12969 const T7 v7_;
12970 const T8 v8_;
12971 const T9 v9_;
12972 const T10 v10_;
12973 const T11 v11_;
12974 const T12 v12_;
12975 const T13 v13_;
12976 const T14 v14_;
12977 const T15 v15_;
12978 const T16 v16_;
12979 const T17 v17_;
12980 const T18 v18_;
12981 const T19 v19_;
12982 const T20 v20_;
12983};
12984
12985template <typename T1, typename T2, typename T3, typename T4, typename T5,
12986 typename T6, typename T7, typename T8, typename T9, typename T10,
12987 typename T11, typename T12, typename T13, typename T14, typename T15,
12988 typename T16, typename T17, typename T18, typename T19, typename T20,
12989 typename T21>
12990class ValueArray21 {
12991 public:
12992 ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12993 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12994 T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12995 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12996 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12997 v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
12998
12999 template <typename T>
13000 operator ParamGenerator<T>() const {
13001 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13002 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13003 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13004 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13005 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13006 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13007 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13008 static_cast<T>(v21_)};
13009 return ValuesIn(array);
13010 }
13011
f67539c2
TL
13012 ValueArray21(const ValueArray21& other) : v1_(other.v1_), v2_(other.v2_),
13013 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13014 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13015 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13016 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13017 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_) {}
13018
7c673cae
FG
13019 private:
13020 // No implementation - assignment is unsupported.
13021 void operator=(const ValueArray21& other);
13022
13023 const T1 v1_;
13024 const T2 v2_;
13025 const T3 v3_;
13026 const T4 v4_;
13027 const T5 v5_;
13028 const T6 v6_;
13029 const T7 v7_;
13030 const T8 v8_;
13031 const T9 v9_;
13032 const T10 v10_;
13033 const T11 v11_;
13034 const T12 v12_;
13035 const T13 v13_;
13036 const T14 v14_;
13037 const T15 v15_;
13038 const T16 v16_;
13039 const T17 v17_;
13040 const T18 v18_;
13041 const T19 v19_;
13042 const T20 v20_;
13043 const T21 v21_;
13044};
13045
13046template <typename T1, typename T2, typename T3, typename T4, typename T5,
13047 typename T6, typename T7, typename T8, typename T9, typename T10,
13048 typename T11, typename T12, typename T13, typename T14, typename T15,
13049 typename T16, typename T17, typename T18, typename T19, typename T20,
13050 typename T21, typename T22>
13051class ValueArray22 {
13052 public:
13053 ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13054 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13055 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
13056 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13057 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13058 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
13059
13060 template <typename T>
13061 operator ParamGenerator<T>() const {
13062 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13063 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13064 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13065 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13066 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13067 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13068 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13069 static_cast<T>(v21_), static_cast<T>(v22_)};
13070 return ValuesIn(array);
13071 }
13072
f67539c2
TL
13073 ValueArray22(const ValueArray22& other) : v1_(other.v1_), v2_(other.v2_),
13074 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13075 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13076 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13077 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13078 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_) {}
13079
7c673cae
FG
13080 private:
13081 // No implementation - assignment is unsupported.
13082 void operator=(const ValueArray22& other);
13083
13084 const T1 v1_;
13085 const T2 v2_;
13086 const T3 v3_;
13087 const T4 v4_;
13088 const T5 v5_;
13089 const T6 v6_;
13090 const T7 v7_;
13091 const T8 v8_;
13092 const T9 v9_;
13093 const T10 v10_;
13094 const T11 v11_;
13095 const T12 v12_;
13096 const T13 v13_;
13097 const T14 v14_;
13098 const T15 v15_;
13099 const T16 v16_;
13100 const T17 v17_;
13101 const T18 v18_;
13102 const T19 v19_;
13103 const T20 v20_;
13104 const T21 v21_;
13105 const T22 v22_;
13106};
13107
13108template <typename T1, typename T2, typename T3, typename T4, typename T5,
13109 typename T6, typename T7, typename T8, typename T9, typename T10,
13110 typename T11, typename T12, typename T13, typename T14, typename T15,
13111 typename T16, typename T17, typename T18, typename T19, typename T20,
13112 typename T21, typename T22, typename T23>
13113class ValueArray23 {
13114 public:
13115 ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13116 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13117 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
13118 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13119 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13120 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13121 v23_(v23) {}
13122
13123 template <typename T>
13124 operator ParamGenerator<T>() const {
13125 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13126 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13127 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13128 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13129 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13130 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13131 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13132 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
13133 return ValuesIn(array);
13134 }
13135
f67539c2
TL
13136 ValueArray23(const ValueArray23& other) : v1_(other.v1_), v2_(other.v2_),
13137 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13138 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13139 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13140 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13141 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13142 v23_(other.v23_) {}
13143
7c673cae
FG
13144 private:
13145 // No implementation - assignment is unsupported.
13146 void operator=(const ValueArray23& other);
13147
13148 const T1 v1_;
13149 const T2 v2_;
13150 const T3 v3_;
13151 const T4 v4_;
13152 const T5 v5_;
13153 const T6 v6_;
13154 const T7 v7_;
13155 const T8 v8_;
13156 const T9 v9_;
13157 const T10 v10_;
13158 const T11 v11_;
13159 const T12 v12_;
13160 const T13 v13_;
13161 const T14 v14_;
13162 const T15 v15_;
13163 const T16 v16_;
13164 const T17 v17_;
13165 const T18 v18_;
13166 const T19 v19_;
13167 const T20 v20_;
13168 const T21 v21_;
13169 const T22 v22_;
13170 const T23 v23_;
13171};
13172
13173template <typename T1, typename T2, typename T3, typename T4, typename T5,
13174 typename T6, typename T7, typename T8, typename T9, typename T10,
13175 typename T11, typename T12, typename T13, typename T14, typename T15,
13176 typename T16, typename T17, typename T18, typename T19, typename T20,
13177 typename T21, typename T22, typename T23, typename T24>
13178class ValueArray24 {
13179 public:
13180 ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13181 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13182 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
13183 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13184 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13185 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13186 v22_(v22), v23_(v23), v24_(v24) {}
13187
13188 template <typename T>
13189 operator ParamGenerator<T>() const {
13190 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13191 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13192 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13193 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13194 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13195 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13196 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13197 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13198 static_cast<T>(v24_)};
13199 return ValuesIn(array);
13200 }
13201
f67539c2
TL
13202 ValueArray24(const ValueArray24& other) : v1_(other.v1_), v2_(other.v2_),
13203 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13204 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13205 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13206 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13207 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13208 v23_(other.v23_), v24_(other.v24_) {}
13209
7c673cae
FG
13210 private:
13211 // No implementation - assignment is unsupported.
13212 void operator=(const ValueArray24& other);
13213
13214 const T1 v1_;
13215 const T2 v2_;
13216 const T3 v3_;
13217 const T4 v4_;
13218 const T5 v5_;
13219 const T6 v6_;
13220 const T7 v7_;
13221 const T8 v8_;
13222 const T9 v9_;
13223 const T10 v10_;
13224 const T11 v11_;
13225 const T12 v12_;
13226 const T13 v13_;
13227 const T14 v14_;
13228 const T15 v15_;
13229 const T16 v16_;
13230 const T17 v17_;
13231 const T18 v18_;
13232 const T19 v19_;
13233 const T20 v20_;
13234 const T21 v21_;
13235 const T22 v22_;
13236 const T23 v23_;
13237 const T24 v24_;
13238};
13239
13240template <typename T1, typename T2, typename T3, typename T4, typename T5,
13241 typename T6, typename T7, typename T8, typename T9, typename T10,
13242 typename T11, typename T12, typename T13, typename T14, typename T15,
13243 typename T16, typename T17, typename T18, typename T19, typename T20,
13244 typename T21, typename T22, typename T23, typename T24, typename T25>
13245class ValueArray25 {
13246 public:
13247 ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13248 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13249 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
13250 T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13251 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13252 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13253 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
13254
13255 template <typename T>
13256 operator ParamGenerator<T>() const {
13257 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13258 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13259 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13260 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13261 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13262 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13263 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13264 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13265 static_cast<T>(v24_), static_cast<T>(v25_)};
13266 return ValuesIn(array);
13267 }
13268
f67539c2
TL
13269 ValueArray25(const ValueArray25& other) : v1_(other.v1_), v2_(other.v2_),
13270 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13271 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13272 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13273 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13274 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13275 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_) {}
13276
7c673cae
FG
13277 private:
13278 // No implementation - assignment is unsupported.
13279 void operator=(const ValueArray25& other);
13280
13281 const T1 v1_;
13282 const T2 v2_;
13283 const T3 v3_;
13284 const T4 v4_;
13285 const T5 v5_;
13286 const T6 v6_;
13287 const T7 v7_;
13288 const T8 v8_;
13289 const T9 v9_;
13290 const T10 v10_;
13291 const T11 v11_;
13292 const T12 v12_;
13293 const T13 v13_;
13294 const T14 v14_;
13295 const T15 v15_;
13296 const T16 v16_;
13297 const T17 v17_;
13298 const T18 v18_;
13299 const T19 v19_;
13300 const T20 v20_;
13301 const T21 v21_;
13302 const T22 v22_;
13303 const T23 v23_;
13304 const T24 v24_;
13305 const T25 v25_;
13306};
13307
13308template <typename T1, typename T2, typename T3, typename T4, typename T5,
13309 typename T6, typename T7, typename T8, typename T9, typename T10,
13310 typename T11, typename T12, typename T13, typename T14, typename T15,
13311 typename T16, typename T17, typename T18, typename T19, typename T20,
13312 typename T21, typename T22, typename T23, typename T24, typename T25,
13313 typename T26>
13314class ValueArray26 {
13315 public:
13316 ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13317 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13318 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13319 T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13320 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13321 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13322 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
13323
13324 template <typename T>
13325 operator ParamGenerator<T>() const {
13326 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13327 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13328 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13329 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13330 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13331 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13332 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13333 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13334 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
13335 return ValuesIn(array);
13336 }
13337
f67539c2
TL
13338 ValueArray26(const ValueArray26& other) : v1_(other.v1_), v2_(other.v2_),
13339 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13340 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13341 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13342 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13343 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13344 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_) {}
13345
7c673cae
FG
13346 private:
13347 // No implementation - assignment is unsupported.
13348 void operator=(const ValueArray26& other);
13349
13350 const T1 v1_;
13351 const T2 v2_;
13352 const T3 v3_;
13353 const T4 v4_;
13354 const T5 v5_;
13355 const T6 v6_;
13356 const T7 v7_;
13357 const T8 v8_;
13358 const T9 v9_;
13359 const T10 v10_;
13360 const T11 v11_;
13361 const T12 v12_;
13362 const T13 v13_;
13363 const T14 v14_;
13364 const T15 v15_;
13365 const T16 v16_;
13366 const T17 v17_;
13367 const T18 v18_;
13368 const T19 v19_;
13369 const T20 v20_;
13370 const T21 v21_;
13371 const T22 v22_;
13372 const T23 v23_;
13373 const T24 v24_;
13374 const T25 v25_;
13375 const T26 v26_;
13376};
13377
13378template <typename T1, typename T2, typename T3, typename T4, typename T5,
13379 typename T6, typename T7, typename T8, typename T9, typename T10,
13380 typename T11, typename T12, typename T13, typename T14, typename T15,
13381 typename T16, typename T17, typename T18, typename T19, typename T20,
13382 typename T21, typename T22, typename T23, typename T24, typename T25,
13383 typename T26, typename T27>
13384class ValueArray27 {
13385 public:
13386 ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13387 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13388 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13389 T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13390 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13391 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13392 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13393 v26_(v26), v27_(v27) {}
13394
13395 template <typename T>
13396 operator ParamGenerator<T>() const {
13397 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13398 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13399 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13400 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13401 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13402 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13403 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13404 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13405 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13406 static_cast<T>(v27_)};
13407 return ValuesIn(array);
13408 }
13409
f67539c2
TL
13410 ValueArray27(const ValueArray27& other) : v1_(other.v1_), v2_(other.v2_),
13411 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13412 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13413 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13414 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13415 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13416 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13417 v27_(other.v27_) {}
13418
7c673cae
FG
13419 private:
13420 // No implementation - assignment is unsupported.
13421 void operator=(const ValueArray27& other);
13422
13423 const T1 v1_;
13424 const T2 v2_;
13425 const T3 v3_;
13426 const T4 v4_;
13427 const T5 v5_;
13428 const T6 v6_;
13429 const T7 v7_;
13430 const T8 v8_;
13431 const T9 v9_;
13432 const T10 v10_;
13433 const T11 v11_;
13434 const T12 v12_;
13435 const T13 v13_;
13436 const T14 v14_;
13437 const T15 v15_;
13438 const T16 v16_;
13439 const T17 v17_;
13440 const T18 v18_;
13441 const T19 v19_;
13442 const T20 v20_;
13443 const T21 v21_;
13444 const T22 v22_;
13445 const T23 v23_;
13446 const T24 v24_;
13447 const T25 v25_;
13448 const T26 v26_;
13449 const T27 v27_;
13450};
13451
13452template <typename T1, typename T2, typename T3, typename T4, typename T5,
13453 typename T6, typename T7, typename T8, typename T9, typename T10,
13454 typename T11, typename T12, typename T13, typename T14, typename T15,
13455 typename T16, typename T17, typename T18, typename T19, typename T20,
13456 typename T21, typename T22, typename T23, typename T24, typename T25,
13457 typename T26, typename T27, typename T28>
13458class ValueArray28 {
13459 public:
13460 ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13461 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13462 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13463 T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13464 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13465 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13466 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13467 v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
13468
13469 template <typename T>
13470 operator ParamGenerator<T>() const {
13471 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13472 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13473 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13474 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13475 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13476 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13477 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13478 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13479 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13480 static_cast<T>(v27_), static_cast<T>(v28_)};
13481 return ValuesIn(array);
13482 }
13483
f67539c2
TL
13484 ValueArray28(const ValueArray28& other) : v1_(other.v1_), v2_(other.v2_),
13485 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13486 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13487 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13488 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13489 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13490 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13491 v27_(other.v27_), v28_(other.v28_) {}
13492
7c673cae
FG
13493 private:
13494 // No implementation - assignment is unsupported.
13495 void operator=(const ValueArray28& other);
13496
13497 const T1 v1_;
13498 const T2 v2_;
13499 const T3 v3_;
13500 const T4 v4_;
13501 const T5 v5_;
13502 const T6 v6_;
13503 const T7 v7_;
13504 const T8 v8_;
13505 const T9 v9_;
13506 const T10 v10_;
13507 const T11 v11_;
13508 const T12 v12_;
13509 const T13 v13_;
13510 const T14 v14_;
13511 const T15 v15_;
13512 const T16 v16_;
13513 const T17 v17_;
13514 const T18 v18_;
13515 const T19 v19_;
13516 const T20 v20_;
13517 const T21 v21_;
13518 const T22 v22_;
13519 const T23 v23_;
13520 const T24 v24_;
13521 const T25 v25_;
13522 const T26 v26_;
13523 const T27 v27_;
13524 const T28 v28_;
13525};
13526
13527template <typename T1, typename T2, typename T3, typename T4, typename T5,
13528 typename T6, typename T7, typename T8, typename T9, typename T10,
13529 typename T11, typename T12, typename T13, typename T14, typename T15,
13530 typename T16, typename T17, typename T18, typename T19, typename T20,
13531 typename T21, typename T22, typename T23, typename T24, typename T25,
13532 typename T26, typename T27, typename T28, typename T29>
13533class ValueArray29 {
13534 public:
13535 ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13536 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13537 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13538 T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13539 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13540 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13541 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13542 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
13543
13544 template <typename T>
13545 operator ParamGenerator<T>() const {
13546 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13547 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13548 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13549 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13550 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13551 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13552 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13553 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13554 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13555 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
13556 return ValuesIn(array);
13557 }
13558
f67539c2
TL
13559 ValueArray29(const ValueArray29& other) : v1_(other.v1_), v2_(other.v2_),
13560 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13561 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13562 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13563 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13564 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13565 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13566 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_) {}
13567
7c673cae
FG
13568 private:
13569 // No implementation - assignment is unsupported.
13570 void operator=(const ValueArray29& other);
13571
13572 const T1 v1_;
13573 const T2 v2_;
13574 const T3 v3_;
13575 const T4 v4_;
13576 const T5 v5_;
13577 const T6 v6_;
13578 const T7 v7_;
13579 const T8 v8_;
13580 const T9 v9_;
13581 const T10 v10_;
13582 const T11 v11_;
13583 const T12 v12_;
13584 const T13 v13_;
13585 const T14 v14_;
13586 const T15 v15_;
13587 const T16 v16_;
13588 const T17 v17_;
13589 const T18 v18_;
13590 const T19 v19_;
13591 const T20 v20_;
13592 const T21 v21_;
13593 const T22 v22_;
13594 const T23 v23_;
13595 const T24 v24_;
13596 const T25 v25_;
13597 const T26 v26_;
13598 const T27 v27_;
13599 const T28 v28_;
13600 const T29 v29_;
13601};
13602
13603template <typename T1, typename T2, typename T3, typename T4, typename T5,
13604 typename T6, typename T7, typename T8, typename T9, typename T10,
13605 typename T11, typename T12, typename T13, typename T14, typename T15,
13606 typename T16, typename T17, typename T18, typename T19, typename T20,
13607 typename T21, typename T22, typename T23, typename T24, typename T25,
13608 typename T26, typename T27, typename T28, typename T29, typename T30>
13609class ValueArray30 {
13610 public:
13611 ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13612 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13613 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13614 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
13615 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13616 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13617 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13618 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13619 v29_(v29), v30_(v30) {}
13620
13621 template <typename T>
13622 operator ParamGenerator<T>() const {
13623 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13624 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13625 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13626 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13627 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13628 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13629 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13630 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13631 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13632 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13633 static_cast<T>(v30_)};
13634 return ValuesIn(array);
13635 }
13636
f67539c2
TL
13637 ValueArray30(const ValueArray30& other) : v1_(other.v1_), v2_(other.v2_),
13638 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13639 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13640 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13641 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13642 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13643 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13644 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_) {}
13645
7c673cae
FG
13646 private:
13647 // No implementation - assignment is unsupported.
13648 void operator=(const ValueArray30& other);
13649
13650 const T1 v1_;
13651 const T2 v2_;
13652 const T3 v3_;
13653 const T4 v4_;
13654 const T5 v5_;
13655 const T6 v6_;
13656 const T7 v7_;
13657 const T8 v8_;
13658 const T9 v9_;
13659 const T10 v10_;
13660 const T11 v11_;
13661 const T12 v12_;
13662 const T13 v13_;
13663 const T14 v14_;
13664 const T15 v15_;
13665 const T16 v16_;
13666 const T17 v17_;
13667 const T18 v18_;
13668 const T19 v19_;
13669 const T20 v20_;
13670 const T21 v21_;
13671 const T22 v22_;
13672 const T23 v23_;
13673 const T24 v24_;
13674 const T25 v25_;
13675 const T26 v26_;
13676 const T27 v27_;
13677 const T28 v28_;
13678 const T29 v29_;
13679 const T30 v30_;
13680};
13681
13682template <typename T1, typename T2, typename T3, typename T4, typename T5,
13683 typename T6, typename T7, typename T8, typename T9, typename T10,
13684 typename T11, typename T12, typename T13, typename T14, typename T15,
13685 typename T16, typename T17, typename T18, typename T19, typename T20,
13686 typename T21, typename T22, typename T23, typename T24, typename T25,
13687 typename T26, typename T27, typename T28, typename T29, typename T30,
13688 typename T31>
13689class ValueArray31 {
13690 public:
13691 ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13692 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13693 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13694 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
13695 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13696 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13697 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13698 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13699 v29_(v29), v30_(v30), v31_(v31) {}
13700
13701 template <typename T>
13702 operator ParamGenerator<T>() const {
13703 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13704 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13705 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13706 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13707 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13708 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13709 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13710 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13711 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13712 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13713 static_cast<T>(v30_), static_cast<T>(v31_)};
13714 return ValuesIn(array);
13715 }
13716
f67539c2
TL
13717 ValueArray31(const ValueArray31& other) : v1_(other.v1_), v2_(other.v2_),
13718 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13719 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13720 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13721 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13722 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13723 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13724 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13725 v31_(other.v31_) {}
13726
7c673cae
FG
13727 private:
13728 // No implementation - assignment is unsupported.
13729 void operator=(const ValueArray31& other);
13730
13731 const T1 v1_;
13732 const T2 v2_;
13733 const T3 v3_;
13734 const T4 v4_;
13735 const T5 v5_;
13736 const T6 v6_;
13737 const T7 v7_;
13738 const T8 v8_;
13739 const T9 v9_;
13740 const T10 v10_;
13741 const T11 v11_;
13742 const T12 v12_;
13743 const T13 v13_;
13744 const T14 v14_;
13745 const T15 v15_;
13746 const T16 v16_;
13747 const T17 v17_;
13748 const T18 v18_;
13749 const T19 v19_;
13750 const T20 v20_;
13751 const T21 v21_;
13752 const T22 v22_;
13753 const T23 v23_;
13754 const T24 v24_;
13755 const T25 v25_;
13756 const T26 v26_;
13757 const T27 v27_;
13758 const T28 v28_;
13759 const T29 v29_;
13760 const T30 v30_;
13761 const T31 v31_;
13762};
13763
13764template <typename T1, typename T2, typename T3, typename T4, typename T5,
13765 typename T6, typename T7, typename T8, typename T9, typename T10,
13766 typename T11, typename T12, typename T13, typename T14, typename T15,
13767 typename T16, typename T17, typename T18, typename T19, typename T20,
13768 typename T21, typename T22, typename T23, typename T24, typename T25,
13769 typename T26, typename T27, typename T28, typename T29, typename T30,
13770 typename T31, typename T32>
13771class ValueArray32 {
13772 public:
13773 ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13774 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13775 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13776 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
13777 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13778 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13779 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13780 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13781 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
13782
13783 template <typename T>
13784 operator ParamGenerator<T>() const {
13785 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13786 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13787 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13788 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13789 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13790 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13791 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13792 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13793 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13794 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13795 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
13796 return ValuesIn(array);
13797 }
13798
f67539c2
TL
13799 ValueArray32(const ValueArray32& other) : v1_(other.v1_), v2_(other.v2_),
13800 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13801 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13802 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13803 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13804 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13805 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13806 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13807 v31_(other.v31_), v32_(other.v32_) {}
13808
7c673cae
FG
13809 private:
13810 // No implementation - assignment is unsupported.
13811 void operator=(const ValueArray32& other);
13812
13813 const T1 v1_;
13814 const T2 v2_;
13815 const T3 v3_;
13816 const T4 v4_;
13817 const T5 v5_;
13818 const T6 v6_;
13819 const T7 v7_;
13820 const T8 v8_;
13821 const T9 v9_;
13822 const T10 v10_;
13823 const T11 v11_;
13824 const T12 v12_;
13825 const T13 v13_;
13826 const T14 v14_;
13827 const T15 v15_;
13828 const T16 v16_;
13829 const T17 v17_;
13830 const T18 v18_;
13831 const T19 v19_;
13832 const T20 v20_;
13833 const T21 v21_;
13834 const T22 v22_;
13835 const T23 v23_;
13836 const T24 v24_;
13837 const T25 v25_;
13838 const T26 v26_;
13839 const T27 v27_;
13840 const T28 v28_;
13841 const T29 v29_;
13842 const T30 v30_;
13843 const T31 v31_;
13844 const T32 v32_;
13845};
13846
13847template <typename T1, typename T2, typename T3, typename T4, typename T5,
13848 typename T6, typename T7, typename T8, typename T9, typename T10,
13849 typename T11, typename T12, typename T13, typename T14, typename T15,
13850 typename T16, typename T17, typename T18, typename T19, typename T20,
13851 typename T21, typename T22, typename T23, typename T24, typename T25,
13852 typename T26, typename T27, typename T28, typename T29, typename T30,
13853 typename T31, typename T32, typename T33>
13854class ValueArray33 {
13855 public:
13856 ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13857 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13858 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13859 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
13860 T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13861 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13862 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13863 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13864 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13865 v33_(v33) {}
13866
13867 template <typename T>
13868 operator ParamGenerator<T>() const {
13869 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13870 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13871 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13872 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13873 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13874 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13875 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13876 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13877 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13878 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13879 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13880 static_cast<T>(v33_)};
13881 return ValuesIn(array);
13882 }
13883
f67539c2
TL
13884 ValueArray33(const ValueArray33& other) : v1_(other.v1_), v2_(other.v2_),
13885 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13886 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13887 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13888 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13889 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13890 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13891 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13892 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_) {}
13893
7c673cae
FG
13894 private:
13895 // No implementation - assignment is unsupported.
13896 void operator=(const ValueArray33& other);
13897
13898 const T1 v1_;
13899 const T2 v2_;
13900 const T3 v3_;
13901 const T4 v4_;
13902 const T5 v5_;
13903 const T6 v6_;
13904 const T7 v7_;
13905 const T8 v8_;
13906 const T9 v9_;
13907 const T10 v10_;
13908 const T11 v11_;
13909 const T12 v12_;
13910 const T13 v13_;
13911 const T14 v14_;
13912 const T15 v15_;
13913 const T16 v16_;
13914 const T17 v17_;
13915 const T18 v18_;
13916 const T19 v19_;
13917 const T20 v20_;
13918 const T21 v21_;
13919 const T22 v22_;
13920 const T23 v23_;
13921 const T24 v24_;
13922 const T25 v25_;
13923 const T26 v26_;
13924 const T27 v27_;
13925 const T28 v28_;
13926 const T29 v29_;
13927 const T30 v30_;
13928 const T31 v31_;
13929 const T32 v32_;
13930 const T33 v33_;
13931};
13932
13933template <typename T1, typename T2, typename T3, typename T4, typename T5,
13934 typename T6, typename T7, typename T8, typename T9, typename T10,
13935 typename T11, typename T12, typename T13, typename T14, typename T15,
13936 typename T16, typename T17, typename T18, typename T19, typename T20,
13937 typename T21, typename T22, typename T23, typename T24, typename T25,
13938 typename T26, typename T27, typename T28, typename T29, typename T30,
13939 typename T31, typename T32, typename T33, typename T34>
13940class ValueArray34 {
13941 public:
13942 ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13943 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13944 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13945 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13946 T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13947 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13948 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13949 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13950 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13951 v33_(v33), v34_(v34) {}
13952
13953 template <typename T>
13954 operator ParamGenerator<T>() const {
13955 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13956 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13957 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13958 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13959 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13960 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13961 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13962 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13963 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13964 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13965 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13966 static_cast<T>(v33_), static_cast<T>(v34_)};
13967 return ValuesIn(array);
13968 }
13969
f67539c2
TL
13970 ValueArray34(const ValueArray34& other) : v1_(other.v1_), v2_(other.v2_),
13971 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13972 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13973 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13974 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13975 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13976 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13977 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13978 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_) {}
13979
7c673cae
FG
13980 private:
13981 // No implementation - assignment is unsupported.
13982 void operator=(const ValueArray34& other);
13983
13984 const T1 v1_;
13985 const T2 v2_;
13986 const T3 v3_;
13987 const T4 v4_;
13988 const T5 v5_;
13989 const T6 v6_;
13990 const T7 v7_;
13991 const T8 v8_;
13992 const T9 v9_;
13993 const T10 v10_;
13994 const T11 v11_;
13995 const T12 v12_;
13996 const T13 v13_;
13997 const T14 v14_;
13998 const T15 v15_;
13999 const T16 v16_;
14000 const T17 v17_;
14001 const T18 v18_;
14002 const T19 v19_;
14003 const T20 v20_;
14004 const T21 v21_;
14005 const T22 v22_;
14006 const T23 v23_;
14007 const T24 v24_;
14008 const T25 v25_;
14009 const T26 v26_;
14010 const T27 v27_;
14011 const T28 v28_;
14012 const T29 v29_;
14013 const T30 v30_;
14014 const T31 v31_;
14015 const T32 v32_;
14016 const T33 v33_;
14017 const T34 v34_;
14018};
14019
14020template <typename T1, typename T2, typename T3, typename T4, typename T5,
14021 typename T6, typename T7, typename T8, typename T9, typename T10,
14022 typename T11, typename T12, typename T13, typename T14, typename T15,
14023 typename T16, typename T17, typename T18, typename T19, typename T20,
14024 typename T21, typename T22, typename T23, typename T24, typename T25,
14025 typename T26, typename T27, typename T28, typename T29, typename T30,
14026 typename T31, typename T32, typename T33, typename T34, typename T35>
14027class ValueArray35 {
14028 public:
14029 ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14030 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14031 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14032 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14033 T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
14034 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
14035 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
14036 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
14037 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
14038 v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
14039
14040 template <typename T>
14041 operator ParamGenerator<T>() const {
14042 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14043 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14044 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14045 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14046 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14047 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14048 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14049 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14050 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14051 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14052 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14053 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
14054 return ValuesIn(array);
14055 }
14056
f67539c2
TL
14057 ValueArray35(const ValueArray35& other) : v1_(other.v1_), v2_(other.v2_),
14058 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14059 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14060 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14061 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14062 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14063 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14064 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14065 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14066 v35_(other.v35_) {}
14067
7c673cae
FG
14068 private:
14069 // No implementation - assignment is unsupported.
14070 void operator=(const ValueArray35& other);
14071
14072 const T1 v1_;
14073 const T2 v2_;
14074 const T3 v3_;
14075 const T4 v4_;
14076 const T5 v5_;
14077 const T6 v6_;
14078 const T7 v7_;
14079 const T8 v8_;
14080 const T9 v9_;
14081 const T10 v10_;
14082 const T11 v11_;
14083 const T12 v12_;
14084 const T13 v13_;
14085 const T14 v14_;
14086 const T15 v15_;
14087 const T16 v16_;
14088 const T17 v17_;
14089 const T18 v18_;
14090 const T19 v19_;
14091 const T20 v20_;
14092 const T21 v21_;
14093 const T22 v22_;
14094 const T23 v23_;
14095 const T24 v24_;
14096 const T25 v25_;
14097 const T26 v26_;
14098 const T27 v27_;
14099 const T28 v28_;
14100 const T29 v29_;
14101 const T30 v30_;
14102 const T31 v31_;
14103 const T32 v32_;
14104 const T33 v33_;
14105 const T34 v34_;
14106 const T35 v35_;
14107};
14108
14109template <typename T1, typename T2, typename T3, typename T4, typename T5,
14110 typename T6, typename T7, typename T8, typename T9, typename T10,
14111 typename T11, typename T12, typename T13, typename T14, typename T15,
14112 typename T16, typename T17, typename T18, typename T19, typename T20,
14113 typename T21, typename T22, typename T23, typename T24, typename T25,
14114 typename T26, typename T27, typename T28, typename T29, typename T30,
14115 typename T31, typename T32, typename T33, typename T34, typename T35,
14116 typename T36>
14117class ValueArray36 {
14118 public:
14119 ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14120 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14121 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14122 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14123 T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
14124 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
14125 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
14126 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
14127 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
14128 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
14129
14130 template <typename T>
14131 operator ParamGenerator<T>() const {
14132 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14133 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14134 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14135 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14136 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14137 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14138 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14139 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14140 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14141 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14142 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14143 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14144 static_cast<T>(v36_)};
14145 return ValuesIn(array);
14146 }
14147
f67539c2
TL
14148 ValueArray36(const ValueArray36& other) : v1_(other.v1_), v2_(other.v2_),
14149 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14150 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14151 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14152 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14153 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14154 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14155 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14156 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14157 v35_(other.v35_), v36_(other.v36_) {}
14158
7c673cae
FG
14159 private:
14160 // No implementation - assignment is unsupported.
14161 void operator=(const ValueArray36& other);
14162
14163 const T1 v1_;
14164 const T2 v2_;
14165 const T3 v3_;
14166 const T4 v4_;
14167 const T5 v5_;
14168 const T6 v6_;
14169 const T7 v7_;
14170 const T8 v8_;
14171 const T9 v9_;
14172 const T10 v10_;
14173 const T11 v11_;
14174 const T12 v12_;
14175 const T13 v13_;
14176 const T14 v14_;
14177 const T15 v15_;
14178 const T16 v16_;
14179 const T17 v17_;
14180 const T18 v18_;
14181 const T19 v19_;
14182 const T20 v20_;
14183 const T21 v21_;
14184 const T22 v22_;
14185 const T23 v23_;
14186 const T24 v24_;
14187 const T25 v25_;
14188 const T26 v26_;
14189 const T27 v27_;
14190 const T28 v28_;
14191 const T29 v29_;
14192 const T30 v30_;
14193 const T31 v31_;
14194 const T32 v32_;
14195 const T33 v33_;
14196 const T34 v34_;
14197 const T35 v35_;
14198 const T36 v36_;
14199};
14200
14201template <typename T1, typename T2, typename T3, typename T4, typename T5,
14202 typename T6, typename T7, typename T8, typename T9, typename T10,
14203 typename T11, typename T12, typename T13, typename T14, typename T15,
14204 typename T16, typename T17, typename T18, typename T19, typename T20,
14205 typename T21, typename T22, typename T23, typename T24, typename T25,
14206 typename T26, typename T27, typename T28, typename T29, typename T30,
14207 typename T31, typename T32, typename T33, typename T34, typename T35,
14208 typename T36, typename T37>
14209class ValueArray37 {
14210 public:
14211 ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14212 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14213 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14214 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14215 T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
14216 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
14217 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
14218 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
14219 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
14220 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
14221 v36_(v36), v37_(v37) {}
14222
14223 template <typename T>
14224 operator ParamGenerator<T>() const {
14225 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14226 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14227 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14228 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14229 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14230 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14231 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14232 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14233 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14234 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14235 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14236 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14237 static_cast<T>(v36_), static_cast<T>(v37_)};
14238 return ValuesIn(array);
14239 }
14240
f67539c2
TL
14241 ValueArray37(const ValueArray37& other) : v1_(other.v1_), v2_(other.v2_),
14242 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14243 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14244 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14245 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14246 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14247 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14248 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14249 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14250 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_) {}
14251
7c673cae
FG
14252 private:
14253 // No implementation - assignment is unsupported.
14254 void operator=(const ValueArray37& other);
14255
14256 const T1 v1_;
14257 const T2 v2_;
14258 const T3 v3_;
14259 const T4 v4_;
14260 const T5 v5_;
14261 const T6 v6_;
14262 const T7 v7_;
14263 const T8 v8_;
14264 const T9 v9_;
14265 const T10 v10_;
14266 const T11 v11_;
14267 const T12 v12_;
14268 const T13 v13_;
14269 const T14 v14_;
14270 const T15 v15_;
14271 const T16 v16_;
14272 const T17 v17_;
14273 const T18 v18_;
14274 const T19 v19_;
14275 const T20 v20_;
14276 const T21 v21_;
14277 const T22 v22_;
14278 const T23 v23_;
14279 const T24 v24_;
14280 const T25 v25_;
14281 const T26 v26_;
14282 const T27 v27_;
14283 const T28 v28_;
14284 const T29 v29_;
14285 const T30 v30_;
14286 const T31 v31_;
14287 const T32 v32_;
14288 const T33 v33_;
14289 const T34 v34_;
14290 const T35 v35_;
14291 const T36 v36_;
14292 const T37 v37_;
14293};
14294
14295template <typename T1, typename T2, typename T3, typename T4, typename T5,
14296 typename T6, typename T7, typename T8, typename T9, typename T10,
14297 typename T11, typename T12, typename T13, typename T14, typename T15,
14298 typename T16, typename T17, typename T18, typename T19, typename T20,
14299 typename T21, typename T22, typename T23, typename T24, typename T25,
14300 typename T26, typename T27, typename T28, typename T29, typename T30,
14301 typename T31, typename T32, typename T33, typename T34, typename T35,
14302 typename T36, typename T37, typename T38>
14303class ValueArray38 {
14304 public:
14305 ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14306 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14307 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14308 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14309 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
14310 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14311 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14312 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14313 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14314 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14315 v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
14316
14317 template <typename T>
14318 operator ParamGenerator<T>() const {
14319 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14320 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14321 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14322 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14323 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14324 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14325 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14326 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14327 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14328 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14329 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14330 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14331 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
14332 return ValuesIn(array);
14333 }
14334
f67539c2
TL
14335 ValueArray38(const ValueArray38& other) : v1_(other.v1_), v2_(other.v2_),
14336 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14337 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14338 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14339 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14340 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14341 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14342 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14343 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14344 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_) {}
14345
7c673cae
FG
14346 private:
14347 // No implementation - assignment is unsupported.
14348 void operator=(const ValueArray38& other);
14349
14350 const T1 v1_;
14351 const T2 v2_;
14352 const T3 v3_;
14353 const T4 v4_;
14354 const T5 v5_;
14355 const T6 v6_;
14356 const T7 v7_;
14357 const T8 v8_;
14358 const T9 v9_;
14359 const T10 v10_;
14360 const T11 v11_;
14361 const T12 v12_;
14362 const T13 v13_;
14363 const T14 v14_;
14364 const T15 v15_;
14365 const T16 v16_;
14366 const T17 v17_;
14367 const T18 v18_;
14368 const T19 v19_;
14369 const T20 v20_;
14370 const T21 v21_;
14371 const T22 v22_;
14372 const T23 v23_;
14373 const T24 v24_;
14374 const T25 v25_;
14375 const T26 v26_;
14376 const T27 v27_;
14377 const T28 v28_;
14378 const T29 v29_;
14379 const T30 v30_;
14380 const T31 v31_;
14381 const T32 v32_;
14382 const T33 v33_;
14383 const T34 v34_;
14384 const T35 v35_;
14385 const T36 v36_;
14386 const T37 v37_;
14387 const T38 v38_;
14388};
14389
14390template <typename T1, typename T2, typename T3, typename T4, typename T5,
14391 typename T6, typename T7, typename T8, typename T9, typename T10,
14392 typename T11, typename T12, typename T13, typename T14, typename T15,
14393 typename T16, typename T17, typename T18, typename T19, typename T20,
14394 typename T21, typename T22, typename T23, typename T24, typename T25,
14395 typename T26, typename T27, typename T28, typename T29, typename T30,
14396 typename T31, typename T32, typename T33, typename T34, typename T35,
14397 typename T36, typename T37, typename T38, typename T39>
14398class ValueArray39 {
14399 public:
14400 ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14401 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14402 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14403 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14404 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
14405 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14406 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14407 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14408 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14409 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14410 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
14411
14412 template <typename T>
14413 operator ParamGenerator<T>() const {
14414 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14415 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14416 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14417 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14418 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14419 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14420 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14421 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14422 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14423 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14424 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14425 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14426 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14427 static_cast<T>(v39_)};
14428 return ValuesIn(array);
14429 }
14430
f67539c2
TL
14431 ValueArray39(const ValueArray39& other) : v1_(other.v1_), v2_(other.v2_),
14432 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14433 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14434 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14435 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14436 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14437 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14438 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14439 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14440 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14441 v39_(other.v39_) {}
14442
7c673cae
FG
14443 private:
14444 // No implementation - assignment is unsupported.
14445 void operator=(const ValueArray39& other);
14446
14447 const T1 v1_;
14448 const T2 v2_;
14449 const T3 v3_;
14450 const T4 v4_;
14451 const T5 v5_;
14452 const T6 v6_;
14453 const T7 v7_;
14454 const T8 v8_;
14455 const T9 v9_;
14456 const T10 v10_;
14457 const T11 v11_;
14458 const T12 v12_;
14459 const T13 v13_;
14460 const T14 v14_;
14461 const T15 v15_;
14462 const T16 v16_;
14463 const T17 v17_;
14464 const T18 v18_;
14465 const T19 v19_;
14466 const T20 v20_;
14467 const T21 v21_;
14468 const T22 v22_;
14469 const T23 v23_;
14470 const T24 v24_;
14471 const T25 v25_;
14472 const T26 v26_;
14473 const T27 v27_;
14474 const T28 v28_;
14475 const T29 v29_;
14476 const T30 v30_;
14477 const T31 v31_;
14478 const T32 v32_;
14479 const T33 v33_;
14480 const T34 v34_;
14481 const T35 v35_;
14482 const T36 v36_;
14483 const T37 v37_;
14484 const T38 v38_;
14485 const T39 v39_;
14486};
14487
14488template <typename T1, typename T2, typename T3, typename T4, typename T5,
14489 typename T6, typename T7, typename T8, typename T9, typename T10,
14490 typename T11, typename T12, typename T13, typename T14, typename T15,
14491 typename T16, typename T17, typename T18, typename T19, typename T20,
14492 typename T21, typename T22, typename T23, typename T24, typename T25,
14493 typename T26, typename T27, typename T28, typename T29, typename T30,
14494 typename T31, typename T32, typename T33, typename T34, typename T35,
14495 typename T36, typename T37, typename T38, typename T39, typename T40>
14496class ValueArray40 {
14497 public:
14498 ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14499 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14500 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14501 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14502 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
14503 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
14504 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
14505 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
14506 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
14507 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
14508 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
14509 v40_(v40) {}
14510
14511 template <typename T>
14512 operator ParamGenerator<T>() const {
14513 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14514 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14515 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14516 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14517 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14518 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14519 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14520 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14521 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14522 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14523 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14524 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14525 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14526 static_cast<T>(v39_), static_cast<T>(v40_)};
14527 return ValuesIn(array);
14528 }
14529
f67539c2
TL
14530 ValueArray40(const ValueArray40& other) : v1_(other.v1_), v2_(other.v2_),
14531 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14532 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14533 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14534 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14535 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14536 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14537 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14538 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14539 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14540 v39_(other.v39_), v40_(other.v40_) {}
14541
7c673cae
FG
14542 private:
14543 // No implementation - assignment is unsupported.
14544 void operator=(const ValueArray40& other);
14545
14546 const T1 v1_;
14547 const T2 v2_;
14548 const T3 v3_;
14549 const T4 v4_;
14550 const T5 v5_;
14551 const T6 v6_;
14552 const T7 v7_;
14553 const T8 v8_;
14554 const T9 v9_;
14555 const T10 v10_;
14556 const T11 v11_;
14557 const T12 v12_;
14558 const T13 v13_;
14559 const T14 v14_;
14560 const T15 v15_;
14561 const T16 v16_;
14562 const T17 v17_;
14563 const T18 v18_;
14564 const T19 v19_;
14565 const T20 v20_;
14566 const T21 v21_;
14567 const T22 v22_;
14568 const T23 v23_;
14569 const T24 v24_;
14570 const T25 v25_;
14571 const T26 v26_;
14572 const T27 v27_;
14573 const T28 v28_;
14574 const T29 v29_;
14575 const T30 v30_;
14576 const T31 v31_;
14577 const T32 v32_;
14578 const T33 v33_;
14579 const T34 v34_;
14580 const T35 v35_;
14581 const T36 v36_;
14582 const T37 v37_;
14583 const T38 v38_;
14584 const T39 v39_;
14585 const T40 v40_;
14586};
14587
14588template <typename T1, typename T2, typename T3, typename T4, typename T5,
14589 typename T6, typename T7, typename T8, typename T9, typename T10,
14590 typename T11, typename T12, typename T13, typename T14, typename T15,
14591 typename T16, typename T17, typename T18, typename T19, typename T20,
14592 typename T21, typename T22, typename T23, typename T24, typename T25,
14593 typename T26, typename T27, typename T28, typename T29, typename T30,
14594 typename T31, typename T32, typename T33, typename T34, typename T35,
14595 typename T36, typename T37, typename T38, typename T39, typename T40,
14596 typename T41>
14597class ValueArray41 {
14598 public:
14599 ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14600 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14601 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14602 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14603 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
14604 T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14605 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14606 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14607 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14608 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14609 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14610 v39_(v39), v40_(v40), v41_(v41) {}
14611
14612 template <typename T>
14613 operator ParamGenerator<T>() const {
14614 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14615 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14616 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14617 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14618 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14619 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14620 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14621 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14622 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14623 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14624 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14625 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14626 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14627 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
14628 return ValuesIn(array);
14629 }
14630
f67539c2
TL
14631 ValueArray41(const ValueArray41& other) : v1_(other.v1_), v2_(other.v2_),
14632 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14633 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14634 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14635 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14636 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14637 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14638 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14639 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14640 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14641 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_) {}
14642
7c673cae
FG
14643 private:
14644 // No implementation - assignment is unsupported.
14645 void operator=(const ValueArray41& other);
14646
14647 const T1 v1_;
14648 const T2 v2_;
14649 const T3 v3_;
14650 const T4 v4_;
14651 const T5 v5_;
14652 const T6 v6_;
14653 const T7 v7_;
14654 const T8 v8_;
14655 const T9 v9_;
14656 const T10 v10_;
14657 const T11 v11_;
14658 const T12 v12_;
14659 const T13 v13_;
14660 const T14 v14_;
14661 const T15 v15_;
14662 const T16 v16_;
14663 const T17 v17_;
14664 const T18 v18_;
14665 const T19 v19_;
14666 const T20 v20_;
14667 const T21 v21_;
14668 const T22 v22_;
14669 const T23 v23_;
14670 const T24 v24_;
14671 const T25 v25_;
14672 const T26 v26_;
14673 const T27 v27_;
14674 const T28 v28_;
14675 const T29 v29_;
14676 const T30 v30_;
14677 const T31 v31_;
14678 const T32 v32_;
14679 const T33 v33_;
14680 const T34 v34_;
14681 const T35 v35_;
14682 const T36 v36_;
14683 const T37 v37_;
14684 const T38 v38_;
14685 const T39 v39_;
14686 const T40 v40_;
14687 const T41 v41_;
14688};
14689
14690template <typename T1, typename T2, typename T3, typename T4, typename T5,
14691 typename T6, typename T7, typename T8, typename T9, typename T10,
14692 typename T11, typename T12, typename T13, typename T14, typename T15,
14693 typename T16, typename T17, typename T18, typename T19, typename T20,
14694 typename T21, typename T22, typename T23, typename T24, typename T25,
14695 typename T26, typename T27, typename T28, typename T29, typename T30,
14696 typename T31, typename T32, typename T33, typename T34, typename T35,
14697 typename T36, typename T37, typename T38, typename T39, typename T40,
14698 typename T41, typename T42>
14699class ValueArray42 {
14700 public:
14701 ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14702 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14703 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14704 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14705 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14706 T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14707 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14708 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14709 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14710 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14711 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14712 v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
14713
14714 template <typename T>
14715 operator ParamGenerator<T>() const {
14716 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14717 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14718 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14719 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14720 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14721 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14722 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14723 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14724 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14725 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14726 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14727 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14728 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14729 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14730 static_cast<T>(v42_)};
14731 return ValuesIn(array);
14732 }
14733
f67539c2
TL
14734 ValueArray42(const ValueArray42& other) : v1_(other.v1_), v2_(other.v2_),
14735 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14736 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14737 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14738 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14739 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14740 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14741 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14742 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14743 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14744 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_) {}
14745
7c673cae
FG
14746 private:
14747 // No implementation - assignment is unsupported.
14748 void operator=(const ValueArray42& other);
14749
14750 const T1 v1_;
14751 const T2 v2_;
14752 const T3 v3_;
14753 const T4 v4_;
14754 const T5 v5_;
14755 const T6 v6_;
14756 const T7 v7_;
14757 const T8 v8_;
14758 const T9 v9_;
14759 const T10 v10_;
14760 const T11 v11_;
14761 const T12 v12_;
14762 const T13 v13_;
14763 const T14 v14_;
14764 const T15 v15_;
14765 const T16 v16_;
14766 const T17 v17_;
14767 const T18 v18_;
14768 const T19 v19_;
14769 const T20 v20_;
14770 const T21 v21_;
14771 const T22 v22_;
14772 const T23 v23_;
14773 const T24 v24_;
14774 const T25 v25_;
14775 const T26 v26_;
14776 const T27 v27_;
14777 const T28 v28_;
14778 const T29 v29_;
14779 const T30 v30_;
14780 const T31 v31_;
14781 const T32 v32_;
14782 const T33 v33_;
14783 const T34 v34_;
14784 const T35 v35_;
14785 const T36 v36_;
14786 const T37 v37_;
14787 const T38 v38_;
14788 const T39 v39_;
14789 const T40 v40_;
14790 const T41 v41_;
14791 const T42 v42_;
14792};
14793
14794template <typename T1, typename T2, typename T3, typename T4, typename T5,
14795 typename T6, typename T7, typename T8, typename T9, typename T10,
14796 typename T11, typename T12, typename T13, typename T14, typename T15,
14797 typename T16, typename T17, typename T18, typename T19, typename T20,
14798 typename T21, typename T22, typename T23, typename T24, typename T25,
14799 typename T26, typename T27, typename T28, typename T29, typename T30,
14800 typename T31, typename T32, typename T33, typename T34, typename T35,
14801 typename T36, typename T37, typename T38, typename T39, typename T40,
14802 typename T41, typename T42, typename T43>
14803class ValueArray43 {
14804 public:
14805 ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14806 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14807 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14808 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14809 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14810 T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
14811 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
14812 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
14813 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
14814 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
14815 v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
14816 v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
14817
14818 template <typename T>
14819 operator ParamGenerator<T>() const {
14820 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14821 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14822 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14823 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14824 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14825 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14826 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14827 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14828 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14829 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14830 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14831 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14832 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14833 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14834 static_cast<T>(v42_), static_cast<T>(v43_)};
14835 return ValuesIn(array);
14836 }
14837
f67539c2
TL
14838 ValueArray43(const ValueArray43& other) : v1_(other.v1_), v2_(other.v2_),
14839 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14840 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14841 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14842 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14843 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14844 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14845 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14846 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14847 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14848 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
14849 v43_(other.v43_) {}
14850
7c673cae
FG
14851 private:
14852 // No implementation - assignment is unsupported.
14853 void operator=(const ValueArray43& other);
14854
14855 const T1 v1_;
14856 const T2 v2_;
14857 const T3 v3_;
14858 const T4 v4_;
14859 const T5 v5_;
14860 const T6 v6_;
14861 const T7 v7_;
14862 const T8 v8_;
14863 const T9 v9_;
14864 const T10 v10_;
14865 const T11 v11_;
14866 const T12 v12_;
14867 const T13 v13_;
14868 const T14 v14_;
14869 const T15 v15_;
14870 const T16 v16_;
14871 const T17 v17_;
14872 const T18 v18_;
14873 const T19 v19_;
14874 const T20 v20_;
14875 const T21 v21_;
14876 const T22 v22_;
14877 const T23 v23_;
14878 const T24 v24_;
14879 const T25 v25_;
14880 const T26 v26_;
14881 const T27 v27_;
14882 const T28 v28_;
14883 const T29 v29_;
14884 const T30 v30_;
14885 const T31 v31_;
14886 const T32 v32_;
14887 const T33 v33_;
14888 const T34 v34_;
14889 const T35 v35_;
14890 const T36 v36_;
14891 const T37 v37_;
14892 const T38 v38_;
14893 const T39 v39_;
14894 const T40 v40_;
14895 const T41 v41_;
14896 const T42 v42_;
14897 const T43 v43_;
14898};
14899
14900template <typename T1, typename T2, typename T3, typename T4, typename T5,
14901 typename T6, typename T7, typename T8, typename T9, typename T10,
14902 typename T11, typename T12, typename T13, typename T14, typename T15,
14903 typename T16, typename T17, typename T18, typename T19, typename T20,
14904 typename T21, typename T22, typename T23, typename T24, typename T25,
14905 typename T26, typename T27, typename T28, typename T29, typename T30,
14906 typename T31, typename T32, typename T33, typename T34, typename T35,
14907 typename T36, typename T37, typename T38, typename T39, typename T40,
14908 typename T41, typename T42, typename T43, typename T44>
14909class ValueArray44 {
14910 public:
14911 ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14912 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14913 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14914 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14915 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14916 T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
14917 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
14918 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
14919 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
14920 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
14921 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
14922 v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
14923 v43_(v43), v44_(v44) {}
14924
14925 template <typename T>
14926 operator ParamGenerator<T>() const {
14927 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14928 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14929 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14930 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14931 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14932 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14933 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14934 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14935 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14936 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14937 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14938 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14939 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14940 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14941 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
14942 return ValuesIn(array);
14943 }
14944
f67539c2
TL
14945 ValueArray44(const ValueArray44& other) : v1_(other.v1_), v2_(other.v2_),
14946 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14947 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14948 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14949 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14950 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14951 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14952 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14953 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14954 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14955 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
14956 v43_(other.v43_), v44_(other.v44_) {}
14957
7c673cae
FG
14958 private:
14959 // No implementation - assignment is unsupported.
14960 void operator=(const ValueArray44& other);
14961
14962 const T1 v1_;
14963 const T2 v2_;
14964 const T3 v3_;
14965 const T4 v4_;
14966 const T5 v5_;
14967 const T6 v6_;
14968 const T7 v7_;
14969 const T8 v8_;
14970 const T9 v9_;
14971 const T10 v10_;
14972 const T11 v11_;
14973 const T12 v12_;
14974 const T13 v13_;
14975 const T14 v14_;
14976 const T15 v15_;
14977 const T16 v16_;
14978 const T17 v17_;
14979 const T18 v18_;
14980 const T19 v19_;
14981 const T20 v20_;
14982 const T21 v21_;
14983 const T22 v22_;
14984 const T23 v23_;
14985 const T24 v24_;
14986 const T25 v25_;
14987 const T26 v26_;
14988 const T27 v27_;
14989 const T28 v28_;
14990 const T29 v29_;
14991 const T30 v30_;
14992 const T31 v31_;
14993 const T32 v32_;
14994 const T33 v33_;
14995 const T34 v34_;
14996 const T35 v35_;
14997 const T36 v36_;
14998 const T37 v37_;
14999 const T38 v38_;
15000 const T39 v39_;
15001 const T40 v40_;
15002 const T41 v41_;
15003 const T42 v42_;
15004 const T43 v43_;
15005 const T44 v44_;
15006};
15007
15008template <typename T1, typename T2, typename T3, typename T4, typename T5,
15009 typename T6, typename T7, typename T8, typename T9, typename T10,
15010 typename T11, typename T12, typename T13, typename T14, typename T15,
15011 typename T16, typename T17, typename T18, typename T19, typename T20,
15012 typename T21, typename T22, typename T23, typename T24, typename T25,
15013 typename T26, typename T27, typename T28, typename T29, typename T30,
15014 typename T31, typename T32, typename T33, typename T34, typename T35,
15015 typename T36, typename T37, typename T38, typename T39, typename T40,
15016 typename T41, typename T42, typename T43, typename T44, typename T45>
15017class ValueArray45 {
15018 public:
15019 ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15020 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15021 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15022 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15023 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15024 T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
15025 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
15026 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
15027 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
15028 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
15029 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
15030 v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
15031 v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
15032
15033 template <typename T>
15034 operator ParamGenerator<T>() const {
15035 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15036 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15037 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15038 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15039 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15040 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15041 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15042 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15043 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15044 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15045 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15046 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15047 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15048 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15049 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15050 static_cast<T>(v45_)};
15051 return ValuesIn(array);
15052 }
15053
f67539c2
TL
15054 ValueArray45(const ValueArray45& other) : v1_(other.v1_), v2_(other.v2_),
15055 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15056 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15057 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15058 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15059 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15060 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15061 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15062 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15063 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15064 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15065 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_) {}
15066
7c673cae
FG
15067 private:
15068 // No implementation - assignment is unsupported.
15069 void operator=(const ValueArray45& other);
15070
15071 const T1 v1_;
15072 const T2 v2_;
15073 const T3 v3_;
15074 const T4 v4_;
15075 const T5 v5_;
15076 const T6 v6_;
15077 const T7 v7_;
15078 const T8 v8_;
15079 const T9 v9_;
15080 const T10 v10_;
15081 const T11 v11_;
15082 const T12 v12_;
15083 const T13 v13_;
15084 const T14 v14_;
15085 const T15 v15_;
15086 const T16 v16_;
15087 const T17 v17_;
15088 const T18 v18_;
15089 const T19 v19_;
15090 const T20 v20_;
15091 const T21 v21_;
15092 const T22 v22_;
15093 const T23 v23_;
15094 const T24 v24_;
15095 const T25 v25_;
15096 const T26 v26_;
15097 const T27 v27_;
15098 const T28 v28_;
15099 const T29 v29_;
15100 const T30 v30_;
15101 const T31 v31_;
15102 const T32 v32_;
15103 const T33 v33_;
15104 const T34 v34_;
15105 const T35 v35_;
15106 const T36 v36_;
15107 const T37 v37_;
15108 const T38 v38_;
15109 const T39 v39_;
15110 const T40 v40_;
15111 const T41 v41_;
15112 const T42 v42_;
15113 const T43 v43_;
15114 const T44 v44_;
15115 const T45 v45_;
15116};
15117
15118template <typename T1, typename T2, typename T3, typename T4, typename T5,
15119 typename T6, typename T7, typename T8, typename T9, typename T10,
15120 typename T11, typename T12, typename T13, typename T14, typename T15,
15121 typename T16, typename T17, typename T18, typename T19, typename T20,
15122 typename T21, typename T22, typename T23, typename T24, typename T25,
15123 typename T26, typename T27, typename T28, typename T29, typename T30,
15124 typename T31, typename T32, typename T33, typename T34, typename T35,
15125 typename T36, typename T37, typename T38, typename T39, typename T40,
15126 typename T41, typename T42, typename T43, typename T44, typename T45,
15127 typename T46>
15128class ValueArray46 {
15129 public:
15130 ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15131 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15132 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15133 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15134 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15135 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
15136 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
15137 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
15138 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
15139 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
15140 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
15141 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
15142 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
15143
15144 template <typename T>
15145 operator ParamGenerator<T>() const {
15146 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15147 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15148 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15149 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15150 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15151 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15152 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15153 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15154 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15155 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15156 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15157 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15158 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15159 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15160 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15161 static_cast<T>(v45_), static_cast<T>(v46_)};
15162 return ValuesIn(array);
15163 }
15164
f67539c2
TL
15165 ValueArray46(const ValueArray46& other) : v1_(other.v1_), v2_(other.v2_),
15166 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15167 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15168 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15169 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15170 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15171 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15172 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15173 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15174 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15175 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15176 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_) {}
15177
7c673cae
FG
15178 private:
15179 // No implementation - assignment is unsupported.
15180 void operator=(const ValueArray46& other);
15181
15182 const T1 v1_;
15183 const T2 v2_;
15184 const T3 v3_;
15185 const T4 v4_;
15186 const T5 v5_;
15187 const T6 v6_;
15188 const T7 v7_;
15189 const T8 v8_;
15190 const T9 v9_;
15191 const T10 v10_;
15192 const T11 v11_;
15193 const T12 v12_;
15194 const T13 v13_;
15195 const T14 v14_;
15196 const T15 v15_;
15197 const T16 v16_;
15198 const T17 v17_;
15199 const T18 v18_;
15200 const T19 v19_;
15201 const T20 v20_;
15202 const T21 v21_;
15203 const T22 v22_;
15204 const T23 v23_;
15205 const T24 v24_;
15206 const T25 v25_;
15207 const T26 v26_;
15208 const T27 v27_;
15209 const T28 v28_;
15210 const T29 v29_;
15211 const T30 v30_;
15212 const T31 v31_;
15213 const T32 v32_;
15214 const T33 v33_;
15215 const T34 v34_;
15216 const T35 v35_;
15217 const T36 v36_;
15218 const T37 v37_;
15219 const T38 v38_;
15220 const T39 v39_;
15221 const T40 v40_;
15222 const T41 v41_;
15223 const T42 v42_;
15224 const T43 v43_;
15225 const T44 v44_;
15226 const T45 v45_;
15227 const T46 v46_;
15228};
15229
15230template <typename T1, typename T2, typename T3, typename T4, typename T5,
15231 typename T6, typename T7, typename T8, typename T9, typename T10,
15232 typename T11, typename T12, typename T13, typename T14, typename T15,
15233 typename T16, typename T17, typename T18, typename T19, typename T20,
15234 typename T21, typename T22, typename T23, typename T24, typename T25,
15235 typename T26, typename T27, typename T28, typename T29, typename T30,
15236 typename T31, typename T32, typename T33, typename T34, typename T35,
15237 typename T36, typename T37, typename T38, typename T39, typename T40,
15238 typename T41, typename T42, typename T43, typename T44, typename T45,
15239 typename T46, typename T47>
15240class ValueArray47 {
15241 public:
15242 ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15243 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15244 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15245 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15246 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15247 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
15248 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
15249 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
15250 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
15251 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
15252 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
15253 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
15254 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
15255 v47_(v47) {}
15256
15257 template <typename T>
15258 operator ParamGenerator<T>() const {
15259 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15260 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15261 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15262 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15263 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15264 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15265 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15266 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15267 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15268 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15269 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15270 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15271 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15272 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15273 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15274 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
15275 return ValuesIn(array);
15276 }
15277
f67539c2
TL
15278 ValueArray47(const ValueArray47& other) : v1_(other.v1_), v2_(other.v2_),
15279 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15280 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15281 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15282 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15283 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15284 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15285 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15286 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15287 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15288 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15289 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15290 v47_(other.v47_) {}
15291
7c673cae
FG
15292 private:
15293 // No implementation - assignment is unsupported.
15294 void operator=(const ValueArray47& other);
15295
15296 const T1 v1_;
15297 const T2 v2_;
15298 const T3 v3_;
15299 const T4 v4_;
15300 const T5 v5_;
15301 const T6 v6_;
15302 const T7 v7_;
15303 const T8 v8_;
15304 const T9 v9_;
15305 const T10 v10_;
15306 const T11 v11_;
15307 const T12 v12_;
15308 const T13 v13_;
15309 const T14 v14_;
15310 const T15 v15_;
15311 const T16 v16_;
15312 const T17 v17_;
15313 const T18 v18_;
15314 const T19 v19_;
15315 const T20 v20_;
15316 const T21 v21_;
15317 const T22 v22_;
15318 const T23 v23_;
15319 const T24 v24_;
15320 const T25 v25_;
15321 const T26 v26_;
15322 const T27 v27_;
15323 const T28 v28_;
15324 const T29 v29_;
15325 const T30 v30_;
15326 const T31 v31_;
15327 const T32 v32_;
15328 const T33 v33_;
15329 const T34 v34_;
15330 const T35 v35_;
15331 const T36 v36_;
15332 const T37 v37_;
15333 const T38 v38_;
15334 const T39 v39_;
15335 const T40 v40_;
15336 const T41 v41_;
15337 const T42 v42_;
15338 const T43 v43_;
15339 const T44 v44_;
15340 const T45 v45_;
15341 const T46 v46_;
15342 const T47 v47_;
15343};
15344
15345template <typename T1, typename T2, typename T3, typename T4, typename T5,
15346 typename T6, typename T7, typename T8, typename T9, typename T10,
15347 typename T11, typename T12, typename T13, typename T14, typename T15,
15348 typename T16, typename T17, typename T18, typename T19, typename T20,
15349 typename T21, typename T22, typename T23, typename T24, typename T25,
15350 typename T26, typename T27, typename T28, typename T29, typename T30,
15351 typename T31, typename T32, typename T33, typename T34, typename T35,
15352 typename T36, typename T37, typename T38, typename T39, typename T40,
15353 typename T41, typename T42, typename T43, typename T44, typename T45,
15354 typename T46, typename T47, typename T48>
15355class ValueArray48 {
15356 public:
15357 ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15358 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15359 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15360 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15361 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15362 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
15363 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
15364 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
15365 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
15366 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
15367 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
15368 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
15369 v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
15370 v46_(v46), v47_(v47), v48_(v48) {}
15371
15372 template <typename T>
15373 operator ParamGenerator<T>() const {
15374 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15375 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15376 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15377 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15378 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15379 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15380 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15381 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15382 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15383 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15384 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15385 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15386 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15387 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15388 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15389 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15390 static_cast<T>(v48_)};
15391 return ValuesIn(array);
15392 }
15393
f67539c2
TL
15394 ValueArray48(const ValueArray48& other) : v1_(other.v1_), v2_(other.v2_),
15395 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15396 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15397 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15398 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15399 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15400 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15401 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15402 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15403 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15404 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15405 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15406 v47_(other.v47_), v48_(other.v48_) {}
15407
7c673cae
FG
15408 private:
15409 // No implementation - assignment is unsupported.
15410 void operator=(const ValueArray48& other);
15411
15412 const T1 v1_;
15413 const T2 v2_;
15414 const T3 v3_;
15415 const T4 v4_;
15416 const T5 v5_;
15417 const T6 v6_;
15418 const T7 v7_;
15419 const T8 v8_;
15420 const T9 v9_;
15421 const T10 v10_;
15422 const T11 v11_;
15423 const T12 v12_;
15424 const T13 v13_;
15425 const T14 v14_;
15426 const T15 v15_;
15427 const T16 v16_;
15428 const T17 v17_;
15429 const T18 v18_;
15430 const T19 v19_;
15431 const T20 v20_;
15432 const T21 v21_;
15433 const T22 v22_;
15434 const T23 v23_;
15435 const T24 v24_;
15436 const T25 v25_;
15437 const T26 v26_;
15438 const T27 v27_;
15439 const T28 v28_;
15440 const T29 v29_;
15441 const T30 v30_;
15442 const T31 v31_;
15443 const T32 v32_;
15444 const T33 v33_;
15445 const T34 v34_;
15446 const T35 v35_;
15447 const T36 v36_;
15448 const T37 v37_;
15449 const T38 v38_;
15450 const T39 v39_;
15451 const T40 v40_;
15452 const T41 v41_;
15453 const T42 v42_;
15454 const T43 v43_;
15455 const T44 v44_;
15456 const T45 v45_;
15457 const T46 v46_;
15458 const T47 v47_;
15459 const T48 v48_;
15460};
15461
15462template <typename T1, typename T2, typename T3, typename T4, typename T5,
15463 typename T6, typename T7, typename T8, typename T9, typename T10,
15464 typename T11, typename T12, typename T13, typename T14, typename T15,
15465 typename T16, typename T17, typename T18, typename T19, typename T20,
15466 typename T21, typename T22, typename T23, typename T24, typename T25,
15467 typename T26, typename T27, typename T28, typename T29, typename T30,
15468 typename T31, typename T32, typename T33, typename T34, typename T35,
15469 typename T36, typename T37, typename T38, typename T39, typename T40,
15470 typename T41, typename T42, typename T43, typename T44, typename T45,
15471 typename T46, typename T47, typename T48, typename T49>
15472class ValueArray49 {
15473 public:
15474 ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15475 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15476 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15477 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15478 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15479 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
15480 T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
15481 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
15482 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
15483 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
15484 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
15485 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
15486 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
15487 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
15488
15489 template <typename T>
15490 operator ParamGenerator<T>() const {
15491 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15492 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15493 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15494 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15495 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15496 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15497 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15498 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15499 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15500 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15501 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15502 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15503 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15504 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15505 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15506 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15507 static_cast<T>(v48_), static_cast<T>(v49_)};
15508 return ValuesIn(array);
15509 }
15510
f67539c2
TL
15511 ValueArray49(const ValueArray49& other) : v1_(other.v1_), v2_(other.v2_),
15512 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15513 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15514 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15515 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15516 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15517 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15518 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15519 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15520 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15521 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15522 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15523 v47_(other.v47_), v48_(other.v48_), v49_(other.v49_) {}
15524
7c673cae
FG
15525 private:
15526 // No implementation - assignment is unsupported.
15527 void operator=(const ValueArray49& other);
15528
15529 const T1 v1_;
15530 const T2 v2_;
15531 const T3 v3_;
15532 const T4 v4_;
15533 const T5 v5_;
15534 const T6 v6_;
15535 const T7 v7_;
15536 const T8 v8_;
15537 const T9 v9_;
15538 const T10 v10_;
15539 const T11 v11_;
15540 const T12 v12_;
15541 const T13 v13_;
15542 const T14 v14_;
15543 const T15 v15_;
15544 const T16 v16_;
15545 const T17 v17_;
15546 const T18 v18_;
15547 const T19 v19_;
15548 const T20 v20_;
15549 const T21 v21_;
15550 const T22 v22_;
15551 const T23 v23_;
15552 const T24 v24_;
15553 const T25 v25_;
15554 const T26 v26_;
15555 const T27 v27_;
15556 const T28 v28_;
15557 const T29 v29_;
15558 const T30 v30_;
15559 const T31 v31_;
15560 const T32 v32_;
15561 const T33 v33_;
15562 const T34 v34_;
15563 const T35 v35_;
15564 const T36 v36_;
15565 const T37 v37_;
15566 const T38 v38_;
15567 const T39 v39_;
15568 const T40 v40_;
15569 const T41 v41_;
15570 const T42 v42_;
15571 const T43 v43_;
15572 const T44 v44_;
15573 const T45 v45_;
15574 const T46 v46_;
15575 const T47 v47_;
15576 const T48 v48_;
15577 const T49 v49_;
15578};
15579
15580template <typename T1, typename T2, typename T3, typename T4, typename T5,
15581 typename T6, typename T7, typename T8, typename T9, typename T10,
15582 typename T11, typename T12, typename T13, typename T14, typename T15,
15583 typename T16, typename T17, typename T18, typename T19, typename T20,
15584 typename T21, typename T22, typename T23, typename T24, typename T25,
15585 typename T26, typename T27, typename T28, typename T29, typename T30,
15586 typename T31, typename T32, typename T33, typename T34, typename T35,
15587 typename T36, typename T37, typename T38, typename T39, typename T40,
15588 typename T41, typename T42, typename T43, typename T44, typename T45,
15589 typename T46, typename T47, typename T48, typename T49, typename T50>
15590class ValueArray50 {
15591 public:
15592 ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15593 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15594 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15595 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15596 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15597 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
15598 T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
15599 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
15600 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
15601 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
15602 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
15603 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
15604 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
15605 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
15606
15607 template <typename T>
15608 operator ParamGenerator<T>() const {
15609 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15610 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15611 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15612 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15613 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15614 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15615 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15616 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15617 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15618 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15619 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15620 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15621 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15622 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15623 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15624 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15625 static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
15626 return ValuesIn(array);
15627 }
15628
f67539c2
TL
15629 ValueArray50(const ValueArray50& other) : v1_(other.v1_), v2_(other.v2_),
15630 v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15631 v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15632 v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15633 v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15634 v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15635 v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15636 v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15637 v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15638 v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15639 v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15640 v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15641 v47_(other.v47_), v48_(other.v48_), v49_(other.v49_), v50_(other.v50_) {}
15642
7c673cae
FG
15643 private:
15644 // No implementation - assignment is unsupported.
15645 void operator=(const ValueArray50& other);
15646
15647 const T1 v1_;
15648 const T2 v2_;
15649 const T3 v3_;
15650 const T4 v4_;
15651 const T5 v5_;
15652 const T6 v6_;
15653 const T7 v7_;
15654 const T8 v8_;
15655 const T9 v9_;
15656 const T10 v10_;
15657 const T11 v11_;
15658 const T12 v12_;
15659 const T13 v13_;
15660 const T14 v14_;
15661 const T15 v15_;
15662 const T16 v16_;
15663 const T17 v17_;
15664 const T18 v18_;
15665 const T19 v19_;
15666 const T20 v20_;
15667 const T21 v21_;
15668 const T22 v22_;
15669 const T23 v23_;
15670 const T24 v24_;
15671 const T25 v25_;
15672 const T26 v26_;
15673 const T27 v27_;
15674 const T28 v28_;
15675 const T29 v29_;
15676 const T30 v30_;
15677 const T31 v31_;
15678 const T32 v32_;
15679 const T33 v33_;
15680 const T34 v34_;
15681 const T35 v35_;
15682 const T36 v36_;
15683 const T37 v37_;
15684 const T38 v38_;
15685 const T39 v39_;
15686 const T40 v40_;
15687 const T41 v41_;
15688 const T42 v42_;
15689 const T43 v43_;
15690 const T44 v44_;
15691 const T45 v45_;
15692 const T46 v46_;
15693 const T47 v47_;
15694 const T48 v48_;
15695 const T49 v49_;
15696 const T50 v50_;
15697};
15698
15699# if GTEST_HAS_COMBINE
15700// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15701//
15702// Generates values from the Cartesian product of values produced
15703// by the argument generators.
15704//
15705template <typename T1, typename T2>
15706class CartesianProductGenerator2
15707 : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
15708 public:
15709 typedef ::testing::tuple<T1, T2> ParamType;
15710
15711 CartesianProductGenerator2(const ParamGenerator<T1>& g1,
15712 const ParamGenerator<T2>& g2)
15713 : g1_(g1), g2_(g2) {}
15714 virtual ~CartesianProductGenerator2() {}
15715
15716 virtual ParamIteratorInterface<ParamType>* Begin() const {
15717 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
15718 }
15719 virtual ParamIteratorInterface<ParamType>* End() const {
15720 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
15721 }
15722
15723 private:
15724 class Iterator : public ParamIteratorInterface<ParamType> {
15725 public:
15726 Iterator(const ParamGeneratorInterface<ParamType>* base,
15727 const ParamGenerator<T1>& g1,
15728 const typename ParamGenerator<T1>::iterator& current1,
15729 const ParamGenerator<T2>& g2,
15730 const typename ParamGenerator<T2>::iterator& current2)
15731 : base_(base),
15732 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15733 begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
15734 ComputeCurrentValue();
15735 }
15736 virtual ~Iterator() {}
15737
15738 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15739 return base_;
15740 }
15741 // Advance should not be called on beyond-of-range iterators
15742 // so no component iterators must be beyond end of range, either.
15743 virtual void Advance() {
15744 assert(!AtEnd());
15745 ++current2_;
15746 if (current2_ == end2_) {
15747 current2_ = begin2_;
15748 ++current1_;
15749 }
15750 ComputeCurrentValue();
15751 }
15752 virtual ParamIteratorInterface<ParamType>* Clone() const {
15753 return new Iterator(*this);
15754 }
f67539c2 15755 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
15756 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15757 // Having the same base generator guarantees that the other
15758 // iterator is of the same type and we can downcast.
15759 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15760 << "The program attempted to compare iterators "
15761 << "from different generators." << std::endl;
15762 const Iterator* typed_other =
15763 CheckedDowncastToActualType<const Iterator>(&other);
15764 // We must report iterators equal if they both point beyond their
15765 // respective ranges. That can happen in a variety of fashions,
15766 // so we have to consult AtEnd().
15767 return (AtEnd() && typed_other->AtEnd()) ||
15768 (
15769 current1_ == typed_other->current1_ &&
15770 current2_ == typed_other->current2_);
15771 }
15772
15773 private:
15774 Iterator(const Iterator& other)
15775 : base_(other.base_),
15776 begin1_(other.begin1_),
15777 end1_(other.end1_),
15778 current1_(other.current1_),
15779 begin2_(other.begin2_),
15780 end2_(other.end2_),
15781 current2_(other.current2_) {
15782 ComputeCurrentValue();
15783 }
15784
15785 void ComputeCurrentValue() {
15786 if (!AtEnd())
f67539c2 15787 current_value_.reset(new ParamType(*current1_, *current2_));
7c673cae
FG
15788 }
15789 bool AtEnd() const {
15790 // We must report iterator past the end of the range when either of the
15791 // component iterators has reached the end of its range.
15792 return
15793 current1_ == end1_ ||
15794 current2_ == end2_;
15795 }
15796
15797 // No implementation - assignment is unsupported.
15798 void operator=(const Iterator& other);
15799
15800 const ParamGeneratorInterface<ParamType>* const base_;
15801 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15802 // current[i]_ is the actual traversing iterator.
15803 const typename ParamGenerator<T1>::iterator begin1_;
15804 const typename ParamGenerator<T1>::iterator end1_;
15805 typename ParamGenerator<T1>::iterator current1_;
15806 const typename ParamGenerator<T2>::iterator begin2_;
15807 const typename ParamGenerator<T2>::iterator end2_;
15808 typename ParamGenerator<T2>::iterator current2_;
f67539c2 15809 linked_ptr<ParamType> current_value_;
7c673cae
FG
15810 }; // class CartesianProductGenerator2::Iterator
15811
15812 // No implementation - assignment is unsupported.
15813 void operator=(const CartesianProductGenerator2& other);
15814
15815 const ParamGenerator<T1> g1_;
15816 const ParamGenerator<T2> g2_;
15817}; // class CartesianProductGenerator2
15818
15819
15820template <typename T1, typename T2, typename T3>
15821class CartesianProductGenerator3
15822 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
15823 public:
15824 typedef ::testing::tuple<T1, T2, T3> ParamType;
15825
15826 CartesianProductGenerator3(const ParamGenerator<T1>& g1,
15827 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
15828 : g1_(g1), g2_(g2), g3_(g3) {}
15829 virtual ~CartesianProductGenerator3() {}
15830
15831 virtual ParamIteratorInterface<ParamType>* Begin() const {
15832 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15833 g3_.begin());
15834 }
15835 virtual ParamIteratorInterface<ParamType>* End() const {
15836 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
15837 }
15838
15839 private:
15840 class Iterator : public ParamIteratorInterface<ParamType> {
15841 public:
15842 Iterator(const ParamGeneratorInterface<ParamType>* base,
15843 const ParamGenerator<T1>& g1,
15844 const typename ParamGenerator<T1>::iterator& current1,
15845 const ParamGenerator<T2>& g2,
15846 const typename ParamGenerator<T2>::iterator& current2,
15847 const ParamGenerator<T3>& g3,
15848 const typename ParamGenerator<T3>::iterator& current3)
15849 : base_(base),
15850 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15851 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15852 begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
15853 ComputeCurrentValue();
15854 }
15855 virtual ~Iterator() {}
15856
15857 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15858 return base_;
15859 }
15860 // Advance should not be called on beyond-of-range iterators
15861 // so no component iterators must be beyond end of range, either.
15862 virtual void Advance() {
15863 assert(!AtEnd());
15864 ++current3_;
15865 if (current3_ == end3_) {
15866 current3_ = begin3_;
15867 ++current2_;
15868 }
15869 if (current2_ == end2_) {
15870 current2_ = begin2_;
15871 ++current1_;
15872 }
15873 ComputeCurrentValue();
15874 }
15875 virtual ParamIteratorInterface<ParamType>* Clone() const {
15876 return new Iterator(*this);
15877 }
f67539c2 15878 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
15879 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15880 // Having the same base generator guarantees that the other
15881 // iterator is of the same type and we can downcast.
15882 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15883 << "The program attempted to compare iterators "
15884 << "from different generators." << std::endl;
15885 const Iterator* typed_other =
15886 CheckedDowncastToActualType<const Iterator>(&other);
15887 // We must report iterators equal if they both point beyond their
15888 // respective ranges. That can happen in a variety of fashions,
15889 // so we have to consult AtEnd().
15890 return (AtEnd() && typed_other->AtEnd()) ||
15891 (
15892 current1_ == typed_other->current1_ &&
15893 current2_ == typed_other->current2_ &&
15894 current3_ == typed_other->current3_);
15895 }
15896
15897 private:
15898 Iterator(const Iterator& other)
15899 : base_(other.base_),
15900 begin1_(other.begin1_),
15901 end1_(other.end1_),
15902 current1_(other.current1_),
15903 begin2_(other.begin2_),
15904 end2_(other.end2_),
15905 current2_(other.current2_),
15906 begin3_(other.begin3_),
15907 end3_(other.end3_),
15908 current3_(other.current3_) {
15909 ComputeCurrentValue();
15910 }
15911
15912 void ComputeCurrentValue() {
15913 if (!AtEnd())
f67539c2 15914 current_value_.reset(new ParamType(*current1_, *current2_, *current3_));
7c673cae
FG
15915 }
15916 bool AtEnd() const {
15917 // We must report iterator past the end of the range when either of the
15918 // component iterators has reached the end of its range.
15919 return
15920 current1_ == end1_ ||
15921 current2_ == end2_ ||
15922 current3_ == end3_;
15923 }
15924
15925 // No implementation - assignment is unsupported.
15926 void operator=(const Iterator& other);
15927
15928 const ParamGeneratorInterface<ParamType>* const base_;
15929 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15930 // current[i]_ is the actual traversing iterator.
15931 const typename ParamGenerator<T1>::iterator begin1_;
15932 const typename ParamGenerator<T1>::iterator end1_;
15933 typename ParamGenerator<T1>::iterator current1_;
15934 const typename ParamGenerator<T2>::iterator begin2_;
15935 const typename ParamGenerator<T2>::iterator end2_;
15936 typename ParamGenerator<T2>::iterator current2_;
15937 const typename ParamGenerator<T3>::iterator begin3_;
15938 const typename ParamGenerator<T3>::iterator end3_;
15939 typename ParamGenerator<T3>::iterator current3_;
f67539c2 15940 linked_ptr<ParamType> current_value_;
7c673cae
FG
15941 }; // class CartesianProductGenerator3::Iterator
15942
15943 // No implementation - assignment is unsupported.
15944 void operator=(const CartesianProductGenerator3& other);
15945
15946 const ParamGenerator<T1> g1_;
15947 const ParamGenerator<T2> g2_;
15948 const ParamGenerator<T3> g3_;
15949}; // class CartesianProductGenerator3
15950
15951
15952template <typename T1, typename T2, typename T3, typename T4>
15953class CartesianProductGenerator4
15954 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
15955 public:
15956 typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
15957
15958 CartesianProductGenerator4(const ParamGenerator<T1>& g1,
15959 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15960 const ParamGenerator<T4>& g4)
15961 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15962 virtual ~CartesianProductGenerator4() {}
15963
15964 virtual ParamIteratorInterface<ParamType>* Begin() const {
15965 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15966 g3_.begin(), g4_, g4_.begin());
15967 }
15968 virtual ParamIteratorInterface<ParamType>* End() const {
15969 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15970 g4_, g4_.end());
15971 }
15972
15973 private:
15974 class Iterator : public ParamIteratorInterface<ParamType> {
15975 public:
15976 Iterator(const ParamGeneratorInterface<ParamType>* base,
15977 const ParamGenerator<T1>& g1,
15978 const typename ParamGenerator<T1>::iterator& current1,
15979 const ParamGenerator<T2>& g2,
15980 const typename ParamGenerator<T2>::iterator& current2,
15981 const ParamGenerator<T3>& g3,
15982 const typename ParamGenerator<T3>::iterator& current3,
15983 const ParamGenerator<T4>& g4,
15984 const typename ParamGenerator<T4>::iterator& current4)
15985 : base_(base),
15986 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15987 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15988 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15989 begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
15990 ComputeCurrentValue();
15991 }
15992 virtual ~Iterator() {}
15993
15994 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15995 return base_;
15996 }
15997 // Advance should not be called on beyond-of-range iterators
15998 // so no component iterators must be beyond end of range, either.
15999 virtual void Advance() {
16000 assert(!AtEnd());
16001 ++current4_;
16002 if (current4_ == end4_) {
16003 current4_ = begin4_;
16004 ++current3_;
16005 }
16006 if (current3_ == end3_) {
16007 current3_ = begin3_;
16008 ++current2_;
16009 }
16010 if (current2_ == end2_) {
16011 current2_ = begin2_;
16012 ++current1_;
16013 }
16014 ComputeCurrentValue();
16015 }
16016 virtual ParamIteratorInterface<ParamType>* Clone() const {
16017 return new Iterator(*this);
16018 }
f67539c2 16019 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16020 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16021 // Having the same base generator guarantees that the other
16022 // iterator is of the same type and we can downcast.
16023 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16024 << "The program attempted to compare iterators "
16025 << "from different generators." << std::endl;
16026 const Iterator* typed_other =
16027 CheckedDowncastToActualType<const Iterator>(&other);
16028 // We must report iterators equal if they both point beyond their
16029 // respective ranges. That can happen in a variety of fashions,
16030 // so we have to consult AtEnd().
16031 return (AtEnd() && typed_other->AtEnd()) ||
16032 (
16033 current1_ == typed_other->current1_ &&
16034 current2_ == typed_other->current2_ &&
16035 current3_ == typed_other->current3_ &&
16036 current4_ == typed_other->current4_);
16037 }
16038
16039 private:
16040 Iterator(const Iterator& other)
16041 : base_(other.base_),
16042 begin1_(other.begin1_),
16043 end1_(other.end1_),
16044 current1_(other.current1_),
16045 begin2_(other.begin2_),
16046 end2_(other.end2_),
16047 current2_(other.current2_),
16048 begin3_(other.begin3_),
16049 end3_(other.end3_),
16050 current3_(other.current3_),
16051 begin4_(other.begin4_),
16052 end4_(other.end4_),
16053 current4_(other.current4_) {
16054 ComputeCurrentValue();
16055 }
16056
16057 void ComputeCurrentValue() {
16058 if (!AtEnd())
f67539c2
TL
16059 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16060 *current4_));
7c673cae
FG
16061 }
16062 bool AtEnd() const {
16063 // We must report iterator past the end of the range when either of the
16064 // component iterators has reached the end of its range.
16065 return
16066 current1_ == end1_ ||
16067 current2_ == end2_ ||
16068 current3_ == end3_ ||
16069 current4_ == end4_;
16070 }
16071
16072 // No implementation - assignment is unsupported.
16073 void operator=(const Iterator& other);
16074
16075 const ParamGeneratorInterface<ParamType>* const base_;
16076 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16077 // current[i]_ is the actual traversing iterator.
16078 const typename ParamGenerator<T1>::iterator begin1_;
16079 const typename ParamGenerator<T1>::iterator end1_;
16080 typename ParamGenerator<T1>::iterator current1_;
16081 const typename ParamGenerator<T2>::iterator begin2_;
16082 const typename ParamGenerator<T2>::iterator end2_;
16083 typename ParamGenerator<T2>::iterator current2_;
16084 const typename ParamGenerator<T3>::iterator begin3_;
16085 const typename ParamGenerator<T3>::iterator end3_;
16086 typename ParamGenerator<T3>::iterator current3_;
16087 const typename ParamGenerator<T4>::iterator begin4_;
16088 const typename ParamGenerator<T4>::iterator end4_;
16089 typename ParamGenerator<T4>::iterator current4_;
f67539c2 16090 linked_ptr<ParamType> current_value_;
7c673cae
FG
16091 }; // class CartesianProductGenerator4::Iterator
16092
16093 // No implementation - assignment is unsupported.
16094 void operator=(const CartesianProductGenerator4& other);
16095
16096 const ParamGenerator<T1> g1_;
16097 const ParamGenerator<T2> g2_;
16098 const ParamGenerator<T3> g3_;
16099 const ParamGenerator<T4> g4_;
16100}; // class CartesianProductGenerator4
16101
16102
16103template <typename T1, typename T2, typename T3, typename T4, typename T5>
16104class CartesianProductGenerator5
16105 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
16106 public:
16107 typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
16108
16109 CartesianProductGenerator5(const ParamGenerator<T1>& g1,
16110 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16111 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
16112 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
16113 virtual ~CartesianProductGenerator5() {}
16114
16115 virtual ParamIteratorInterface<ParamType>* Begin() const {
16116 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16117 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
16118 }
16119 virtual ParamIteratorInterface<ParamType>* End() const {
16120 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16121 g4_, g4_.end(), g5_, g5_.end());
16122 }
16123
16124 private:
16125 class Iterator : public ParamIteratorInterface<ParamType> {
16126 public:
16127 Iterator(const ParamGeneratorInterface<ParamType>* base,
16128 const ParamGenerator<T1>& g1,
16129 const typename ParamGenerator<T1>::iterator& current1,
16130 const ParamGenerator<T2>& g2,
16131 const typename ParamGenerator<T2>::iterator& current2,
16132 const ParamGenerator<T3>& g3,
16133 const typename ParamGenerator<T3>::iterator& current3,
16134 const ParamGenerator<T4>& g4,
16135 const typename ParamGenerator<T4>::iterator& current4,
16136 const ParamGenerator<T5>& g5,
16137 const typename ParamGenerator<T5>::iterator& current5)
16138 : base_(base),
16139 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16140 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16141 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16142 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16143 begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
16144 ComputeCurrentValue();
16145 }
16146 virtual ~Iterator() {}
16147
16148 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16149 return base_;
16150 }
16151 // Advance should not be called on beyond-of-range iterators
16152 // so no component iterators must be beyond end of range, either.
16153 virtual void Advance() {
16154 assert(!AtEnd());
16155 ++current5_;
16156 if (current5_ == end5_) {
16157 current5_ = begin5_;
16158 ++current4_;
16159 }
16160 if (current4_ == end4_) {
16161 current4_ = begin4_;
16162 ++current3_;
16163 }
16164 if (current3_ == end3_) {
16165 current3_ = begin3_;
16166 ++current2_;
16167 }
16168 if (current2_ == end2_) {
16169 current2_ = begin2_;
16170 ++current1_;
16171 }
16172 ComputeCurrentValue();
16173 }
16174 virtual ParamIteratorInterface<ParamType>* Clone() const {
16175 return new Iterator(*this);
16176 }
f67539c2 16177 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16178 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16179 // Having the same base generator guarantees that the other
16180 // iterator is of the same type and we can downcast.
16181 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16182 << "The program attempted to compare iterators "
16183 << "from different generators." << std::endl;
16184 const Iterator* typed_other =
16185 CheckedDowncastToActualType<const Iterator>(&other);
16186 // We must report iterators equal if they both point beyond their
16187 // respective ranges. That can happen in a variety of fashions,
16188 // so we have to consult AtEnd().
16189 return (AtEnd() && typed_other->AtEnd()) ||
16190 (
16191 current1_ == typed_other->current1_ &&
16192 current2_ == typed_other->current2_ &&
16193 current3_ == typed_other->current3_ &&
16194 current4_ == typed_other->current4_ &&
16195 current5_ == typed_other->current5_);
16196 }
16197
16198 private:
16199 Iterator(const Iterator& other)
16200 : base_(other.base_),
16201 begin1_(other.begin1_),
16202 end1_(other.end1_),
16203 current1_(other.current1_),
16204 begin2_(other.begin2_),
16205 end2_(other.end2_),
16206 current2_(other.current2_),
16207 begin3_(other.begin3_),
16208 end3_(other.end3_),
16209 current3_(other.current3_),
16210 begin4_(other.begin4_),
16211 end4_(other.end4_),
16212 current4_(other.current4_),
16213 begin5_(other.begin5_),
16214 end5_(other.end5_),
16215 current5_(other.current5_) {
16216 ComputeCurrentValue();
16217 }
16218
16219 void ComputeCurrentValue() {
16220 if (!AtEnd())
f67539c2
TL
16221 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16222 *current4_, *current5_));
7c673cae
FG
16223 }
16224 bool AtEnd() const {
16225 // We must report iterator past the end of the range when either of the
16226 // component iterators has reached the end of its range.
16227 return
16228 current1_ == end1_ ||
16229 current2_ == end2_ ||
16230 current3_ == end3_ ||
16231 current4_ == end4_ ||
16232 current5_ == end5_;
16233 }
16234
16235 // No implementation - assignment is unsupported.
16236 void operator=(const Iterator& other);
16237
16238 const ParamGeneratorInterface<ParamType>* const base_;
16239 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16240 // current[i]_ is the actual traversing iterator.
16241 const typename ParamGenerator<T1>::iterator begin1_;
16242 const typename ParamGenerator<T1>::iterator end1_;
16243 typename ParamGenerator<T1>::iterator current1_;
16244 const typename ParamGenerator<T2>::iterator begin2_;
16245 const typename ParamGenerator<T2>::iterator end2_;
16246 typename ParamGenerator<T2>::iterator current2_;
16247 const typename ParamGenerator<T3>::iterator begin3_;
16248 const typename ParamGenerator<T3>::iterator end3_;
16249 typename ParamGenerator<T3>::iterator current3_;
16250 const typename ParamGenerator<T4>::iterator begin4_;
16251 const typename ParamGenerator<T4>::iterator end4_;
16252 typename ParamGenerator<T4>::iterator current4_;
16253 const typename ParamGenerator<T5>::iterator begin5_;
16254 const typename ParamGenerator<T5>::iterator end5_;
16255 typename ParamGenerator<T5>::iterator current5_;
f67539c2 16256 linked_ptr<ParamType> current_value_;
7c673cae
FG
16257 }; // class CartesianProductGenerator5::Iterator
16258
16259 // No implementation - assignment is unsupported.
16260 void operator=(const CartesianProductGenerator5& other);
16261
16262 const ParamGenerator<T1> g1_;
16263 const ParamGenerator<T2> g2_;
16264 const ParamGenerator<T3> g3_;
16265 const ParamGenerator<T4> g4_;
16266 const ParamGenerator<T5> g5_;
16267}; // class CartesianProductGenerator5
16268
16269
16270template <typename T1, typename T2, typename T3, typename T4, typename T5,
16271 typename T6>
16272class CartesianProductGenerator6
16273 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
16274 T6> > {
16275 public:
16276 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
16277
16278 CartesianProductGenerator6(const ParamGenerator<T1>& g1,
16279 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16280 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16281 const ParamGenerator<T6>& g6)
16282 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
16283 virtual ~CartesianProductGenerator6() {}
16284
16285 virtual ParamIteratorInterface<ParamType>* Begin() const {
16286 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16287 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
16288 }
16289 virtual ParamIteratorInterface<ParamType>* End() const {
16290 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16291 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
16292 }
16293
16294 private:
16295 class Iterator : public ParamIteratorInterface<ParamType> {
16296 public:
16297 Iterator(const ParamGeneratorInterface<ParamType>* base,
16298 const ParamGenerator<T1>& g1,
16299 const typename ParamGenerator<T1>::iterator& current1,
16300 const ParamGenerator<T2>& g2,
16301 const typename ParamGenerator<T2>::iterator& current2,
16302 const ParamGenerator<T3>& g3,
16303 const typename ParamGenerator<T3>::iterator& current3,
16304 const ParamGenerator<T4>& g4,
16305 const typename ParamGenerator<T4>::iterator& current4,
16306 const ParamGenerator<T5>& g5,
16307 const typename ParamGenerator<T5>::iterator& current5,
16308 const ParamGenerator<T6>& g6,
16309 const typename ParamGenerator<T6>::iterator& current6)
16310 : base_(base),
16311 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16312 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16313 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16314 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16315 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16316 begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
16317 ComputeCurrentValue();
16318 }
16319 virtual ~Iterator() {}
16320
16321 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16322 return base_;
16323 }
16324 // Advance should not be called on beyond-of-range iterators
16325 // so no component iterators must be beyond end of range, either.
16326 virtual void Advance() {
16327 assert(!AtEnd());
16328 ++current6_;
16329 if (current6_ == end6_) {
16330 current6_ = begin6_;
16331 ++current5_;
16332 }
16333 if (current5_ == end5_) {
16334 current5_ = begin5_;
16335 ++current4_;
16336 }
16337 if (current4_ == end4_) {
16338 current4_ = begin4_;
16339 ++current3_;
16340 }
16341 if (current3_ == end3_) {
16342 current3_ = begin3_;
16343 ++current2_;
16344 }
16345 if (current2_ == end2_) {
16346 current2_ = begin2_;
16347 ++current1_;
16348 }
16349 ComputeCurrentValue();
16350 }
16351 virtual ParamIteratorInterface<ParamType>* Clone() const {
16352 return new Iterator(*this);
16353 }
f67539c2 16354 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16355 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16356 // Having the same base generator guarantees that the other
16357 // iterator is of the same type and we can downcast.
16358 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16359 << "The program attempted to compare iterators "
16360 << "from different generators." << std::endl;
16361 const Iterator* typed_other =
16362 CheckedDowncastToActualType<const Iterator>(&other);
16363 // We must report iterators equal if they both point beyond their
16364 // respective ranges. That can happen in a variety of fashions,
16365 // so we have to consult AtEnd().
16366 return (AtEnd() && typed_other->AtEnd()) ||
16367 (
16368 current1_ == typed_other->current1_ &&
16369 current2_ == typed_other->current2_ &&
16370 current3_ == typed_other->current3_ &&
16371 current4_ == typed_other->current4_ &&
16372 current5_ == typed_other->current5_ &&
16373 current6_ == typed_other->current6_);
16374 }
16375
16376 private:
16377 Iterator(const Iterator& other)
16378 : base_(other.base_),
16379 begin1_(other.begin1_),
16380 end1_(other.end1_),
16381 current1_(other.current1_),
16382 begin2_(other.begin2_),
16383 end2_(other.end2_),
16384 current2_(other.current2_),
16385 begin3_(other.begin3_),
16386 end3_(other.end3_),
16387 current3_(other.current3_),
16388 begin4_(other.begin4_),
16389 end4_(other.end4_),
16390 current4_(other.current4_),
16391 begin5_(other.begin5_),
16392 end5_(other.end5_),
16393 current5_(other.current5_),
16394 begin6_(other.begin6_),
16395 end6_(other.end6_),
16396 current6_(other.current6_) {
16397 ComputeCurrentValue();
16398 }
16399
16400 void ComputeCurrentValue() {
16401 if (!AtEnd())
f67539c2
TL
16402 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16403 *current4_, *current5_, *current6_));
7c673cae
FG
16404 }
16405 bool AtEnd() const {
16406 // We must report iterator past the end of the range when either of the
16407 // component iterators has reached the end of its range.
16408 return
16409 current1_ == end1_ ||
16410 current2_ == end2_ ||
16411 current3_ == end3_ ||
16412 current4_ == end4_ ||
16413 current5_ == end5_ ||
16414 current6_ == end6_;
16415 }
16416
16417 // No implementation - assignment is unsupported.
16418 void operator=(const Iterator& other);
16419
16420 const ParamGeneratorInterface<ParamType>* const base_;
16421 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16422 // current[i]_ is the actual traversing iterator.
16423 const typename ParamGenerator<T1>::iterator begin1_;
16424 const typename ParamGenerator<T1>::iterator end1_;
16425 typename ParamGenerator<T1>::iterator current1_;
16426 const typename ParamGenerator<T2>::iterator begin2_;
16427 const typename ParamGenerator<T2>::iterator end2_;
16428 typename ParamGenerator<T2>::iterator current2_;
16429 const typename ParamGenerator<T3>::iterator begin3_;
16430 const typename ParamGenerator<T3>::iterator end3_;
16431 typename ParamGenerator<T3>::iterator current3_;
16432 const typename ParamGenerator<T4>::iterator begin4_;
16433 const typename ParamGenerator<T4>::iterator end4_;
16434 typename ParamGenerator<T4>::iterator current4_;
16435 const typename ParamGenerator<T5>::iterator begin5_;
16436 const typename ParamGenerator<T5>::iterator end5_;
16437 typename ParamGenerator<T5>::iterator current5_;
16438 const typename ParamGenerator<T6>::iterator begin6_;
16439 const typename ParamGenerator<T6>::iterator end6_;
16440 typename ParamGenerator<T6>::iterator current6_;
f67539c2 16441 linked_ptr<ParamType> current_value_;
7c673cae
FG
16442 }; // class CartesianProductGenerator6::Iterator
16443
16444 // No implementation - assignment is unsupported.
16445 void operator=(const CartesianProductGenerator6& other);
16446
16447 const ParamGenerator<T1> g1_;
16448 const ParamGenerator<T2> g2_;
16449 const ParamGenerator<T3> g3_;
16450 const ParamGenerator<T4> g4_;
16451 const ParamGenerator<T5> g5_;
16452 const ParamGenerator<T6> g6_;
16453}; // class CartesianProductGenerator6
16454
16455
16456template <typename T1, typename T2, typename T3, typename T4, typename T5,
16457 typename T6, typename T7>
16458class CartesianProductGenerator7
16459 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16460 T7> > {
16461 public:
16462 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
16463
16464 CartesianProductGenerator7(const ParamGenerator<T1>& g1,
16465 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16466 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16467 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
16468 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
16469 virtual ~CartesianProductGenerator7() {}
16470
16471 virtual ParamIteratorInterface<ParamType>* Begin() const {
16472 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16473 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16474 g7_.begin());
16475 }
16476 virtual ParamIteratorInterface<ParamType>* End() const {
16477 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16478 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
16479 }
16480
16481 private:
16482 class Iterator : public ParamIteratorInterface<ParamType> {
16483 public:
16484 Iterator(const ParamGeneratorInterface<ParamType>* base,
16485 const ParamGenerator<T1>& g1,
16486 const typename ParamGenerator<T1>::iterator& current1,
16487 const ParamGenerator<T2>& g2,
16488 const typename ParamGenerator<T2>::iterator& current2,
16489 const ParamGenerator<T3>& g3,
16490 const typename ParamGenerator<T3>::iterator& current3,
16491 const ParamGenerator<T4>& g4,
16492 const typename ParamGenerator<T4>::iterator& current4,
16493 const ParamGenerator<T5>& g5,
16494 const typename ParamGenerator<T5>::iterator& current5,
16495 const ParamGenerator<T6>& g6,
16496 const typename ParamGenerator<T6>::iterator& current6,
16497 const ParamGenerator<T7>& g7,
16498 const typename ParamGenerator<T7>::iterator& current7)
16499 : base_(base),
16500 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16501 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16502 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16503 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16504 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16505 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16506 begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
16507 ComputeCurrentValue();
16508 }
16509 virtual ~Iterator() {}
16510
16511 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16512 return base_;
16513 }
16514 // Advance should not be called on beyond-of-range iterators
16515 // so no component iterators must be beyond end of range, either.
16516 virtual void Advance() {
16517 assert(!AtEnd());
16518 ++current7_;
16519 if (current7_ == end7_) {
16520 current7_ = begin7_;
16521 ++current6_;
16522 }
16523 if (current6_ == end6_) {
16524 current6_ = begin6_;
16525 ++current5_;
16526 }
16527 if (current5_ == end5_) {
16528 current5_ = begin5_;
16529 ++current4_;
16530 }
16531 if (current4_ == end4_) {
16532 current4_ = begin4_;
16533 ++current3_;
16534 }
16535 if (current3_ == end3_) {
16536 current3_ = begin3_;
16537 ++current2_;
16538 }
16539 if (current2_ == end2_) {
16540 current2_ = begin2_;
16541 ++current1_;
16542 }
16543 ComputeCurrentValue();
16544 }
16545 virtual ParamIteratorInterface<ParamType>* Clone() const {
16546 return new Iterator(*this);
16547 }
f67539c2 16548 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16549 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16550 // Having the same base generator guarantees that the other
16551 // iterator is of the same type and we can downcast.
16552 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16553 << "The program attempted to compare iterators "
16554 << "from different generators." << std::endl;
16555 const Iterator* typed_other =
16556 CheckedDowncastToActualType<const Iterator>(&other);
16557 // We must report iterators equal if they both point beyond their
16558 // respective ranges. That can happen in a variety of fashions,
16559 // so we have to consult AtEnd().
16560 return (AtEnd() && typed_other->AtEnd()) ||
16561 (
16562 current1_ == typed_other->current1_ &&
16563 current2_ == typed_other->current2_ &&
16564 current3_ == typed_other->current3_ &&
16565 current4_ == typed_other->current4_ &&
16566 current5_ == typed_other->current5_ &&
16567 current6_ == typed_other->current6_ &&
16568 current7_ == typed_other->current7_);
16569 }
16570
16571 private:
16572 Iterator(const Iterator& other)
16573 : base_(other.base_),
16574 begin1_(other.begin1_),
16575 end1_(other.end1_),
16576 current1_(other.current1_),
16577 begin2_(other.begin2_),
16578 end2_(other.end2_),
16579 current2_(other.current2_),
16580 begin3_(other.begin3_),
16581 end3_(other.end3_),
16582 current3_(other.current3_),
16583 begin4_(other.begin4_),
16584 end4_(other.end4_),
16585 current4_(other.current4_),
16586 begin5_(other.begin5_),
16587 end5_(other.end5_),
16588 current5_(other.current5_),
16589 begin6_(other.begin6_),
16590 end6_(other.end6_),
16591 current6_(other.current6_),
16592 begin7_(other.begin7_),
16593 end7_(other.end7_),
16594 current7_(other.current7_) {
16595 ComputeCurrentValue();
16596 }
16597
16598 void ComputeCurrentValue() {
16599 if (!AtEnd())
f67539c2
TL
16600 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16601 *current4_, *current5_, *current6_, *current7_));
7c673cae
FG
16602 }
16603 bool AtEnd() const {
16604 // We must report iterator past the end of the range when either of the
16605 // component iterators has reached the end of its range.
16606 return
16607 current1_ == end1_ ||
16608 current2_ == end2_ ||
16609 current3_ == end3_ ||
16610 current4_ == end4_ ||
16611 current5_ == end5_ ||
16612 current6_ == end6_ ||
16613 current7_ == end7_;
16614 }
16615
16616 // No implementation - assignment is unsupported.
16617 void operator=(const Iterator& other);
16618
16619 const ParamGeneratorInterface<ParamType>* const base_;
16620 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16621 // current[i]_ is the actual traversing iterator.
16622 const typename ParamGenerator<T1>::iterator begin1_;
16623 const typename ParamGenerator<T1>::iterator end1_;
16624 typename ParamGenerator<T1>::iterator current1_;
16625 const typename ParamGenerator<T2>::iterator begin2_;
16626 const typename ParamGenerator<T2>::iterator end2_;
16627 typename ParamGenerator<T2>::iterator current2_;
16628 const typename ParamGenerator<T3>::iterator begin3_;
16629 const typename ParamGenerator<T3>::iterator end3_;
16630 typename ParamGenerator<T3>::iterator current3_;
16631 const typename ParamGenerator<T4>::iterator begin4_;
16632 const typename ParamGenerator<T4>::iterator end4_;
16633 typename ParamGenerator<T4>::iterator current4_;
16634 const typename ParamGenerator<T5>::iterator begin5_;
16635 const typename ParamGenerator<T5>::iterator end5_;
16636 typename ParamGenerator<T5>::iterator current5_;
16637 const typename ParamGenerator<T6>::iterator begin6_;
16638 const typename ParamGenerator<T6>::iterator end6_;
16639 typename ParamGenerator<T6>::iterator current6_;
16640 const typename ParamGenerator<T7>::iterator begin7_;
16641 const typename ParamGenerator<T7>::iterator end7_;
16642 typename ParamGenerator<T7>::iterator current7_;
f67539c2 16643 linked_ptr<ParamType> current_value_;
7c673cae
FG
16644 }; // class CartesianProductGenerator7::Iterator
16645
16646 // No implementation - assignment is unsupported.
16647 void operator=(const CartesianProductGenerator7& other);
16648
16649 const ParamGenerator<T1> g1_;
16650 const ParamGenerator<T2> g2_;
16651 const ParamGenerator<T3> g3_;
16652 const ParamGenerator<T4> g4_;
16653 const ParamGenerator<T5> g5_;
16654 const ParamGenerator<T6> g6_;
16655 const ParamGenerator<T7> g7_;
16656}; // class CartesianProductGenerator7
16657
16658
16659template <typename T1, typename T2, typename T3, typename T4, typename T5,
16660 typename T6, typename T7, typename T8>
16661class CartesianProductGenerator8
16662 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16663 T7, T8> > {
16664 public:
16665 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
16666
16667 CartesianProductGenerator8(const ParamGenerator<T1>& g1,
16668 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16669 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16670 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16671 const ParamGenerator<T8>& g8)
16672 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
16673 g8_(g8) {}
16674 virtual ~CartesianProductGenerator8() {}
16675
16676 virtual ParamIteratorInterface<ParamType>* Begin() const {
16677 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16678 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16679 g7_.begin(), g8_, g8_.begin());
16680 }
16681 virtual ParamIteratorInterface<ParamType>* End() const {
16682 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16683 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16684 g8_.end());
16685 }
16686
16687 private:
16688 class Iterator : public ParamIteratorInterface<ParamType> {
16689 public:
16690 Iterator(const ParamGeneratorInterface<ParamType>* base,
16691 const ParamGenerator<T1>& g1,
16692 const typename ParamGenerator<T1>::iterator& current1,
16693 const ParamGenerator<T2>& g2,
16694 const typename ParamGenerator<T2>::iterator& current2,
16695 const ParamGenerator<T3>& g3,
16696 const typename ParamGenerator<T3>::iterator& current3,
16697 const ParamGenerator<T4>& g4,
16698 const typename ParamGenerator<T4>::iterator& current4,
16699 const ParamGenerator<T5>& g5,
16700 const typename ParamGenerator<T5>::iterator& current5,
16701 const ParamGenerator<T6>& g6,
16702 const typename ParamGenerator<T6>::iterator& current6,
16703 const ParamGenerator<T7>& g7,
16704 const typename ParamGenerator<T7>::iterator& current7,
16705 const ParamGenerator<T8>& g8,
16706 const typename ParamGenerator<T8>::iterator& current8)
16707 : base_(base),
16708 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16709 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16710 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16711 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16712 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16713 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16714 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16715 begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
16716 ComputeCurrentValue();
16717 }
16718 virtual ~Iterator() {}
16719
16720 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16721 return base_;
16722 }
16723 // Advance should not be called on beyond-of-range iterators
16724 // so no component iterators must be beyond end of range, either.
16725 virtual void Advance() {
16726 assert(!AtEnd());
16727 ++current8_;
16728 if (current8_ == end8_) {
16729 current8_ = begin8_;
16730 ++current7_;
16731 }
16732 if (current7_ == end7_) {
16733 current7_ = begin7_;
16734 ++current6_;
16735 }
16736 if (current6_ == end6_) {
16737 current6_ = begin6_;
16738 ++current5_;
16739 }
16740 if (current5_ == end5_) {
16741 current5_ = begin5_;
16742 ++current4_;
16743 }
16744 if (current4_ == end4_) {
16745 current4_ = begin4_;
16746 ++current3_;
16747 }
16748 if (current3_ == end3_) {
16749 current3_ = begin3_;
16750 ++current2_;
16751 }
16752 if (current2_ == end2_) {
16753 current2_ = begin2_;
16754 ++current1_;
16755 }
16756 ComputeCurrentValue();
16757 }
16758 virtual ParamIteratorInterface<ParamType>* Clone() const {
16759 return new Iterator(*this);
16760 }
f67539c2 16761 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16762 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16763 // Having the same base generator guarantees that the other
16764 // iterator is of the same type and we can downcast.
16765 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16766 << "The program attempted to compare iterators "
16767 << "from different generators." << std::endl;
16768 const Iterator* typed_other =
16769 CheckedDowncastToActualType<const Iterator>(&other);
16770 // We must report iterators equal if they both point beyond their
16771 // respective ranges. That can happen in a variety of fashions,
16772 // so we have to consult AtEnd().
16773 return (AtEnd() && typed_other->AtEnd()) ||
16774 (
16775 current1_ == typed_other->current1_ &&
16776 current2_ == typed_other->current2_ &&
16777 current3_ == typed_other->current3_ &&
16778 current4_ == typed_other->current4_ &&
16779 current5_ == typed_other->current5_ &&
16780 current6_ == typed_other->current6_ &&
16781 current7_ == typed_other->current7_ &&
16782 current8_ == typed_other->current8_);
16783 }
16784
16785 private:
16786 Iterator(const Iterator& other)
16787 : base_(other.base_),
16788 begin1_(other.begin1_),
16789 end1_(other.end1_),
16790 current1_(other.current1_),
16791 begin2_(other.begin2_),
16792 end2_(other.end2_),
16793 current2_(other.current2_),
16794 begin3_(other.begin3_),
16795 end3_(other.end3_),
16796 current3_(other.current3_),
16797 begin4_(other.begin4_),
16798 end4_(other.end4_),
16799 current4_(other.current4_),
16800 begin5_(other.begin5_),
16801 end5_(other.end5_),
16802 current5_(other.current5_),
16803 begin6_(other.begin6_),
16804 end6_(other.end6_),
16805 current6_(other.current6_),
16806 begin7_(other.begin7_),
16807 end7_(other.end7_),
16808 current7_(other.current7_),
16809 begin8_(other.begin8_),
16810 end8_(other.end8_),
16811 current8_(other.current8_) {
16812 ComputeCurrentValue();
16813 }
16814
16815 void ComputeCurrentValue() {
16816 if (!AtEnd())
f67539c2
TL
16817 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16818 *current4_, *current5_, *current6_, *current7_, *current8_));
7c673cae
FG
16819 }
16820 bool AtEnd() const {
16821 // We must report iterator past the end of the range when either of the
16822 // component iterators has reached the end of its range.
16823 return
16824 current1_ == end1_ ||
16825 current2_ == end2_ ||
16826 current3_ == end3_ ||
16827 current4_ == end4_ ||
16828 current5_ == end5_ ||
16829 current6_ == end6_ ||
16830 current7_ == end7_ ||
16831 current8_ == end8_;
16832 }
16833
16834 // No implementation - assignment is unsupported.
16835 void operator=(const Iterator& other);
16836
16837 const ParamGeneratorInterface<ParamType>* const base_;
16838 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16839 // current[i]_ is the actual traversing iterator.
16840 const typename ParamGenerator<T1>::iterator begin1_;
16841 const typename ParamGenerator<T1>::iterator end1_;
16842 typename ParamGenerator<T1>::iterator current1_;
16843 const typename ParamGenerator<T2>::iterator begin2_;
16844 const typename ParamGenerator<T2>::iterator end2_;
16845 typename ParamGenerator<T2>::iterator current2_;
16846 const typename ParamGenerator<T3>::iterator begin3_;
16847 const typename ParamGenerator<T3>::iterator end3_;
16848 typename ParamGenerator<T3>::iterator current3_;
16849 const typename ParamGenerator<T4>::iterator begin4_;
16850 const typename ParamGenerator<T4>::iterator end4_;
16851 typename ParamGenerator<T4>::iterator current4_;
16852 const typename ParamGenerator<T5>::iterator begin5_;
16853 const typename ParamGenerator<T5>::iterator end5_;
16854 typename ParamGenerator<T5>::iterator current5_;
16855 const typename ParamGenerator<T6>::iterator begin6_;
16856 const typename ParamGenerator<T6>::iterator end6_;
16857 typename ParamGenerator<T6>::iterator current6_;
16858 const typename ParamGenerator<T7>::iterator begin7_;
16859 const typename ParamGenerator<T7>::iterator end7_;
16860 typename ParamGenerator<T7>::iterator current7_;
16861 const typename ParamGenerator<T8>::iterator begin8_;
16862 const typename ParamGenerator<T8>::iterator end8_;
16863 typename ParamGenerator<T8>::iterator current8_;
f67539c2 16864 linked_ptr<ParamType> current_value_;
7c673cae
FG
16865 }; // class CartesianProductGenerator8::Iterator
16866
16867 // No implementation - assignment is unsupported.
16868 void operator=(const CartesianProductGenerator8& other);
16869
16870 const ParamGenerator<T1> g1_;
16871 const ParamGenerator<T2> g2_;
16872 const ParamGenerator<T3> g3_;
16873 const ParamGenerator<T4> g4_;
16874 const ParamGenerator<T5> g5_;
16875 const ParamGenerator<T6> g6_;
16876 const ParamGenerator<T7> g7_;
16877 const ParamGenerator<T8> g8_;
16878}; // class CartesianProductGenerator8
16879
16880
16881template <typename T1, typename T2, typename T3, typename T4, typename T5,
16882 typename T6, typename T7, typename T8, typename T9>
16883class CartesianProductGenerator9
16884 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16885 T7, T8, T9> > {
16886 public:
16887 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
16888
16889 CartesianProductGenerator9(const ParamGenerator<T1>& g1,
16890 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16891 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16892 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16893 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
16894 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16895 g9_(g9) {}
16896 virtual ~CartesianProductGenerator9() {}
16897
16898 virtual ParamIteratorInterface<ParamType>* Begin() const {
16899 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16900 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16901 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
16902 }
16903 virtual ParamIteratorInterface<ParamType>* End() const {
16904 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16905 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16906 g8_.end(), g9_, g9_.end());
16907 }
16908
16909 private:
16910 class Iterator : public ParamIteratorInterface<ParamType> {
16911 public:
16912 Iterator(const ParamGeneratorInterface<ParamType>* base,
16913 const ParamGenerator<T1>& g1,
16914 const typename ParamGenerator<T1>::iterator& current1,
16915 const ParamGenerator<T2>& g2,
16916 const typename ParamGenerator<T2>::iterator& current2,
16917 const ParamGenerator<T3>& g3,
16918 const typename ParamGenerator<T3>::iterator& current3,
16919 const ParamGenerator<T4>& g4,
16920 const typename ParamGenerator<T4>::iterator& current4,
16921 const ParamGenerator<T5>& g5,
16922 const typename ParamGenerator<T5>::iterator& current5,
16923 const ParamGenerator<T6>& g6,
16924 const typename ParamGenerator<T6>::iterator& current6,
16925 const ParamGenerator<T7>& g7,
16926 const typename ParamGenerator<T7>::iterator& current7,
16927 const ParamGenerator<T8>& g8,
16928 const typename ParamGenerator<T8>::iterator& current8,
16929 const ParamGenerator<T9>& g9,
16930 const typename ParamGenerator<T9>::iterator& current9)
16931 : base_(base),
16932 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16933 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16934 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16935 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16936 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16937 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16938 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16939 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
16940 begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
16941 ComputeCurrentValue();
16942 }
16943 virtual ~Iterator() {}
16944
16945 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16946 return base_;
16947 }
16948 // Advance should not be called on beyond-of-range iterators
16949 // so no component iterators must be beyond end of range, either.
16950 virtual void Advance() {
16951 assert(!AtEnd());
16952 ++current9_;
16953 if (current9_ == end9_) {
16954 current9_ = begin9_;
16955 ++current8_;
16956 }
16957 if (current8_ == end8_) {
16958 current8_ = begin8_;
16959 ++current7_;
16960 }
16961 if (current7_ == end7_) {
16962 current7_ = begin7_;
16963 ++current6_;
16964 }
16965 if (current6_ == end6_) {
16966 current6_ = begin6_;
16967 ++current5_;
16968 }
16969 if (current5_ == end5_) {
16970 current5_ = begin5_;
16971 ++current4_;
16972 }
16973 if (current4_ == end4_) {
16974 current4_ = begin4_;
16975 ++current3_;
16976 }
16977 if (current3_ == end3_) {
16978 current3_ = begin3_;
16979 ++current2_;
16980 }
16981 if (current2_ == end2_) {
16982 current2_ = begin2_;
16983 ++current1_;
16984 }
16985 ComputeCurrentValue();
16986 }
16987 virtual ParamIteratorInterface<ParamType>* Clone() const {
16988 return new Iterator(*this);
16989 }
f67539c2 16990 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
16991 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16992 // Having the same base generator guarantees that the other
16993 // iterator is of the same type and we can downcast.
16994 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16995 << "The program attempted to compare iterators "
16996 << "from different generators." << std::endl;
16997 const Iterator* typed_other =
16998 CheckedDowncastToActualType<const Iterator>(&other);
16999 // We must report iterators equal if they both point beyond their
17000 // respective ranges. That can happen in a variety of fashions,
17001 // so we have to consult AtEnd().
17002 return (AtEnd() && typed_other->AtEnd()) ||
17003 (
17004 current1_ == typed_other->current1_ &&
17005 current2_ == typed_other->current2_ &&
17006 current3_ == typed_other->current3_ &&
17007 current4_ == typed_other->current4_ &&
17008 current5_ == typed_other->current5_ &&
17009 current6_ == typed_other->current6_ &&
17010 current7_ == typed_other->current7_ &&
17011 current8_ == typed_other->current8_ &&
17012 current9_ == typed_other->current9_);
17013 }
17014
17015 private:
17016 Iterator(const Iterator& other)
17017 : base_(other.base_),
17018 begin1_(other.begin1_),
17019 end1_(other.end1_),
17020 current1_(other.current1_),
17021 begin2_(other.begin2_),
17022 end2_(other.end2_),
17023 current2_(other.current2_),
17024 begin3_(other.begin3_),
17025 end3_(other.end3_),
17026 current3_(other.current3_),
17027 begin4_(other.begin4_),
17028 end4_(other.end4_),
17029 current4_(other.current4_),
17030 begin5_(other.begin5_),
17031 end5_(other.end5_),
17032 current5_(other.current5_),
17033 begin6_(other.begin6_),
17034 end6_(other.end6_),
17035 current6_(other.current6_),
17036 begin7_(other.begin7_),
17037 end7_(other.end7_),
17038 current7_(other.current7_),
17039 begin8_(other.begin8_),
17040 end8_(other.end8_),
17041 current8_(other.current8_),
17042 begin9_(other.begin9_),
17043 end9_(other.end9_),
17044 current9_(other.current9_) {
17045 ComputeCurrentValue();
17046 }
17047
17048 void ComputeCurrentValue() {
17049 if (!AtEnd())
f67539c2 17050 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
7c673cae 17051 *current4_, *current5_, *current6_, *current7_, *current8_,
f67539c2 17052 *current9_));
7c673cae
FG
17053 }
17054 bool AtEnd() const {
17055 // We must report iterator past the end of the range when either of the
17056 // component iterators has reached the end of its range.
17057 return
17058 current1_ == end1_ ||
17059 current2_ == end2_ ||
17060 current3_ == end3_ ||
17061 current4_ == end4_ ||
17062 current5_ == end5_ ||
17063 current6_ == end6_ ||
17064 current7_ == end7_ ||
17065 current8_ == end8_ ||
17066 current9_ == end9_;
17067 }
17068
17069 // No implementation - assignment is unsupported.
17070 void operator=(const Iterator& other);
17071
17072 const ParamGeneratorInterface<ParamType>* const base_;
17073 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
17074 // current[i]_ is the actual traversing iterator.
17075 const typename ParamGenerator<T1>::iterator begin1_;
17076 const typename ParamGenerator<T1>::iterator end1_;
17077 typename ParamGenerator<T1>::iterator current1_;
17078 const typename ParamGenerator<T2>::iterator begin2_;
17079 const typename ParamGenerator<T2>::iterator end2_;
17080 typename ParamGenerator<T2>::iterator current2_;
17081 const typename ParamGenerator<T3>::iterator begin3_;
17082 const typename ParamGenerator<T3>::iterator end3_;
17083 typename ParamGenerator<T3>::iterator current3_;
17084 const typename ParamGenerator<T4>::iterator begin4_;
17085 const typename ParamGenerator<T4>::iterator end4_;
17086 typename ParamGenerator<T4>::iterator current4_;
17087 const typename ParamGenerator<T5>::iterator begin5_;
17088 const typename ParamGenerator<T5>::iterator end5_;
17089 typename ParamGenerator<T5>::iterator current5_;
17090 const typename ParamGenerator<T6>::iterator begin6_;
17091 const typename ParamGenerator<T6>::iterator end6_;
17092 typename ParamGenerator<T6>::iterator current6_;
17093 const typename ParamGenerator<T7>::iterator begin7_;
17094 const typename ParamGenerator<T7>::iterator end7_;
17095 typename ParamGenerator<T7>::iterator current7_;
17096 const typename ParamGenerator<T8>::iterator begin8_;
17097 const typename ParamGenerator<T8>::iterator end8_;
17098 typename ParamGenerator<T8>::iterator current8_;
17099 const typename ParamGenerator<T9>::iterator begin9_;
17100 const typename ParamGenerator<T9>::iterator end9_;
17101 typename ParamGenerator<T9>::iterator current9_;
f67539c2 17102 linked_ptr<ParamType> current_value_;
7c673cae
FG
17103 }; // class CartesianProductGenerator9::Iterator
17104
17105 // No implementation - assignment is unsupported.
17106 void operator=(const CartesianProductGenerator9& other);
17107
17108 const ParamGenerator<T1> g1_;
17109 const ParamGenerator<T2> g2_;
17110 const ParamGenerator<T3> g3_;
17111 const ParamGenerator<T4> g4_;
17112 const ParamGenerator<T5> g5_;
17113 const ParamGenerator<T6> g6_;
17114 const ParamGenerator<T7> g7_;
17115 const ParamGenerator<T8> g8_;
17116 const ParamGenerator<T9> g9_;
17117}; // class CartesianProductGenerator9
17118
17119
17120template <typename T1, typename T2, typename T3, typename T4, typename T5,
17121 typename T6, typename T7, typename T8, typename T9, typename T10>
17122class CartesianProductGenerator10
17123 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
17124 T7, T8, T9, T10> > {
17125 public:
17126 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
17127
17128 CartesianProductGenerator10(const ParamGenerator<T1>& g1,
17129 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
17130 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
17131 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
17132 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
17133 const ParamGenerator<T10>& g10)
17134 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17135 g9_(g9), g10_(g10) {}
17136 virtual ~CartesianProductGenerator10() {}
17137
17138 virtual ParamIteratorInterface<ParamType>* Begin() const {
17139 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
17140 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
17141 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
17142 }
17143 virtual ParamIteratorInterface<ParamType>* End() const {
17144 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
17145 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
17146 g8_.end(), g9_, g9_.end(), g10_, g10_.end());
17147 }
17148
17149 private:
17150 class Iterator : public ParamIteratorInterface<ParamType> {
17151 public:
17152 Iterator(const ParamGeneratorInterface<ParamType>* base,
17153 const ParamGenerator<T1>& g1,
17154 const typename ParamGenerator<T1>::iterator& current1,
17155 const ParamGenerator<T2>& g2,
17156 const typename ParamGenerator<T2>::iterator& current2,
17157 const ParamGenerator<T3>& g3,
17158 const typename ParamGenerator<T3>::iterator& current3,
17159 const ParamGenerator<T4>& g4,
17160 const typename ParamGenerator<T4>::iterator& current4,
17161 const ParamGenerator<T5>& g5,
17162 const typename ParamGenerator<T5>::iterator& current5,
17163 const ParamGenerator<T6>& g6,
17164 const typename ParamGenerator<T6>::iterator& current6,
17165 const ParamGenerator<T7>& g7,
17166 const typename ParamGenerator<T7>::iterator& current7,
17167 const ParamGenerator<T8>& g8,
17168 const typename ParamGenerator<T8>::iterator& current8,
17169 const ParamGenerator<T9>& g9,
17170 const typename ParamGenerator<T9>::iterator& current9,
17171 const ParamGenerator<T10>& g10,
17172 const typename ParamGenerator<T10>::iterator& current10)
17173 : base_(base),
17174 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
17175 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
17176 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
17177 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
17178 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
17179 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
17180 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
17181 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
17182 begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
17183 begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
17184 ComputeCurrentValue();
17185 }
17186 virtual ~Iterator() {}
17187
17188 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
17189 return base_;
17190 }
17191 // Advance should not be called on beyond-of-range iterators
17192 // so no component iterators must be beyond end of range, either.
17193 virtual void Advance() {
17194 assert(!AtEnd());
17195 ++current10_;
17196 if (current10_ == end10_) {
17197 current10_ = begin10_;
17198 ++current9_;
17199 }
17200 if (current9_ == end9_) {
17201 current9_ = begin9_;
17202 ++current8_;
17203 }
17204 if (current8_ == end8_) {
17205 current8_ = begin8_;
17206 ++current7_;
17207 }
17208 if (current7_ == end7_) {
17209 current7_ = begin7_;
17210 ++current6_;
17211 }
17212 if (current6_ == end6_) {
17213 current6_ = begin6_;
17214 ++current5_;
17215 }
17216 if (current5_ == end5_) {
17217 current5_ = begin5_;
17218 ++current4_;
17219 }
17220 if (current4_ == end4_) {
17221 current4_ = begin4_;
17222 ++current3_;
17223 }
17224 if (current3_ == end3_) {
17225 current3_ = begin3_;
17226 ++current2_;
17227 }
17228 if (current2_ == end2_) {
17229 current2_ = begin2_;
17230 ++current1_;
17231 }
17232 ComputeCurrentValue();
17233 }
17234 virtual ParamIteratorInterface<ParamType>* Clone() const {
17235 return new Iterator(*this);
17236 }
f67539c2 17237 virtual const ParamType* Current() const { return current_value_.get(); }
7c673cae
FG
17238 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
17239 // Having the same base generator guarantees that the other
17240 // iterator is of the same type and we can downcast.
17241 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
17242 << "The program attempted to compare iterators "
17243 << "from different generators." << std::endl;
17244 const Iterator* typed_other =
17245 CheckedDowncastToActualType<const Iterator>(&other);
17246 // We must report iterators equal if they both point beyond their
17247 // respective ranges. That can happen in a variety of fashions,
17248 // so we have to consult AtEnd().
17249 return (AtEnd() && typed_other->AtEnd()) ||
17250 (
17251 current1_ == typed_other->current1_ &&
17252 current2_ == typed_other->current2_ &&
17253 current3_ == typed_other->current3_ &&
17254 current4_ == typed_other->current4_ &&
17255 current5_ == typed_other->current5_ &&
17256 current6_ == typed_other->current6_ &&
17257 current7_ == typed_other->current7_ &&
17258 current8_ == typed_other->current8_ &&
17259 current9_ == typed_other->current9_ &&
17260 current10_ == typed_other->current10_);
17261 }
17262
17263 private:
17264 Iterator(const Iterator& other)
17265 : base_(other.base_),
17266 begin1_(other.begin1_),
17267 end1_(other.end1_),
17268 current1_(other.current1_),
17269 begin2_(other.begin2_),
17270 end2_(other.end2_),
17271 current2_(other.current2_),
17272 begin3_(other.begin3_),
17273 end3_(other.end3_),
17274 current3_(other.current3_),
17275 begin4_(other.begin4_),
17276 end4_(other.end4_),
17277 current4_(other.current4_),
17278 begin5_(other.begin5_),
17279 end5_(other.end5_),
17280 current5_(other.current5_),
17281 begin6_(other.begin6_),
17282 end6_(other.end6_),
17283 current6_(other.current6_),
17284 begin7_(other.begin7_),
17285 end7_(other.end7_),
17286 current7_(other.current7_),
17287 begin8_(other.begin8_),
17288 end8_(other.end8_),
17289 current8_(other.current8_),
17290 begin9_(other.begin9_),
17291 end9_(other.end9_),
17292 current9_(other.current9_),
17293 begin10_(other.begin10_),
17294 end10_(other.end10_),
17295 current10_(other.current10_) {
17296 ComputeCurrentValue();
17297 }
17298
17299 void ComputeCurrentValue() {
17300 if (!AtEnd())
f67539c2 17301 current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
7c673cae 17302 *current4_, *current5_, *current6_, *current7_, *current8_,
f67539c2 17303 *current9_, *current10_));
7c673cae
FG
17304 }
17305 bool AtEnd() const {
17306 // We must report iterator past the end of the range when either of the
17307 // component iterators has reached the end of its range.
17308 return
17309 current1_ == end1_ ||
17310 current2_ == end2_ ||
17311 current3_ == end3_ ||
17312 current4_ == end4_ ||
17313 current5_ == end5_ ||
17314 current6_ == end6_ ||
17315 current7_ == end7_ ||
17316 current8_ == end8_ ||
17317 current9_ == end9_ ||
17318 current10_ == end10_;
17319 }
17320
17321 // No implementation - assignment is unsupported.
17322 void operator=(const Iterator& other);
17323
17324 const ParamGeneratorInterface<ParamType>* const base_;
17325 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
17326 // current[i]_ is the actual traversing iterator.
17327 const typename ParamGenerator<T1>::iterator begin1_;
17328 const typename ParamGenerator<T1>::iterator end1_;
17329 typename ParamGenerator<T1>::iterator current1_;
17330 const typename ParamGenerator<T2>::iterator begin2_;
17331 const typename ParamGenerator<T2>::iterator end2_;
17332 typename ParamGenerator<T2>::iterator current2_;
17333 const typename ParamGenerator<T3>::iterator begin3_;
17334 const typename ParamGenerator<T3>::iterator end3_;
17335 typename ParamGenerator<T3>::iterator current3_;
17336 const typename ParamGenerator<T4>::iterator begin4_;
17337 const typename ParamGenerator<T4>::iterator end4_;
17338 typename ParamGenerator<T4>::iterator current4_;
17339 const typename ParamGenerator<T5>::iterator begin5_;
17340 const typename ParamGenerator<T5>::iterator end5_;
17341 typename ParamGenerator<T5>::iterator current5_;
17342 const typename ParamGenerator<T6>::iterator begin6_;
17343 const typename ParamGenerator<T6>::iterator end6_;
17344 typename ParamGenerator<T6>::iterator current6_;
17345 const typename ParamGenerator<T7>::iterator begin7_;
17346 const typename ParamGenerator<T7>::iterator end7_;
17347 typename ParamGenerator<T7>::iterator current7_;
17348 const typename ParamGenerator<T8>::iterator begin8_;
17349 const typename ParamGenerator<T8>::iterator end8_;
17350 typename ParamGenerator<T8>::iterator current8_;
17351 const typename ParamGenerator<T9>::iterator begin9_;
17352 const typename ParamGenerator<T9>::iterator end9_;
17353 typename ParamGenerator<T9>::iterator current9_;
17354 const typename ParamGenerator<T10>::iterator begin10_;
17355 const typename ParamGenerator<T10>::iterator end10_;
17356 typename ParamGenerator<T10>::iterator current10_;
f67539c2 17357 linked_ptr<ParamType> current_value_;
7c673cae
FG
17358 }; // class CartesianProductGenerator10::Iterator
17359
17360 // No implementation - assignment is unsupported.
17361 void operator=(const CartesianProductGenerator10& other);
17362
17363 const ParamGenerator<T1> g1_;
17364 const ParamGenerator<T2> g2_;
17365 const ParamGenerator<T3> g3_;
17366 const ParamGenerator<T4> g4_;
17367 const ParamGenerator<T5> g5_;
17368 const ParamGenerator<T6> g6_;
17369 const ParamGenerator<T7> g7_;
17370 const ParamGenerator<T8> g8_;
17371 const ParamGenerator<T9> g9_;
17372 const ParamGenerator<T10> g10_;
17373}; // class CartesianProductGenerator10
17374
17375
17376// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17377//
17378// Helper classes providing Combine() with polymorphic features. They allow
17379// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
17380// convertible to U.
17381//
17382template <class Generator1, class Generator2>
17383class CartesianProductHolder2 {
17384 public:
17385CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
17386 : g1_(g1), g2_(g2) {}
17387 template <typename T1, typename T2>
17388 operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
17389 return ParamGenerator< ::testing::tuple<T1, T2> >(
17390 new CartesianProductGenerator2<T1, T2>(
17391 static_cast<ParamGenerator<T1> >(g1_),
17392 static_cast<ParamGenerator<T2> >(g2_)));
17393 }
17394
17395 private:
17396 // No implementation - assignment is unsupported.
17397 void operator=(const CartesianProductHolder2& other);
17398
17399 const Generator1 g1_;
17400 const Generator2 g2_;
17401}; // class CartesianProductHolder2
17402
17403template <class Generator1, class Generator2, class Generator3>
17404class CartesianProductHolder3 {
17405 public:
17406CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
17407 const Generator3& g3)
17408 : g1_(g1), g2_(g2), g3_(g3) {}
17409 template <typename T1, typename T2, typename T3>
17410 operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
17411 return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
17412 new CartesianProductGenerator3<T1, T2, T3>(
17413 static_cast<ParamGenerator<T1> >(g1_),
17414 static_cast<ParamGenerator<T2> >(g2_),
17415 static_cast<ParamGenerator<T3> >(g3_)));
17416 }
17417
17418 private:
17419 // No implementation - assignment is unsupported.
17420 void operator=(const CartesianProductHolder3& other);
17421
17422 const Generator1 g1_;
17423 const Generator2 g2_;
17424 const Generator3 g3_;
17425}; // class CartesianProductHolder3
17426
17427template <class Generator1, class Generator2, class Generator3,
17428 class Generator4>
17429class CartesianProductHolder4 {
17430 public:
17431CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
17432 const Generator3& g3, const Generator4& g4)
17433 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
17434 template <typename T1, typename T2, typename T3, typename T4>
17435 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
17436 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
17437 new CartesianProductGenerator4<T1, T2, T3, T4>(
17438 static_cast<ParamGenerator<T1> >(g1_),
17439 static_cast<ParamGenerator<T2> >(g2_),
17440 static_cast<ParamGenerator<T3> >(g3_),
17441 static_cast<ParamGenerator<T4> >(g4_)));
17442 }
17443
17444 private:
17445 // No implementation - assignment is unsupported.
17446 void operator=(const CartesianProductHolder4& other);
17447
17448 const Generator1 g1_;
17449 const Generator2 g2_;
17450 const Generator3 g3_;
17451 const Generator4 g4_;
17452}; // class CartesianProductHolder4
17453
17454template <class Generator1, class Generator2, class Generator3,
17455 class Generator4, class Generator5>
17456class CartesianProductHolder5 {
17457 public:
17458CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
17459 const Generator3& g3, const Generator4& g4, const Generator5& g5)
17460 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
17461 template <typename T1, typename T2, typename T3, typename T4, typename T5>
17462 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
17463 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
17464 new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
17465 static_cast<ParamGenerator<T1> >(g1_),
17466 static_cast<ParamGenerator<T2> >(g2_),
17467 static_cast<ParamGenerator<T3> >(g3_),
17468 static_cast<ParamGenerator<T4> >(g4_),
17469 static_cast<ParamGenerator<T5> >(g5_)));
17470 }
17471
17472 private:
17473 // No implementation - assignment is unsupported.
17474 void operator=(const CartesianProductHolder5& other);
17475
17476 const Generator1 g1_;
17477 const Generator2 g2_;
17478 const Generator3 g3_;
17479 const Generator4 g4_;
17480 const Generator5 g5_;
17481}; // class CartesianProductHolder5
17482
17483template <class Generator1, class Generator2, class Generator3,
17484 class Generator4, class Generator5, class Generator6>
17485class CartesianProductHolder6 {
17486 public:
17487CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
17488 const Generator3& g3, const Generator4& g4, const Generator5& g5,
17489 const Generator6& g6)
17490 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
17491 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17492 typename T6>
17493 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
17494 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
17495 new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
17496 static_cast<ParamGenerator<T1> >(g1_),
17497 static_cast<ParamGenerator<T2> >(g2_),
17498 static_cast<ParamGenerator<T3> >(g3_),
17499 static_cast<ParamGenerator<T4> >(g4_),
17500 static_cast<ParamGenerator<T5> >(g5_),
17501 static_cast<ParamGenerator<T6> >(g6_)));
17502 }
17503
17504 private:
17505 // No implementation - assignment is unsupported.
17506 void operator=(const CartesianProductHolder6& other);
17507
17508 const Generator1 g1_;
17509 const Generator2 g2_;
17510 const Generator3 g3_;
17511 const Generator4 g4_;
17512 const Generator5 g5_;
17513 const Generator6 g6_;
17514}; // class CartesianProductHolder6
17515
17516template <class Generator1, class Generator2, class Generator3,
17517 class Generator4, class Generator5, class Generator6, class Generator7>
17518class CartesianProductHolder7 {
17519 public:
17520CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
17521 const Generator3& g3, const Generator4& g4, const Generator5& g5,
17522 const Generator6& g6, const Generator7& g7)
17523 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
17524 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17525 typename T6, typename T7>
17526 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
17527 T7> >() const {
17528 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
17529 new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
17530 static_cast<ParamGenerator<T1> >(g1_),
17531 static_cast<ParamGenerator<T2> >(g2_),
17532 static_cast<ParamGenerator<T3> >(g3_),
17533 static_cast<ParamGenerator<T4> >(g4_),
17534 static_cast<ParamGenerator<T5> >(g5_),
17535 static_cast<ParamGenerator<T6> >(g6_),
17536 static_cast<ParamGenerator<T7> >(g7_)));
17537 }
17538
17539 private:
17540 // No implementation - assignment is unsupported.
17541 void operator=(const CartesianProductHolder7& other);
17542
17543 const Generator1 g1_;
17544 const Generator2 g2_;
17545 const Generator3 g3_;
17546 const Generator4 g4_;
17547 const Generator5 g5_;
17548 const Generator6 g6_;
17549 const Generator7 g7_;
17550}; // class CartesianProductHolder7
17551
17552template <class Generator1, class Generator2, class Generator3,
17553 class Generator4, class Generator5, class Generator6, class Generator7,
17554 class Generator8>
17555class CartesianProductHolder8 {
17556 public:
17557CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
17558 const Generator3& g3, const Generator4& g4, const Generator5& g5,
17559 const Generator6& g6, const Generator7& g7, const Generator8& g8)
17560 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
17561 g8_(g8) {}
17562 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17563 typename T6, typename T7, typename T8>
17564 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
17565 T8> >() const {
17566 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
17567 new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
17568 static_cast<ParamGenerator<T1> >(g1_),
17569 static_cast<ParamGenerator<T2> >(g2_),
17570 static_cast<ParamGenerator<T3> >(g3_),
17571 static_cast<ParamGenerator<T4> >(g4_),
17572 static_cast<ParamGenerator<T5> >(g5_),
17573 static_cast<ParamGenerator<T6> >(g6_),
17574 static_cast<ParamGenerator<T7> >(g7_),
17575 static_cast<ParamGenerator<T8> >(g8_)));
17576 }
17577
17578 private:
17579 // No implementation - assignment is unsupported.
17580 void operator=(const CartesianProductHolder8& other);
17581
17582 const Generator1 g1_;
17583 const Generator2 g2_;
17584 const Generator3 g3_;
17585 const Generator4 g4_;
17586 const Generator5 g5_;
17587 const Generator6 g6_;
17588 const Generator7 g7_;
17589 const Generator8 g8_;
17590}; // class CartesianProductHolder8
17591
17592template <class Generator1, class Generator2, class Generator3,
17593 class Generator4, class Generator5, class Generator6, class Generator7,
17594 class Generator8, class Generator9>
17595class CartesianProductHolder9 {
17596 public:
17597CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
17598 const Generator3& g3, const Generator4& g4, const Generator5& g5,
17599 const Generator6& g6, const Generator7& g7, const Generator8& g8,
17600 const Generator9& g9)
17601 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17602 g9_(g9) {}
17603 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17604 typename T6, typename T7, typename T8, typename T9>
17605 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
17606 T9> >() const {
17607 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
17608 T9> >(
17609 new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
17610 static_cast<ParamGenerator<T1> >(g1_),
17611 static_cast<ParamGenerator<T2> >(g2_),
17612 static_cast<ParamGenerator<T3> >(g3_),
17613 static_cast<ParamGenerator<T4> >(g4_),
17614 static_cast<ParamGenerator<T5> >(g5_),
17615 static_cast<ParamGenerator<T6> >(g6_),
17616 static_cast<ParamGenerator<T7> >(g7_),
17617 static_cast<ParamGenerator<T8> >(g8_),
17618 static_cast<ParamGenerator<T9> >(g9_)));
17619 }
17620
17621 private:
17622 // No implementation - assignment is unsupported.
17623 void operator=(const CartesianProductHolder9& other);
17624
17625 const Generator1 g1_;
17626 const Generator2 g2_;
17627 const Generator3 g3_;
17628 const Generator4 g4_;
17629 const Generator5 g5_;
17630 const Generator6 g6_;
17631 const Generator7 g7_;
17632 const Generator8 g8_;
17633 const Generator9 g9_;
17634}; // class CartesianProductHolder9
17635
17636template <class Generator1, class Generator2, class Generator3,
17637 class Generator4, class Generator5, class Generator6, class Generator7,
17638 class Generator8, class Generator9, class Generator10>
17639class CartesianProductHolder10 {
17640 public:
17641CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
17642 const Generator3& g3, const Generator4& g4, const Generator5& g5,
17643 const Generator6& g6, const Generator7& g7, const Generator8& g8,
17644 const Generator9& g9, const Generator10& g10)
17645 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17646 g9_(g9), g10_(g10) {}
17647 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17648 typename T6, typename T7, typename T8, typename T9, typename T10>
17649 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17650 T10> >() const {
17651 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17652 T10> >(
17653 new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17654 T10>(
17655 static_cast<ParamGenerator<T1> >(g1_),
17656 static_cast<ParamGenerator<T2> >(g2_),
17657 static_cast<ParamGenerator<T3> >(g3_),
17658 static_cast<ParamGenerator<T4> >(g4_),
17659 static_cast<ParamGenerator<T5> >(g5_),
17660 static_cast<ParamGenerator<T6> >(g6_),
17661 static_cast<ParamGenerator<T7> >(g7_),
17662 static_cast<ParamGenerator<T8> >(g8_),
17663 static_cast<ParamGenerator<T9> >(g9_),
17664 static_cast<ParamGenerator<T10> >(g10_)));
17665 }
17666
17667 private:
17668 // No implementation - assignment is unsupported.
17669 void operator=(const CartesianProductHolder10& other);
17670
17671 const Generator1 g1_;
17672 const Generator2 g2_;
17673 const Generator3 g3_;
17674 const Generator4 g4_;
17675 const Generator5 g5_;
17676 const Generator6 g6_;
17677 const Generator7 g7_;
17678 const Generator8 g8_;
17679 const Generator9 g9_;
17680 const Generator10 g10_;
17681}; // class CartesianProductHolder10
17682
17683# endif // GTEST_HAS_COMBINE
17684
17685} // namespace internal
17686} // namespace testing
17687
7c673cae
FG
17688#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
17689
7c673cae
FG
17690namespace testing {
17691
17692// Functions producing parameter generators.
17693//
17694// Google Test uses these generators to produce parameters for value-
17695// parameterized tests. When a parameterized test case is instantiated
17696// with a particular generator, Google Test creates and runs tests
17697// for each element in the sequence produced by the generator.
17698//
17699// In the following sample, tests from test case FooTest are instantiated
17700// each three times with parameter values 3, 5, and 8:
17701//
17702// class FooTest : public TestWithParam<int> { ... };
17703//
17704// TEST_P(FooTest, TestThis) {
17705// }
17706// TEST_P(FooTest, TestThat) {
17707// }
17708// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
17709//
17710
17711// Range() returns generators providing sequences of values in a range.
17712//
17713// Synopsis:
17714// Range(start, end)
17715// - returns a generator producing a sequence of values {start, start+1,
17716// start+2, ..., }.
17717// Range(start, end, step)
17718// - returns a generator producing a sequence of values {start, start+step,
17719// start+step+step, ..., }.
17720// Notes:
17721// * The generated sequences never include end. For example, Range(1, 5)
17722// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
17723// returns a generator producing {1, 3, 5, 7}.
17724// * start and end must have the same type. That type may be any integral or
17725// floating-point type or a user defined type satisfying these conditions:
17726// * It must be assignable (have operator=() defined).
17727// * It must have operator+() (operator+(int-compatible type) for
17728// two-operand version).
17729// * It must have operator<() defined.
17730// Elements in the resulting sequences will also have that type.
17731// * Condition start < end must be satisfied in order for resulting sequences
17732// to contain any elements.
17733//
17734template <typename T, typename IncrementT>
17735internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
17736 return internal::ParamGenerator<T>(
17737 new internal::RangeGenerator<T, IncrementT>(start, end, step));
17738}
17739
17740template <typename T>
17741internal::ParamGenerator<T> Range(T start, T end) {
17742 return Range(start, end, 1);
17743}
17744
17745// ValuesIn() function allows generation of tests with parameters coming from
17746// a container.
17747//
17748// Synopsis:
17749// ValuesIn(const T (&array)[N])
17750// - returns a generator producing sequences with elements from
17751// a C-style array.
17752// ValuesIn(const Container& container)
17753// - returns a generator producing sequences with elements from
17754// an STL-style container.
17755// ValuesIn(Iterator begin, Iterator end)
17756// - returns a generator producing sequences with elements from
17757// a range [begin, end) defined by a pair of STL-style iterators. These
17758// iterators can also be plain C pointers.
17759//
17760// Please note that ValuesIn copies the values from the containers
17761// passed in and keeps them to generate tests in RUN_ALL_TESTS().
17762//
17763// Examples:
17764//
17765// This instantiates tests from test case StringTest
17766// each with C-string values of "foo", "bar", and "baz":
17767//
17768// const char* strings[] = {"foo", "bar", "baz"};
f67539c2 17769// INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
7c673cae
FG
17770//
17771// This instantiates tests from test case StlStringTest
17772// each with STL strings with values "a" and "b":
17773//
17774// ::std::vector< ::std::string> GetParameterStrings() {
17775// ::std::vector< ::std::string> v;
17776// v.push_back("a");
17777// v.push_back("b");
17778// return v;
17779// }
17780//
17781// INSTANTIATE_TEST_CASE_P(CharSequence,
17782// StlStringTest,
17783// ValuesIn(GetParameterStrings()));
17784//
17785//
17786// This will also instantiate tests from CharTest
17787// each with parameter values 'a' and 'b':
17788//
17789// ::std::list<char> GetParameterChars() {
17790// ::std::list<char> list;
17791// list.push_back('a');
17792// list.push_back('b');
17793// return list;
17794// }
17795// ::std::list<char> l = GetParameterChars();
17796// INSTANTIATE_TEST_CASE_P(CharSequence2,
17797// CharTest,
17798// ValuesIn(l.begin(), l.end()));
17799//
17800template <typename ForwardIterator>
17801internal::ParamGenerator<
17802 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
17803ValuesIn(ForwardIterator begin, ForwardIterator end) {
17804 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
17805 ::value_type ParamType;
17806 return internal::ParamGenerator<ParamType>(
17807 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
17808}
17809
17810template <typename T, size_t N>
17811internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
17812 return ValuesIn(array, array + N);
17813}
17814
17815template <class Container>
17816internal::ParamGenerator<typename Container::value_type> ValuesIn(
17817 const Container& container) {
17818 return ValuesIn(container.begin(), container.end());
17819}
17820
17821// Values() allows generating tests from explicitly specified list of
17822// parameters.
17823//
17824// Synopsis:
17825// Values(T v1, T v2, ..., T vN)
17826// - returns a generator producing sequences with elements v1, v2, ..., vN.
17827//
17828// For example, this instantiates tests from test case BarTest each
17829// with values "one", "two", and "three":
17830//
17831// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
17832//
17833// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
17834// The exact type of values will depend on the type of parameter in BazTest.
17835//
17836// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
17837//
17838// Currently, Values() supports from 1 to 50 parameters.
17839//
17840template <typename T1>
17841internal::ValueArray1<T1> Values(T1 v1) {
17842 return internal::ValueArray1<T1>(v1);
17843}
17844
17845template <typename T1, typename T2>
17846internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
17847 return internal::ValueArray2<T1, T2>(v1, v2);
17848}
17849
17850template <typename T1, typename T2, typename T3>
17851internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
17852 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
17853}
17854
17855template <typename T1, typename T2, typename T3, typename T4>
17856internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
17857 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
17858}
17859
17860template <typename T1, typename T2, typename T3, typename T4, typename T5>
17861internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17862 T5 v5) {
17863 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
17864}
17865
17866template <typename T1, typename T2, typename T3, typename T4, typename T5,
17867 typename T6>
17868internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
17869 T4 v4, T5 v5, T6 v6) {
17870 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
17871}
17872
17873template <typename T1, typename T2, typename T3, typename T4, typename T5,
17874 typename T6, typename T7>
17875internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
17876 T4 v4, T5 v5, T6 v6, T7 v7) {
17877 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
17878 v6, v7);
17879}
17880
17881template <typename T1, typename T2, typename T3, typename T4, typename T5,
17882 typename T6, typename T7, typename T8>
17883internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
17884 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
17885 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
17886 v5, v6, v7, v8);
17887}
17888
17889template <typename T1, typename T2, typename T3, typename T4, typename T5,
17890 typename T6, typename T7, typename T8, typename T9>
17891internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
17892 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
17893 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
17894 v4, v5, v6, v7, v8, v9);
17895}
17896
17897template <typename T1, typename T2, typename T3, typename T4, typename T5,
17898 typename T6, typename T7, typename T8, typename T9, typename T10>
17899internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
17900 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
17901 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
17902 v2, v3, v4, v5, v6, v7, v8, v9, v10);
17903}
17904
17905template <typename T1, typename T2, typename T3, typename T4, typename T5,
17906 typename T6, typename T7, typename T8, typename T9, typename T10,
17907 typename T11>
17908internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17909 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17910 T10 v10, T11 v11) {
17911 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17912 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
17913}
17914
17915template <typename T1, typename T2, typename T3, typename T4, typename T5,
17916 typename T6, typename T7, typename T8, typename T9, typename T10,
17917 typename T11, typename T12>
17918internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17919 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17920 T10 v10, T11 v11, T12 v12) {
17921 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17922 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
17923}
17924
17925template <typename T1, typename T2, typename T3, typename T4, typename T5,
17926 typename T6, typename T7, typename T8, typename T9, typename T10,
17927 typename T11, typename T12, typename T13>
17928internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
17929 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17930 T10 v10, T11 v11, T12 v12, T13 v13) {
17931 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17932 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
17933}
17934
17935template <typename T1, typename T2, typename T3, typename T4, typename T5,
17936 typename T6, typename T7, typename T8, typename T9, typename T10,
17937 typename T11, typename T12, typename T13, typename T14>
17938internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17939 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17940 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
17941 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17942 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
17943 v14);
17944}
17945
17946template <typename T1, typename T2, typename T3, typename T4, typename T5,
17947 typename T6, typename T7, typename T8, typename T9, typename T10,
17948 typename T11, typename T12, typename T13, typename T14, typename T15>
17949internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17950 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
17951 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
17952 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17953 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
17954 v13, v14, v15);
17955}
17956
17957template <typename T1, typename T2, typename T3, typename T4, typename T5,
17958 typename T6, typename T7, typename T8, typename T9, typename T10,
17959 typename T11, typename T12, typename T13, typename T14, typename T15,
17960 typename T16>
17961internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17962 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17963 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17964 T16 v16) {
17965 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17966 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
17967 v12, v13, v14, v15, v16);
17968}
17969
17970template <typename T1, typename T2, typename T3, typename T4, typename T5,
17971 typename T6, typename T7, typename T8, typename T9, typename T10,
17972 typename T11, typename T12, typename T13, typename T14, typename T15,
17973 typename T16, typename T17>
17974internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17975 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17976 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17977 T16 v16, T17 v17) {
17978 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17979 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
17980 v11, v12, v13, v14, v15, v16, v17);
17981}
17982
17983template <typename T1, typename T2, typename T3, typename T4, typename T5,
17984 typename T6, typename T7, typename T8, typename T9, typename T10,
17985 typename T11, typename T12, typename T13, typename T14, typename T15,
17986 typename T16, typename T17, typename T18>
17987internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17988 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
17989 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17990 T16 v16, T17 v17, T18 v18) {
17991 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17992 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
17993 v10, v11, v12, v13, v14, v15, v16, v17, v18);
17994}
17995
17996template <typename T1, typename T2, typename T3, typename T4, typename T5,
17997 typename T6, typename T7, typename T8, typename T9, typename T10,
17998 typename T11, typename T12, typename T13, typename T14, typename T15,
17999 typename T16, typename T17, typename T18, typename T19>
18000internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18001 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
18002 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
18003 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
18004 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18005 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
18006 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
18007}
18008
18009template <typename T1, typename T2, typename T3, typename T4, typename T5,
18010 typename T6, typename T7, typename T8, typename T9, typename T10,
18011 typename T11, typename T12, typename T13, typename T14, typename T15,
18012 typename T16, typename T17, typename T18, typename T19, typename T20>
18013internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18014 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18015 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18016 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
18017 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18018 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
18019 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
18020}
18021
18022template <typename T1, typename T2, typename T3, typename T4, typename T5,
18023 typename T6, typename T7, typename T8, typename T9, typename T10,
18024 typename T11, typename T12, typename T13, typename T14, typename T15,
18025 typename T16, typename T17, typename T18, typename T19, typename T20,
18026 typename T21>
18027internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18028 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18029 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18030 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
18031 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18032 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
18033 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
18034}
18035
18036template <typename T1, typename T2, typename T3, typename T4, typename T5,
18037 typename T6, typename T7, typename T8, typename T9, typename T10,
18038 typename T11, typename T12, typename T13, typename T14, typename T15,
18039 typename T16, typename T17, typename T18, typename T19, typename T20,
18040 typename T21, typename T22>
18041internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18042 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
18043 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18044 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18045 T21 v21, T22 v22) {
18046 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18047 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
18048 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18049 v20, v21, v22);
18050}
18051
18052template <typename T1, typename T2, typename T3, typename T4, typename T5,
18053 typename T6, typename T7, typename T8, typename T9, typename T10,
18054 typename T11, typename T12, typename T13, typename T14, typename T15,
18055 typename T16, typename T17, typename T18, typename T19, typename T20,
18056 typename T21, typename T22, typename T23>
18057internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18058 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
18059 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18060 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18061 T21 v21, T22 v22, T23 v23) {
18062 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18063 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
18064 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18065 v20, v21, v22, v23);
18066}
18067
18068template <typename T1, typename T2, typename T3, typename T4, typename T5,
18069 typename T6, typename T7, typename T8, typename T9, typename T10,
18070 typename T11, typename T12, typename T13, typename T14, typename T15,
18071 typename T16, typename T17, typename T18, typename T19, typename T20,
18072 typename T21, typename T22, typename T23, typename T24>
18073internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18074 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
18075 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18076 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18077 T21 v21, T22 v22, T23 v23, T24 v24) {
18078 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18079 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
18080 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
18081 v19, v20, v21, v22, v23, v24);
18082}
18083
18084template <typename T1, typename T2, typename T3, typename T4, typename T5,
18085 typename T6, typename T7, typename T8, typename T9, typename T10,
18086 typename T11, typename T12, typename T13, typename T14, typename T15,
18087 typename T16, typename T17, typename T18, typename T19, typename T20,
18088 typename T21, typename T22, typename T23, typename T24, typename T25>
18089internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18090 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
18091 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
18092 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
18093 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
18094 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18095 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
18096 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
18097 v18, v19, v20, v21, v22, v23, v24, v25);
18098}
18099
18100template <typename T1, typename T2, typename T3, typename T4, typename T5,
18101 typename T6, typename T7, typename T8, typename T9, typename T10,
18102 typename T11, typename T12, typename T13, typename T14, typename T15,
18103 typename T16, typename T17, typename T18, typename T19, typename T20,
18104 typename T21, typename T22, typename T23, typename T24, typename T25,
18105 typename T26>
18106internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18107 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18108 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18109 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18110 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18111 T26 v26) {
18112 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18113 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18114 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
18115 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
18116}
18117
18118template <typename T1, typename T2, typename T3, typename T4, typename T5,
18119 typename T6, typename T7, typename T8, typename T9, typename T10,
18120 typename T11, typename T12, typename T13, typename T14, typename T15,
18121 typename T16, typename T17, typename T18, typename T19, typename T20,
18122 typename T21, typename T22, typename T23, typename T24, typename T25,
18123 typename T26, typename T27>
18124internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18125 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
18126 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18127 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18128 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18129 T26 v26, T27 v27) {
18130 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18131 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18132 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
18133 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
18134}
18135
18136template <typename T1, typename T2, typename T3, typename T4, typename T5,
18137 typename T6, typename T7, typename T8, typename T9, typename T10,
18138 typename T11, typename T12, typename T13, typename T14, typename T15,
18139 typename T16, typename T17, typename T18, typename T19, typename T20,
18140 typename T21, typename T22, typename T23, typename T24, typename T25,
18141 typename T26, typename T27, typename T28>
18142internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18143 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
18144 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18145 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18146 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18147 T26 v26, T27 v27, T28 v28) {
18148 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18149 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18150 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
18151 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
18152 v28);
18153}
18154
18155template <typename T1, typename T2, typename T3, typename T4, typename T5,
18156 typename T6, typename T7, typename T8, typename T9, typename T10,
18157 typename T11, typename T12, typename T13, typename T14, typename T15,
18158 typename T16, typename T17, typename T18, typename T19, typename T20,
18159 typename T21, typename T22, typename T23, typename T24, typename T25,
18160 typename T26, typename T27, typename T28, typename T29>
18161internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18162 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18163 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18164 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18165 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18166 T26 v26, T27 v27, T28 v28, T29 v29) {
18167 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18168 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18169 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
18170 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
18171 v27, v28, v29);
18172}
18173
18174template <typename T1, typename T2, typename T3, typename T4, typename T5,
18175 typename T6, typename T7, typename T8, typename T9, typename T10,
18176 typename T11, typename T12, typename T13, typename T14, typename T15,
18177 typename T16, typename T17, typename T18, typename T19, typename T20,
18178 typename T21, typename T22, typename T23, typename T24, typename T25,
18179 typename T26, typename T27, typename T28, typename T29, typename T30>
18180internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18181 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18182 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
18183 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
18184 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
18185 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
18186 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18187 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18188 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
18189 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
18190 v26, v27, v28, v29, v30);
18191}
18192
18193template <typename T1, typename T2, typename T3, typename T4, typename T5,
18194 typename T6, typename T7, typename T8, typename T9, typename T10,
18195 typename T11, typename T12, typename T13, typename T14, typename T15,
18196 typename T16, typename T17, typename T18, typename T19, typename T20,
18197 typename T21, typename T22, typename T23, typename T24, typename T25,
18198 typename T26, typename T27, typename T28, typename T29, typename T30,
18199 typename T31>
18200internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18201 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18202 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18203 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18204 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18205 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
18206 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18207 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18208 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
18209 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
18210 v25, v26, v27, v28, v29, v30, v31);
18211}
18212
18213template <typename T1, typename T2, typename T3, typename T4, typename T5,
18214 typename T6, typename T7, typename T8, typename T9, typename T10,
18215 typename T11, typename T12, typename T13, typename T14, typename T15,
18216 typename T16, typename T17, typename T18, typename T19, typename T20,
18217 typename T21, typename T22, typename T23, typename T24, typename T25,
18218 typename T26, typename T27, typename T28, typename T29, typename T30,
18219 typename T31, typename T32>
18220internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18221 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18222 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18223 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18224 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18225 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18226 T32 v32) {
18227 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18228 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18229 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
18230 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18231 v24, v25, v26, v27, v28, v29, v30, v31, v32);
18232}
18233
18234template <typename T1, typename T2, typename T3, typename T4, typename T5,
18235 typename T6, typename T7, typename T8, typename T9, typename T10,
18236 typename T11, typename T12, typename T13, typename T14, typename T15,
18237 typename T16, typename T17, typename T18, typename T19, typename T20,
18238 typename T21, typename T22, typename T23, typename T24, typename T25,
18239 typename T26, typename T27, typename T28, typename T29, typename T30,
18240 typename T31, typename T32, typename T33>
18241internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18242 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18243 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
18244 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18245 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18246 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18247 T32 v32, T33 v33) {
18248 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18249 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18250 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
18251 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18252 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
18253}
18254
18255template <typename T1, typename T2, typename T3, typename T4, typename T5,
18256 typename T6, typename T7, typename T8, typename T9, typename T10,
18257 typename T11, typename T12, typename T13, typename T14, typename T15,
18258 typename T16, typename T17, typename T18, typename T19, typename T20,
18259 typename T21, typename T22, typename T23, typename T24, typename T25,
18260 typename T26, typename T27, typename T28, typename T29, typename T30,
18261 typename T31, typename T32, typename T33, typename T34>
18262internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18263 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18264 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
18265 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
18266 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
18267 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
18268 T31 v31, T32 v32, T33 v33, T34 v34) {
18269 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18270 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18271 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
18272 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
18273 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
18274}
18275
18276template <typename T1, typename T2, typename T3, typename T4, typename T5,
18277 typename T6, typename T7, typename T8, typename T9, typename T10,
18278 typename T11, typename T12, typename T13, typename T14, typename T15,
18279 typename T16, typename T17, typename T18, typename T19, typename T20,
18280 typename T21, typename T22, typename T23, typename T24, typename T25,
18281 typename T26, typename T27, typename T28, typename T29, typename T30,
18282 typename T31, typename T32, typename T33, typename T34, typename T35>
18283internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18284 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18285 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18286 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18287 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18288 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18289 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
18290 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18291 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18292 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
18293 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
18294 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
18295}
18296
18297template <typename T1, typename T2, typename T3, typename T4, typename T5,
18298 typename T6, typename T7, typename T8, typename T9, typename T10,
18299 typename T11, typename T12, typename T13, typename T14, typename T15,
18300 typename T16, typename T17, typename T18, typename T19, typename T20,
18301 typename T21, typename T22, typename T23, typename T24, typename T25,
18302 typename T26, typename T27, typename T28, typename T29, typename T30,
18303 typename T31, typename T32, typename T33, typename T34, typename T35,
18304 typename T36>
18305internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18306 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18307 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18308 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18309 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18310 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18311 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
18312 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18313 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18314 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
18315 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18316 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18317 v34, v35, v36);
18318}
18319
18320template <typename T1, typename T2, typename T3, typename T4, typename T5,
18321 typename T6, typename T7, typename T8, typename T9, typename T10,
18322 typename T11, typename T12, typename T13, typename T14, typename T15,
18323 typename T16, typename T17, typename T18, typename T19, typename T20,
18324 typename T21, typename T22, typename T23, typename T24, typename T25,
18325 typename T26, typename T27, typename T28, typename T29, typename T30,
18326 typename T31, typename T32, typename T33, typename T34, typename T35,
18327 typename T36, typename T37>
18328internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18329 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18330 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
18331 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18332 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18333 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18334 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18335 T37 v37) {
18336 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18337 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18338 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
18339 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18340 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18341 v34, v35, v36, v37);
18342}
18343
18344template <typename T1, typename T2, typename T3, typename T4, typename T5,
18345 typename T6, typename T7, typename T8, typename T9, typename T10,
18346 typename T11, typename T12, typename T13, typename T14, typename T15,
18347 typename T16, typename T17, typename T18, typename T19, typename T20,
18348 typename T21, typename T22, typename T23, typename T24, typename T25,
18349 typename T26, typename T27, typename T28, typename T29, typename T30,
18350 typename T31, typename T32, typename T33, typename T34, typename T35,
18351 typename T36, typename T37, typename T38>
18352internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18353 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18354 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
18355 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18356 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18357 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18358 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18359 T37 v37, T38 v38) {
18360 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18361 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18362 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
18363 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
18364 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
18365 v33, v34, v35, v36, v37, v38);
18366}
18367
18368template <typename T1, typename T2, typename T3, typename T4, typename T5,
18369 typename T6, typename T7, typename T8, typename T9, typename T10,
18370 typename T11, typename T12, typename T13, typename T14, typename T15,
18371 typename T16, typename T17, typename T18, typename T19, typename T20,
18372 typename T21, typename T22, typename T23, typename T24, typename T25,
18373 typename T26, typename T27, typename T28, typename T29, typename T30,
18374 typename T31, typename T32, typename T33, typename T34, typename T35,
18375 typename T36, typename T37, typename T38, typename T39>
18376internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18377 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18378 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
18379 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18380 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18381 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18382 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18383 T37 v37, T38 v38, T39 v39) {
18384 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18385 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18386 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
18387 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
18388 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
18389 v32, v33, v34, v35, v36, v37, v38, v39);
18390}
18391
18392template <typename T1, typename T2, typename T3, typename T4, typename T5,
18393 typename T6, typename T7, typename T8, typename T9, typename T10,
18394 typename T11, typename T12, typename T13, typename T14, typename T15,
18395 typename T16, typename T17, typename T18, typename T19, typename T20,
18396 typename T21, typename T22, typename T23, typename T24, typename T25,
18397 typename T26, typename T27, typename T28, typename T29, typename T30,
18398 typename T31, typename T32, typename T33, typename T34, typename T35,
18399 typename T36, typename T37, typename T38, typename T39, typename T40>
18400internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18401 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18402 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
18403 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
18404 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
18405 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
18406 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
18407 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
18408 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18409 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18410 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18411 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
18412 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
18413 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
18414}
18415
18416template <typename T1, typename T2, typename T3, typename T4, typename T5,
18417 typename T6, typename T7, typename T8, typename T9, typename T10,
18418 typename T11, typename T12, typename T13, typename T14, typename T15,
18419 typename T16, typename T17, typename T18, typename T19, typename T20,
18420 typename T21, typename T22, typename T23, typename T24, typename T25,
18421 typename T26, typename T27, typename T28, typename T29, typename T30,
18422 typename T31, typename T32, typename T33, typename T34, typename T35,
18423 typename T36, typename T37, typename T38, typename T39, typename T40,
18424 typename T41>
18425internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18426 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18427 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
18428 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18429 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18430 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18431 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18432 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
18433 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18434 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18435 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18436 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
18437 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
18438 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
18439}
18440
18441template <typename T1, typename T2, typename T3, typename T4, typename T5,
18442 typename T6, typename T7, typename T8, typename T9, typename T10,
18443 typename T11, typename T12, typename T13, typename T14, typename T15,
18444 typename T16, typename T17, typename T18, typename T19, typename T20,
18445 typename T21, typename T22, typename T23, typename T24, typename T25,
18446 typename T26, typename T27, typename T28, typename T29, typename T30,
18447 typename T31, typename T32, typename T33, typename T34, typename T35,
18448 typename T36, typename T37, typename T38, typename T39, typename T40,
18449 typename T41, typename T42>
18450internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18451 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18452 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
18453 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18454 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18455 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18456 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18457 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18458 T42 v42) {
18459 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18460 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18461 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18462 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
18463 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
18464 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
18465 v42);
18466}
18467
18468template <typename T1, typename T2, typename T3, typename T4, typename T5,
18469 typename T6, typename T7, typename T8, typename T9, typename T10,
18470 typename T11, typename T12, typename T13, typename T14, typename T15,
18471 typename T16, typename T17, typename T18, typename T19, typename T20,
18472 typename T21, typename T22, typename T23, typename T24, typename T25,
18473 typename T26, typename T27, typename T28, typename T29, typename T30,
18474 typename T31, typename T32, typename T33, typename T34, typename T35,
18475 typename T36, typename T37, typename T38, typename T39, typename T40,
18476 typename T41, typename T42, typename T43>
18477internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18478 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18479 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
18480 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18481 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18482 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18483 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18484 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18485 T42 v42, T43 v43) {
18486 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18487 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18488 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18489 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
18490 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
18491 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
18492 v41, v42, v43);
18493}
18494
18495template <typename T1, typename T2, typename T3, typename T4, typename T5,
18496 typename T6, typename T7, typename T8, typename T9, typename T10,
18497 typename T11, typename T12, typename T13, typename T14, typename T15,
18498 typename T16, typename T17, typename T18, typename T19, typename T20,
18499 typename T21, typename T22, typename T23, typename T24, typename T25,
18500 typename T26, typename T27, typename T28, typename T29, typename T30,
18501 typename T31, typename T32, typename T33, typename T34, typename T35,
18502 typename T36, typename T37, typename T38, typename T39, typename T40,
18503 typename T41, typename T42, typename T43, typename T44>
18504internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18505 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18506 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18507 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18508 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18509 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18510 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18511 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18512 T42 v42, T43 v43, T44 v44) {
18513 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18514 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18515 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18516 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
18517 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
18518 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
18519 v40, v41, v42, v43, v44);
18520}
18521
18522template <typename T1, typename T2, typename T3, typename T4, typename T5,
18523 typename T6, typename T7, typename T8, typename T9, typename T10,
18524 typename T11, typename T12, typename T13, typename T14, typename T15,
18525 typename T16, typename T17, typename T18, typename T19, typename T20,
18526 typename T21, typename T22, typename T23, typename T24, typename T25,
18527 typename T26, typename T27, typename T28, typename T29, typename T30,
18528 typename T31, typename T32, typename T33, typename T34, typename T35,
18529 typename T36, typename T37, typename T38, typename T39, typename T40,
18530 typename T41, typename T42, typename T43, typename T44, typename T45>
18531internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18532 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18533 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18534 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
18535 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
18536 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
18537 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
18538 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
18539 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
18540 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18541 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18542 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18543 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
18544 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
18545 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
18546 v39, v40, v41, v42, v43, v44, v45);
18547}
18548
18549template <typename T1, typename T2, typename T3, typename T4, typename T5,
18550 typename T6, typename T7, typename T8, typename T9, typename T10,
18551 typename T11, typename T12, typename T13, typename T14, typename T15,
18552 typename T16, typename T17, typename T18, typename T19, typename T20,
18553 typename T21, typename T22, typename T23, typename T24, typename T25,
18554 typename T26, typename T27, typename T28, typename T29, typename T30,
18555 typename T31, typename T32, typename T33, typename T34, typename T35,
18556 typename T36, typename T37, typename T38, typename T39, typename T40,
18557 typename T41, typename T42, typename T43, typename T44, typename T45,
18558 typename T46>
18559internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18560 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18561 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18562 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18563 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18564 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18565 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18566 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18567 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
18568 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18569 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18570 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18571 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
18572 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18573 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
18574 v38, v39, v40, v41, v42, v43, v44, v45, v46);
18575}
18576
18577template <typename T1, typename T2, typename T3, typename T4, typename T5,
18578 typename T6, typename T7, typename T8, typename T9, typename T10,
18579 typename T11, typename T12, typename T13, typename T14, typename T15,
18580 typename T16, typename T17, typename T18, typename T19, typename T20,
18581 typename T21, typename T22, typename T23, typename T24, typename T25,
18582 typename T26, typename T27, typename T28, typename T29, typename T30,
18583 typename T31, typename T32, typename T33, typename T34, typename T35,
18584 typename T36, typename T37, typename T38, typename T39, typename T40,
18585 typename T41, typename T42, typename T43, typename T44, typename T45,
18586 typename T46, typename T47>
18587internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18588 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18589 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18590 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18591 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18592 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18593 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18594 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18595 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
18596 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18597 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18598 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18599 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
18600 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18601 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
18602 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
18603}
18604
18605template <typename T1, typename T2, typename T3, typename T4, typename T5,
18606 typename T6, typename T7, typename T8, typename T9, typename T10,
18607 typename T11, typename T12, typename T13, typename T14, typename T15,
18608 typename T16, typename T17, typename T18, typename T19, typename T20,
18609 typename T21, typename T22, typename T23, typename T24, typename T25,
18610 typename T26, typename T27, typename T28, typename T29, typename T30,
18611 typename T31, typename T32, typename T33, typename T34, typename T35,
18612 typename T36, typename T37, typename T38, typename T39, typename T40,
18613 typename T41, typename T42, typename T43, typename T44, typename T45,
18614 typename T46, typename T47, typename T48>
18615internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18616 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18617 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18618 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
18619 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18620 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18621 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18622 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18623 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
18624 T48 v48) {
18625 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18626 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18627 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18628 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
18629 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
18630 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
18631 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
18632}
18633
18634template <typename T1, typename T2, typename T3, typename T4, typename T5,
18635 typename T6, typename T7, typename T8, typename T9, typename T10,
18636 typename T11, typename T12, typename T13, typename T14, typename T15,
18637 typename T16, typename T17, typename T18, typename T19, typename T20,
18638 typename T21, typename T22, typename T23, typename T24, typename T25,
18639 typename T26, typename T27, typename T28, typename T29, typename T30,
18640 typename T31, typename T32, typename T33, typename T34, typename T35,
18641 typename T36, typename T37, typename T38, typename T39, typename T40,
18642 typename T41, typename T42, typename T43, typename T44, typename T45,
18643 typename T46, typename T47, typename T48, typename T49>
18644internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18645 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18646 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18647 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
18648 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
18649 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
18650 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
18651 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
18652 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
18653 T47 v47, T48 v48, T49 v49) {
18654 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18655 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18656 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18657 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
18658 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
18659 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
18660 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
18661}
18662
18663template <typename T1, typename T2, typename T3, typename T4, typename T5,
18664 typename T6, typename T7, typename T8, typename T9, typename T10,
18665 typename T11, typename T12, typename T13, typename T14, typename T15,
18666 typename T16, typename T17, typename T18, typename T19, typename T20,
18667 typename T21, typename T22, typename T23, typename T24, typename T25,
18668 typename T26, typename T27, typename T28, typename T29, typename T30,
18669 typename T31, typename T32, typename T33, typename T34, typename T35,
18670 typename T36, typename T37, typename T38, typename T39, typename T40,
18671 typename T41, typename T42, typename T43, typename T44, typename T45,
18672 typename T46, typename T47, typename T48, typename T49, typename T50>
18673internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18674 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18675 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18676 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18677 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18678 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18679 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18680 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
18681 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
18682 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
18683 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18684 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18685 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18686 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
18687 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18688 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18689 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
18690 v48, v49, v50);
18691}
18692
18693// Bool() allows generating tests with parameters in a set of (false, true).
18694//
18695// Synopsis:
18696// Bool()
18697// - returns a generator producing sequences with elements {false, true}.
18698//
18699// It is useful when testing code that depends on Boolean flags. Combinations
18700// of multiple flags can be tested when several Bool()'s are combined using
18701// Combine() function.
18702//
18703// In the following example all tests in the test case FlagDependentTest
18704// will be instantiated twice with parameters false and true.
18705//
18706// class FlagDependentTest : public testing::TestWithParam<bool> {
18707// virtual void SetUp() {
18708// external_flag = GetParam();
18709// }
18710// }
18711// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
18712//
18713inline internal::ParamGenerator<bool> Bool() {
18714 return Values(false, true);
18715}
18716
18717# if GTEST_HAS_COMBINE
18718// Combine() allows the user to combine two or more sequences to produce
18719// values of a Cartesian product of those sequences' elements.
18720//
18721// Synopsis:
18722// Combine(gen1, gen2, ..., genN)
18723// - returns a generator producing sequences with elements coming from
18724// the Cartesian product of elements from the sequences generated by
18725// gen1, gen2, ..., genN. The sequence elements will have a type of
18726// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
18727// of elements from sequences produces by gen1, gen2, ..., genN.
18728//
18729// Combine can have up to 10 arguments. This number is currently limited
18730// by the maximum number of elements in the tuple implementation used by Google
18731// Test.
18732//
18733// Example:
18734//
18735// This will instantiate tests in test case AnimalTest each one with
18736// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
18737// tuple("dog", BLACK), and tuple("dog", WHITE):
18738//
18739// enum Color { BLACK, GRAY, WHITE };
18740// class AnimalTest
18741// : public testing::TestWithParam<tuple<const char*, Color> > {...};
18742//
18743// TEST_P(AnimalTest, AnimalLooksNice) {...}
18744//
18745// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
18746// Combine(Values("cat", "dog"),
18747// Values(BLACK, WHITE)));
18748//
18749// This will instantiate tests in FlagDependentTest with all variations of two
18750// Boolean flags:
18751//
18752// class FlagDependentTest
18753// : public testing::TestWithParam<tuple<bool, bool> > {
18754// virtual void SetUp() {
18755// // Assigns external_flag_1 and external_flag_2 values from the tuple.
18756// tie(external_flag_1, external_flag_2) = GetParam();
18757// }
18758// };
18759//
18760// TEST_P(FlagDependentTest, TestFeature1) {
18761// // Test your code using external_flag_1 and external_flag_2 here.
18762// }
18763// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
18764// Combine(Bool(), Bool()));
18765//
18766template <typename Generator1, typename Generator2>
18767internal::CartesianProductHolder2<Generator1, Generator2> Combine(
18768 const Generator1& g1, const Generator2& g2) {
18769 return internal::CartesianProductHolder2<Generator1, Generator2>(
18770 g1, g2);
18771}
18772
18773template <typename Generator1, typename Generator2, typename Generator3>
18774internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
18775 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
18776 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
18777 g1, g2, g3);
18778}
18779
18780template <typename Generator1, typename Generator2, typename Generator3,
18781 typename Generator4>
18782internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18783 Generator4> Combine(
18784 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18785 const Generator4& g4) {
18786 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18787 Generator4>(
18788 g1, g2, g3, g4);
18789}
18790
18791template <typename Generator1, typename Generator2, typename Generator3,
18792 typename Generator4, typename Generator5>
18793internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18794 Generator4, Generator5> Combine(
18795 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18796 const Generator4& g4, const Generator5& g5) {
18797 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18798 Generator4, Generator5>(
18799 g1, g2, g3, g4, g5);
18800}
18801
18802template <typename Generator1, typename Generator2, typename Generator3,
18803 typename Generator4, typename Generator5, typename Generator6>
18804internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18805 Generator4, Generator5, Generator6> Combine(
18806 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18807 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
18808 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18809 Generator4, Generator5, Generator6>(
18810 g1, g2, g3, g4, g5, g6);
18811}
18812
18813template <typename Generator1, typename Generator2, typename Generator3,
18814 typename Generator4, typename Generator5, typename Generator6,
18815 typename Generator7>
18816internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18817 Generator4, Generator5, Generator6, Generator7> Combine(
18818 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18819 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18820 const Generator7& g7) {
18821 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18822 Generator4, Generator5, Generator6, Generator7>(
18823 g1, g2, g3, g4, g5, g6, g7);
18824}
18825
18826template <typename Generator1, typename Generator2, typename Generator3,
18827 typename Generator4, typename Generator5, typename Generator6,
18828 typename Generator7, typename Generator8>
18829internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18830 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
18831 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18832 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18833 const Generator7& g7, const Generator8& g8) {
18834 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18835 Generator4, Generator5, Generator6, Generator7, Generator8>(
18836 g1, g2, g3, g4, g5, g6, g7, g8);
18837}
18838
18839template <typename Generator1, typename Generator2, typename Generator3,
18840 typename Generator4, typename Generator5, typename Generator6,
18841 typename Generator7, typename Generator8, typename Generator9>
18842internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18843 Generator4, Generator5, Generator6, Generator7, Generator8,
18844 Generator9> Combine(
18845 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18846 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18847 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
18848 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18849 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
18850 g1, g2, g3, g4, g5, g6, g7, g8, g9);
18851}
18852
18853template <typename Generator1, typename Generator2, typename Generator3,
18854 typename Generator4, typename Generator5, typename Generator6,
18855 typename Generator7, typename Generator8, typename Generator9,
18856 typename Generator10>
18857internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18858 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18859 Generator10> Combine(
18860 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18861 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18862 const Generator7& g7, const Generator8& g8, const Generator9& g9,
18863 const Generator10& g10) {
18864 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18865 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18866 Generator10>(
18867 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
18868}
18869# endif // GTEST_HAS_COMBINE
18870
7c673cae
FG
18871# define TEST_P(test_case_name, test_name) \
18872 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
18873 : public test_case_name { \
18874 public: \
18875 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
18876 virtual void TestBody(); \
18877 private: \
18878 static int AddToRegistry() { \
18879 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18880 GetTestCasePatternHolder<test_case_name>(\
f67539c2
TL
18881 #test_case_name, \
18882 ::testing::internal::CodeLocation(\
18883 __FILE__, __LINE__))->AddTestPattern(\
18884 GTEST_STRINGIFY_(test_case_name), \
18885 GTEST_STRINGIFY_(test_name), \
18886 new ::testing::internal::TestMetaFactory< \
18887 GTEST_TEST_CLASS_NAME_(\
18888 test_case_name, test_name)>()); \
7c673cae
FG
18889 return 0; \
18890 } \
18891 static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
18892 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
18893 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
18894 }; \
18895 int GTEST_TEST_CLASS_NAME_(test_case_name, \
18896 test_name)::gtest_registering_dummy_ = \
18897 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
18898 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
18899
f67539c2
TL
18900// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
18901// to specify a function or functor that generates custom test name suffixes
18902// based on the test parameters. The function should accept one argument of
18903// type testing::TestParamInfo<class ParamType>, and return std::string.
18904//
18905// testing::PrintToStringParamName is a builtin test suffix generator that
18906// returns the value of testing::PrintToString(GetParam()).
18907//
18908// Note: test names must be non-empty, unique, and may only contain ASCII
18909// alphanumeric characters or underscore. Because PrintToString adds quotes
18910// to std::string and C strings, it won't work for these types.
18911
18912# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
18913 static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
7c673cae 18914 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
f67539c2
TL
18915 static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
18916 const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
18917 return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
18918 (__VA_ARGS__)(info); \
18919 } \
18920 static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
7c673cae
FG
18921 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18922 GetTestCasePatternHolder<test_case_name>(\
f67539c2
TL
18923 #test_case_name, \
18924 ::testing::internal::CodeLocation(\
18925 __FILE__, __LINE__))->AddTestCaseInstantiation(\
18926 #prefix, \
18927 &gtest_##prefix##test_case_name##_EvalGenerator_, \
18928 &gtest_##prefix##test_case_name##_EvalGenerateName_, \
18929 __FILE__, __LINE__)
7c673cae
FG
18930
18931} // namespace testing
18932
7c673cae
FG
18933#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
18934// Copyright 2006, Google Inc.
18935// All rights reserved.
18936//
18937// Redistribution and use in source and binary forms, with or without
18938// modification, are permitted provided that the following conditions are
18939// met:
18940//
18941// * Redistributions of source code must retain the above copyright
18942// notice, this list of conditions and the following disclaimer.
18943// * Redistributions in binary form must reproduce the above
18944// copyright notice, this list of conditions and the following disclaimer
18945// in the documentation and/or other materials provided with the
18946// distribution.
18947// * Neither the name of Google Inc. nor the names of its
18948// contributors may be used to endorse or promote products derived from
18949// this software without specific prior written permission.
18950//
18951// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18952// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18953// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18954// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18955// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18956// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18957// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18958// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18959// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18960// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18961// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2 18962
7c673cae 18963//
f67539c2
TL
18964// Google C++ Testing and Mocking Framework definitions useful in production code.
18965// GOOGLETEST_CM0003 DO NOT DELETE
7c673cae
FG
18966
18967#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18968#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18969
18970// When you need to test the private or protected members of a class,
18971// use the FRIEND_TEST macro to declare your tests as friends of the
18972// class. For example:
18973//
18974// class MyClass {
18975// private:
f67539c2
TL
18976// void PrivateMethod();
18977// FRIEND_TEST(MyClassTest, PrivateMethodWorks);
7c673cae
FG
18978// };
18979//
18980// class MyClassTest : public testing::Test {
18981// // ...
18982// };
18983//
f67539c2
TL
18984// TEST_F(MyClassTest, PrivateMethodWorks) {
18985// // Can call MyClass::PrivateMethod() here.
7c673cae 18986// }
f67539c2
TL
18987//
18988// Note: The test class must be in the same namespace as the class being tested.
18989// For example, putting MyClassTest in an anonymous namespace will not work.
7c673cae
FG
18990
18991#define FRIEND_TEST(test_case_name, test_name)\
18992friend class test_case_name##_##test_name##_Test
18993
18994#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18995// Copyright 2008, Google Inc.
18996// All rights reserved.
18997//
18998// Redistribution and use in source and binary forms, with or without
18999// modification, are permitted provided that the following conditions are
19000// met:
19001//
19002// * Redistributions of source code must retain the above copyright
19003// notice, this list of conditions and the following disclaimer.
19004// * Redistributions in binary form must reproduce the above
19005// copyright notice, this list of conditions and the following disclaimer
19006// in the documentation and/or other materials provided with the
19007// distribution.
19008// * Neither the name of Google Inc. nor the names of its
19009// contributors may be used to endorse or promote products derived from
19010// this software without specific prior written permission.
19011//
19012// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19013// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19014// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19015// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19016// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19017// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19018// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19019// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19020// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19021// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19022// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19023//
f67539c2 19024// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae
FG
19025
19026#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19027#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19028
19029#include <iosfwd>
19030#include <vector>
19031
f67539c2
TL
19032GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
19033/* class A needs to have dll-interface to be used by clients of class B */)
19034
7c673cae
FG
19035namespace testing {
19036
19037// A copyable object representing the result of a test part (i.e. an
19038// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
19039//
19040// Don't inherit from TestPartResult as its destructor is not virtual.
19041class GTEST_API_ TestPartResult {
19042 public:
19043 // The possible outcomes of a test part (i.e. an assertion or an
19044 // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
19045 enum Type {
19046 kSuccess, // Succeeded.
19047 kNonFatalFailure, // Failed but the test can continue.
19048 kFatalFailure // Failed and the test should be terminated.
19049 };
19050
19051 // C'tor. TestPartResult does NOT have a default constructor.
19052 // Always use this constructor (with parameters) to create a
19053 // TestPartResult object.
19054 TestPartResult(Type a_type,
19055 const char* a_file_name,
19056 int a_line_number,
19057 const char* a_message)
19058 : type_(a_type),
19059 file_name_(a_file_name == NULL ? "" : a_file_name),
19060 line_number_(a_line_number),
19061 summary_(ExtractSummary(a_message)),
19062 message_(a_message) {
19063 }
19064
19065 // Gets the outcome of the test part.
19066 Type type() const { return type_; }
19067
19068 // Gets the name of the source file where the test part took place, or
19069 // NULL if it's unknown.
19070 const char* file_name() const {
19071 return file_name_.empty() ? NULL : file_name_.c_str();
19072 }
19073
19074 // Gets the line in the source file where the test part took place,
19075 // or -1 if it's unknown.
19076 int line_number() const { return line_number_; }
19077
19078 // Gets the summary of the failure message.
19079 const char* summary() const { return summary_.c_str(); }
19080
19081 // Gets the message associated with the test part.
19082 const char* message() const { return message_.c_str(); }
19083
19084 // Returns true iff the test part passed.
19085 bool passed() const { return type_ == kSuccess; }
19086
19087 // Returns true iff the test part failed.
19088 bool failed() const { return type_ != kSuccess; }
19089
19090 // Returns true iff the test part non-fatally failed.
19091 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
19092
19093 // Returns true iff the test part fatally failed.
19094 bool fatally_failed() const { return type_ == kFatalFailure; }
19095
19096 private:
19097 Type type_;
19098
19099 // Gets the summary of the failure message by omitting the stack
19100 // trace in it.
19101 static std::string ExtractSummary(const char* message);
19102
19103 // The name of the source file where the test part took place, or
19104 // "" if the source file is unknown.
19105 std::string file_name_;
19106 // The line in the source file where the test part took place, or -1
19107 // if the line number is unknown.
19108 int line_number_;
19109 std::string summary_; // The test failure summary.
19110 std::string message_; // The test failure message.
19111};
19112
19113// Prints a TestPartResult object.
19114std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
19115
19116// An array of TestPartResult objects.
19117//
19118// Don't inherit from TestPartResultArray as its destructor is not
19119// virtual.
19120class GTEST_API_ TestPartResultArray {
19121 public:
19122 TestPartResultArray() {}
19123
19124 // Appends the given TestPartResult to the array.
19125 void Append(const TestPartResult& result);
19126
19127 // Returns the TestPartResult at the given index (0-based).
19128 const TestPartResult& GetTestPartResult(int index) const;
19129
19130 // Returns the number of TestPartResult objects in the array.
19131 int size() const;
19132
19133 private:
19134 std::vector<TestPartResult> array_;
19135
19136 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
19137};
19138
19139// This interface knows how to report a test part result.
f67539c2 19140class GTEST_API_ TestPartResultReporterInterface {
7c673cae
FG
19141 public:
19142 virtual ~TestPartResultReporterInterface() {}
19143
19144 virtual void ReportTestPartResult(const TestPartResult& result) = 0;
19145};
19146
19147namespace internal {
19148
19149// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
19150// statement generates new fatal failures. To do so it registers itself as the
19151// current test part result reporter. Besides checking if fatal failures were
19152// reported, it only delegates the reporting to the former result reporter.
19153// The original result reporter is restored in the destructor.
19154// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19155class GTEST_API_ HasNewFatalFailureHelper
19156 : public TestPartResultReporterInterface {
19157 public:
19158 HasNewFatalFailureHelper();
19159 virtual ~HasNewFatalFailureHelper();
19160 virtual void ReportTestPartResult(const TestPartResult& result);
19161 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
19162 private:
19163 bool has_new_fatal_failure_;
19164 TestPartResultReporterInterface* original_reporter_;
19165
19166 GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
19167};
19168
19169} // namespace internal
19170
19171} // namespace testing
19172
f67539c2
TL
19173GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
19174
7c673cae
FG
19175#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19176// Copyright 2008 Google Inc.
19177// All Rights Reserved.
19178//
19179// Redistribution and use in source and binary forms, with or without
19180// modification, are permitted provided that the following conditions are
19181// met:
19182//
19183// * Redistributions of source code must retain the above copyright
19184// notice, this list of conditions and the following disclaimer.
19185// * Redistributions in binary form must reproduce the above
19186// copyright notice, this list of conditions and the following disclaimer
19187// in the documentation and/or other materials provided with the
19188// distribution.
19189// * Neither the name of Google Inc. nor the names of its
19190// contributors may be used to endorse or promote products derived from
19191// this software without specific prior written permission.
19192//
19193// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19194// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19195// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19196// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19197// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19198// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19199// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19200// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19201// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19202// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19203// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f67539c2
TL
19204
19205
19206// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae
FG
19207
19208#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19209#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19210
19211// This header implements typed tests and type-parameterized tests.
19212
19213// Typed (aka type-driven) tests repeat the same test for types in a
19214// list. You must know which types you want to test with when writing
19215// typed tests. Here's how you do it:
19216
19217#if 0
19218
19219// First, define a fixture class template. It should be parameterized
19220// by a type. Remember to derive it from testing::Test.
19221template <typename T>
19222class FooTest : public testing::Test {
19223 public:
19224 ...
19225 typedef std::list<T> List;
19226 static T shared_;
19227 T value_;
19228};
19229
19230// Next, associate a list of types with the test case, which will be
19231// repeated for each type in the list. The typedef is necessary for
19232// the macro to parse correctly.
19233typedef testing::Types<char, int, unsigned int> MyTypes;
19234TYPED_TEST_CASE(FooTest, MyTypes);
19235
19236// If the type list contains only one type, you can write that type
19237// directly without Types<...>:
19238// TYPED_TEST_CASE(FooTest, int);
19239
19240// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
19241// tests for this test case as you want.
19242TYPED_TEST(FooTest, DoesBlah) {
19243 // Inside a test, refer to TypeParam to get the type parameter.
19244 // Since we are inside a derived class template, C++ requires use to
19245 // visit the members of FooTest via 'this'.
19246 TypeParam n = this->value_;
19247
19248 // To visit static members of the fixture, add the TestFixture::
19249 // prefix.
19250 n += TestFixture::shared_;
19251
19252 // To refer to typedefs in the fixture, add the "typename
19253 // TestFixture::" prefix.
19254 typename TestFixture::List values;
19255 values.push_back(n);
19256 ...
19257}
19258
19259TYPED_TEST(FooTest, HasPropertyA) { ... }
19260
f67539c2
TL
19261// TYPED_TEST_CASE takes an optional third argument which allows to specify a
19262// class that generates custom test name suffixes based on the type. This should
19263// be a class which has a static template function GetName(int index) returning
19264// a string for each type. The provided integer index equals the index of the
19265// type in the provided type list. In many cases the index can be ignored.
19266//
19267// For example:
19268// class MyTypeNames {
19269// public:
19270// template <typename T>
19271// static std::string GetName(int) {
19272// if (std::is_same<T, char>()) return "char";
19273// if (std::is_same<T, int>()) return "int";
19274// if (std::is_same<T, unsigned int>()) return "unsignedInt";
19275// }
19276// };
19277// TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
19278
7c673cae
FG
19279#endif // 0
19280
19281// Type-parameterized tests are abstract test patterns parameterized
19282// by a type. Compared with typed tests, type-parameterized tests
19283// allow you to define the test pattern without knowing what the type
19284// parameters are. The defined pattern can be instantiated with
19285// different types any number of times, in any number of translation
19286// units.
19287//
19288// If you are designing an interface or concept, you can define a
19289// suite of type-parameterized tests to verify properties that any
19290// valid implementation of the interface/concept should have. Then,
19291// each implementation can easily instantiate the test suite to verify
19292// that it conforms to the requirements, without having to write
19293// similar tests repeatedly. Here's an example:
19294
19295#if 0
19296
19297// First, define a fixture class template. It should be parameterized
19298// by a type. Remember to derive it from testing::Test.
19299template <typename T>
19300class FooTest : public testing::Test {
19301 ...
19302};
19303
19304// Next, declare that you will define a type-parameterized test case
19305// (the _P suffix is for "parameterized" or "pattern", whichever you
19306// prefer):
19307TYPED_TEST_CASE_P(FooTest);
19308
19309// Then, use TYPED_TEST_P() to define as many type-parameterized tests
19310// for this type-parameterized test case as you want.
19311TYPED_TEST_P(FooTest, DoesBlah) {
19312 // Inside a test, refer to TypeParam to get the type parameter.
19313 TypeParam n = 0;
19314 ...
19315}
19316
19317TYPED_TEST_P(FooTest, HasPropertyA) { ... }
19318
19319// Now the tricky part: you need to register all test patterns before
19320// you can instantiate them. The first argument of the macro is the
19321// test case name; the rest are the names of the tests in this test
19322// case.
19323REGISTER_TYPED_TEST_CASE_P(FooTest,
19324 DoesBlah, HasPropertyA);
19325
19326// Finally, you are free to instantiate the pattern with the types you
19327// want. If you put the above code in a header file, you can #include
19328// it in multiple C++ source files and instantiate it multiple times.
19329//
19330// To distinguish different instances of the pattern, the first
19331// argument to the INSTANTIATE_* macro is a prefix that will be added
19332// to the actual test case name. Remember to pick unique prefixes for
19333// different instances.
19334typedef testing::Types<char, int, unsigned int> MyTypes;
19335INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
19336
19337// If the type list contains only one type, you can write that type
19338// directly without Types<...>:
19339// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
f67539c2
TL
19340//
19341// Similar to the optional argument of TYPED_TEST_CASE above,
19342// INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to
19343// generate custom names.
19344// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);
7c673cae
FG
19345
19346#endif // 0
19347
19348
19349// Implements typed tests.
19350
19351#if GTEST_HAS_TYPED_TEST
19352
19353// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19354//
19355// Expands to the name of the typedef for the type parameters of the
19356// given test case.
19357# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
19358
f67539c2
TL
19359// Expands to the name of the typedef for the NameGenerator, responsible for
19360// creating the suffixes of the name.
19361#define GTEST_NAME_GENERATOR_(TestCaseName) \
19362 gtest_type_params_##TestCaseName##_NameGenerator
19363
7c673cae
FG
19364// The 'Types' template argument below must have spaces around it
19365// since some compilers may choke on '>>' when passing a template
19366// instance (e.g. Types<int>)
f67539c2
TL
19367# define TYPED_TEST_CASE(CaseName, Types, ...) \
19368 typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \
19369 CaseName); \
19370 typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
19371 GTEST_NAME_GENERATOR_(CaseName)
19372
19373# define TYPED_TEST(CaseName, TestName) \
19374 template <typename gtest_TypeParam_> \
19375 class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
19376 : public CaseName<gtest_TypeParam_> { \
19377 private: \
19378 typedef CaseName<gtest_TypeParam_> TestFixture; \
19379 typedef gtest_TypeParam_ TypeParam; \
19380 virtual void TestBody(); \
19381 }; \
19382 static bool gtest_##CaseName##_##TestName##_registered_ \
19383 GTEST_ATTRIBUTE_UNUSED_ = \
19384 ::testing::internal::TypeParameterizedTest< \
19385 CaseName, \
19386 ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \
19387 TestName)>, \
19388 GTEST_TYPE_PARAMS_( \
19389 CaseName)>::Register("", \
19390 ::testing::internal::CodeLocation( \
19391 __FILE__, __LINE__), \
19392 #CaseName, #TestName, 0, \
19393 ::testing::internal::GenerateNames< \
19394 GTEST_NAME_GENERATOR_(CaseName), \
19395 GTEST_TYPE_PARAMS_(CaseName)>()); \
19396 template <typename gtest_TypeParam_> \
19397 void GTEST_TEST_CLASS_NAME_(CaseName, \
19398 TestName)<gtest_TypeParam_>::TestBody()
7c673cae
FG
19399
19400#endif // GTEST_HAS_TYPED_TEST
19401
19402// Implements type-parameterized tests.
19403
19404#if GTEST_HAS_TYPED_TEST_P
19405
19406// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19407//
19408// Expands to the namespace name that the type-parameterized tests for
19409// the given type-parameterized test case are defined in. The exact
19410// name of the namespace is subject to change without notice.
19411# define GTEST_CASE_NAMESPACE_(TestCaseName) \
19412 gtest_case_##TestCaseName##_
19413
19414// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19415//
19416// Expands to the name of the variable used to remember the names of
19417// the defined tests in the given test case.
19418# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
19419 gtest_typed_test_case_p_state_##TestCaseName##_
19420
19421// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
19422//
19423// Expands to the name of the variable used to remember the names of
19424// the registered tests in the given test case.
19425# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
19426 gtest_registered_test_names_##TestCaseName##_
19427
19428// The variables defined in the type-parameterized test macros are
19429// static as typically these macros are used in a .h file that can be
19430// #included in multiple translation units linked together.
19431# define TYPED_TEST_CASE_P(CaseName) \
19432 static ::testing::internal::TypedTestCasePState \
19433 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
19434
19435# define TYPED_TEST_P(CaseName, TestName) \
19436 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
19437 template <typename gtest_TypeParam_> \
19438 class TestName : public CaseName<gtest_TypeParam_> { \
19439 private: \
19440 typedef CaseName<gtest_TypeParam_> TestFixture; \
19441 typedef gtest_TypeParam_ TypeParam; \
19442 virtual void TestBody(); \
19443 }; \
19444 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
19445 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
19446 __FILE__, __LINE__, #CaseName, #TestName); \
19447 } \
19448 template <typename gtest_TypeParam_> \
19449 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
19450
19451# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
19452 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
19453 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
19454 } \
f67539c2
TL
19455 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
19456 GTEST_ATTRIBUTE_UNUSED_ = \
19457 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \
19458 __FILE__, __LINE__, #__VA_ARGS__)
7c673cae
FG
19459
19460// The 'Types' template argument below must have spaces around it
19461// since some compilers may choke on '>>' when passing a template
19462// instance (e.g. Types<int>)
f67539c2
TL
19463# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...) \
19464 static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
19465 ::testing::internal::TypeParameterizedTestCase< \
19466 CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
19467 ::testing::internal::TypeList< Types >::type>:: \
19468 Register(#Prefix, \
19469 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
19470 &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName, \
19471 GTEST_REGISTERED_TEST_NAMES_(CaseName), \
19472 ::testing::internal::GenerateNames< \
19473 ::testing::internal::NameGeneratorSelector< \
19474 __VA_ARGS__>::type, \
19475 ::testing::internal::TypeList< Types >::type>())
7c673cae
FG
19476
19477#endif // GTEST_HAS_TYPED_TEST_P
19478
19479#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19480
f67539c2
TL
19481GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
19482/* class A needs to have dll-interface to be used by clients of class B */)
19483
7c673cae
FG
19484// Depending on the platform, different string classes are available.
19485// On Linux, in addition to ::std::string, Google also makes use of
19486// class ::string, which has the same interface as ::std::string, but
19487// has a different implementation.
19488//
19489// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
19490// ::string is available AND is a distinct type to ::std::string, or
19491// define it to 0 to indicate otherwise.
19492//
19493// If ::std::string and ::string are the same class on your platform
19494// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
19495//
19496// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
19497// heuristically.
19498
19499namespace testing {
19500
f67539c2
TL
19501// Silence C4100 (unreferenced formal parameter) and 4805
19502// unsafe mix of type 'const int' and type 'const bool'
19503#ifdef _MSC_VER
19504# pragma warning(push)
19505# pragma warning(disable:4805)
19506# pragma warning(disable:4100)
19507#endif
19508
19509
7c673cae
FG
19510// Declares the flags.
19511
19512// This flag temporary enables the disabled tests.
19513GTEST_DECLARE_bool_(also_run_disabled_tests);
19514
19515// This flag brings the debugger on an assertion failure.
19516GTEST_DECLARE_bool_(break_on_failure);
19517
19518// This flag controls whether Google Test catches all test-thrown exceptions
19519// and logs them as failures.
19520GTEST_DECLARE_bool_(catch_exceptions);
19521
19522// This flag enables using colors in terminal output. Available values are
19523// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
19524// to let Google Test decide.
19525GTEST_DECLARE_string_(color);
19526
19527// This flag sets up the filter to select by name using a glob pattern
19528// the tests to run. If the filter is not given all tests are executed.
19529GTEST_DECLARE_string_(filter);
19530
f67539c2
TL
19531// This flag controls whether Google Test installs a signal handler that dumps
19532// debugging information when fatal signals are raised.
19533GTEST_DECLARE_bool_(install_failure_signal_handler);
19534
7c673cae
FG
19535// This flag causes the Google Test to list tests. None of the tests listed
19536// are actually run if the flag is provided.
19537GTEST_DECLARE_bool_(list_tests);
19538
19539// This flag controls whether Google Test emits a detailed XML report to a file
19540// in addition to its normal textual output.
19541GTEST_DECLARE_string_(output);
19542
19543// This flags control whether Google Test prints the elapsed time for each
19544// test.
19545GTEST_DECLARE_bool_(print_time);
19546
f67539c2
TL
19547// This flags control whether Google Test prints UTF8 characters as text.
19548GTEST_DECLARE_bool_(print_utf8);
19549
7c673cae
FG
19550// This flag specifies the random number seed.
19551GTEST_DECLARE_int32_(random_seed);
19552
19553// This flag sets how many times the tests are repeated. The default value
19554// is 1. If the value is -1 the tests are repeating forever.
19555GTEST_DECLARE_int32_(repeat);
19556
19557// This flag controls whether Google Test includes Google Test internal
19558// stack frames in failure stack traces.
19559GTEST_DECLARE_bool_(show_internal_stack_frames);
19560
19561// When this flag is specified, tests' order is randomized on every iteration.
19562GTEST_DECLARE_bool_(shuffle);
19563
19564// This flag specifies the maximum number of stack frames to be
19565// printed in a failure message.
19566GTEST_DECLARE_int32_(stack_trace_depth);
19567
19568// When this flag is specified, a failed assertion will throw an
19569// exception if exceptions are enabled, or exit the program with a
f67539c2 19570// non-zero code otherwise. For use with an external test framework.
7c673cae
FG
19571GTEST_DECLARE_bool_(throw_on_failure);
19572
19573// When this flag is set with a "host:port" string, on supported
19574// platforms test results are streamed to the specified port on
19575// the specified host machine.
19576GTEST_DECLARE_string_(stream_result_to);
19577
f67539c2
TL
19578#if GTEST_USE_OWN_FLAGFILE_FLAG_
19579GTEST_DECLARE_string_(flagfile);
19580#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
19581
7c673cae
FG
19582// The upper limit for valid stack trace depths.
19583const int kMaxStackTraceDepth = 100;
19584
19585namespace internal {
19586
19587class AssertHelper;
19588class DefaultGlobalTestPartResultReporter;
19589class ExecDeathTest;
19590class NoExecDeathTest;
19591class FinalSuccessChecker;
19592class GTestFlagSaver;
19593class StreamingListenerTest;
19594class TestResultAccessor;
19595class TestEventListenersAccessor;
19596class TestEventRepeater;
19597class UnitTestRecordPropertyTestHelper;
19598class WindowsDeathTest;
f67539c2 19599class FuchsiaDeathTest;
7c673cae
FG
19600class UnitTestImpl* GetUnitTestImpl();
19601void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
19602 const std::string& message);
19603
19604} // namespace internal
19605
19606// The friend relationship of some of these classes is cyclic.
19607// If we don't forward declare them the compiler might confuse the classes
19608// in friendship clauses with same named classes on the scope.
19609class Test;
19610class TestCase;
19611class TestInfo;
19612class UnitTest;
19613
19614// A class for indicating whether an assertion was successful. When
19615// the assertion wasn't successful, the AssertionResult object
19616// remembers a non-empty message that describes how it failed.
19617//
19618// To create an instance of this class, use one of the factory functions
19619// (AssertionSuccess() and AssertionFailure()).
19620//
19621// This class is useful for two purposes:
19622// 1. Defining predicate functions to be used with Boolean test assertions
19623// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
19624// 2. Defining predicate-format functions to be
19625// used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
19626//
19627// For example, if you define IsEven predicate:
19628//
19629// testing::AssertionResult IsEven(int n) {
19630// if ((n % 2) == 0)
19631// return testing::AssertionSuccess();
19632// else
19633// return testing::AssertionFailure() << n << " is odd";
19634// }
19635//
19636// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
19637// will print the message
19638//
19639// Value of: IsEven(Fib(5))
19640// Actual: false (5 is odd)
19641// Expected: true
19642//
19643// instead of a more opaque
19644//
19645// Value of: IsEven(Fib(5))
19646// Actual: false
19647// Expected: true
19648//
19649// in case IsEven is a simple Boolean predicate.
19650//
19651// If you expect your predicate to be reused and want to support informative
19652// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
19653// about half as often as positive ones in our tests), supply messages for
19654// both success and failure cases:
19655//
19656// testing::AssertionResult IsEven(int n) {
19657// if ((n % 2) == 0)
19658// return testing::AssertionSuccess() << n << " is even";
19659// else
19660// return testing::AssertionFailure() << n << " is odd";
19661// }
19662//
19663// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
19664//
19665// Value of: IsEven(Fib(6))
19666// Actual: true (8 is even)
19667// Expected: false
19668//
19669// NB: Predicates that support negative Boolean assertions have reduced
19670// performance in positive ones so be careful not to use them in tests
19671// that have lots (tens of thousands) of positive Boolean assertions.
19672//
19673// To use this class with EXPECT_PRED_FORMAT assertions such as:
19674//
19675// // Verifies that Foo() returns an even number.
19676// EXPECT_PRED_FORMAT1(IsEven, Foo());
19677//
19678// you need to define:
19679//
19680// testing::AssertionResult IsEven(const char* expr, int n) {
19681// if ((n % 2) == 0)
19682// return testing::AssertionSuccess();
19683// else
19684// return testing::AssertionFailure()
19685// << "Expected: " << expr << " is even\n Actual: it's " << n;
19686// }
19687//
19688// If Foo() returns 5, you will see the following message:
19689//
19690// Expected: Foo() is even
19691// Actual: it's 5
19692//
19693class GTEST_API_ AssertionResult {
19694 public:
19695 // Copy constructor.
19696 // Used in EXPECT_TRUE/FALSE(assertion_result).
19697 AssertionResult(const AssertionResult& other);
19698
f67539c2 19699#if defined(_MSC_VER) && _MSC_VER < 1910
7c673cae 19700 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
f67539c2 19701#endif
7c673cae
FG
19702
19703 // Used in the EXPECT_TRUE/FALSE(bool_expression).
19704 //
19705 // T must be contextually convertible to bool.
19706 //
19707 // The second parameter prevents this overload from being considered if
19708 // the argument is implicitly convertible to AssertionResult. In that case
19709 // we want AssertionResult's copy constructor to be used.
19710 template <typename T>
19711 explicit AssertionResult(
19712 const T& success,
19713 typename internal::EnableIf<
19714 !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
19715 /*enabler*/ = NULL)
19716 : success_(success) {}
19717
f67539c2 19718#if defined(_MSC_VER) && _MSC_VER < 1910
7c673cae 19719 GTEST_DISABLE_MSC_WARNINGS_POP_()
f67539c2 19720#endif
7c673cae
FG
19721
19722 // Assignment operator.
19723 AssertionResult& operator=(AssertionResult other) {
19724 swap(other);
19725 return *this;
19726 }
19727
19728 // Returns true iff the assertion succeeded.
19729 operator bool() const { return success_; } // NOLINT
19730
19731 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
19732 AssertionResult operator!() const;
19733
19734 // Returns the text streamed into this AssertionResult. Test assertions
19735 // use it when they fail (i.e., the predicate's outcome doesn't match the
19736 // assertion's expectation). When nothing has been streamed into the
19737 // object, returns an empty string.
19738 const char* message() const {
19739 return message_.get() != NULL ? message_->c_str() : "";
19740 }
f67539c2 19741 // FIXME: Remove this after making sure no clients use it.
7c673cae
FG
19742 // Deprecated; please use message() instead.
19743 const char* failure_message() const { return message(); }
19744
19745 // Streams a custom failure message into this object.
19746 template <typename T> AssertionResult& operator<<(const T& value) {
19747 AppendMessage(Message() << value);
19748 return *this;
19749 }
19750
19751 // Allows streaming basic output manipulators such as endl or flush into
19752 // this object.
19753 AssertionResult& operator<<(
19754 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
19755 AppendMessage(Message() << basic_manipulator);
19756 return *this;
19757 }
19758
19759 private:
19760 // Appends the contents of message to message_.
19761 void AppendMessage(const Message& a_message) {
19762 if (message_.get() == NULL)
19763 message_.reset(new ::std::string);
19764 message_->append(a_message.GetString().c_str());
19765 }
19766
19767 // Swap the contents of this AssertionResult with other.
19768 void swap(AssertionResult& other);
19769
19770 // Stores result of the assertion predicate.
19771 bool success_;
19772 // Stores the message describing the condition in case the expectation
19773 // construct is not satisfied with the predicate's outcome.
19774 // Referenced via a pointer to avoid taking too much stack frame space
19775 // with test assertions.
19776 internal::scoped_ptr< ::std::string> message_;
19777};
19778
19779// Makes a successful assertion result.
19780GTEST_API_ AssertionResult AssertionSuccess();
19781
19782// Makes a failed assertion result.
19783GTEST_API_ AssertionResult AssertionFailure();
19784
19785// Makes a failed assertion result with the given failure message.
19786// Deprecated; use AssertionFailure() << msg.
19787GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
19788
f67539c2
TL
19789} // namespace testing
19790
19791// Includes the auto-generated header that implements a family of generic
19792// predicate assertion macros. This include comes late because it relies on
19793// APIs declared above.
19794// Copyright 2006, Google Inc.
19795// All rights reserved.
7c673cae 19796//
f67539c2
TL
19797// Redistribution and use in source and binary forms, with or without
19798// modification, are permitted provided that the following conditions are
19799// met:
7c673cae 19800//
f67539c2
TL
19801// * Redistributions of source code must retain the above copyright
19802// notice, this list of conditions and the following disclaimer.
19803// * Redistributions in binary form must reproduce the above
19804// copyright notice, this list of conditions and the following disclaimer
19805// in the documentation and/or other materials provided with the
19806// distribution.
19807// * Neither the name of Google Inc. nor the names of its
19808// contributors may be used to endorse or promote products derived from
19809// this software without specific prior written permission.
7c673cae 19810//
f67539c2
TL
19811// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19812// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19813// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19814// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19815// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19816// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19817// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19818// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19819// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19820// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19821// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19822
19823// This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
19824// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
7c673cae 19825//
f67539c2 19826// Implements a family of generic predicate assertion macros.
7c673cae 19827
f67539c2 19828// GOOGLETEST_CM0001 DO NOT DELETE
7c673cae 19829
f67539c2
TL
19830#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19831#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
7c673cae 19832
7c673cae 19833
f67539c2 19834namespace testing {
7c673cae 19835
f67539c2
TL
19836// This header implements a family of generic predicate assertion
19837// macros:
19838//
19839// ASSERT_PRED_FORMAT1(pred_format, v1)
19840// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19841// ...
19842//
19843// where pred_format is a function or functor that takes n (in the
19844// case of ASSERT_PRED_FORMATn) values and their source expression
19845// text, and returns a testing::AssertionResult. See the definition
19846// of ASSERT_EQ in gtest.h for an example.
19847//
19848// If you don't care about formatting, you can use the more
19849// restrictive version:
19850//
19851// ASSERT_PRED1(pred, v1)
19852// ASSERT_PRED2(pred, v1, v2)
19853// ...
19854//
19855// where pred is an n-ary function or functor that returns bool,
19856// and the values v1, v2, ..., must support the << operator for
19857// streaming to std::ostream.
19858//
19859// We also define the EXPECT_* variations.
19860//
19861// For now we only support predicates whose arity is at most 5.
7c673cae 19862
f67539c2
TL
19863// GTEST_ASSERT_ is the basic statement to which all of the assertions
19864// in this file reduce. Don't use this in your code.
7c673cae 19865
f67539c2
TL
19866#define GTEST_ASSERT_(expression, on_failure) \
19867 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19868 if (const ::testing::AssertionResult gtest_ar = (expression)) \
19869 ; \
19870 else \
19871 on_failure(gtest_ar.failure_message())
7c673cae 19872
7c673cae 19873
f67539c2
TL
19874// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
19875// this in your code.
19876template <typename Pred,
19877 typename T1>
19878AssertionResult AssertPred1Helper(const char* pred_text,
19879 const char* e1,
19880 Pred pred,
19881 const T1& v1) {
19882 if (pred(v1)) return AssertionSuccess();
7c673cae 19883
f67539c2
TL
19884 return AssertionFailure() << pred_text << "("
19885 << e1 << ") evaluates to false, where"
19886 << "\n" << e1 << " evaluates to " << v1;
19887}
7c673cae 19888
f67539c2
TL
19889// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19890// Don't use this in your code.
19891#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19892 GTEST_ASSERT_(pred_format(#v1, v1), \
19893 on_failure)
7c673cae 19894
f67539c2
TL
19895// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
19896// this in your code.
19897#define GTEST_PRED1_(pred, v1, on_failure)\
19898 GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19899 #v1, \
19900 pred, \
19901 v1), on_failure)
7c673cae 19902
f67539c2
TL
19903// Unary predicate assertion macros.
19904#define EXPECT_PRED_FORMAT1(pred_format, v1) \
19905 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19906#define EXPECT_PRED1(pred, v1) \
19907 GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19908#define ASSERT_PRED_FORMAT1(pred_format, v1) \
19909 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19910#define ASSERT_PRED1(pred, v1) \
19911 GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
7c673cae 19912
7c673cae 19913
7c673cae 19914
f67539c2
TL
19915// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
19916// this in your code.
19917template <typename Pred,
19918 typename T1,
19919 typename T2>
19920AssertionResult AssertPred2Helper(const char* pred_text,
19921 const char* e1,
19922 const char* e2,
19923 Pred pred,
19924 const T1& v1,
19925 const T2& v2) {
19926 if (pred(v1, v2)) return AssertionSuccess();
7c673cae 19927
f67539c2
TL
19928 return AssertionFailure() << pred_text << "("
19929 << e1 << ", "
19930 << e2 << ") evaluates to false, where"
19931 << "\n" << e1 << " evaluates to " << v1
19932 << "\n" << e2 << " evaluates to " << v2;
19933}
7c673cae 19934
f67539c2
TL
19935// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19936// Don't use this in your code.
19937#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19938 GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19939 on_failure)
7c673cae 19940
f67539c2
TL
19941// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
19942// this in your code.
19943#define GTEST_PRED2_(pred, v1, v2, on_failure)\
19944 GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19945 #v1, \
19946 #v2, \
19947 pred, \
19948 v1, \
19949 v2), on_failure)
7c673cae 19950
f67539c2
TL
19951// Binary predicate assertion macros.
19952#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19953 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19954#define EXPECT_PRED2(pred, v1, v2) \
19955 GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19956#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19957 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19958#define ASSERT_PRED2(pred, v1, v2) \
19959 GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
7c673cae 19960
7c673cae 19961
7c673cae 19962
f67539c2
TL
19963// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
19964// this in your code.
19965template <typename Pred,
19966 typename T1,
19967 typename T2,
19968 typename T3>
19969AssertionResult AssertPred3Helper(const char* pred_text,
19970 const char* e1,
19971 const char* e2,
19972 const char* e3,
19973 Pred pred,
19974 const T1& v1,
19975 const T2& v2,
19976 const T3& v3) {
19977 if (pred(v1, v2, v3)) return AssertionSuccess();
7c673cae 19978
f67539c2
TL
19979 return AssertionFailure() << pred_text << "("
19980 << e1 << ", "
19981 << e2 << ", "
19982 << e3 << ") evaluates to false, where"
19983 << "\n" << e1 << " evaluates to " << v1
19984 << "\n" << e2 << " evaluates to " << v2
19985 << "\n" << e3 << " evaluates to " << v3;
19986}
7c673cae 19987
f67539c2
TL
19988// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19989// Don't use this in your code.
19990#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19991 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19992 on_failure)
7c673cae 19993
f67539c2
TL
19994// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
19995// this in your code.
19996#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19997 GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19998 #v1, \
19999 #v2, \
20000 #v3, \
20001 pred, \
20002 v1, \
20003 v2, \
20004 v3), on_failure)
7c673cae 20005
f67539c2
TL
20006// Ternary predicate assertion macros.
20007#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20008 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20009#define EXPECT_PRED3(pred, v1, v2, v3) \
20010 GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20011#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20012 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
20013#define ASSERT_PRED3(pred, v1, v2, v3) \
20014 GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
7c673cae 20015
7c673cae 20016
7c673cae 20017
f67539c2
TL
20018// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
20019// this in your code.
20020template <typename Pred,
20021 typename T1,
20022 typename T2,
20023 typename T3,
20024 typename T4>
20025AssertionResult AssertPred4Helper(const char* pred_text,
20026 const char* e1,
20027 const char* e2,
20028 const char* e3,
20029 const char* e4,
20030 Pred pred,
20031 const T1& v1,
20032 const T2& v2,
20033 const T3& v3,
20034 const T4& v4) {
20035 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
7c673cae 20036
f67539c2
TL
20037 return AssertionFailure() << pred_text << "("
20038 << e1 << ", "
20039 << e2 << ", "
20040 << e3 << ", "
20041 << e4 << ") evaluates to false, where"
20042 << "\n" << e1 << " evaluates to " << v1
20043 << "\n" << e2 << " evaluates to " << v2
20044 << "\n" << e3 << " evaluates to " << v3
20045 << "\n" << e4 << " evaluates to " << v4;
20046}
7c673cae 20047
f67539c2
TL
20048// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
20049// Don't use this in your code.
20050#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
20051 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
20052 on_failure)
7c673cae 20053
f67539c2
TL
20054// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
20055// this in your code.
20056#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
20057 GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
20058 #v1, \
20059 #v2, \
20060 #v3, \
20061 #v4, \
20062 pred, \
20063 v1, \
20064 v2, \
20065 v3, \
20066 v4), on_failure)
7c673cae 20067
f67539c2
TL
20068// 4-ary predicate assertion macros.
20069#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20070 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20071#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
20072 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20073#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20074 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
20075#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
20076 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
7c673cae 20077
7c673cae 20078
7c673cae 20079
f67539c2
TL
20080// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
20081// this in your code.
20082template <typename Pred,
20083 typename T1,
20084 typename T2,
20085 typename T3,
20086 typename T4,
20087 typename T5>
20088AssertionResult AssertPred5Helper(const char* pred_text,
20089 const char* e1,
20090 const char* e2,
20091 const char* e3,
20092 const char* e4,
20093 const char* e5,
20094 Pred pred,
20095 const T1& v1,
20096 const T2& v2,
20097 const T3& v3,
20098 const T4& v4,
20099 const T5& v5) {
20100 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
7c673cae 20101
f67539c2
TL
20102 return AssertionFailure() << pred_text << "("
20103 << e1 << ", "
20104 << e2 << ", "
20105 << e3 << ", "
20106 << e4 << ", "
20107 << e5 << ") evaluates to false, where"
20108 << "\n" << e1 << " evaluates to " << v1
20109 << "\n" << e2 << " evaluates to " << v2
20110 << "\n" << e3 << " evaluates to " << v3
20111 << "\n" << e4 << " evaluates to " << v4
20112 << "\n" << e5 << " evaluates to " << v5;
20113}
7c673cae 20114
f67539c2
TL
20115// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
20116// Don't use this in your code.
20117#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
20118 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
20119 on_failure)
7c673cae 20120
f67539c2
TL
20121// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
20122// this in your code.
20123#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
20124 GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
20125 #v1, \
20126 #v2, \
20127 #v3, \
20128 #v4, \
20129 #v5, \
20130 pred, \
20131 v1, \
20132 v2, \
20133 v3, \
20134 v4, \
20135 v5), on_failure)
7c673cae 20136
f67539c2
TL
20137// 5-ary predicate assertion macros.
20138#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20139 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20140#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
20141 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20142#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20143 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
20144#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
20145 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
7c673cae 20146
7c673cae 20147
7c673cae 20148
f67539c2 20149} // namespace testing
7c673cae 20150
f67539c2 20151#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
7c673cae 20152
f67539c2 20153namespace testing {
7c673cae 20154
f67539c2 20155// The abstract class that all tests inherit from.
7c673cae 20156//
f67539c2
TL
20157// In Google Test, a unit test program contains one or many TestCases, and
20158// each TestCase contains one or many Tests.
7c673cae 20159//
f67539c2
TL
20160// When you define a test using the TEST macro, you don't need to
20161// explicitly derive from Test - the TEST macro automatically does
20162// this for you.
20163//
20164// The only time you derive from Test is when defining a test fixture
20165// to be used in a TEST_F. For example:
20166//
20167// class FooTest : public testing::Test {
20168// protected:
20169// void SetUp() override { ... }
20170// void TearDown() override { ... }
20171// ...
20172// };
20173//
20174// TEST_F(FooTest, Bar) { ... }
20175// TEST_F(FooTest, Baz) { ... }
20176//
20177// Test is not copyable.
20178class GTEST_API_ Test {
7c673cae 20179 public:
f67539c2 20180 friend class TestInfo;
7c673cae 20181
f67539c2
TL
20182 // Defines types for pointers to functions that set up and tear down
20183 // a test case.
20184 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
20185 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
7c673cae 20186
f67539c2
TL
20187 // The d'tor is virtual as we intend to inherit from Test.
20188 virtual ~Test();
7c673cae 20189
f67539c2 20190 // Sets up the stuff shared by all tests in this test case.
7c673cae 20191 //
f67539c2
TL
20192 // Google Test will call Foo::SetUpTestCase() before running the first
20193 // test in test case Foo. Hence a sub-class can define its own
20194 // SetUpTestCase() method to shadow the one defined in the super
20195 // class.
20196 static void SetUpTestCase() {}
20197
20198 // Tears down the stuff shared by all tests in this test case.
7c673cae 20199 //
f67539c2
TL
20200 // Google Test will call Foo::TearDownTestCase() after running the last
20201 // test in test case Foo. Hence a sub-class can define its own
20202 // TearDownTestCase() method to shadow the one defined in the super
20203 // class.
20204 static void TearDownTestCase() {}
7c673cae 20205
f67539c2
TL
20206 // Returns true iff the current test has a fatal failure.
20207 static bool HasFatalFailure();
7c673cae 20208
f67539c2
TL
20209 // Returns true iff the current test has a non-fatal failure.
20210 static bool HasNonfatalFailure();
7c673cae 20211
f67539c2
TL
20212 // Returns true iff the current test has a (either fatal or
20213 // non-fatal) failure.
20214 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
7c673cae 20215
f67539c2
TL
20216 // Logs a property for the current test, test case, or for the entire
20217 // invocation of the test program when used outside of the context of a
20218 // test case. Only the last value for a given key is remembered. These
20219 // are public static so they can be called from utility functions that are
20220 // not members of the test fixture. Calls to RecordProperty made during
20221 // lifespan of the test (from the moment its constructor starts to the
20222 // moment its destructor finishes) will be output in XML as attributes of
20223 // the <testcase> element. Properties recorded from fixture's
20224 // SetUpTestCase or TearDownTestCase are logged as attributes of the
20225 // corresponding <testsuite> element. Calls to RecordProperty made in the
20226 // global context (before or after invocation of RUN_ALL_TESTS and from
20227 // SetUp/TearDown method of Environment objects registered with Google
20228 // Test) will be output as attributes of the <testsuites> element.
20229 static void RecordProperty(const std::string& key, const std::string& value);
20230 static void RecordProperty(const std::string& key, int value);
7c673cae 20231
f67539c2
TL
20232 protected:
20233 // Creates a Test object.
20234 Test();
7c673cae 20235
f67539c2
TL
20236 // Sets up the test fixture.
20237 virtual void SetUp();
7c673cae 20238
f67539c2
TL
20239 // Tears down the test fixture.
20240 virtual void TearDown();
7c673cae 20241
f67539c2
TL
20242 private:
20243 // Returns true iff the current test has the same fixture class as
20244 // the first test in the current test case.
20245 static bool HasSameFixtureClass();
7c673cae 20246
f67539c2
TL
20247 // Runs the test after the test fixture has been set up.
20248 //
20249 // A sub-class must implement this to define the test logic.
20250 //
20251 // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
20252 // Instead, use the TEST or TEST_F macro.
20253 virtual void TestBody() = 0;
7c673cae 20254
f67539c2
TL
20255 // Sets up, executes, and tears down the test.
20256 void Run();
7c673cae 20257
f67539c2
TL
20258 // Deletes self. We deliberately pick an unusual name for this
20259 // internal method to avoid clashing with names used in user TESTs.
20260 void DeleteSelf_() { delete this; }
20261
20262 const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
20263
20264 // Often a user misspells SetUp() as Setup() and spends a long time
20265 // wondering why it is never called by Google Test. The declaration of
20266 // the following method is solely for catching such an error at
20267 // compile time:
7c673cae 20268 //
f67539c2
TL
20269 // - The return type is deliberately chosen to be not void, so it
20270 // will be a conflict if void Setup() is declared in the user's
20271 // test fixture.
7c673cae 20272 //
f67539c2
TL
20273 // - This method is private, so it will be another compiler error
20274 // if the method is called from the user's test fixture.
7c673cae 20275 //
f67539c2
TL
20276 // DO NOT OVERRIDE THIS FUNCTION.
20277 //
20278 // If you see an error about overriding the following function or
20279 // about it being private, you have mis-spelled SetUp() as Setup().
20280 struct Setup_should_be_spelled_SetUp {};
20281 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
7c673cae 20282
f67539c2
TL
20283 // We disallow copying Tests.
20284 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
20285};
7c673cae 20286
f67539c2 20287typedef internal::TimeInMillis TimeInMillis;
7c673cae 20288
f67539c2
TL
20289// A copyable object representing a user specified test property which can be
20290// output as a key/value string pair.
20291//
20292// Don't inherit from TestProperty as its destructor is not virtual.
20293class TestProperty {
20294 public:
20295 // C'tor. TestProperty does NOT have a default constructor.
20296 // Always use this constructor (with parameters) to create a
20297 // TestProperty object.
20298 TestProperty(const std::string& a_key, const std::string& a_value) :
20299 key_(a_key), value_(a_value) {
7c673cae
FG
20300 }
20301
f67539c2
TL
20302 // Gets the user supplied key.
20303 const char* key() const {
20304 return key_.c_str();
20305 }
7c673cae 20306
f67539c2
TL
20307 // Gets the user supplied value.
20308 const char* value() const {
20309 return value_.c_str();
20310 }
7c673cae 20311
f67539c2
TL
20312 // Sets a new value, overriding the one supplied in the constructor.
20313 void SetValue(const std::string& new_value) {
20314 value_ = new_value;
20315 }
7c673cae 20316
f67539c2
TL
20317 private:
20318 // The key supplied by the user.
20319 std::string key_;
20320 // The value supplied by the user.
20321 std::string value_;
20322};
7c673cae 20323
f67539c2
TL
20324// The result of a single Test. This includes a list of
20325// TestPartResults, a list of TestProperties, a count of how many
20326// death tests there are in the Test, and how much time it took to run
20327// the Test.
20328//
20329// TestResult is not copyable.
20330class GTEST_API_ TestResult {
20331 public:
20332 // Creates an empty TestResult.
20333 TestResult();
7c673cae 20334
f67539c2
TL
20335 // D'tor. Do not inherit from TestResult.
20336 ~TestResult();
7c673cae 20337
f67539c2
TL
20338 // Gets the number of all test parts. This is the sum of the number
20339 // of successful test parts and the number of failed test parts.
20340 int total_part_count() const;
7c673cae 20341
f67539c2
TL
20342 // Returns the number of the test properties.
20343 int test_property_count() const;
7c673cae 20344
f67539c2 20345 // Returns true iff the test passed (i.e. no test part failed).
7c673cae
FG
20346 bool Passed() const { return !Failed(); }
20347
f67539c2
TL
20348 // Returns true iff the test failed.
20349 bool Failed() const;
20350
20351 // Returns true iff the test fatally failed.
20352 bool HasFatalFailure() const;
20353
20354 // Returns true iff the test has a non-fatal failure.
20355 bool HasNonfatalFailure() const;
7c673cae
FG
20356
20357 // Returns the elapsed time, in milliseconds.
20358 TimeInMillis elapsed_time() const { return elapsed_time_; }
20359
f67539c2
TL
20360 // Returns the i-th test part result among all the results. i can range from 0
20361 // to total_part_count() - 1. If i is not in that range, aborts the program.
20362 const TestPartResult& GetTestPartResult(int i) const;
7c673cae 20363
f67539c2
TL
20364 // Returns the i-th test property. i can range from 0 to
20365 // test_property_count() - 1. If i is not in that range, aborts the
20366 // program.
20367 const TestProperty& GetTestProperty(int i) const;
7c673cae
FG
20368
20369 private:
f67539c2
TL
20370 friend class TestInfo;
20371 friend class TestCase;
20372 friend class UnitTest;
20373 friend class internal::DefaultGlobalTestPartResultReporter;
20374 friend class internal::ExecDeathTest;
20375 friend class internal::TestResultAccessor;
7c673cae 20376 friend class internal::UnitTestImpl;
f67539c2
TL
20377 friend class internal::WindowsDeathTest;
20378 friend class internal::FuchsiaDeathTest;
7c673cae 20379
f67539c2
TL
20380 // Gets the vector of TestPartResults.
20381 const std::vector<TestPartResult>& test_part_results() const {
20382 return test_part_results_;
20383 }
7c673cae 20384
f67539c2
TL
20385 // Gets the vector of TestProperties.
20386 const std::vector<TestProperty>& test_properties() const {
20387 return test_properties_;
7c673cae
FG
20388 }
20389
f67539c2
TL
20390 // Sets the elapsed time.
20391 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
7c673cae 20392
f67539c2
TL
20393 // Adds a test property to the list. The property is validated and may add
20394 // a non-fatal failure if invalid (e.g., if it conflicts with reserved
20395 // key names). If a property is already recorded for the same key, the
20396 // value will be updated, rather than storing multiple values for the same
20397 // key. xml_element specifies the element for which the property is being
20398 // recorded and is used for validation.
20399 void RecordProperty(const std::string& xml_element,
20400 const TestProperty& test_property);
7c673cae 20401
f67539c2
TL
20402 // Adds a failure if the key is a reserved attribute of Google Test
20403 // testcase tags. Returns true if the property is valid.
20404 // FIXME: Validate attribute names are legal and human readable.
20405 static bool ValidateTestProperty(const std::string& xml_element,
20406 const TestProperty& test_property);
7c673cae 20407
f67539c2
TL
20408 // Adds a test part result to the list.
20409 void AddTestPartResult(const TestPartResult& test_part_result);
7c673cae 20410
f67539c2
TL
20411 // Returns the death test count.
20412 int death_test_count() const { return death_test_count_; }
7c673cae 20413
f67539c2
TL
20414 // Increments the death test count, returning the new count.
20415 int increment_death_test_count() { return ++death_test_count_; }
7c673cae 20416
f67539c2
TL
20417 // Clears the test part results.
20418 void ClearTestPartResults();
7c673cae 20419
f67539c2
TL
20420 // Clears the object.
20421 void Clear();
7c673cae 20422
f67539c2
TL
20423 // Protects mutable state of the property vector and of owned
20424 // properties, whose values may be updated.
20425 internal::Mutex test_properites_mutex_;
7c673cae 20426
f67539c2
TL
20427 // The vector of TestPartResults
20428 std::vector<TestPartResult> test_part_results_;
20429 // The vector of TestProperties
20430 std::vector<TestProperty> test_properties_;
20431 // Running count of death tests.
20432 int death_test_count_;
20433 // The elapsed time, in milliseconds.
20434 TimeInMillis elapsed_time_;
7c673cae 20435
f67539c2
TL
20436 // We disallow copying TestResult.
20437 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
20438}; // class TestResult
20439
20440// A TestInfo object stores the following information about a test:
20441//
20442// Test case name
20443// Test name
20444// Whether the test should be run
20445// A function pointer that creates the test object when invoked
20446// Test result
20447//
20448// The constructor of TestInfo registers itself with the UnitTest
20449// singleton such that the RUN_ALL_TESTS() macro knows which tests to
20450// run.
20451class GTEST_API_ TestInfo {
20452 public:
20453 // Destructs a TestInfo object. This function is not virtual, so
20454 // don't inherit from TestInfo.
20455 ~TestInfo();
20456
20457 // Returns the test case name.
20458 const char* test_case_name() const { return test_case_name_.c_str(); }
20459
20460 // Returns the test name.
20461 const char* name() const { return name_.c_str(); }
20462
20463 // Returns the name of the parameter type, or NULL if this is not a typed
20464 // or a type-parameterized test.
20465 const char* type_param() const {
20466 if (type_param_.get() != NULL)
20467 return type_param_->c_str();
20468 return NULL;
7c673cae
FG
20469 }
20470
f67539c2
TL
20471 // Returns the text representation of the value parameter, or NULL if this
20472 // is not a value-parameterized test.
20473 const char* value_param() const {
20474 if (value_param_.get() != NULL)
20475 return value_param_->c_str();
20476 return NULL;
7c673cae
FG
20477 }
20478
f67539c2
TL
20479 // Returns the file name where this test is defined.
20480 const char* file() const { return location_.file.c_str(); }
20481
20482 // Returns the line where this test is defined.
20483 int line() const { return location_.line; }
20484
20485 // Return true if this test should not be run because it's in another shard.
20486 bool is_in_another_shard() const { return is_in_another_shard_; }
20487
20488 // Returns true if this test should run, that is if the test is not
20489 // disabled (or it is disabled but the also_run_disabled_tests flag has
20490 // been specified) and its full name matches the user-specified filter.
20491 //
20492 // Google Test allows the user to filter the tests by their full names.
20493 // The full name of a test Bar in test case Foo is defined as
20494 // "Foo.Bar". Only the tests that match the filter will run.
20495 //
20496 // A filter is a colon-separated list of glob (not regex) patterns,
20497 // optionally followed by a '-' and a colon-separated list of
20498 // negative patterns (tests to exclude). A test is run if it
20499 // matches one of the positive patterns and does not match any of
20500 // the negative patterns.
20501 //
20502 // For example, *A*:Foo.* is a filter that matches any string that
20503 // contains the character 'A' or starts with "Foo.".
20504 bool should_run() const { return should_run_; }
20505
7c673cae 20506 // Returns true iff this test will appear in the XML report.
f67539c2
TL
20507 bool is_reportable() const {
20508 // The XML report includes tests matching the filter, excluding those
20509 // run in other shards.
20510 return matches_filter_ && !is_in_another_shard_;
7c673cae
FG
20511 }
20512
f67539c2
TL
20513 // Returns the result of the test.
20514 const TestResult* result() const { return &result_; }
20515
20516 private:
20517#if GTEST_HAS_DEATH_TEST
20518 friend class internal::DefaultDeathTestFactory;
20519#endif // GTEST_HAS_DEATH_TEST
20520 friend class Test;
20521 friend class TestCase;
20522 friend class internal::UnitTestImpl;
20523 friend class internal::StreamingListenerTest;
20524 friend TestInfo* internal::MakeAndRegisterTestInfo(
20525 const char* test_case_name,
20526 const char* name,
20527 const char* type_param,
20528 const char* value_param,
20529 internal::CodeLocation code_location,
20530 internal::TypeId fixture_class_id,
20531 Test::SetUpTestCaseFunc set_up_tc,
20532 Test::TearDownTestCaseFunc tear_down_tc,
20533 internal::TestFactoryBase* factory);
20534
20535 // Constructs a TestInfo object. The newly constructed instance assumes
20536 // ownership of the factory object.
20537 TestInfo(const std::string& test_case_name,
20538 const std::string& name,
20539 const char* a_type_param, // NULL if not a type-parameterized test
20540 const char* a_value_param, // NULL if not a value-parameterized test
20541 internal::CodeLocation a_code_location,
20542 internal::TypeId fixture_class_id,
20543 internal::TestFactoryBase* factory);
20544
20545 // Increments the number of death tests encountered in this test so
20546 // far.
20547 int increment_death_test_count() {
20548 return result_.increment_death_test_count();
7c673cae
FG
20549 }
20550
f67539c2
TL
20551 // Creates the test object, runs it, records its result, and then
20552 // deletes it.
20553 void Run();
7c673cae 20554
f67539c2
TL
20555 static void ClearTestResult(TestInfo* test_info) {
20556 test_info->result_.Clear();
20557 }
7c673cae 20558
f67539c2
TL
20559 // These fields are immutable properties of the test.
20560 const std::string test_case_name_; // Test case name
20561 const std::string name_; // Test name
7c673cae
FG
20562 // Name of the parameter type, or NULL if this is not a typed or a
20563 // type-parameterized test.
20564 const internal::scoped_ptr<const ::std::string> type_param_;
f67539c2
TL
20565 // Text representation of the value parameter, or NULL if this is not a
20566 // value-parameterized test.
20567 const internal::scoped_ptr<const ::std::string> value_param_;
20568 internal::CodeLocation location_;
20569 const internal::TypeId fixture_class_id_; // ID of the test fixture class
20570 bool should_run_; // True iff this test should run
20571 bool is_disabled_; // True iff this test is disabled
20572 bool matches_filter_; // True if this test matches the
20573 // user-specified filter.
20574 bool is_in_another_shard_; // Will be run in another shard.
20575 internal::TestFactoryBase* const factory_; // The factory that creates
20576 // the test object
7c673cae 20577
f67539c2
TL
20578 // This field is mutable and needs to be reset before running the
20579 // test for the second time.
20580 TestResult result_;
20581
20582 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
7c673cae
FG
20583};
20584
f67539c2 20585// A test case, which consists of a vector of TestInfos.
7c673cae 20586//
f67539c2
TL
20587// TestCase is not copyable.
20588class GTEST_API_ TestCase {
7c673cae 20589 public:
f67539c2
TL
20590 // Creates a TestCase with the given name.
20591 //
20592 // TestCase does NOT have a default constructor. Always use this
20593 // constructor to create a TestCase object.
20594 //
20595 // Arguments:
20596 //
20597 // name: name of the test case
20598 // a_type_param: the name of the test's type parameter, or NULL if
20599 // this is not a type-parameterized test.
20600 // set_up_tc: pointer to the function that sets up the test case
20601 // tear_down_tc: pointer to the function that tears down the test case
20602 TestCase(const char* name, const char* a_type_param,
20603 Test::SetUpTestCaseFunc set_up_tc,
20604 Test::TearDownTestCaseFunc tear_down_tc);
7c673cae 20605
f67539c2
TL
20606 // Destructor of TestCase.
20607 virtual ~TestCase();
20608
20609 // Gets the name of the TestCase.
20610 const char* name() const { return name_.c_str(); }
20611
20612 // Returns the name of the parameter type, or NULL if this is not a
20613 // type-parameterized test case.
20614 const char* type_param() const {
20615 if (type_param_.get() != NULL)
20616 return type_param_->c_str();
20617 return NULL;
20618 }
20619
20620 // Returns true if any test in this test case should run.
20621 bool should_run() const { return should_run_; }
20622
20623 // Gets the number of successful tests in this test case.
20624 int successful_test_count() const;
20625
20626 // Gets the number of failed tests in this test case.
20627 int failed_test_count() const;
20628
20629 // Gets the number of disabled tests that will be reported in the XML report.
20630 int reportable_disabled_test_count() const;
20631
20632 // Gets the number of disabled tests in this test case.
20633 int disabled_test_count() const;
20634
20635 // Gets the number of tests to be printed in the XML report.
20636 int reportable_test_count() const;
20637
20638 // Get the number of tests in this test case that should run.
20639 int test_to_run_count() const;
20640
20641 // Gets the number of all tests in this test case.
20642 int total_test_count() const;
20643
20644 // Returns true iff the test case passed.
20645 bool Passed() const { return !Failed(); }
20646
20647 // Returns true iff the test case failed.
20648 bool Failed() const { return failed_test_count() > 0; }
20649
20650 // Returns the elapsed time, in milliseconds.
20651 TimeInMillis elapsed_time() const { return elapsed_time_; }
20652
20653 // Returns the i-th test among all the tests. i can range from 0 to
20654 // total_test_count() - 1. If i is not in that range, returns NULL.
20655 const TestInfo* GetTestInfo(int i) const;
20656
20657 // Returns the TestResult that holds test properties recorded during
20658 // execution of SetUpTestCase and TearDownTestCase.
20659 const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
20660
20661 private:
20662 friend class Test;
20663 friend class internal::UnitTestImpl;
20664
20665 // Gets the (mutable) vector of TestInfos in this TestCase.
20666 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
20667
20668 // Gets the (immutable) vector of TestInfos in this TestCase.
20669 const std::vector<TestInfo*>& test_info_list() const {
20670 return test_info_list_;
20671 }
20672
20673 // Returns the i-th test among all the tests. i can range from 0 to
20674 // total_test_count() - 1. If i is not in that range, returns NULL.
20675 TestInfo* GetMutableTestInfo(int i);
20676
20677 // Sets the should_run member.
20678 void set_should_run(bool should) { should_run_ = should; }
20679
20680 // Adds a TestInfo to this test case. Will delete the TestInfo upon
20681 // destruction of the TestCase object.
20682 void AddTestInfo(TestInfo * test_info);
20683
20684 // Clears the results of all tests in this test case.
20685 void ClearResult();
20686
20687 // Clears the results of all tests in the given test case.
20688 static void ClearTestCaseResult(TestCase* test_case) {
20689 test_case->ClearResult();
20690 }
20691
20692 // Runs every test in this TestCase.
20693 void Run();
20694
20695 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
20696 // for catching exceptions thrown from SetUpTestCase().
20697 void RunSetUpTestCase() { (*set_up_tc_)(); }
20698
20699 // Runs TearDownTestCase() for this TestCase. This wrapper is
20700 // needed for catching exceptions thrown from TearDownTestCase().
20701 void RunTearDownTestCase() { (*tear_down_tc_)(); }
20702
20703 // Returns true iff test passed.
20704 static bool TestPassed(const TestInfo* test_info) {
20705 return test_info->should_run() && test_info->result()->Passed();
20706 }
20707
20708 // Returns true iff test failed.
20709 static bool TestFailed(const TestInfo* test_info) {
20710 return test_info->should_run() && test_info->result()->Failed();
20711 }
20712
20713 // Returns true iff the test is disabled and will be reported in the XML
20714 // report.
20715 static bool TestReportableDisabled(const TestInfo* test_info) {
20716 return test_info->is_reportable() && test_info->is_disabled_;
20717 }
20718
20719 // Returns true iff test is disabled.
20720 static bool TestDisabled(const TestInfo* test_info) {
20721 return test_info->is_disabled_;
20722 }
20723
20724 // Returns true iff this test will appear in the XML report.
20725 static bool TestReportable(const TestInfo* test_info) {
20726 return test_info->is_reportable();
20727 }
20728
20729 // Returns true if the given test should run.
20730 static bool ShouldRunTest(const TestInfo* test_info) {
20731 return test_info->should_run();
20732 }
20733
20734 // Shuffles the tests in this test case.
20735 void ShuffleTests(internal::Random* random);
20736
20737 // Restores the test order to before the first shuffle.
20738 void UnshuffleTests();
20739
20740 // Name of the test case.
20741 std::string name_;
20742 // Name of the parameter type, or NULL if this is not a typed or a
20743 // type-parameterized test.
20744 const internal::scoped_ptr<const ::std::string> type_param_;
20745 // The vector of TestInfos in their original order. It owns the
20746 // elements in the vector.
20747 std::vector<TestInfo*> test_info_list_;
20748 // Provides a level of indirection for the test list to allow easy
20749 // shuffling and restoring the test order. The i-th element in this
20750 // vector is the index of the i-th test in the shuffled test list.
20751 std::vector<int> test_indices_;
20752 // Pointer to the function that sets up the test case.
20753 Test::SetUpTestCaseFunc set_up_tc_;
20754 // Pointer to the function that tears down the test case.
20755 Test::TearDownTestCaseFunc tear_down_tc_;
20756 // True iff any test in this test case should run.
20757 bool should_run_;
20758 // Elapsed time, in milliseconds.
20759 TimeInMillis elapsed_time_;
20760 // Holds test properties recorded during execution of SetUpTestCase and
20761 // TearDownTestCase.
20762 TestResult ad_hoc_test_result_;
20763
20764 // We disallow copying TestCases.
20765 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
20766};
20767
20768// An Environment object is capable of setting up and tearing down an
20769// environment. You should subclass this to define your own
20770// environment(s).
20771//
20772// An Environment object does the set-up and tear-down in virtual
20773// methods SetUp() and TearDown() instead of the constructor and the
20774// destructor, as:
20775//
20776// 1. You cannot safely throw from a destructor. This is a problem
20777// as in some cases Google Test is used where exceptions are enabled, and
20778// we may want to implement ASSERT_* using exceptions where they are
20779// available.
20780// 2. You cannot use ASSERT_* directly in a constructor or
20781// destructor.
20782class Environment {
20783 public:
20784 // The d'tor is virtual as we need to subclass Environment.
20785 virtual ~Environment() {}
20786
20787 // Override this to define how to set up the environment.
7c673cae
FG
20788 virtual void SetUp() {}
20789
20790 // Override this to define how to tear down the environment.
20791 virtual void TearDown() {}
20792 private:
20793 // If you see an error about overriding the following function or
20794 // about it being private, you have mis-spelled SetUp() as Setup().
20795 struct Setup_should_be_spelled_SetUp {};
20796 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
20797};
20798
f67539c2
TL
20799#if GTEST_HAS_EXCEPTIONS
20800
20801// Exception which can be thrown from TestEventListener::OnTestPartResult.
20802class GTEST_API_ AssertionException
20803 : public internal::GoogleTestFailureException {
20804 public:
20805 explicit AssertionException(const TestPartResult& result)
20806 : GoogleTestFailureException(result) {}
20807};
20808
20809#endif // GTEST_HAS_EXCEPTIONS
20810
7c673cae
FG
20811// The interface for tracing execution of tests. The methods are organized in
20812// the order the corresponding events are fired.
20813class TestEventListener {
20814 public:
20815 virtual ~TestEventListener() {}
20816
20817 // Fired before any test activity starts.
20818 virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
20819
20820 // Fired before each iteration of tests starts. There may be more than
20821 // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
20822 // index, starting from 0.
20823 virtual void OnTestIterationStart(const UnitTest& unit_test,
20824 int iteration) = 0;
20825
20826 // Fired before environment set-up for each iteration of tests starts.
20827 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
20828
20829 // Fired after environment set-up for each iteration of tests ends.
20830 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
20831
20832 // Fired before the test case starts.
20833 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
20834
20835 // Fired before the test starts.
20836 virtual void OnTestStart(const TestInfo& test_info) = 0;
20837
20838 // Fired after a failed assertion or a SUCCEED() invocation.
f67539c2
TL
20839 // If you want to throw an exception from this function to skip to the next
20840 // TEST, it must be AssertionException defined above, or inherited from it.
7c673cae
FG
20841 virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
20842
20843 // Fired after the test ends.
20844 virtual void OnTestEnd(const TestInfo& test_info) = 0;
20845
20846 // Fired after the test case ends.
20847 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
20848
20849 // Fired before environment tear-down for each iteration of tests starts.
20850 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
20851
20852 // Fired after environment tear-down for each iteration of tests ends.
20853 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
20854
20855 // Fired after each iteration of tests finishes.
20856 virtual void OnTestIterationEnd(const UnitTest& unit_test,
20857 int iteration) = 0;
20858
20859 // Fired after all test activities have ended.
20860 virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
20861};
20862
20863// The convenience class for users who need to override just one or two
20864// methods and are not concerned that a possible change to a signature of
20865// the methods they override will not be caught during the build. For
20866// comments about each method please see the definition of TestEventListener
20867// above.
20868class EmptyTestEventListener : public TestEventListener {
20869 public:
20870 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
20871 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
20872 int /*iteration*/) {}
20873 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
20874 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
20875 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
20876 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
20877 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
20878 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
20879 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
20880 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
20881 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
20882 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
20883 int /*iteration*/) {}
20884 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
20885};
20886
20887// TestEventListeners lets users add listeners to track events in Google Test.
20888class GTEST_API_ TestEventListeners {
20889 public:
20890 TestEventListeners();
20891 ~TestEventListeners();
20892
20893 // Appends an event listener to the end of the list. Google Test assumes
20894 // the ownership of the listener (i.e. it will delete the listener when
20895 // the test program finishes).
20896 void Append(TestEventListener* listener);
20897
20898 // Removes the given event listener from the list and returns it. It then
20899 // becomes the caller's responsibility to delete the listener. Returns
20900 // NULL if the listener is not found in the list.
20901 TestEventListener* Release(TestEventListener* listener);
20902
20903 // Returns the standard listener responsible for the default console
20904 // output. Can be removed from the listeners list to shut down default
20905 // console output. Note that removing this object from the listener list
20906 // with Release transfers its ownership to the caller and makes this
20907 // function return NULL the next time.
20908 TestEventListener* default_result_printer() const {
20909 return default_result_printer_;
20910 }
20911
20912 // Returns the standard listener responsible for the default XML output
20913 // controlled by the --gtest_output=xml flag. Can be removed from the
20914 // listeners list by users who want to shut down the default XML output
20915 // controlled by this flag and substitute it with custom one. Note that
20916 // removing this object from the listener list with Release transfers its
20917 // ownership to the caller and makes this function return NULL the next
20918 // time.
20919 TestEventListener* default_xml_generator() const {
20920 return default_xml_generator_;
20921 }
20922
20923 private:
20924 friend class TestCase;
20925 friend class TestInfo;
20926 friend class internal::DefaultGlobalTestPartResultReporter;
20927 friend class internal::NoExecDeathTest;
20928 friend class internal::TestEventListenersAccessor;
20929 friend class internal::UnitTestImpl;
20930
20931 // Returns repeater that broadcasts the TestEventListener events to all
20932 // subscribers.
20933 TestEventListener* repeater();
20934
20935 // Sets the default_result_printer attribute to the provided listener.
20936 // The listener is also added to the listener list and previous
20937 // default_result_printer is removed from it and deleted. The listener can
20938 // also be NULL in which case it will not be added to the list. Does
20939 // nothing if the previous and the current listener objects are the same.
20940 void SetDefaultResultPrinter(TestEventListener* listener);
20941
20942 // Sets the default_xml_generator attribute to the provided listener. The
20943 // listener is also added to the listener list and previous
20944 // default_xml_generator is removed from it and deleted. The listener can
20945 // also be NULL in which case it will not be added to the list. Does
20946 // nothing if the previous and the current listener objects are the same.
20947 void SetDefaultXmlGenerator(TestEventListener* listener);
20948
20949 // Controls whether events will be forwarded by the repeater to the
20950 // listeners in the list.
20951 bool EventForwardingEnabled() const;
20952 void SuppressEventForwarding();
20953
20954 // The actual list of listeners.
20955 internal::TestEventRepeater* repeater_;
20956 // Listener responsible for the standard result output.
20957 TestEventListener* default_result_printer_;
20958 // Listener responsible for the creation of the XML output file.
20959 TestEventListener* default_xml_generator_;
20960
20961 // We disallow copying TestEventListeners.
20962 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
20963};
20964
20965// A UnitTest consists of a vector of TestCases.
20966//
20967// This is a singleton class. The only instance of UnitTest is
20968// created when UnitTest::GetInstance() is first called. This
20969// instance is never deleted.
20970//
20971// UnitTest is not copyable.
20972//
20973// This class is thread-safe as long as the methods are called
20974// according to their specification.
20975class GTEST_API_ UnitTest {
20976 public:
20977 // Gets the singleton UnitTest object. The first time this method
20978 // is called, a UnitTest object is constructed and returned.
20979 // Consecutive calls will return the same object.
20980 static UnitTest* GetInstance();
20981
20982 // Runs all tests in this UnitTest object and prints the result.
20983 // Returns 0 if successful, or 1 otherwise.
20984 //
20985 // This method can only be called from the main thread.
20986 //
20987 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20988 int Run() GTEST_MUST_USE_RESULT_;
20989
20990 // Returns the working directory when the first TEST() or TEST_F()
20991 // was executed. The UnitTest object owns the string.
20992 const char* original_working_dir() const;
20993
20994 // Returns the TestCase object for the test that's currently running,
20995 // or NULL if no test is running.
20996 const TestCase* current_test_case() const
20997 GTEST_LOCK_EXCLUDED_(mutex_);
20998
20999 // Returns the TestInfo object for the test that's currently running,
21000 // or NULL if no test is running.
21001 const TestInfo* current_test_info() const
21002 GTEST_LOCK_EXCLUDED_(mutex_);
21003
21004 // Returns the random seed used at the start of the current test run.
21005 int random_seed() const;
21006
7c673cae
FG
21007 // Returns the ParameterizedTestCaseRegistry object used to keep track of
21008 // value-parameterized tests and instantiate and register them.
21009 //
21010 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21011 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
21012 GTEST_LOCK_EXCLUDED_(mutex_);
7c673cae
FG
21013
21014 // Gets the number of successful test cases.
21015 int successful_test_case_count() const;
21016
21017 // Gets the number of failed test cases.
21018 int failed_test_case_count() const;
21019
21020 // Gets the number of all test cases.
21021 int total_test_case_count() const;
21022
21023 // Gets the number of all test cases that contain at least one test
21024 // that should run.
21025 int test_case_to_run_count() const;
21026
21027 // Gets the number of successful tests.
21028 int successful_test_count() const;
21029
21030 // Gets the number of failed tests.
21031 int failed_test_count() const;
21032
21033 // Gets the number of disabled tests that will be reported in the XML report.
21034 int reportable_disabled_test_count() const;
21035
21036 // Gets the number of disabled tests.
21037 int disabled_test_count() const;
21038
21039 // Gets the number of tests to be printed in the XML report.
21040 int reportable_test_count() const;
21041
21042 // Gets the number of all tests.
21043 int total_test_count() const;
21044
21045 // Gets the number of tests that should run.
21046 int test_to_run_count() const;
21047
21048 // Gets the time of the test program start, in ms from the start of the
21049 // UNIX epoch.
21050 TimeInMillis start_timestamp() const;
21051
21052 // Gets the elapsed time, in milliseconds.
21053 TimeInMillis elapsed_time() const;
21054
21055 // Returns true iff the unit test passed (i.e. all test cases passed).
21056 bool Passed() const;
21057
21058 // Returns true iff the unit test failed (i.e. some test case failed
21059 // or something outside of all tests failed).
21060 bool Failed() const;
21061
21062 // Gets the i-th test case among all the test cases. i can range from 0 to
21063 // total_test_case_count() - 1. If i is not in that range, returns NULL.
21064 const TestCase* GetTestCase(int i) const;
21065
21066 // Returns the TestResult containing information on test failures and
21067 // properties logged outside of individual test cases.
21068 const TestResult& ad_hoc_test_result() const;
21069
21070 // Returns the list of event listeners that can be used to track events
21071 // inside Google Test.
21072 TestEventListeners& listeners();
21073
21074 private:
21075 // Registers and returns a global test environment. When a test
21076 // program is run, all global test environments will be set-up in
21077 // the order they were registered. After all tests in the program
21078 // have finished, all global test environments will be torn-down in
21079 // the *reverse* order they were registered.
21080 //
21081 // The UnitTest object takes ownership of the given environment.
21082 //
21083 // This method can only be called from the main thread.
21084 Environment* AddEnvironment(Environment* env);
21085
21086 // Adds a TestPartResult to the current TestResult object. All
21087 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
21088 // eventually call this to report their results. The user code
21089 // should use the assertion macros instead of calling this directly.
21090 void AddTestPartResult(TestPartResult::Type result_type,
21091 const char* file_name,
21092 int line_number,
21093 const std::string& message,
21094 const std::string& os_stack_trace)
21095 GTEST_LOCK_EXCLUDED_(mutex_);
21096
21097 // Adds a TestProperty to the current TestResult object when invoked from
21098 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
21099 // from SetUpTestCase or TearDownTestCase, or to the global property set
21100 // when invoked elsewhere. If the result already contains a property with
21101 // the same key, the value will be updated.
21102 void RecordProperty(const std::string& key, const std::string& value);
21103
21104 // Gets the i-th test case among all the test cases. i can range from 0 to
21105 // total_test_case_count() - 1. If i is not in that range, returns NULL.
21106 TestCase* GetMutableTestCase(int i);
21107
21108 // Accessors for the implementation object.
21109 internal::UnitTestImpl* impl() { return impl_; }
21110 const internal::UnitTestImpl* impl() const { return impl_; }
21111
f67539c2 21112 // These classes and functions are friends as they need to access private
7c673cae 21113 // members of UnitTest.
f67539c2 21114 friend class ScopedTrace;
7c673cae
FG
21115 friend class Test;
21116 friend class internal::AssertHelper;
7c673cae
FG
21117 friend class internal::StreamingListenerTest;
21118 friend class internal::UnitTestRecordPropertyTestHelper;
21119 friend Environment* AddGlobalTestEnvironment(Environment* env);
21120 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
21121 friend void internal::ReportFailureInUnknownLocation(
21122 TestPartResult::Type result_type,
21123 const std::string& message);
21124
21125 // Creates an empty UnitTest.
21126 UnitTest();
21127
21128 // D'tor
21129 virtual ~UnitTest();
21130
21131 // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
21132 // Google Test trace stack.
21133 void PushGTestTrace(const internal::TraceInfo& trace)
21134 GTEST_LOCK_EXCLUDED_(mutex_);
21135
21136 // Pops a trace from the per-thread Google Test trace stack.
21137 void PopGTestTrace()
21138 GTEST_LOCK_EXCLUDED_(mutex_);
21139
21140 // Protects mutable state in *impl_. This is mutable as some const
21141 // methods need to lock it too.
21142 mutable internal::Mutex mutex_;
21143
21144 // Opaque implementation object. This field is never changed once
21145 // the object is constructed. We don't mark it as const here, as
21146 // doing so will cause a warning in the constructor of UnitTest.
21147 // Mutable state in *impl_ is protected by mutex_.
21148 internal::UnitTestImpl* impl_;
21149
21150 // We disallow copying UnitTest.
21151 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
21152};
21153
21154// A convenient wrapper for adding an environment for the test
21155// program.
21156//
21157// You should call this before RUN_ALL_TESTS() is called, probably in
21158// main(). If you use gtest_main, you need to call this before main()
21159// starts for it to take effect. For example, you can define a global
21160// variable like this:
21161//
21162// testing::Environment* const foo_env =
21163// testing::AddGlobalTestEnvironment(new FooEnvironment);
21164//
21165// However, we strongly recommend you to write your own main() and
21166// call AddGlobalTestEnvironment() there, as relying on initialization
21167// of global variables makes the code harder to read and may cause
21168// problems when you register multiple environments from different
21169// translation units and the environments have dependencies among them
21170// (remember that the compiler doesn't guarantee the order in which
21171// global variables from different translation units are initialized).
21172inline Environment* AddGlobalTestEnvironment(Environment* env) {
21173 return UnitTest::GetInstance()->AddEnvironment(env);
21174}
21175
21176// Initializes Google Test. This must be called before calling
21177// RUN_ALL_TESTS(). In particular, it parses a command line for the
21178// flags that Google Test recognizes. Whenever a Google Test flag is
21179// seen, it is removed from argv, and *argc is decremented.
21180//
21181// No value is returned. Instead, the Google Test flag variables are
21182// updated.
21183//
21184// Calling the function for the second time has no user-visible effect.
21185GTEST_API_ void InitGoogleTest(int* argc, char** argv);
21186
21187// This overloaded version can be used in Windows programs compiled in
21188// UNICODE mode.
21189GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
21190
21191namespace internal {
21192
f67539c2
TL
21193// Separate the error generating code from the code path to reduce the stack
21194// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
21195// when calling EXPECT_* in a tight loop.
21196template <typename T1, typename T2>
21197AssertionResult CmpHelperEQFailure(const char* lhs_expression,
21198 const char* rhs_expression,
21199 const T1& lhs, const T2& rhs) {
21200 return EqFailure(lhs_expression,
21201 rhs_expression,
21202 FormatForComparisonFailureMessage(lhs, rhs),
21203 FormatForComparisonFailureMessage(rhs, lhs),
21204 false);
21205}
7c673cae 21206
f67539c2
TL
21207// The helper function for {ASSERT|EXPECT}_EQ.
21208template <typename T1, typename T2>
21209AssertionResult CmpHelperEQ(const char* lhs_expression,
21210 const char* rhs_expression,
21211 const T1& lhs,
21212 const T2& rhs) {
21213 if (lhs == rhs) {
21214 return AssertionSuccess();
7c673cae 21215 }
7c673cae 21216
f67539c2
TL
21217 return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
21218}
21219
21220// With this overloaded version, we allow anonymous enums to be used
21221// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
21222// can be implicitly cast to BiggestInt.
21223GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
21224 const char* rhs_expression,
21225 BiggestInt lhs,
21226 BiggestInt rhs);
21227
21228// The helper class for {ASSERT|EXPECT}_EQ. The template argument
21229// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
21230// is a null pointer literal. The following default implementation is
21231// for lhs_is_null_literal being false.
21232template <bool lhs_is_null_literal>
21233class EqHelper {
7c673cae 21234 public:
f67539c2
TL
21235 // This templatized version is for the general case.
21236 template <typename T1, typename T2>
21237 static AssertionResult Compare(const char* lhs_expression,
21238 const char* rhs_expression,
21239 const T1& lhs,
21240 const T2& rhs) {
21241 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
7c673cae 21242 }
7c673cae 21243
f67539c2
TL
21244 // With this overloaded version, we allow anonymous enums to be used
21245 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
21246 // enums can be implicitly cast to BiggestInt.
21247 //
21248 // Even though its body looks the same as the above version, we
21249 // cannot merge the two, as it will make anonymous enums unhappy.
21250 static AssertionResult Compare(const char* lhs_expression,
21251 const char* rhs_expression,
21252 BiggestInt lhs,
21253 BiggestInt rhs) {
21254 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
7c673cae 21255 }
f67539c2 21256};
7c673cae
FG
21257
21258// This specialization is used when the first argument to ASSERT_EQ()
21259// is a null pointer literal, like NULL, false, or 0.
21260template <>
21261class EqHelper<true> {
21262 public:
21263 // We define two overloaded versions of Compare(). The first
21264 // version will be picked when the second argument to ASSERT_EQ() is
21265 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
21266 // EXPECT_EQ(false, a_bool).
21267 template <typename T1, typename T2>
21268 static AssertionResult Compare(
f67539c2
TL
21269 const char* lhs_expression,
21270 const char* rhs_expression,
21271 const T1& lhs,
21272 const T2& rhs,
7c673cae
FG
21273 // The following line prevents this overload from being considered if T2
21274 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
21275 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
21276 // to match the Secret* in the other overload, which would otherwise make
21277 // this template match better.
21278 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
f67539c2 21279 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
7c673cae
FG
21280 }
21281
21282 // This version will be picked when the second argument to ASSERT_EQ() is a
21283 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
21284 template <typename T>
21285 static AssertionResult Compare(
f67539c2
TL
21286 const char* lhs_expression,
21287 const char* rhs_expression,
7c673cae
FG
21288 // We used to have a second template parameter instead of Secret*. That
21289 // template parameter would deduce to 'long', making this a better match
21290 // than the first overload even without the first overload's EnableIf.
21291 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
21292 // non-pointer argument" (even a deduced integral argument), so the old
21293 // implementation caused warnings in user code.
f67539c2
TL
21294 Secret* /* lhs (NULL) */,
21295 T* rhs) {
21296 // We already know that 'lhs' is a null pointer.
21297 return CmpHelperEQ(lhs_expression, rhs_expression,
21298 static_cast<T*>(NULL), rhs);
7c673cae
FG
21299 }
21300};
21301
21302// Separate the error generating code from the code path to reduce the stack
21303// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
21304// when calling EXPECT_OP in a tight loop.
21305template <typename T1, typename T2>
21306AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
21307 const T1& val1, const T2& val2,
21308 const char* op) {
21309 return AssertionFailure()
21310 << "Expected: (" << expr1 << ") " << op << " (" << expr2
21311 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
21312 << " vs " << FormatForComparisonFailureMessage(val2, val1);
21313}
21314
21315// A macro for implementing the helper functions needed to implement
21316// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
21317// of similar code.
21318//
21319// For each templatized helper function, we also define an overloaded
21320// version for BiggestInt in order to reduce code bloat and allow
21321// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
21322// with gcc 4.
21323//
21324// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21325
21326#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
21327template <typename T1, typename T2>\
21328AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
21329 const T1& val1, const T2& val2) {\
21330 if (val1 op val2) {\
21331 return AssertionSuccess();\
21332 } else {\
21333 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
21334 }\
21335}\
21336GTEST_API_ AssertionResult CmpHelper##op_name(\
21337 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
21338
21339// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21340
21341// Implements the helper function for {ASSERT|EXPECT}_NE
21342GTEST_IMPL_CMP_HELPER_(NE, !=);
21343// Implements the helper function for {ASSERT|EXPECT}_LE
21344GTEST_IMPL_CMP_HELPER_(LE, <=);
21345// Implements the helper function for {ASSERT|EXPECT}_LT
21346GTEST_IMPL_CMP_HELPER_(LT, <);
21347// Implements the helper function for {ASSERT|EXPECT}_GE
21348GTEST_IMPL_CMP_HELPER_(GE, >=);
21349// Implements the helper function for {ASSERT|EXPECT}_GT
21350GTEST_IMPL_CMP_HELPER_(GT, >);
21351
21352#undef GTEST_IMPL_CMP_HELPER_
21353
21354// The helper function for {ASSERT|EXPECT}_STREQ.
21355//
21356// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
f67539c2
TL
21357GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
21358 const char* s2_expression,
21359 const char* s1,
21360 const char* s2);
7c673cae
FG
21361
21362// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
21363//
21364// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
f67539c2
TL
21365GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
21366 const char* s2_expression,
21367 const char* s1,
21368 const char* s2);
7c673cae
FG
21369
21370// The helper function for {ASSERT|EXPECT}_STRNE.
21371//
21372// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21373GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
21374 const char* s2_expression,
21375 const char* s1,
21376 const char* s2);
21377
21378// The helper function for {ASSERT|EXPECT}_STRCASENE.
21379//
21380// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21381GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
21382 const char* s2_expression,
21383 const char* s1,
21384 const char* s2);
21385
21386
21387// Helper function for *_STREQ on wide strings.
21388//
21389// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
f67539c2
TL
21390GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
21391 const char* s2_expression,
21392 const wchar_t* s1,
21393 const wchar_t* s2);
7c673cae
FG
21394
21395// Helper function for *_STRNE on wide strings.
21396//
21397// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21398GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
21399 const char* s2_expression,
21400 const wchar_t* s1,
21401 const wchar_t* s2);
21402
21403} // namespace internal
21404
21405// IsSubstring() and IsNotSubstring() are intended to be used as the
21406// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
21407// themselves. They check whether needle is a substring of haystack
21408// (NULL is considered a substring of itself only), and return an
21409// appropriate error message when they fail.
21410//
21411// The {needle,haystack}_expr arguments are the stringified
21412// expressions that generated the two real arguments.
21413GTEST_API_ AssertionResult IsSubstring(
21414 const char* needle_expr, const char* haystack_expr,
21415 const char* needle, const char* haystack);
21416GTEST_API_ AssertionResult IsSubstring(
21417 const char* needle_expr, const char* haystack_expr,
21418 const wchar_t* needle, const wchar_t* haystack);
21419GTEST_API_ AssertionResult IsNotSubstring(
21420 const char* needle_expr, const char* haystack_expr,
21421 const char* needle, const char* haystack);
21422GTEST_API_ AssertionResult IsNotSubstring(
21423 const char* needle_expr, const char* haystack_expr,
21424 const wchar_t* needle, const wchar_t* haystack);
21425GTEST_API_ AssertionResult IsSubstring(
21426 const char* needle_expr, const char* haystack_expr,
21427 const ::std::string& needle, const ::std::string& haystack);
21428GTEST_API_ AssertionResult IsNotSubstring(
21429 const char* needle_expr, const char* haystack_expr,
21430 const ::std::string& needle, const ::std::string& haystack);
21431
21432#if GTEST_HAS_STD_WSTRING
21433GTEST_API_ AssertionResult IsSubstring(
21434 const char* needle_expr, const char* haystack_expr,
21435 const ::std::wstring& needle, const ::std::wstring& haystack);
21436GTEST_API_ AssertionResult IsNotSubstring(
21437 const char* needle_expr, const char* haystack_expr,
21438 const ::std::wstring& needle, const ::std::wstring& haystack);
21439#endif // GTEST_HAS_STD_WSTRING
21440
21441namespace internal {
21442
21443// Helper template function for comparing floating-points.
21444//
21445// Template parameter:
21446//
21447// RawType: the raw floating-point type (either float or double)
21448//
21449// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21450template <typename RawType>
f67539c2
TL
21451AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
21452 const char* rhs_expression,
21453 RawType lhs_value,
21454 RawType rhs_value) {
21455 const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
7c673cae
FG
21456
21457 if (lhs.AlmostEquals(rhs)) {
21458 return AssertionSuccess();
21459 }
21460
f67539c2
TL
21461 ::std::stringstream lhs_ss;
21462 lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
21463 << lhs_value;
7c673cae 21464
f67539c2
TL
21465 ::std::stringstream rhs_ss;
21466 rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
21467 << rhs_value;
7c673cae 21468
f67539c2
TL
21469 return EqFailure(lhs_expression,
21470 rhs_expression,
21471 StringStreamToString(&lhs_ss),
21472 StringStreamToString(&rhs_ss),
7c673cae
FG
21473 false);
21474}
21475
21476// Helper function for implementing ASSERT_NEAR.
21477//
21478// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21479GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
21480 const char* expr2,
21481 const char* abs_error_expr,
21482 double val1,
21483 double val2,
21484 double abs_error);
21485
21486// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
21487// A class that enables one to stream messages to assertion macros
21488class GTEST_API_ AssertHelper {
21489 public:
21490 // Constructor.
21491 AssertHelper(TestPartResult::Type type,
21492 const char* file,
21493 int line,
21494 const char* message);
21495 ~AssertHelper();
21496
21497 // Message assignment is a semantic trick to enable assertion
21498 // streaming; see the GTEST_MESSAGE_ macro below.
21499 void operator=(const Message& message) const;
21500
21501 private:
21502 // We put our data in a struct so that the size of the AssertHelper class can
21503 // be as small as possible. This is important because gcc is incapable of
21504 // re-using stack space even for temporary variables, so every EXPECT_EQ
21505 // reserves stack space for another AssertHelper.
21506 struct AssertHelperData {
21507 AssertHelperData(TestPartResult::Type t,
21508 const char* srcfile,
21509 int line_num,
21510 const char* msg)
21511 : type(t), file(srcfile), line(line_num), message(msg) { }
21512
21513 TestPartResult::Type const type;
21514 const char* const file;
21515 int const line;
21516 std::string const message;
21517
21518 private:
21519 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
21520 };
21521
21522 AssertHelperData* const data_;
21523
21524 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
21525};
21526
21527} // namespace internal
21528
7c673cae
FG
21529// The pure interface class that all value-parameterized tests inherit from.
21530// A value-parameterized class must inherit from both ::testing::Test and
21531// ::testing::WithParamInterface. In most cases that just means inheriting
21532// from ::testing::TestWithParam, but more complicated test hierarchies
21533// may need to inherit from Test and WithParamInterface at different levels.
21534//
21535// This interface has support for accessing the test parameter value via
21536// the GetParam() method.
21537//
21538// Use it with one of the parameter generator defining functions, like Range(),
21539// Values(), ValuesIn(), Bool(), and Combine().
21540//
21541// class FooTest : public ::testing::TestWithParam<int> {
21542// protected:
21543// FooTest() {
21544// // Can use GetParam() here.
21545// }
21546// virtual ~FooTest() {
21547// // Can use GetParam() here.
21548// }
21549// virtual void SetUp() {
21550// // Can use GetParam() here.
21551// }
21552// virtual void TearDown {
21553// // Can use GetParam() here.
21554// }
21555// };
21556// TEST_P(FooTest, DoesBar) {
21557// // Can use GetParam() method here.
21558// Foo foo;
21559// ASSERT_TRUE(foo.DoesBar(GetParam()));
21560// }
21561// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
21562
21563template <typename T>
21564class WithParamInterface {
21565 public:
21566 typedef T ParamType;
21567 virtual ~WithParamInterface() {}
21568
21569 // The current parameter value. Is also available in the test fixture's
21570 // constructor. This member function is non-static, even though it only
21571 // references static data, to reduce the opportunity for incorrect uses
21572 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
21573 // uses a fixture whose parameter type is int.
f67539c2
TL
21574 const ParamType& GetParam() const {
21575 GTEST_CHECK_(parameter_ != NULL)
21576 << "GetParam() can only be called inside a value-parameterized test "
21577 << "-- did you intend to write TEST_P instead of TEST_F?";
21578 return *parameter_;
21579 }
7c673cae 21580
f67539c2
TL
21581 private:
21582 // Sets parameter value. The caller is responsible for making sure the value
21583 // remains alive and unchanged throughout the current test.
21584 static void SetParam(const ParamType* parameter) {
21585 parameter_ = parameter;
21586 }
7c673cae 21587
f67539c2
TL
21588 // Static value used for accessing parameter during a test lifetime.
21589 static const ParamType* parameter_;
7c673cae 21590
f67539c2
TL
21591 // TestClass must be a subclass of WithParamInterface<T> and Test.
21592 template <class TestClass> friend class internal::ParameterizedTestFactory;
21593};
7c673cae 21594
f67539c2
TL
21595template <typename T>
21596const T* WithParamInterface<T>::parameter_ = NULL;
7c673cae 21597
f67539c2
TL
21598// Most value-parameterized classes can ignore the existence of
21599// WithParamInterface, and can just inherit from ::testing::TestWithParam.
7c673cae 21600
f67539c2
TL
21601template <typename T>
21602class TestWithParam : public Test, public WithParamInterface<T> {
21603};
7c673cae 21604
f67539c2 21605// Macros for indicating success/failure in test code.
7c673cae 21606
f67539c2
TL
21607// ADD_FAILURE unconditionally adds a failure to the current test.
21608// SUCCEED generates a success - it doesn't automatically make the
21609// current test successful, as a test is only successful when it has
21610// no failure.
21611//
21612// EXPECT_* verifies that a certain condition is satisfied. If not,
21613// it behaves like ADD_FAILURE. In particular:
21614//
21615// EXPECT_TRUE verifies that a Boolean condition is true.
21616// EXPECT_FALSE verifies that a Boolean condition is false.
21617//
21618// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
21619// that they will also abort the current function on failure. People
21620// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
21621// writing data-driven tests often find themselves using ADD_FAILURE
21622// and EXPECT_* more.
7c673cae 21623
f67539c2
TL
21624// Generates a nonfatal failure with a generic message.
21625#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
7c673cae 21626
f67539c2
TL
21627// Generates a nonfatal failure at the given source file location with
21628// a generic message.
21629#define ADD_FAILURE_AT(file, line) \
21630 GTEST_MESSAGE_AT_(file, line, "Failed", \
21631 ::testing::TestPartResult::kNonFatalFailure)
7c673cae 21632
f67539c2
TL
21633// Generates a fatal failure with a generic message.
21634#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
7c673cae 21635
f67539c2
TL
21636// Define this macro to 1 to omit the definition of FAIL(), which is a
21637// generic name and clashes with some other libraries.
21638#if !GTEST_DONT_DEFINE_FAIL
21639# define FAIL() GTEST_FAIL()
21640#endif
7c673cae 21641
f67539c2
TL
21642// Generates a success with a generic message.
21643#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
7c673cae 21644
f67539c2
TL
21645// Define this macro to 1 to omit the definition of SUCCEED(), which
21646// is a generic name and clashes with some other libraries.
21647#if !GTEST_DONT_DEFINE_SUCCEED
21648# define SUCCEED() GTEST_SUCCEED()
21649#endif
7c673cae 21650
f67539c2
TL
21651// Macros for testing exceptions.
21652//
21653// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
21654// Tests that the statement throws the expected exception.
21655// * {ASSERT|EXPECT}_NO_THROW(statement):
21656// Tests that the statement doesn't throw any exception.
21657// * {ASSERT|EXPECT}_ANY_THROW(statement):
21658// Tests that the statement throws an exception.
7c673cae 21659
f67539c2
TL
21660#define EXPECT_THROW(statement, expected_exception) \
21661 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
21662#define EXPECT_NO_THROW(statement) \
21663 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
21664#define EXPECT_ANY_THROW(statement) \
21665 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
21666#define ASSERT_THROW(statement, expected_exception) \
21667 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
21668#define ASSERT_NO_THROW(statement) \
21669 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
21670#define ASSERT_ANY_THROW(statement) \
21671 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
7c673cae 21672
f67539c2
TL
21673// Boolean assertions. Condition can be either a Boolean expression or an
21674// AssertionResult. For more information on how to use AssertionResult with
21675// these macros see comments on that class.
21676#define EXPECT_TRUE(condition) \
21677 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
21678 GTEST_NONFATAL_FAILURE_)
21679#define EXPECT_FALSE(condition) \
21680 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
21681 GTEST_NONFATAL_FAILURE_)
21682#define ASSERT_TRUE(condition) \
21683 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
21684 GTEST_FATAL_FAILURE_)
21685#define ASSERT_FALSE(condition) \
21686 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
21687 GTEST_FATAL_FAILURE_)
7c673cae
FG
21688
21689// Macros for testing equalities and inequalities.
21690//
f67539c2
TL
21691// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
21692// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
21693// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
21694// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
21695// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
21696// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
7c673cae
FG
21697//
21698// When they are not, Google Test prints both the tested expressions and
21699// their actual values. The values must be compatible built-in types,
21700// or you will get a compiler error. By "compatible" we mean that the
21701// values can be compared by the respective operator.
21702//
21703// Note:
21704//
21705// 1. It is possible to make a user-defined type work with
21706// {ASSERT|EXPECT}_??(), but that requires overloading the
21707// comparison operators and is thus discouraged by the Google C++
21708// Usage Guide. Therefore, you are advised to use the
21709// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
21710// equal.
21711//
21712// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
21713// pointers (in particular, C strings). Therefore, if you use it
21714// with two C strings, you are testing how their locations in memory
21715// are related, not how their content is related. To compare two C
21716// strings by content, use {ASSERT|EXPECT}_STR*().
21717//
f67539c2
TL
21718// 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
21719// {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
7c673cae
FG
21720// what the actual value is when it fails, and similarly for the
21721// other comparisons.
21722//
21723// 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
21724// evaluate their arguments, which is undefined.
21725//
21726// 5. These macros evaluate their arguments exactly once.
21727//
21728// Examples:
21729//
f67539c2
TL
21730// EXPECT_NE(Foo(), 5);
21731// EXPECT_EQ(a_pointer, NULL);
7c673cae
FG
21732// ASSERT_LT(i, array_size);
21733// ASSERT_GT(records.size(), 0) << "There is no record left.";
21734
f67539c2 21735#define EXPECT_EQ(val1, val2) \
7c673cae 21736 EXPECT_PRED_FORMAT2(::testing::internal:: \
f67539c2
TL
21737 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
21738 val1, val2)
21739#define EXPECT_NE(val1, val2) \
21740 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
7c673cae
FG
21741#define EXPECT_LE(val1, val2) \
21742 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
21743#define EXPECT_LT(val1, val2) \
21744 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
21745#define EXPECT_GE(val1, val2) \
21746 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
21747#define EXPECT_GT(val1, val2) \
21748 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
21749
f67539c2 21750#define GTEST_ASSERT_EQ(val1, val2) \
7c673cae 21751 ASSERT_PRED_FORMAT2(::testing::internal:: \
f67539c2
TL
21752 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
21753 val1, val2)
7c673cae
FG
21754#define GTEST_ASSERT_NE(val1, val2) \
21755 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
21756#define GTEST_ASSERT_LE(val1, val2) \
21757 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
21758#define GTEST_ASSERT_LT(val1, val2) \
21759 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
21760#define GTEST_ASSERT_GE(val1, val2) \
21761 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
21762#define GTEST_ASSERT_GT(val1, val2) \
21763 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
21764
21765// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
21766// ASSERT_XY(), which clashes with some users' own code.
21767
21768#if !GTEST_DONT_DEFINE_ASSERT_EQ
21769# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
21770#endif
21771
21772#if !GTEST_DONT_DEFINE_ASSERT_NE
21773# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
21774#endif
21775
21776#if !GTEST_DONT_DEFINE_ASSERT_LE
21777# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
21778#endif
21779
21780#if !GTEST_DONT_DEFINE_ASSERT_LT
21781# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
21782#endif
21783
21784#if !GTEST_DONT_DEFINE_ASSERT_GE
21785# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
21786#endif
21787
21788#if !GTEST_DONT_DEFINE_ASSERT_GT
21789# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
21790#endif
21791
21792// C-string Comparisons. All tests treat NULL and any non-NULL string
21793// as different. Two NULLs are equal.
21794//
21795// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
21796// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
21797// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
21798// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
21799//
21800// For wide or narrow string objects, you can use the
21801// {ASSERT|EXPECT}_??() macros.
21802//
21803// Don't depend on the order in which the arguments are evaluated,
21804// which is undefined.
21805//
21806// These macros evaluate their arguments exactly once.
21807
f67539c2
TL
21808#define EXPECT_STREQ(s1, s2) \
21809 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
7c673cae
FG
21810#define EXPECT_STRNE(s1, s2) \
21811 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
f67539c2
TL
21812#define EXPECT_STRCASEEQ(s1, s2) \
21813 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
7c673cae
FG
21814#define EXPECT_STRCASENE(s1, s2)\
21815 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
21816
f67539c2
TL
21817#define ASSERT_STREQ(s1, s2) \
21818 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
7c673cae
FG
21819#define ASSERT_STRNE(s1, s2) \
21820 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
f67539c2
TL
21821#define ASSERT_STRCASEEQ(s1, s2) \
21822 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
7c673cae
FG
21823#define ASSERT_STRCASENE(s1, s2)\
21824 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
21825
21826// Macros for comparing floating-point numbers.
21827//
f67539c2 21828// * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
7c673cae 21829// Tests that two float values are almost equal.
f67539c2 21830// * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
7c673cae
FG
21831// Tests that two double values are almost equal.
21832// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
21833// Tests that v1 and v2 are within the given distance to each other.
21834//
21835// Google Test uses ULP-based comparison to automatically pick a default
21836// error bound that is appropriate for the operands. See the
21837// FloatingPoint template class in gtest-internal.h if you are
21838// interested in the implementation details.
21839
f67539c2 21840#define EXPECT_FLOAT_EQ(val1, val2)\
7c673cae 21841 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
f67539c2 21842 val1, val2)
7c673cae 21843
f67539c2 21844#define EXPECT_DOUBLE_EQ(val1, val2)\
7c673cae 21845 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
f67539c2 21846 val1, val2)
7c673cae 21847
f67539c2 21848#define ASSERT_FLOAT_EQ(val1, val2)\
7c673cae 21849 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
f67539c2 21850 val1, val2)
7c673cae 21851
f67539c2 21852#define ASSERT_DOUBLE_EQ(val1, val2)\
7c673cae 21853 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
f67539c2 21854 val1, val2)
7c673cae
FG
21855
21856#define EXPECT_NEAR(val1, val2, abs_error)\
21857 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21858 val1, val2, abs_error)
21859
21860#define ASSERT_NEAR(val1, val2, abs_error)\
21861 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21862 val1, val2, abs_error)
21863
21864// These predicate format functions work on floating-point values, and
21865// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
21866//
21867// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
21868
21869// Asserts that val1 is less than, or almost equal to, val2. Fails
21870// otherwise. In particular, it fails if either val1 or val2 is NaN.
21871GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
21872 float val1, float val2);
21873GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
21874 double val1, double val2);
21875
21876
21877#if GTEST_OS_WINDOWS
21878
21879// Macros that test for HRESULT failure and success, these are only useful
21880// on Windows, and rely on Windows SDK macros and APIs to compile.
21881//
21882// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
21883//
21884// When expr unexpectedly fails or succeeds, Google Test prints the
21885// expected result and the actual result with both a human-readable
21886// string representation of the error, if available, as well as the
21887// hex result code.
21888# define EXPECT_HRESULT_SUCCEEDED(expr) \
21889 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21890
21891# define ASSERT_HRESULT_SUCCEEDED(expr) \
21892 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21893
21894# define EXPECT_HRESULT_FAILED(expr) \
21895 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21896
21897# define ASSERT_HRESULT_FAILED(expr) \
21898 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21899
21900#endif // GTEST_OS_WINDOWS
21901
21902// Macros that execute statement and check that it doesn't generate new fatal
21903// failures in the current thread.
21904//
21905// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
21906//
21907// Examples:
21908//
21909// EXPECT_NO_FATAL_FAILURE(Process());
21910// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
21911//
21912#define ASSERT_NO_FATAL_FAILURE(statement) \
21913 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
21914#define EXPECT_NO_FATAL_FAILURE(statement) \
21915 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
21916
f67539c2
TL
21917// Causes a trace (including the given source file path and line number,
21918// and the given message) to be included in every test failure message generated
21919// by code in the scope of the lifetime of an instance of this class. The effect
21920// is undone with the destruction of the instance.
21921//
21922// The message argument can be anything streamable to std::ostream.
21923//
21924// Example:
21925// testing::ScopedTrace trace("file.cc", 123, "message");
21926//
21927class GTEST_API_ ScopedTrace {
21928 public:
21929 // The c'tor pushes the given source file location and message onto
21930 // a trace stack maintained by Google Test.
21931
21932 // Template version. Uses Message() to convert the values into strings.
21933 // Slow, but flexible.
21934 template <typename T>
21935 ScopedTrace(const char* file, int line, const T& message) {
21936 PushTrace(file, line, (Message() << message).GetString());
21937 }
21938
21939 // Optimize for some known types.
21940 ScopedTrace(const char* file, int line, const char* message) {
21941 PushTrace(file, line, message ? message : "(null)");
21942 }
21943
21944#if GTEST_HAS_GLOBAL_STRING
21945 ScopedTrace(const char* file, int line, const ::string& message) {
21946 PushTrace(file, line, message);
21947 }
21948#endif
21949
21950 ScopedTrace(const char* file, int line, const std::string& message) {
21951 PushTrace(file, line, message);
21952 }
21953
21954 // The d'tor pops the info pushed by the c'tor.
21955 //
21956 // Note that the d'tor is not virtual in order to be efficient.
21957 // Don't inherit from ScopedTrace!
21958 ~ScopedTrace();
21959
21960 private:
21961 void PushTrace(const char* file, int line, std::string message);
21962
21963 GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
21964} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
21965 // c'tor and d'tor. Therefore it doesn't
21966 // need to be used otherwise.
21967
7c673cae
FG
21968// Causes a trace (including the source file path, the current line
21969// number, and the given message) to be included in every test failure
21970// message generated by code in the current scope. The effect is
21971// undone when the control leaves the current scope.
21972//
21973// The message argument can be anything streamable to std::ostream.
21974//
21975// In the implementation, we include the current line number as part
21976// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
21977// to appear in the same block - as long as they are on different
21978// lines.
f67539c2
TL
21979//
21980// Assuming that each thread maintains its own stack of traces.
21981// Therefore, a SCOPED_TRACE() would (correctly) only affect the
21982// assertions in its own thread.
7c673cae 21983#define SCOPED_TRACE(message) \
f67539c2
TL
21984 ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
21985 __FILE__, __LINE__, (message))
21986
7c673cae
FG
21987
21988// Compile-time assertion for type equality.
21989// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
21990// the same type. The value it returns is not interesting.
21991//
21992// Instead of making StaticAssertTypeEq a class template, we make it a
21993// function template that invokes a helper class template. This
21994// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
21995// defining objects of that type.
21996//
21997// CAVEAT:
21998//
21999// When used inside a method of a class template,
22000// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
22001// instantiated. For example, given:
22002//
22003// template <typename T> class Foo {
22004// public:
22005// void Bar() { testing::StaticAssertTypeEq<int, T>(); }
22006// };
22007//
22008// the code:
22009//
22010// void Test1() { Foo<bool> foo; }
22011//
22012// will NOT generate a compiler error, as Foo<bool>::Bar() is never
22013// actually instantiated. Instead, you need:
22014//
22015// void Test2() { Foo<bool> foo; foo.Bar(); }
22016//
22017// to cause a compiler error.
22018template <typename T1, typename T2>
22019bool StaticAssertTypeEq() {
22020 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
22021 return true;
22022}
22023
22024// Defines a test.
22025//
22026// The first parameter is the name of the test case, and the second
22027// parameter is the name of the test within the test case.
22028//
22029// The convention is to end the test case name with "Test". For
22030// example, a test case for the Foo class can be named FooTest.
22031//
22032// Test code should appear between braces after an invocation of
22033// this macro. Example:
22034//
22035// TEST(FooTest, InitializesCorrectly) {
22036// Foo foo;
22037// EXPECT_TRUE(foo.StatusIsOK());
22038// }
22039
22040// Note that we call GetTestTypeId() instead of GetTypeId<
22041// ::testing::Test>() here to get the type ID of testing::Test. This
22042// is to work around a suspected linker bug when using Google Test as
22043// a framework on Mac OS X. The bug causes GetTypeId<
22044// ::testing::Test>() to return different values depending on whether
22045// the call is from the Google Test framework itself or from user test
22046// code. GetTestTypeId() is guaranteed to always return the same
22047// value, as it always calls GetTypeId<>() from the Google Test
22048// framework.
22049#define GTEST_TEST(test_case_name, test_name)\
22050 GTEST_TEST_(test_case_name, test_name, \
22051 ::testing::Test, ::testing::internal::GetTestTypeId())
22052
22053// Define this macro to 1 to omit the definition of TEST(), which
22054// is a generic name and clashes with some other libraries.
22055#if !GTEST_DONT_DEFINE_TEST
22056# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
22057#endif
22058
22059// Defines a test that uses a test fixture.
22060//
22061// The first parameter is the name of the test fixture class, which
22062// also doubles as the test case name. The second parameter is the
22063// name of the test within the test case.
22064//
22065// A test fixture class must be declared earlier. The user should put
f67539c2 22066// the test code between braces after using this macro. Example:
7c673cae
FG
22067//
22068// class FooTest : public testing::Test {
22069// protected:
22070// virtual void SetUp() { b_.AddElement(3); }
22071//
22072// Foo a_;
22073// Foo b_;
22074// };
22075//
22076// TEST_F(FooTest, InitializesCorrectly) {
22077// EXPECT_TRUE(a_.StatusIsOK());
22078// }
22079//
22080// TEST_F(FooTest, ReturnsElementCountCorrectly) {
f67539c2
TL
22081// EXPECT_EQ(a_.size(), 0);
22082// EXPECT_EQ(b_.size(), 1);
7c673cae
FG
22083// }
22084
22085#define TEST_F(test_fixture, test_name)\
22086 GTEST_TEST_(test_fixture, test_name, test_fixture, \
22087 ::testing::internal::GetTypeId<test_fixture>())
22088
f67539c2
TL
22089// Returns a path to temporary directory.
22090// Tries to determine an appropriate directory for the platform.
22091GTEST_API_ std::string TempDir();
22092
22093#ifdef _MSC_VER
22094# pragma warning(pop)
22095#endif
22096
7c673cae
FG
22097} // namespace testing
22098
22099// Use this function in main() to run all tests. It returns 0 if all
22100// tests are successful, or 1 otherwise.
22101//
22102// RUN_ALL_TESTS() should be invoked after the command line has been
22103// parsed by InitGoogleTest().
22104//
22105// This function was formerly a macro; thus, it is in the global
22106// namespace and has an all-caps name.
22107int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
22108
22109inline int RUN_ALL_TESTS() {
22110 return ::testing::UnitTest::GetInstance()->Run();
22111}
22112
f67539c2
TL
22113GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
22114
7c673cae 22115#endif // GTEST_INCLUDE_GTEST_GTEST_H_