Modified MimeTypeTestSuite slightly so as to not remove the copied

mime database directory if it already existed in the first place.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@791 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2002-08-16 23:21:48 +00:00
parent dda17c0010
commit 75120765af

View File

@ -117,7 +117,7 @@ void FillWithMimeTypes(ContainerAdapter &container, BMessage &typeMessage, const
// before running all the BMimeType tests
class MimeTypeTestSuite : public CppUnit::TestSuite {
public:
MimeTypeTestSuite() : CppUnit::TestSuite() {}
MimeTypeTestSuite() : CppUnit::TestSuite(), fMimeDirExisted(false) {}
virtual void setUp()
{
// If we're using a directory other than the R5 MIME database directory, make
@ -132,6 +132,7 @@ public:
+ " " + mimeDatabaseDir;
ExecCommand(cmd.c_str());
} else {
fMimeDirExisted = true;
if (BTestShell::GlobalBeVerbose())
cout << "(Using existing copy of MIME database in '" + mimeDatabaseDir + "')" << endl;
}
@ -140,7 +141,7 @@ public:
virtual void tearDown()
{
if (mimeDatabaseDir != R5DatabaseDir) {
if (mimeDatabaseDir != R5DatabaseDir && !fMimeDirExisted) {
if (BTestShell::GlobalBeVerbose())
cout << "(Removing copy of MIME database in '" + mimeDatabaseDir + "')" << endl;
std::string cmd = std::string("rm -rf ") + mimeDatabaseDir;
@ -153,7 +154,9 @@ public:
setUp();
CppUnit::TestSuite::run(result);
tearDown();
}
}
private:
bool fMimeDirExisted;
};
// Suite