From 35a1a1f7d7435d9930341004b004193a6a6ce949 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 23 Nov 2006 09:10:03 +0000 Subject: [PATCH] Removed obsolete test programs --- test/burn.c | 4 -- test/master.c | 126 -------------------------------------------------- test/rip.c | 54 ---------------------- test/tree.py | 77 ------------------------------ test/tree.pyc | Bin 3547 -> 0 bytes 5 files changed, 261 deletions(-) delete mode 100644 test/burn.c delete mode 100644 test/master.c delete mode 100644 test/rip.c delete mode 100644 test/tree.py delete mode 100644 test/tree.pyc diff --git a/test/burn.c b/test/burn.c deleted file mode 100644 index a46866d..0000000 --- a/test/burn.c +++ /dev/null @@ -1,4 +0,0 @@ -int main() -{ - return 0; -} diff --git a/test/master.c b/test/master.c deleted file mode 100644 index 7c0acb4..0000000 --- a/test/master.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static struct burn_drive_info *drives; -static unsigned int n_drives; - -void burn_files(struct burn_drive *drive, struct burn_disc *disc) -{ - struct burn_write_opts *o; - enum burn_disc_status s; - - if (!burn_drive_grab(drive, 1)) { - printf("Unable to open the drive!\n"); - return; - } - while (burn_drive_get_status(drive, NULL)) - usleep(1000); - - while ((s = burn_disc_get_status(drive)) == BURN_DISC_UNREADY) - usleep(1000); - - if (s != BURN_DISC_BLANK) { - burn_drive_release(drive, 0); - printf("Please insert blank media in the drive\n"); - return; - } - o = burn_write_opts_new(drive); - burn_drive_set_speed(drive, 0, 2816); - burn_write_opts_set_perform_opc(o, 0); - burn_write_opts_set_write_type(o, BURN_WRITE_TAO, BURN_BLOCK_MODE1); - burn_write_opts_set_simulate(o, 1); -/* want failure on seggy while debugging :) */ - burn_write_opts_set_underrun_proof(o, 0); - burn_structure_print_disc(disc); - burn_disc_write(o, disc); - burn_write_opts_free(o); - - while (burn_drive_get_status(drive, NULL)) { - sleep(1); - } - printf("\n"); - burn_drive_release(drive, 0); - burn_disc_free(disc); -} - -void parse_args(int argc, char **argv, int *drive, struct burn_disc **disc) -{ - int i, tmode = BURN_AUDIO; - int help = 1; - struct burn_session *session; - struct burn_track *tr; - struct burn_source *src; - - *disc = burn_disc_create(); - session = burn_session_create(); - burn_disc_add_session(*disc, session, BURN_POS_END); - for (i = 1; i < argc; ++i) { - if (!strcmp(argv[i], "--drive")) { - ++i; - if (i >= argc) - printf("--drive requires an argument\n"); - else - *drive = atoi(argv[i]); - } else if (!strcmp(argv[i], "--audio")) { - tmode = BURN_AUDIO; - } else if (!strcmp(argv[i], "--data")) { - tmode = BURN_MODE1; - } else if (!strcmp(argv[i], "--verbose")) { - ++i; - if (i >= argc) - printf("--verbose requires an argument\n"); - else - burn_set_verbosity(atoi(argv[i])); - } else if (!strcmp(argv[i], "--help")) { - help = 1; /* who cares */ - } else { - help = 0; - printf("%s is a track\n", argv[i]); - - tr = burn_track_create(); - src = burn_file_source_new(argv[i], NULL); - burn_track_set_source(tr, src); - burn_source_free(src); - burn_track_define_data(tr, 0, 0, 1, tmode); - burn_session_add_track(session, tr, BURN_POS_END); - } - } - if (help) { - printf("Usage: %s [--drive ] [--verbose ] files\n", - argv[0]); - exit(EXIT_FAILURE); - } -} - -int main(int argc, char **argv) -{ - int drive = 0; - struct burn_disc *disc; - - parse_args(argc, argv, &drive, &disc); - printf("Initializing library..."); - if (burn_initialize()) - printf("Success\n"); - else { - printf("Failed\n"); - return 1; - } - - printf("Scanning for devices..."); - while (!burn_drive_scan(&drives, &n_drives)) ; - printf("Done\n"); - - burn_files(drives[drive].drive, disc); - burn_drive_info_free(drives); - burn_finish(); - return 0; -} diff --git a/test/rip.c b/test/rip.c deleted file mode 100644 index 0606cf4..0000000 --- a/test/rip.c +++ /dev/null @@ -1,54 +0,0 @@ -/* THIS IS NOT A PROPER EXAMPLE */ -#include -#include -#include -#include -#include -#include - -#include - -static struct burn_drive_info *drives; -static unsigned int n_drives; - -#warning this example is totally fried -int main() -{ -#if 0 - struct burn_drive *drive; - struct burn_read_opts o; - - burn_initialize(); - o.datafd = - open("/xp/burn/blah.data", O_CREAT | O_WRONLY, - S_IRUSR | S_IWUSR); - o.subfd = - open("/xp/burn/blah.sub", O_CREAT | O_WRONLY, - S_IRUSR | S_IWUSR); - o.raw = 1; - o.c2errors = 0; - o.subcodes_audio = 1; - o.subcodes_data = 1; - o.hardware_error_recovery = 1; - o.report_recovered_errors = 0; - o.transfer_damaged_blocks = 1; - o.hardware_error_retries = 1; - - printf("Scanning for devices..."); - while (!burn_drive_scan(&drives, &n_drives)) ; - printf("Done\n"); - drive = drives[0].drive; - burn_drive_set_speed(drive, 0, 0); - - if (!burn_drive_grab(drive, 1)) { - printf("Unable to open the drive!\n"); - return EXIT_FAILURE; - } - - while (burn_drive_get_status(drive, NULL)) - usleep(1000); - - burn_disc_read(drive, &o); -#endif - return EXIT_SUCCESS; -} diff --git a/test/tree.py b/test/tree.py deleted file mode 100644 index a7be3d8..0000000 --- a/test/tree.py +++ /dev/null @@ -1,77 +0,0 @@ -# a module to help with handling of filenames, directory trees, etc. - -import os -import os.path -import stat - -def pathsubtract(a, b): - index = a.find(b) - if index == -1: - return None - res = a[ (index + len(b)): ] - - if res.find("/") == 0: - res = res[1:] - return res - -# same as C strcmp() -def strcmp(a, b): - if a < b: - return -1 - if a > b: - return 1 - return 0 - -class TreeNode: - - # path is the location of the file/directory. It is either a full path or - # a path relative to $PWD - def __init__(self, parent, path=".", root=".", isofile=None): - if isofile: - self.root = os.path.abspath(isofile) - self.path = "" - else: - fullpath = os.path.abspath( path ) - fullroot = os.path.abspath( root ) - self.root = fullroot - self.path = pathsubtract( fullpath, fullroot ) - self.parent = parent - self.children = [] - - if self.path == None: - raise NameError, "Invalid paths %s and %s" % (fullpath, fullroot) - - # if this is a directory, add its children recursively - def addchildren(self): - if not stat.S_ISDIR( os.lstat(self.root + "/" + self.path).st_mode ): - return - - children = os.listdir( self.root + "/" + self.path ) - for child in children: - if self.path: - child = self.path + "/" + child - self.children.append( TreeNode(self, child, self.root) ) - for child in self.children: - child.addchildren() - - def printAll(self, spaces=0): - print " "*spaces + self.root + "/" + self.path - for child in self.children: - child.printAll(spaces + 2) - - def isValidISO1(self): - pass - -class Tree: - def __init__(self, root=None, isofile=None): - if isofile: - self.root = TreeNode(parent=None, isofile=isofile) - else: - self.root = TreeNode(parent=None, path=root, root=root) - self.root.addchildren() - - def isValidISO1(self): - return root.isValidISO1(); - -#t = Tree(root=".") -#t.root.printAll() diff --git a/test/tree.pyc b/test/tree.pyc deleted file mode 100644 index efc06d94f69107d01a8b45c266b315ee011aa41b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3547 zcmb_f+ioL85Un2H;#_v4up0~QE<}q~vIN8e@c=@Cy#zrdWTY4o5ebbP&zMYhGUH57 zAV|&&-oN0P2R?((;5YaIIH!7SPn>-r#>(_mcUM(cSDmVweERps>PNr*^?V@3uY&he zJoXSnAo5b=$Ps2rcyi=PVB{6HDiU}~R3)g$5S&#`CnDb;)g-9tQhl~mr^;Tt0o~n! zhp}2bFYvb5ld(u-WNc(&J~k>2nRYx@j}i~>K*k{n@Y>Kytx2|B`#T~{yZC;jkZXwQk!0m7qlyweG7MV z(;yshi$B`=9FP4NLk?U51o{^OKLBV&ky;@RkAPJC)#Mcb4Tvf@kLq$zz*29vJ7Bcw zU20Yj{tjXcH$4UpjYOVA09}=EgI|3pa)c+z(=vww@~S3tnTkTYE@S+uWWFL}V7V?6 z;2kR%ovx<*s8RD*xsD_AH3fDH2dwj6PHgDO_OCb>nGrC%2(_-oAhv~JKl!O2N5PKb zX6K3B=_dhR?F};UiUe8|hn8_ot)g3bxz|4iD1kS+!G`fri7ZWXjl=LFj&++s;Y4>9 zL24P$Q9lb4Cp9>U;sCRG9yP(x?Vp8TWLcWI6r3Gc66V^>8a=9P{?vvW25GwKaI2i7 zUf++BDEIwGpzSsWF%5IyYqIGEj zKT(5-SZ9S}{1`_v0~N1fMoql@n&ofr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