mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-18 08:22:37 +01:00
SF [2851052] Poco::DirectoryIterator copy constructor is broken
added testCreateFile() to the test suite
This commit is contained in:
parent
c5b2daa36c
commit
7a8f1bf483
@ -66,11 +66,9 @@ DirectoryIterator::DirectoryIterator(const std::string& path): _path(path), _pIm
|
||||
|
||||
DirectoryIterator::DirectoryIterator(const DirectoryIterator& iterator): _path(iterator._path), _pImpl(iterator._pImpl)
|
||||
{
|
||||
_path.makeDirectory();
|
||||
if (_pImpl)
|
||||
{
|
||||
_pImpl->duplicate();
|
||||
_path.setFileName(_pImpl->get());
|
||||
_file = _path;
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,17 @@ FileTest::~FileTest()
|
||||
}
|
||||
|
||||
|
||||
void FileTest::testCreateFile()
|
||||
{
|
||||
File f("testfile.dat");
|
||||
bool created = f.createFile();
|
||||
assert (created);
|
||||
assert (!f.isHidden());
|
||||
created = f.createFile();
|
||||
assert (!created);
|
||||
}
|
||||
|
||||
|
||||
void FileTest::testFileAttributes1()
|
||||
{
|
||||
File f("testfile.dat");
|
||||
@ -203,17 +214,6 @@ void FileTest::testFileAttributes1()
|
||||
}
|
||||
|
||||
|
||||
void FileTest::testCreateFile()
|
||||
{
|
||||
File f("testfile.dat");
|
||||
bool created = f.createFile();
|
||||
assert (created);
|
||||
assert (!f.isHidden());
|
||||
created = f.createFile();
|
||||
assert (!created);
|
||||
}
|
||||
|
||||
|
||||
void FileTest::testFileAttributes2()
|
||||
{
|
||||
TemporaryFile f;
|
||||
@ -524,6 +524,7 @@ CppUnit::Test* FileTest::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FileTest");
|
||||
|
||||
CppUnit_addTest(pSuite, FileTest, testCreateFile);
|
||||
CppUnit_addTest(pSuite, FileTest, testFileAttributes1);
|
||||
CppUnit_addTest(pSuite, FileTest, testFileAttributes2);
|
||||
CppUnit_addTest(pSuite, FileTest, testFileAttributes3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user