Added boolean argument to {create,delete}Volume() specifying whether or not the mount point shall be made/deleted.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2209 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-12-09 12:52:58 +00:00
parent 46ce5c12a3
commit 38ce9b085e
2 changed files with 10 additions and 6 deletions

View File

@ -83,7 +83,8 @@ BasicTest::dumpStat(struct stat &st)
// createVolume
void
BasicTest::createVolume(string imageFile, string mountPoint, int32 megs)
BasicTest::createVolume(string imageFile, string mountPoint, int32 megs,
bool makeMountPoint)
{
char megsString[16];
sprintf(megsString, "%ld", megs);
@ -93,17 +94,18 @@ BasicTest::createVolume(string imageFile, string mountPoint, int32 megs)
+ " ; mkbfs " + imageFile
+ " > /dev/null"
+ " ; sync"
+ " ; mkdir " + mountPoint
+ (makeMountPoint ? " ; mkdir " + mountPoint : "")
+ " ; mount " + imageFile + " " + mountPoint);
}
// deleteVolume
void
BasicTest::deleteVolume(string imageFile, string mountPoint)
BasicTest::deleteVolume(string imageFile, string mountPoint,
bool deleteMountPoint)
{
execCommand(string("sync")
+ " ; unmount " + mountPoint
+ " ; rmdir " + mountPoint
+ (deleteMountPoint ? " ; rmdir " + mountPoint : "")
+ " ; rm " + imageFile);
}

View File

@ -29,8 +29,10 @@ public:
static void dumpStat(struct stat &st);
static void createVolume(string imageFile, string mountPoint, int32 megs);
static void deleteVolume(string imageFile, string mountPoint);
static void createVolume(string imageFile, string mountPoint, int32 megs,
bool makeMountPoint = true);
static void deleteVolume(string imageFile, string mountPoint,
bool deleteMountPoint = true);
protected:
int32 fSubTestNumber;