Merge branch 'develop' into multi-config-support
# Conflicts: # unittest/force-styles/test_error_stats.cpp
This commit is contained in:
@ -59,8 +59,8 @@ protected:
|
|||||||
void TearDown() override
|
void TearDown() override
|
||||||
{
|
{
|
||||||
LAMMPSTest::TearDown();
|
LAMMPSTest::TearDown();
|
||||||
unlink("test_variable.file");
|
platform::unlink("test_variable.file");
|
||||||
unlink("test_variable.atomfile");
|
platform::unlink("test_variable.atomfile");
|
||||||
}
|
}
|
||||||
|
|
||||||
void atomic_system()
|
void atomic_system()
|
||||||
@ -165,7 +165,7 @@ TEST_F(VariableTest, CreateDelete)
|
|||||||
fputs(" ", fp);
|
fputs(" ", fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
ASSERT_THAT(variable->retrieve("file"), StrEq("1"));
|
ASSERT_THAT(variable->retrieve("file"), StrEq("1"));
|
||||||
unlink("MYFILE");
|
platform::unlink("MYFILE");
|
||||||
ASSERT_THAT(variable->retrieve("file"), StrEq("0"));
|
ASSERT_THAT(variable->retrieve("file"), StrEq("0"));
|
||||||
|
|
||||||
BEGIN_HIDE_OUTPUT();
|
BEGIN_HIDE_OUTPUT();
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "fmtlib_format.cpp"
|
#include "fmtlib_format.cpp"
|
||||||
#include "fmtlib_os.cpp"
|
#include "fmtlib_os.cpp"
|
||||||
|
|
||||||
|
// Windows may define this as a macro
|
||||||
#if defined(max)
|
#if defined(max)
|
||||||
#undef max
|
#undef max
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -35,8 +35,8 @@ class TextFileReaderTest : public ::testing::Test {
|
|||||||
protected:
|
protected:
|
||||||
void TearDown() override
|
void TearDown() override
|
||||||
{
|
{
|
||||||
unlink("text_reader_one.file");
|
platform::unlink("text_reader_one.file");
|
||||||
unlink("text_reader_two.file");
|
platform::unlink("text_reader_two.file");
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_files()
|
void test_files()
|
||||||
@ -65,16 +65,22 @@ TEST_F(TextFileReaderTest, nofile)
|
|||||||
FileReaderException);
|
FileReaderException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this test cannot work on windows due to its non unix-like permission system
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
TEST_F(TextFileReaderTest, permissions)
|
TEST_F(TextFileReaderTest, permissions)
|
||||||
{
|
{
|
||||||
|
platform::unlink("text_reader_noperms.file");
|
||||||
FILE *fp = fopen("text_reader_noperms.file", "w");
|
FILE *fp = fopen("text_reader_noperms.file", "w");
|
||||||
|
ASSERT_NE(fp,nullptr);
|
||||||
fputs("word\n", fp);
|
fputs("word\n", fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
chmod("text_reader_noperms.file", 0);
|
chmod("text_reader_noperms.file", 0);
|
||||||
ASSERT_THROW({ TextFileReader reader("text_reader_noperms.file", "test"); },
|
ASSERT_THROW({ TextFileReader reader("text_reader_noperms.file", "test"); },
|
||||||
FileReaderException);
|
FileReaderException);
|
||||||
unlink("text_reader_noperms.file");
|
platform::unlink("text_reader_noperms.file");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_F(TextFileReaderTest, nofp)
|
TEST_F(TextFileReaderTest, nofp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user