umd/external/protobuf-2.6/gtest/fused-src/gtest/gtest-all.cc
bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
                                     const char* file, int line,
                                     DeathTest** test) {
  UnitTestImpl* const impl = GetUnitTestImpl();
  const InternalRunDeathTestFlag* const flag =
      impl->internal_run_death_test_flag();
  const int death_test_index = impl->current_test_info()
      ->increment_death_test_count();

  if (flag != NULL) {
    if (death_test_index > flag->index()) {
      DeathTest::set_last_death_test_message(String::Format(
          "Death test count (%d) somehow exceeded expected maximum (%d)",
          death_test_index, flag->index()));
      return false;
    }

    if (!(flag->file() == file && flag->line() == line &&
          flag->index() == death_test_index)) {
      *test = NULL;
      return true;
    }
  }

#if GTEST_OS_WINDOWS
  if (GTEST_FLAG(death_test_style) == "threadsafe" ||
      GTEST_FLAG(death_test_style) == "fast") {
    *test = new WindowsDeathTest(statement, regex, file, line);
  }
#else
  if (GTEST_FLAG(death_test_style) == "threadsafe") {
    *test = new ExecDeathTest(statement, regex, file, line);
  } else if (GTEST_FLAG(death_test_style) == "fast") {
    *test = new NoExecDeathTest(statement, regex);
  }
#endif  // GTEST_OS_WINDOWS
  else {  // NOLINT - this is more readable than unbalanced brackets inside #if.
    DeathTest::set_last_death_test_message(String::Format(
        "Unknown death test style \"%s\" encountered",
        GTEST_FLAG(death_test_style).c_str()));
    return false;
  }
// Creates a concrete DeathTest-derived class that depends on the
// --gtest_death_test_style flag, and sets the pointer pointed to
// by the "test" argument to its address.  If the test should be
// skipped, sets that pointer to NULL.  Returns true, unless the
// flag is set to an invalid value.
Creates a concrete DeathTest-derived class that depends on the
gtest_death_test_style flag, and sets the pointer pointed to
by the "test" argument to its address.  If the test should be
skipped, sets that pointer to NULL.  Returns true, unless the
flag is set to an invalid value.
Creates a concrete DeathTest - derived class that depends on the gtest_death_test_style flag and sets the pointer pointed to by the " test " argument to its address . If the test should be skipped sets that pointer to NULL . Returns true unless the flag is set to an invalid value .
bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
                                     const char* file, int line,
                                     DeathTest** test) {
  UnitTestImpl* const impl = GetUnitTestImpl();
  const InternalRunDeathTestFlag* const flag =
      impl->internal_run_death_test_flag();
  const int death_test_index = impl->current_test_info()
      ->increment_death_test_count();
  if (flag != NULL) {
    if (death_test_index > flag->index()) {
      DeathTest::set_last_death_test_message(String::Format(
          "Death test count (%d) somehow exceeded expected maximum (%d)",
          death_test_index, flag->index()));
      return false;
    }
    if (!(flag->file() == file && flag->line() == line &&
          flag->index() == death_test_index)) {
      *test = NULL;
      return true;
    }
  }
#if GTEST_OS_WINDOWS
  if (GTEST_FLAG(death_test_style) == "threadsafe" ||
      GTEST_FLAG(death_test_style) == "fast") {
    *test = new WindowsDeathTest(statement, regex, file, line);
  }
#else
  if (GTEST_FLAG(death_test_style) == "threadsafe") {
    *test = new ExecDeathTest(statement, regex, file, line);
  } else if (GTEST_FLAG(death_test_style) == "fast") {
    *test = new NoExecDeathTest(statement, regex);
  }
#endif  
  else {  
    DeathTest::set_last_death_test_message(String::Format(
        "Unknown death test style \"%s\" encountered",
        GTEST_FLAG(death_test_style).c_str()));
    return false;
  }
bool DefaultDeathTestFactory :: Create ( const char * statement , const RE * regex , const char * file , int line , DeathTest * * test ) { UnitTestImpl * const impl = GetUnitTestImpl ( ) ; const InternalRunDeathTestFlag * const flag = impl -> internal_run_death_test_flag ( ) ; const int death_test_index = impl -> current_test_info ( ) -> increment_death_test_count ( ) ; if ( flag != NULL ) { if ( death_test_index > flag -> index ( ) ) { DeathTest :: set_last_death_test_message ( String :: Format ( " " , death_test_index , flag -> index ( ) ) ) ; return false ; } if ( ! ( flag -> file ( ) == file && flag -> line ( ) == line && flag -> index ( ) == death_test_index ) ) { * test = NULL ; return true ; } } #if GTEST_OS_WINDOWS if ( GTEST_FLAG ( death_test_style ) == " " || GTEST_FLAG ( death_test_style ) == " " ) { * test = new WindowsDeathTest ( statement , regex , file , line ) ; } #else if ( GTEST_FLAG ( death_test_style ) == " " ) { * test = new ExecDeathTest ( statement , regex , file , line ) ; } else if ( GTEST_FLAG ( death_test_style ) == " " ) { * test = new NoExecDeathTest ( statement , regex ) ; } #endif else { DeathTest :: set_last_death_test_message ( String :: Format ( " \" \" " , GTEST_FLAG ( death_test_style ) . c_str ( ) ) ) ; return false ; }
Creates a concrete DeathTest-derived class that depends on the
gtest_death_test_style flag, and sets the pointer pointed to
by the "test" argument to its address.
Creates a concrete DeathTest - derived class that depends on the gtest_death_test_style flag and sets the pointer pointed to by the " test " argument to its address .
// GTEST_OS_WINDOWS // NOLINT - this is more readable than unbalanced brackets inside #if.