Updated to gmock-1.7.0
[alexxy/gromacs.git] / src / external / gmock-1.7.0 / src / gmock-internal-utils.cc
similarity index 93%
rename from src/external/gmock-1.6.0/src/gmock-internal-utils.cc
rename to src/external/gmock-1.7.0/src/gmock-internal-utils.cc
index dd38132a780aa8c6e090c9eebeeabcabbdc36fd7..fb5308018a712d7478b36a405e74e779db2a7250 100644 (file)
@@ -51,7 +51,7 @@ namespace internal {
 // words.  Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
 // treated as one word.  For example, both "FooBar123" and
 // "foo_bar_123" are converted to "foo bar 123".
-string ConvertIdentifierNameToWords(const char* id_name) {
+GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name) {
   string result;
   char prev_char = '\0';
   for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
@@ -77,13 +77,13 @@ class GoogleTestFailureReporter : public FailureReporterInterface {
  public:
   virtual void ReportFailure(FailureType type, const char* file, int line,
                              const string& message) {
-    AssertHelper(type == FATAL ?
+    AssertHelper(type == kFatal ?
                  TestPartResult::kFatalFailure :
                  TestPartResult::kNonFatalFailure,
                  file,
                  line,
                  message.c_str()) = Message();
-    if (type == FATAL) {
+    if (type == kFatal) {
       posix::Abort();
     }
   }
@@ -91,7 +91,7 @@ class GoogleTestFailureReporter : public FailureReporterInterface {
 
 // Returns the global failure reporter.  Will create a
 // GoogleTestFailureReporter and return it the first time called.
-FailureReporterInterface* GetFailureReporter() {
+GTEST_API_ FailureReporterInterface* GetFailureReporter() {
   // Points to the global failure reporter used by Google Mock.  gcc
   // guarantees that the following use of failure_reporter is
   // thread-safe.  We may need to add additional synchronization to
@@ -107,7 +107,7 @@ static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);
 
 // Returns true iff a log with the given severity is visible according
 // to the --gmock_verbose flag.
-bool LogIsVisible(LogSeverity severity) {
+GTEST_API_ bool LogIsVisible(LogSeverity severity) {
   if (GMOCK_FLAG(verbose) == kInfoVerbosity) {
     // Always show the log if --gmock_verbose=info.
     return true;
@@ -117,7 +117,7 @@ bool LogIsVisible(LogSeverity severity) {
   } else {
     // If --gmock_verbose is neither "info" nor "error", we treat it
     // as "warning" (its default value).
-    return severity == WARNING;
+    return severity == kWarning;
   }
 }
 
@@ -128,8 +128,9 @@ bool LogIsVisible(LogSeverity severity) {
 // stack_frames_to_skip is treated as 0, since we don't know which
 // function calls will be inlined by the compiler and need to be
 // conservative.
-void Log(LogSeverity severity, const string& message,
-         int stack_frames_to_skip) {
+GTEST_API_ void Log(LogSeverity severity,
+                    const string& message,
+                    int stack_frames_to_skip) {
   if (!LogIsVisible(severity))
     return;
 
@@ -139,7 +140,7 @@ void Log(LogSeverity severity, const string& message,
   // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
   // macro.
 
-  if (severity == WARNING) {
+  if (severity == kWarning) {
     // Prints a GMOCK WARNING marker to make the warnings easily searchable.
     std::cout << "\nGMOCK WARNING:";
   }