Home | History | Annotate | Download | only in gtest

Lines Matching defs:string

147 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
149 // ::string, which is different to std::string).
150 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
269 // string.
272 // string.
290 // StringFromGTestEnv() - parses a string environment variable.
296 #include <string.h>
309 #include <string> // NOLINT
472 // The user told us that ::std::string isn't available.
473 # error "Google Test cannot be used where ::std::string isn't available."
477 // The user didn't tell us whether ::string is available, so we need
1977 typedef ::string string;
1979 typedef ::std::string string;
2039 // Constructs an RE from a string.
2040 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
2044 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
2051 // Returns the string representation of the regex.
2061 static bool FullMatch(const ::std::string& str, const RE& re) {
2064 static bool PartialMatch(const ::std::string& str, const RE& re) {
2070 static bool FullMatch(const ::string& str, const RE& re) {
2073 static bool PartialMatch(const ::string& str, const RE& re) {
2085 // We use a const char* instead of an std::string, as Google Test used to be
2086 // used where std::string is not available. TODO(wan@google.com): change to
2087 // std::string.
2107 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2112 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2265 // GetCapturedStdout - stops capturing stdout and returns the captured string.
2267 // GetCapturedStderr - stops capturing stderr and returns the captured string.
2270 GTEST_API_ std::string GetCapturedStdout();
2272 GTEST_API_ std::string GetCapturedStderr();
2279 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2280 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2284 extern ::std::vector<testing::internal::string> g_argvs;
2905 // empty string rather than unset (NULL). Handle that case.
3023 GTEST_API_ extern ::std::string GTEST_FLAG(name)
3031 GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3045 // Parses a bool/Int32/string from the environment variable
3069 #include <string.h>
3172 // Constructs a Message from a C-string.
3247 // These two overloads allow streaming a wide C string to a Message
3253 // Converts the given wide string to a narrow string using the UTF-8
3259 // Converts the given wide string to a narrow string using the UTF-8
3264 // Gets the text streamed to this object so far as an std::string.
3268 std::string GetString() const;
3310 // Converts a streamable value to an std::string. A NULL pointer is
3311 // converted to "(null)". When the input value is a ::string,
3312 // ::std::string, ::wstring, or ::std::wstring object, each NUL
3315 std::string StreamableToString(const T& streamable) {
3356 // This header file declares the String class and functions used internally by
3367 // string.h is not guaranteed to provide strcpy on C++ Builder.
3371 #include <string.h>
3372 #include <string>
3378 // String - an abstract class holding static string utilities.
3379 class GTEST_API_ String {
3383 // Clones a 0-terminated C string, allocating memory using new. The
3385 // delete[]. Returns the cloned string, or NULL if the input is
3388 // This is different from strdup() in string.h, which allocates
3397 // Creates a UTF-16 wide string from the given ANSI string, allocating
3399 // value using delete[]. Returns the wide string, or NULL if the
3402 // The wide string is created using the ANSI codepage (CP_ACP) to
3407 // Creates an ANSI string from the given wide string, allocating
3409 // value using delete[]. Returns the ANSI string, or NULL if the
3412 // The returned string is created using the ANSI codepage (CP_ACP) to
3421 // NULL C string is considered different to any non-NULL C string,
3422 // including the empty string.
3425 // Converts a wide C string to a String using the UTF-8 encoding.
3427 // the conversion, "(failed to convert from wide string)" is
3429 static std::string ShowWideCString(const wchar_t* wide_c_str);
3435 // NULL C string is considered different to any non-NULL C string,
3436 // including the empty string.
3443 // A NULL C string is considered different to any non-NULL C string,
3444 // including the empty string.
3452 // A NULL C string is considered different to any non-NULL wide C string,
3453 // including the empty string.
3463 // Returns true iff the given string ends with the given suffix, ignoring
3464 // case. Any string is considered to end with an empty suffix.
3466 const std::string& str, const std::string& suffix);
3469 static std::string FormatIntWidth2(int value); // "%02d" for width == 2
3472 static std::string FormatHexInt(int value);
3475 static std::string FormatByte(unsigned char value);
3478 String(); // Not meant to be instantiated.
3479 }; // class String
3481 // Gets the content of the stringstream's buffer as an std::string. Each '\0'
3483 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3551 explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3564 const std::string& string() const { return pathname_; }
3601 // the name, otherwise return the name string unmodified.
3687 std::string pathname_;
3756 std::string GetTypeName() {
3768 const std::string name_str(status == 0 ? readable_name : name);
7052 ::std::string PrintToString(const T& value);
7098 GTEST_API_ std::string AppendUserMessage(
7099 const std::string& gtest_msg, const Message& user_msg);
7148 // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
7152 const std::string& expected_value,
7153 const std::string& actual_value,
7157 GTEST_API_ std::string GetBoolAssertionFailureMessage(
7513 // the entire string if it contains no comma.
7514 inline std::string GetPrefixUntilComma(const char* str) {
7516 return comma == NULL ? str : std::string(str, comma);
7542 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
7601 // Returns the current OS stack trace as an std::string.
7611 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
8288 static void set_last_death_test_message(const std::string& message);
8291 // A string containing a description of the outcome of the last death test.
8292 static std::string last_death_test_message_;
8394 InternalRunDeathTestFlag(const std::string& a_file,
8406 const std::string& file() const { return file_; }
8412 std::string file_;
8573 // ^ matches the beginning of a string (not that of each line)
8574 // $ matches the end of a string (not that of each line)
9243 // If none of the above is defined, it will print the debug string of
9249 // pointer value and the NUL-terminated string it points to are
9254 // // Prints a value to a string. For a (const or not) char
9255 // // pointer, the NUL-terminated string (but not the pointer) is
9257 // std::string ::testing::PrintToString(const T& value);
9261 // // pointer, the NUL-terminated string (but not the pointer) is
9267 // // pointer and the NUL-terminated string for a (const or not) char pointer.
9270 // // Prints the fields of a tuple tersely to a string vector, one
9273 // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9294 #include <string>
9333 // We print a protobuf using its ShortDebugString() when the string
9342 const ::testing::internal::string short_str = value.ShortDebugString();
9343 const ::testing::internal::string pretty_str =
9367 // protocol message, its debug string is printed; if it's an enum or
9623 // wchar_t* would cause unsigned short* be printed as a wide string,
9647 // Overloads for ::string and ::std::string.
9649 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9650 inline void PrintTo(const ::string& s, ::std::ostream* os) {
9655 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9656 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9870 // NUL-terminated string (but not the pointer) is printed.
9900 UniversalPrint(string(str), os);
9942 // NUL-terminated string.
9952 typedef ::std::vector<string> Strings;
9973 // Tersely prints the first N fields of a tuple to a string vector,
10024 // Prints the fields of a tuple tersely to a string vector, one
10039 ::std::string PrintToString(const T& value) {
10420 virtual const string& GetTestCaseName() const = 0;
10457 virtual const string& GetTestCaseName() const { return test_case_name_; }
10475 int AddTestCaseInstantiation(const string& instantiation_name,
10494 const string& instantiation_name = gen_it->first;
10497 string test_case_name;
10533 const string test_case_base_name;
10534 const string test_base_name;
10540 typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10543 const string test_case_name_;
15840 // each with C-string values of "foo", "bar", and "baz":
15848 // ::std::vector< ::std::string> GetParameterStrings() {
15849 // ::std::vector< ::std::string> v;
17151 static std::string ExtractSummary(const char* message);
17155 std::string file_name_;
17159 std::string summary_; // The test failure summary.
17160 std::string message_; // The test failure message.
17482 // Depending on the platform, different string classes are available.
17483 // On Linux, in addition to ::std::string, Google also makes use of
17484 // class ::string, which has the same interface as ::std::string, but
17488 // ::string is available AND is a distinct type to ::std::string, or
17491 // If the user's ::std::string and ::string are the same class due to
17555 // When this flag is set with a "host:port" string, on supported
17579 const std::string& message);
17687 // object, returns an empty string.
17713 message_.reset(new ::std::string);
17723 internal::scoped_ptr< ::std::string> message_;
17812 static void RecordProperty(const std::string& key, const std::string& value);
17813 static void RecordProperty(const std::string& key, int value);
17874 // output as a key/value string pair.
17882 TestProperty(const std::string& a_key, const std::string& a_value) :
17897 void SetValue(const std::string& new_value) {
17903 std::string key_;
17905 std::string value_;
17983 void RecordProperty(const std::string& xml_element,
17989 static bool ValidateTestProperty(const std::string& xml_element,
18077 // For example, *A*:Foo.* is a filter that matches any string that
18112 TestInfo(const std::string& test_case_name,
18113 const std::string& name,
18134 const std::string test_case_name_; // Test case name
18135 const std::string name_; // Test name
18138 const internal::scoped_ptr<const ::std::string> type_param_;
18141 const internal::scoped_ptr<const ::std::string> value_param_;
18313 std::string name_;
18316 const internal::scoped_ptr<const ::std::string> type_param_;
18549 // was executed. The UnitTest object owns the string.
18653 const std::string& message,
18654 const std::string& os_stack_trace)
18662 void RecordProperty(const std::string& key, const std::string& value);
18683 const std::string& message);
18757 // format the value. In particular, when the value is a C string
18758 // (char pointer) and the other operand is an STL string object, we
18759 // want to format the C string as a string, since we know it is
18760 // compared by value with the string object. If the value is a char
18761 // pointer but the other operand is not an STL string object, we don't
18763 // string, and thus want to print it as a pointer to be safe.
18771 static ::std::string Format(const ToPrint& value) {
18780 static ::std::string Format(const ToPrint* value) {
18785 // By default, print C string as pointers to be safe, as we don't know
18786 // whether they actually point to a NUL-terminated string.
18792 static ::std::string Format(CharType* value) { \
18804 // If a C string is compared with an STL string object, we know it's meant
18805 // to point to a NUL-terminated string, and thus can print it as a string.
18811 static ::std::string Format(CharType* value) { \
18816 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18817 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18820 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18821 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18840 // char* or void*, and print it as a C string when it is compared
18841 // against an std::string object, for example.
18845 std::string FormatForComparisonFailureMessage(
19076 const ::std::string& needle, const ::std::string& haystack);
19079 const ::std::string& needle, const ::std::string& haystack);
19165 std::string const message;
19805 // C-string Comparisons. All tests treat NULL and any non-NULL string
19813 // For wide or narrow string objects, you can use the
19899 // string representation of the error, if available, as well as the