DBD-InterBase
view release on metacpan or search on metacpan
t/60leaks.t view on Meta::CPAN
#!/usr/local/bin/perl
#
# $Id: 60leaks.t 291 2003-05-20 02:43:57Z edpratomo $
#
# This is a memory leak test.
#
BEGIN {
$^W = 1;
$COUNT_CONNECT = 500; # Number of connect/disconnect iterations
$COUNT_PREPARE = 10000; # Number of prepare/execute/finish iterations
$TOTALMEM = 0;
#
# Make -w happy
#
$test_dsn = '';
$test_user = '';
$test_password = '';
}
print "1..0 # Skipped: Long running memory leak test\n" and exit 0 unless ($^O eq 'linux' && $ENV{MEMORY_TEST});
#
# Include lib.pl
#
use DBI;
#DBI->trace(2, "trace.txt");
$mdriver = "";
foreach $file ("lib.pl", "t/lib.pl", "DBD-~~dbd_driver~~/t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
# Main loop; leave this untouched, put tests after creating
# the new table.
#
while (Testing()) {
#
# Connect to the database
Test($state or $dbh = DBI->connect($test_dsn, $test_user, $test_password))
or ServerError();
#
# Find a possible new table name
#
Test($state or $table = FindNewTable($dbh))
or DbiError($dbh->err, $dbh->errstr);
#
# Create a new table; EDIT THIS!
#
( run in 0.540 second using v1.01-cache-2.11-cpan-71847e10f99 )