From 38ce9b085e7ca14507f7c74c89cfe4957478a5af Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 9 Dec 2002 12:52:58 +0000 Subject: [PATCH] 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 --- src/tests/kits/storage/BasicTest.cpp | 10 ++++++---- src/tests/kits/storage/BasicTest.h | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tests/kits/storage/BasicTest.cpp b/src/tests/kits/storage/BasicTest.cpp index 8ab6c83ff6..95adf562b9 100644 --- a/src/tests/kits/storage/BasicTest.cpp +++ b/src/tests/kits/storage/BasicTest.cpp @@ -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); } diff --git a/src/tests/kits/storage/BasicTest.h b/src/tests/kits/storage/BasicTest.h index c783eba768..36758c05bd 100644 --- a/src/tests/kits/storage/BasicTest.h +++ b/src/tests/kits/storage/BasicTest.h @@ -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;