summaryrefslogtreecommitdiff
path: root/test/get-range
diff options
context:
space:
mode:
Diffstat (limited to 'test/get-range')
-rwxr-xr-xtest/get-range18
1 files changed, 9 insertions, 9 deletions
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;