Allow specifying disk directory as parameter, /dev/vdc is default path

This commit is contained in:
Victor 2023-11-03 18:55:02 -07:00
parent e38810caf3
commit 0442a53fbf
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,5 @@
set(TARGET_LAYER0 test_layer0) set(TARGET_LAYER0 test_layer0)
set(DIR_PLACE /dev/vdb)
# add test sources here ... # add test sources here ...
add_executable(${TARGET_LAYER0} add_executable(${TARGET_LAYER0}
@ -8,4 +8,4 @@ add_executable(${TARGET_LAYER0}
) )
# add test to activate ctest -VV # add test to activate ctest -VV
add_test(NAME ${TARGET_LAYER0} COMMAND sudo ./${TARGET_LAYER0}) add_test(NAME ${TARGET_LAYER0} COMMAND sudo ./${TARGET_LAYER0} ${DIR_PLACE})

View File

@ -3,8 +3,14 @@
#include <assert.h> #include <assert.h>
#include "rawdisk.h" #include "rawdisk.h"
int main() { int main(int argc, char *argv[]) {
char *d = strdup("/dev/vdb"); char *d = NULL;
if(argc < 2){
d = strdup("/dev/vdc");
}else{
d = argv[1];
}
RawDisk *H = new RawDisk(d); RawDisk *H = new RawDisk(d);
char *buf = "iloveosdfjlseirfnerig"; char *buf = "iloveosdfjlseirfnerig";