IOSS 2.0
Loading...
Searching...
No Matches
Iocatalyst_LoggingTest.h
Go to the documentation of this file.
1// Copyright(C) 1999-2020 National Technology & Engineering Solutions
2// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3// NTESS, the U.S. Government retains certain rights in this software.
4//
5// See packages/seacas/LICENSE for details
6
7#pragma once
8
9#include "gtest/gtest.h"
11
12class LoggingTest : public ::testing::Test
13{
14protected:
17
18 ~LoggingTest() { remove(log.getLogFileName().c_str()); }
19
20 void checkTestOutputFileExists(const char *fileName) { EXPECT_TRUE(isFileExists(fileName)); }
21
22 bool isFileExists(const char *fileName)
23 {
24 FILE *fp = fopen(fileName, "r");
25 bool outputFileExists = false;
26 if (fp != NULL) {
27 outputFileExists = true;
28 fclose(fp);
29 }
30 return outputFileExists;
31 }
32};
Definition Iocatalyst_CatalystLogging.h:20
std::string getLogFileName()
Definition Iocatalyst_CatalystLogging.h:77
A collection of Ioss::Property objects.
Definition Ioss_PropertyManager.h:36
Definition Iocatalyst_LoggingTest.h:13
Ioss::PropertyManager props
Definition Iocatalyst_LoggingTest.h:16
~LoggingTest()
Definition Iocatalyst_LoggingTest.h:18
void checkTestOutputFileExists(const char *fileName)
Definition Iocatalyst_LoggingTest.h:20
bool isFileExists(const char *fileName)
Definition Iocatalyst_LoggingTest.h:22
Iocatalyst::CatalystLogging log
Definition Iocatalyst_LoggingTest.h:15