Skip to content

Commit

Permalink
Fix typos in tests and use makeNativePath to avoid the "/" versus "\\…
Browse files Browse the repository at this point in the history
…" thing on windows
  • Loading branch information
jmarrec committed Feb 8, 2021
1 parent a9936d4 commit f374460
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tst/EnergyPlus/unit/FileSystem.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
// only
namespace fs {
void remove_all(const std::string& p) {
#ifdef _wIN
#ifdef _WIN32
EnergyPlus::FileSystem::systemCall("rmdir /Q /S \"" + p + "\"");
#else
EnergyPlus::FileSystem::systemCall("rm -Rf \"" + p + "\"");
Expand Down Expand Up @@ -129,8 +129,15 @@ TEST(FileSystem, Others)
EnergyPlus::FileSystem::makeNativePath(pathName);

EXPECT_EQ("idf", EnergyPlus::FileSystem::getFileExtension(pathName));
EXPECT_EQ("folder/FileSystemTest.txt", EnergyPlus::FileSystem::removeFileExtension(pathName));
EXPECT_EQ("folder/", EnergyPlus::FileSystem::getParentDirectoryPath(pathName));

std::string noExt = "folder/FileSystemTest.txt";
EnergyPlus::FileSystem::makeNativePath(noExt);
EXPECT_EQ(noExt, EnergyPlus::FileSystem::removeFileExtension(pathName));

std::string folder = "folder/";
EnergyPlus::FileSystem::makeNativePath(folder);
EXPECT_EQ(folder, EnergyPlus::FileSystem::getParentDirectoryPath(pathName));

std::string root = "./";
EnergyPlus::FileSystem::makeNativePath(root);
EXPECT_EQ(root, EnergyPlus::FileSystem::getParentDirectoryPath("Myfile.txt.idf"));
Expand Down

4 comments on commit f374460

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8376_FileSystem_Move_minimal (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3041 of 3041 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8376_FileSystem_Move_minimal (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1565 of 1565 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8376_FileSystem_Move_minimal (jmarrec) - x86_64-MacOS-10.15-clang-11.0.0: OK (3001 of 3001 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8376_FileSystem_Move_minimal (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.