Home | History | Annotate | Download | only in internal

Lines Matching defs:to

15 // contributors may be used to endorse or promote products derived from
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 // Low-level types and utilities for porting Google Test to various
33 // platforms. They are subject to change without notice. DO NOT USE
36 // This file is fundamental to Google Test. All other Google Test source
37 // files are expected to #include this. Therefore, it cannot #include
43 // The user can define the following macros in the build script to
47 // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
49 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
51 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
53 // ::string, which is different to std::string).
54 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
56 // ::wstring, which is different to std::wstring).
57 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
59 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
61 // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
63 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
66 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
68 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
72 // - Define it to 1/0 to indicate whether the
75 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
78 // GTEST_HAS_TR1_TUPLE to 0.
79 // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
82 // - Define to 1 when compiling tests that use
86 // - Define to 1 when compiling Google Test itself
91 // Macros indicating the current platform (defined to 1 if compiled on
114 // don't have access to other platforms, support for them may be less
121 // Macros indicating available Google Test features (defined to 1 if
139 // variable don't have to be used.
147 // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
167 // LogToStderr() - directs all log messages to stderr.
179 // TypeWithSize - maps an integer to a int type.
222 // Determines the version of gcc that is used to compile this.
290 // is not the case, we need to include headers that provide the functions
300 // Used to define __ANDROID_API__ matching the target NDK API level.
304 // Defines this to true iff Google Test can use POSIX regular expressions.
316 // On some platforms, <regex.h> needs someone to define size_t, and
318 // included <stdlib.h>, which is guaranteed to define size_t through
340 // to figure it out.
343 // macro to enable exceptions, so we'll do the same.
350 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
358 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
361 // Exception handling is in effect by default in HP aCC compiler. It has to
365 // For other compilers, we assume exceptions are disabled to be
382 // to figure it out.
390 // to figure it out.
391 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
404 // to figure it out.
411 // The user didn't tell us whether RTTI is enabled, so we need to
428 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
447 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
466 // It's this header's responsibility to #include <typeinfo> when RTTI
477 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
478 // to your compiler flags.
484 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
493 // this macro to 0 to prevent Google Test from using tuple (any
500 // The user didn't tell us not to do it, so we assume it's OK.
508 // The user didn't tell us, so we need to figure it out.
514 // pretends to be GCC by defining __GNUC__ and friends, but cannot
527 // can build with clang but need to use gcc4.2's libstdc++).
540 // To avoid conditional compilation everywhere, we make it
541 // gtest-port.h's responsibility to #include the header implementing
550 // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
565 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
568 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
581 // not conform to the TR1 spec, which requires the header to be <tuple>.
585 // which is #included by <tr1/tuple>, to not compile when RTTI is
587 // <tr1/functional>. Hence the following #define is a hack to prevent
591 # undef _TR1_FUNCTIONAL // Allows the user to #include
592 // <tr1/functional> if he chooses to.
610 // The user didn't tell us, so we need to figure it out.
629 // Determines whether to support stream redirection. This is used to test
630 // output correctness and to implement death tests.
641 // Determines whether to support death tests.
659 // Determines whether to support type-driven tests.
669 // Determines whether to support Combine(). This only makes sense when
681 // Determines whether test results can be streamed to a socket.
689 // an "else" statement and braces are not used to explicitly disambiguate the
690 // "else" binding. This leads to problems with code like:
695 // The "switch (0) case 0:" idiom is used to suppress this.
702 // Use this annotation at the end of a struct/class definition to
711 // Also use it after a variable or parameter declaration to tell the
712 // compiler the variable/parameter does not have to be used.
719 // A macro to disallow operator=
724 // A macro to disallow copy constructor and operator=
730 // Tell the compiler to warn about unused return values for functions declared
745 // The user didn't tell us, so we need to figure it out.
748 // These two compilers are known to support SEH.
772 // Ask the compiler to never inline a given function.
792 // definition on purpose. Therefore it's impossible to create a
796 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
797 // expression is true. For example, you could use it to verify the
803 // or to make sure a struct is smaller than a certain size:
807 // The second argument to the macro is the name of the variable. If
830 // of the C++ standard). As a result, gcc fails to reject the
834 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
842 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
846 // instead, these compilers will refuse to compile
850 // (They seem to think the ">" in "5 > 0" marks the end of the
857 // This is to avoid running into a bug in MS VC 7.1, which
858 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
888 // enough stuff to satisfy Google Test's need.
928 // A copy constructor is required by the Standard to initialize object
978 // We use a const char* instead of an std::string, as Google Test used to be
979 // used where std::string is not available. TODO(wan@google.com): change to
999 // in an error message from the compiler used to compile this code.
1003 // Although this function is not platform dependent, we put it next to
1004 // FormatFileLocation in order to contrast the two functions.
1011 // LogToStderr() - directs all log messages to stderr.
1067 // An all-mode assert to verify that the given POSIX-style function
1069 // doesn't expand to a balanced 'if' statement, so enclose the macro
1070 // in {} if you need to use it as the only statement in an 'if'
1080 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
1084 // instead of an argument type convertable to a target type.
1097 template<typename To>
1098 inline To ImplicitCast_(To x) { return x; }
1100 // When you upcast (that is, cast a pointer from type Foo to type
1101 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
1103 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
1107 // use dynamic_cast<> to double-check the downcast is legal (we die
1109 // instead. Thus, it's important to test in debug mode to make sure
1112 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
1116 // You should design the code some other way not to need this.
1121 template<typename To, typename From> // use like this: DownCast_<T*>(foo);
1122 inline To DownCast_(From* f) { // so we only accept pointers
1123 // Ensures that To is a sub-type of From *. This test is here only
1128 const To to = NULL;
1129 ::testing::internal::ImplicitCast_<From*>(to);
1134 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
1136 return static_cast<To>(f);
1139 // Downcasts the pointer of type Base to Derived.
1141 // point to a class of type Derived, not any subclass of it.
1143 // check to enforce this.
1196 // Allows a controller thread to pause execution of newly created
1211 // Notifies all threads created with this notification to start. Must
1241 // in order to call its Run(). Introducing ThreadWithParamBase as a
1242 // non-templated base class for ThreadWithParam allows us to bypass this
1250 // pthread_create() accepts a pointer to a function type with the C linkage.
1251 // According to the Standard (7.5/1), function types with different linkages
1254 // cannot be defined with C-linkage we need to define a free C-function to
1262 // To use it, write:
1307 const T param_; // User-supplied parameter to the thread function.
1308 // When non-NULL, used to block execution until the controller thread
1327 // the following to define a static mutex:
1335 // To create a dynamic mutex, just define an object of type Mutex.
1348 // considered valid. We don't protect writing to has_owner_ here, as it's
1349 // the caller's responsibility to ensure that the current thread holds the
1364 // must be able to initialize a static mutex object at link time.
1365 // This means MutexBase has to be a POD and its member variables
1366 // have to be public.
1370 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
1371 // accesses to the owner_ field should be protected by a check of this field.
1372 // An alternative might be to memset() owner_ to all zeros, but there's no
1387 // This allows initialization to work whether pthread_t is a scalar or struct.
1388 // The flag -Wmissing-field-initializers must not be specified for this to work.
1428 // pthread_key_create() requires DeleteThreadLocalValue() to have
1429 // C-linkage. Therefore it cannot be templatized to access
1437 // Called by pthread to delete thread-local data stored by
1458 // In addition, the default ThreadLocal constructor requires T to have
1464 // responsibility to ensure that all other threads using a ThreadLocal
1584 // Returns the number of threads running in the process, or 0 to indicate that
1590 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
1592 // objects. We define this to ensure that only POD is passed through
1656 // Therefore we need to cast a char to unsigned char before calling
1797 // Environment variables which we programmatically clear will be set to the
1822 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
1823 // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
1824 // function in order to achieve that. We use macro definition here because
1831 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
1843 // are not part of standard C++ and numeric_limits doesn't need to be
1848 to
1849 // type. It maps a size in bytes to a primitive type with that
1854 // is typedef-ed to be unsigned int (unsigned integer made up of 4
1857 // Such functionality should belong to STL, but I cannot find it
1931 // to *value and returns true; otherwise leaves *value unchanged and returns
1933 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
1934 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
1939 // corresponding to the given Google Test flag.