SF [2851052] Poco::DirectoryIterator copy constructor is broken

added testCreateFile() to the test suite
This commit is contained in:
Aleksandar Fabijanic 2009-09-04 14:56:19 +00:00
parent c5b2daa36c
commit 7a8f1bf483
2 changed files with 12 additions and 13 deletions

View File

@ -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;
}
}

View File

@ -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);