// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests that Google Test manipulates the premature-exit-detection
// file correctly.
class PrematureExitTest : public Test {
public:
- // Returns true iff the given file exists.
+ // Returns true if and only if the given file exists.
static bool FileExists(const char* filepath) {
StatStruct stat;
return Stat(filepath, &stat) == 0;
premature_exit_file_path_ = GetEnv("TEST_PREMATURE_EXIT_FILE");
// Normalize NULL to "" for ease of handling.
- if (premature_exit_file_path_ == NULL) {
+ if (premature_exit_file_path_ == nullptr) {
premature_exit_file_path_ = "";
}
}
- // Returns true iff the premature-exit file exists.
+ // Returns true if and only if the premature-exit file exists.
bool PrematureExitFileExists() const {
return FileExists(premature_exit_file_path_);
}
// Test that the premature-exit file is deleted upon return from
// RUN_ALL_TESTS().
const char* const filepath = GetEnv("TEST_PREMATURE_EXIT_FILE");
- if (filepath != NULL && *filepath != '\0') {
+ if (filepath != nullptr && *filepath != '\0') {
if (PrematureExitTest::FileExists(filepath)) {
printf(
"File %s shouldn't exist after the test program finishes, but does.",