mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 00:19:55 +02:00
unit test fix
This commit is contained in:
@@ -51,7 +51,6 @@
|
|||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
extern const char* standardFolders[];
|
|
||||||
|
|
||||||
void FWBTreeTest::isSystem()
|
void FWBTreeTest::isSystem()
|
||||||
{
|
{
|
||||||
@@ -75,19 +74,12 @@ void FWBTreeTest::isSystem()
|
|||||||
CPPUNIT_ASSERT(fwbtree.isSystem(&fw) == false);
|
CPPUNIT_ASSERT(fwbtree.isSystem(&fw) == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FWBTreeTest::isStandardFolder(string path)
|
|
||||||
{
|
|
||||||
for (const char **cptr=standardFolders; *cptr!=NULL; cptr++)
|
|
||||||
if (path == *cptr) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSet<FWObject*> FWBTreeTest::getStandardFolders(FWObject *root)
|
QSet<FWObject*> FWBTreeTest::getStandardFolders(FWObject *root)
|
||||||
{
|
{
|
||||||
QSet<FWObject*> res;
|
QSet<FWObject*> res;
|
||||||
for (FWObject::iterator i = root->begin(); i != root->end(); i++)
|
for (FWObject::iterator i = root->begin(); i != root->end(); i++)
|
||||||
{
|
{
|
||||||
if (isStandardFolder((*i)->getPath(true))) res.insert(*i);
|
if (FWBTree().isStandardFolder(*i)) res.insert(*i);
|
||||||
res += getStandardFolders(*i);
|
res += getStandardFolders(*i);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
class FWBTreeTest : public CppUnit::TestFixture
|
class FWBTreeTest : public CppUnit::TestFixture
|
||||||
{
|
{
|
||||||
bool isStandardFolder(std::string path);
|
|
||||||
QSet<libfwbuilder::FWObject*> getStandardFolders(libfwbuilder::FWObject *root);
|
QSet<libfwbuilder::FWObject*> getStandardFolders(libfwbuilder::FWObject *root);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user