diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1b77761..4ff961f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ set(TARGET_LAYER0 test_layer0) - +set(DIR_PLACE /dev/vdb) # add test sources here ... add_executable(${TARGET_LAYER0} @@ -8,4 +8,4 @@ add_executable(${TARGET_LAYER0} ) # add test to activate ctest -VV -add_test(NAME ${TARGET_LAYER0} COMMAND sudo ./${TARGET_LAYER0}) \ No newline at end of file +add_test(NAME ${TARGET_LAYER0} COMMAND sudo ./${TARGET_LAYER0} ${DIR_PLACE}) \ No newline at end of file diff --git a/test/layer0.cpp b/test/layer0.cpp index 4d95e8d..1b8faeb 100644 --- a/test/layer0.cpp +++ b/test/layer0.cpp @@ -3,8 +3,14 @@ #include #include "rawdisk.h" -int main() { - char *d = strdup("/dev/vdb"); +int main(int argc, char *argv[]) { + char *d = NULL; + if(argc < 2){ + d = strdup("/dev/vdc"); + }else{ + d = argv[1]; + } + RawDisk *H = new RawDisk(d); char *buf = "iloveosdfjlseirfnerig";