Lines Matching defs:to

15 // contributors may be used to endorse or promote products derived from
32 // Low-level types and utilities for porting Google Test to various
34 // internal namespace are subject to change without notice. Code
39 // This file is fundamental to Google Test. All other Google Test source
40 // files are expected to #include this. Therefore, it cannot #include
54 // Google Test tries to automatically detect the properties of its
55 // environment, so users usually don't need to worry about these
57 // Sometimes it's necessary for a user to define some of the following
58 // macros in the build script to override Google Test's decisions.
62 // macros in this list will be defined to either 1 or 0.
64 // Notes to maintainers:
67 // - Use #if to key off these macros. Don't use #ifdef or "#if
71 // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
73 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
75 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
77 // ::string, which is different to std::string).
78 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
80 // ::wstring, which is different to std::wstring).
81 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
83 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
85 // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
87 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
90 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
92 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
96 // - Define it to 1/0 to indicate whether the
99 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
102 // GTEST_HAS_TR1_TUPLE to 0.
103 // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
106 // - Define to 1 when compiling tests that use
110 // - Define to 1 when compiling Google Test itself
117 // (a macro is defined to 1 if compiled on the given platform;
118 // otherwise UNDEFINED -- it's never defined to 0.). Google Test
145 // don't have access to other platforms, support for them may be less
156 // is defined to 1 if the corresponding feature is supported;
157 // otherwise UNDEFINED -- it's never defined to 0.). Google Test
186 // GTEST_FLAG(flag_name) - references the variable corresponding to
198 // variable don't have to be used.
231 // LogToStderr() - directs all log messages to stderr.
243 // TypeWithSize - maps an integer to a int type.
297 // Determines the version of gcc that is used to compile this.
335 // proper C++11 library support. Notably, it's possible to build in
398 // In order to avoid having to include <windows.h>, use forward declaration
405 // is not the case, we need to include headers that provide the functions
412 // Used to define __ANDROID_API__ matching the target NDK API level.
416 // Defines this to true iff Google Test can use POSIX regular expressions.
431 // On some platforms, <regex.h> needs someone to define size_t, and
433 // included <stdlib.h>, which is guaranteed to define size_t through
455 // to figure it out.
458 // macro to enable exceptions, so we'll do the same.
469 // exceptions starting at clang r206352, but which checked for cleanups prior to
474 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
482 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
485 // Exception handling is in effect by default in HP aCC compiler. It has to
489 // For other compilers, we assume exceptions are disabled to be
506 // to figure it out.
514 // to figure it out.
515 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
528 // to figure it out.
535 // The user didn't tell us whether RTTI is enabled, so we need to
552 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
571 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
590 // It's this header's responsibility to #include <typeinfo> when RTTI
602 // to your compiler flags.
608 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
626 // this macro to 0 to prevent Google Test from using tuple (any
633 // The user didn't tell us not to do it, so we assume it's OK.
641 // The user didn't tell us, so we need to figure it out.
647 // pretends to be GCC by defining __GNUC__ and friends, but cannot
660 // can build with clang but need to use gcc4.2's libstdc++).
674 // gtest-port.h's responsibility to #include the header implementing
681 // We include tr1::tuple even if std::tuple is available to define printers for
693 // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
708 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
711 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
724 // not conform to the TR1 spec, which requires the header to be <tuple>.
728 // which is #included by <tr1/tuple>, to not compile when RTTI is
730 // <tr1/functional>. Hence the following #define is a hack to prevent
734 # undef _TR1_FUNCTIONAL // Allows the user to #include
735 // <tr1/functional> if he chooses to.
753 // The user didn't tell us, so we need to figure it out.
772 // Determines whether to support stream redirection. This is used to test
773 // output correctness and to implement death tests.
785 // Determines whether to support death tests.
802 // Determines whether to support type-driven tests.
812 // Determines whether to support Combine(). This only makes sense when
824 // Determines whether test results can be streamed to a socket.
832 // an "else" statement and braces are not used to explicitly disambiguate the
833 // "else" binding. This leads to problems with code like:
838 // The "switch (0) case 0:" idiom is used to suppress this.
845 // Use this annotation at the end of a struct/class definition to
854 // Also use it after a variable or parameter declaration to tell the
855 // compiler the variable/parameter does not have to be used.
867 // A macro to disallow operator=
872 // A macro to disallow copy constructor and operator=
878 // Tell the compiler to warn about unused return values for functions declared
890 // constant. In some contexts this warning is false positive and needs to be
906 // The user didn't tell us, so we need to figure it out.
909 // These two compilers are known to support SEH.
938 // Ask the compiler to never inline a given function.
951 // A function level attribute to disable checking for use of uninitialized
964 // A function level attribute to disable AddressSanitizer instrumentation.
976 // A function level attribute to disable ThreadSanitizer instrumentation.
994 // It is part of our interface, having them in ::testing allows us to change
1006 // definition on purpose. Therefore it's impossible to create a
1010 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1011 // expression is true. For example, you could use it to verify the
1017 // or to make sure a struct is smaller than a certain size:
1021 // The second argument to the macro is the name of the variable. If
1050 // of the C++ standard). As a result, gcc fails to reject the
1054 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1062 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
1066 // instead, these compilers will refuse to compile
1070 // (They seem to think the ">" in "5 > 0" marks the end of the
1077 // This is to avoid running into a bug in MS VC 7.1, which
1078 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1091 // Evaluates to the number of elements in 'array'.
1113 // enough stuff to satisfy Google Test's need.
1158 // A copy constructor is required by the Standard to initialize object
1208 // We use a const char* instead of an std::string, as Google Test used to be
1209 // used where std::string is not available. TODO(wan@google.com): change to
1229 // in an error message from the compiler used to compile this code.
1233 // Although this function is not platform dependent, we put it next to
1234 // FormatFileLocation in order to contrast the two functions.
1241 // LogToStderr() - directs all log messages to stderr.
1303 // An all-mode assert to verify that the given POSIX-style function
1305 // doesn't expand to a balanced 'if' statement, so enclose the macro
1306 // in {} if you need to use it as the only statement in an 'if'
1325 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
1329 // instead of an argument type convertable to a target type.
1345 // When you upcast (that is, cast a pointer from type Foo to type
1346 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
1348 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
1352 // use dynamic_cast<> to double-check the downcast is legal (we die
1354 // instead. Thus, it's important to test in debug mode to make sure
1357 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
1361 // You should design the code some other way not to need this.
1375 const To to = NULL;
1376 ::testing::internal::ImplicitCast_<From*>(to);
1386 // Downcasts the pointer of type Base to Derived.
1388 // point to a class of type Derived, not any subclass of it.
1390 // check to enforce this.
1421 // Returns a path to temporary directory.
1459 // Nothing to do here.
1462 // Allows a controller thread to pause execution of newly created
1477 // Notifies all threads created with this notification to start. Must
1513 // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
1515 // undesirable because it defines a lot of symbols and macros that tend to
1537 // Allows a controller thread to pause execution of newly created
1557 // defined, but we don't want to use MinGW's pthreads implementation, which
1563 // in order to call its Run(). Introducing ThreadWithParamBase as a
1564 // non-templated base class for ThreadWithParam allows us to bypass this
1572 // pthread_create() accepts a pointer to a function type with the C linkage.
1573 // According to the Standard (7.5/1), function types with different linkages
1576 // cannot be defined with C-linkage we need to define a free C-function to
1628 const T param_; // User-supplied parameter to the thread function.
1629 // When non-NULL, used to block execution until the controller thread
1642 // Nothing to do here.
1663 // We rely on kStaticMutex being 0 as it is to what the linker initializes
1669 // statically initialized to 0 (effectively setting it to kStatic) and on
1670 // ThreadSafeLazyInit() to lazily initialize the rest of the members.
1692 // For static mutexes, we rely on these members being initialized to zeros
1709 // platforms. That macro is used as a defensive measure to prevent against
1727 // Base class for ValueHolder<T>. Allows a caller to hold and delete a value
1734 // Provides a way for a thread to send notifications to a ThreadLocal
1738 // Creates a new ValueHolder<T> object holding a default value passed to
1740 // responsibility not to call this when the ThreadLocal<T> instance already
1752 // Maps a thread to a set of ThreadLocals that have values instantiated on that
1754 // expected to persist until all threads it has values on have terminated.
1758 // Returns a value that can be used to identify the thread from other threads.
1833 // In addition, the default ThreadLocal constructor requires T to have
1836 // The users of a TheadLocal instance have to make sure that all but one
1839 // ThreadLocal instance are not guaranteed to be destroyed on all platforms.
1936 // considered valid. We don't protect writing to has_owner_ here, as it's
1937 // the caller's responsibility to ensure that the current thread holds the
1952 // must be able to initialize a static mutex object at link time.
1953 // This means MutexBase has to be a POD and its member variables
1954 // have to be public.
1958 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
1959 // accesses to the owner_ field should be protected by a check of this field.
1960 // An alternative might be to memset() owner_ to all zeros, but there's no
1993 // platforms. That macro is used as a defensive measure to prevent against
2013 // pthread_key_create() requires DeleteThreadLocalValue() to have
2014 // C-linkage. Therefore it cannot be templatized to access
2022 // Called by pthread to delete thread-local data stored by
2151 // platforms. That macro is used as a defensive measure to prevent against
2176 // Returns the number of threads running in the process, or 0 to indicate that
2182 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2184 // objects. We define this to ensure that only POD is passed through
2248 // Therefore we need to cast a char to unsigned char before calling
2393 // Environment variables which we programmatically clear will be set to the
2416 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2417 // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
2418 // function in order to achieve that. We use macro definition here because
2425 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2437 // are not part of standard C++ and numeric_limits doesn't need to be
2442 // This template class serves as a compile-time function from size to
2443 // type. It maps a size in bytes to a primitive type with that
2448 // is typedef-ed to be unsigned int (unsigned integer made up of 4
2451 // Such functionality should belong to STL, but I cannot find it
2538 // to *value and returns true; otherwise leaves *value unchanged and returns
2540 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
2541 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
2546 // corresponding to the given Google Test flag.