summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/get-dropboxes10
-rwxr-xr-xtest/get-lists14
-rwxr-xr-xtest/get-range18
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;