From a3c47db7368108238bfaf09fdec9f5b68dcdc33c Mon Sep 17 00:00:00 2001 From: Imdad Sardharwalla <imdad.sardharwalla@autodesk.com> Date: Thu, 10 Jun 2021 17:26:08 +0100 Subject: [PATCH] REFORM-1035 REFORM-1082 Remove forward declarations of std classes (#54) --- Test/CMakeLists.txt | 1 - Test/TestChecksum.hh | 4 +++ Test/TestFilesystem.hh | 13 +++++++++ Test/TestResult.hh | 2 +- Test/TestResultAnalysis.hh | 1 + Test/types.hh | 54 -------------------------------------- Utils/RedirectStream.hh | 5 ++++ 7 files changed, 24 insertions(+), 56 deletions(-) delete mode 100644 Test/types.hh diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 65a3c6f..a28da38 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -17,7 +17,6 @@ set(my_headers ${CMAKE_CURRENT_SOURCE_DIR}/TestReport.hh ${CMAKE_CURRENT_SOURCE_DIR}/TestResult.hh ${CMAKE_CURRENT_SOURCE_DIR}/TestResultAnalysis.hh - ${CMAKE_CURRENT_SOURCE_DIR}/types.hh PARENT_SCOPE ) diff --git a/Test/TestChecksum.hh b/Test/TestChecksum.hh index b0a8773..e0b2d90 100644 --- a/Test/TestChecksum.hh +++ b/Test/TestChecksum.hh @@ -15,6 +15,10 @@ namespace Test { + +const char* const REPORT_FILENAME = "report.txt"; +const char* const REPORT_LEVEL_TAG = "Report Level: "; + namespace Checksum { extern Level run_lvl; //<! The global checksum run level diff --git a/Test/TestFilesystem.hh b/Test/TestFilesystem.hh index 1365a04..9659376 100755 --- a/Test/TestFilesystem.hh +++ b/Test/TestFilesystem.hh @@ -9,11 +9,24 @@ #ifdef __APPLE__ #include <boost/filesystem.hpp> +namespace Test +{ +namespace filesystem = boost::filesystem; +typedef boost::filesystem::path Path; +typedef boost::system::error_code error_code; +} // namespace Test #else // __APPLE__ // Include <filesystem> but silence resulting C4995 warnings INSECURE_INCLUDE_SECTION_BEGIN #include <filesystem> INSECURE_INCLUDE_SECTION_END + +namespace Test +{ +namespace filesystem = std::filesystem; +typedef std::filesystem::path Path; +typedef std::error_code error_code; +} // namespace Test #endif // __APPLE__ #endif // TEST_ON diff --git a/Test/TestResult.hh b/Test/TestResult.hh index 05fc235..1747366 100644 --- a/Test/TestResult.hh +++ b/Test/TestResult.hh @@ -5,7 +5,7 @@ #ifdef TEST_ON -#include <Base/Test/types.hh> +#include <cstddef> namespace Test { diff --git a/Test/TestResultAnalysis.hh b/Test/TestResultAnalysis.hh index a5bd1fd..0e9fb79 100644 --- a/Test/TestResultAnalysis.hh +++ b/Test/TestResultAnalysis.hh @@ -6,6 +6,7 @@ #ifdef TEST_ON #include <Base/Test/TestChecksumCompare.hh> +#include <Base/Test/TestFilesystem.hh> #include <map> namespace Test diff --git a/Test/types.hh b/Test/types.hh deleted file mode 100644 index 575662f..0000000 --- a/Test/types.hh +++ /dev/null @@ -1,54 +0,0 @@ -// (C) Copyright 2021 by Autodesk, Inc. - -#ifndef BASE_TYPES_HH_INCLUDE -#define BASE_TYPES_HH_INCLUDE - -#ifdef TEST_ON - -#include "Base/Utils/IOutputStream.hh" - -#ifdef __APPLE__ -namespace boost -{ - namespace filesystem - { - class path; - } - - namespace system - { - class error_code; - } -} // namespace boost -#else // __APPLE__ -namespace std -{ - namespace filesystem - { - class path; - } - - class error_code; -} -#endif // __APPLE__ - -namespace Test { - -#ifdef __APPLE__ -namespace filesystem = boost::filesystem; -typedef boost::filesystem::path Path; -typedef boost::system::error_code error_code; -#else -namespace filesystem = std::filesystem; -typedef std::filesystem::path Path; -typedef std::error_code error_code; -#endif - -const char* const LOG_FILENAME = "out.txt"; -const char* const REPORT_FILENAME = "report.txt"; -const char* const REPORT_LEVEL_TAG = "Report Level: "; -}//namespace Test - -#endif//TEST_ON - -#endif//BASE_TYPES_HH_INCLUDE diff --git a/Utils/RedirectStream.hh b/Utils/RedirectStream.hh index 941a061..96b81e9 100644 --- a/Utils/RedirectStream.hh +++ b/Utils/RedirectStream.hh @@ -55,4 +55,9 @@ protected: } // namespace System +namespace Test +{ +const char* const LOG_FILENAME = "out.txt"; +} // namespace Test + #endif // BASE_REDIRECTSTREAM_HH_INCLUDED -- GitLab