diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-09-30 23:05:11 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-09-30 23:05:11 (GMT) |
commit | 6f1943313a0e503189dd9685483a9ecd1bd7cc6e (patch) | |
tree | 7461bd743125feb61a7f977a06e7698bb184d333 /test | |
parent | 88ba274e7841fedffe9ef98b0933c0610ac6997c (diff) |
introduced rhrd context
Diffstat (limited to 'test')
-rwxr-xr-x | test/get-dropboxes | 10 | ||||
-rwxr-xr-x | test/get-lists | 14 | ||||
-rwxr-xr-x | test/get-range | 18 |
3 files changed, 21 insertions, 21 deletions
diff --git a/test/get-dropboxes b/test/get-dropboxes index b8a5266..89a4935 100755 --- a/test/get-dropboxes +++ b/test/get-dropboxes @@ -33,15 +33,15 @@ my $type = $ARGV[2]; my @dropboxes = (); -my ($dbh, $status, $errorstring) = RHRD::rddb::opendb(); -if(defined $dbh) { - @dropboxes = RHRD::rddb::get_dropboxes($dbh, $username, $groupname, $type); +my ($ctx, $status, $errorstring) = RHRD::rddb::init(); +if(defined $ctx) { + @dropboxes = RHRD::rddb::get_dropboxes($ctx, $username, $groupname, $type); if(!defined $dropboxes[0] && defined $dropboxes[1]) { print STDERR "$dropboxes[1]: $dropboxes[2]"; - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); exit 1; } - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); } else { print STDERR "$errorstring\n"; exit 1; diff --git a/test/get-lists b/test/get-lists index 47d6dfd..2f7be2b 100755 --- a/test/get-lists +++ b/test/get-lists @@ -24,13 +24,13 @@ use strict; use lib "../lib/"; use RHRD::rddb; -my ($dbh, undef, $errorstring) = RHRD::rddb::opendb(); -if(defined $dbh) { +my ($ctx, undef, $errorstring) = RHRD::rddb::init(); +if(defined $ctx) { print "Users:\n"; - my @users = RHRD::rddb::list_users($dbh); + my @users = RHRD::rddb::list_users($ctx); if(!defined $users[0] && defined $users[1]) { print STDERR "$users[1]: $users[2]"; - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); exit 1; } for my $user (@users) { @@ -38,17 +38,17 @@ if(defined $dbh) { } print "\nGroups:\n"; - my @groups = RHRD::rddb::list_groups($dbh); + my @groups = RHRD::rddb::list_groups($ctx); if(!defined $groups[0] && defined $groups[1]) { print STDERR "$groups[1]: $groups[2]"; - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); exit 1; } for my $group (@groups) { print " " . $group . "\n"; } - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); } else { print "$errorstring\n"; exit 1; diff --git a/test/get-range b/test/get-range index 1027653..e0c0e36 100755 --- a/test/get-range +++ b/test/get-range @@ -24,16 +24,16 @@ use strict; use lib "../lib/"; use RHRD::rddb; -my ($dbh, undef, $errorstring) = RHRD::rddb::opendb(); -if(defined $dbh) { +my ($ctx, undef, $errorstring) = RHRD::rddb::init(); +if(defined $ctx) { print "Shows:\n"; - my ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_shows_cart_range($dbh); + my ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_shows_cart_range($ctx); if(!$low_cart) { print "$high_cart: $chunk_size\n"; } else { print "Range: " . $low_cart . " - " . $high_cart . ", chunk size: " . $chunk_size . "\n"; } - my ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_shows_next_free_slot($dbh); + my ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_shows_next_free_slot($ctx); if(!$slot_low_cart) { print "$slot_high_cart: $err\n"; } else { @@ -41,13 +41,13 @@ if(defined $dbh) { } print "\nMusic Pools:\n"; - ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_musicpools_cart_range($dbh); + ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_musicpools_cart_range($ctx); if(!$low_cart) { print "$high_cart: $chunk_size\n"; } else { print "Range: " . $low_cart . " - " . $high_cart . ", chunk size: " . $chunk_size . "\n"; } - ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_musicpools_next_free_slot($dbh); + ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_musicpools_next_free_slot($ctx); if(!$slot_low_cart) { print "$slot_high_cart: $err\n"; } else { @@ -55,13 +55,13 @@ if(defined $dbh) { } print "\nJingles:\n"; - ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_jingles_cart_range($dbh); + ($low_cart, $high_cart, $chunk_size) = RHRD::rddb::get_jingles_cart_range($ctx); if(!$low_cart) { print "$high_cart: $chunk_size\n"; } else { print "Range: " . $low_cart . " - " . $high_cart . ", chunk size: " . $chunk_size . "\n"; } - ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_jingles_next_free_slot($dbh); + ($slot_low_cart, $slot_high_cart, $err) = RHRD::rddb::get_jingles_next_free_slot($ctx); if(!$slot_low_cart) { print "$slot_high_cart: $err\n"; } else { @@ -69,7 +69,7 @@ if(defined $dbh) { } - RHRD::rddb::closedb($dbh); + RHRD::rddb::destroy($ctx); } else { print "$errorstring\n"; exit 1; |