From 1c06ff021eff435533f638066c07ff3e1e99229e Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Wed, 6 May 2009 12:18:37 +0000 Subject: [PATCH] DBD-SQLite: made sure if private methods/functions return true after successful calls (#44871) --- SQLite.xs | 6 ++++-- dbdimp.c | 3 +++ t/08_busy.t | 4 ++-- t/08_busy_func.t | 4 ++-- t/09_create_function.t | 20 ++++++++++---------- t/09_create_function_func.t | 20 ++++++++++---------- t/10_create_aggregate.t | 10 +++++----- t/10_create_aggregate_func.t | 10 +++++----- t/13_create_collation.t | 6 +++--- t/13_create_collation_func.t | 6 +++--- t/14_progress_handler.t | 6 +++--- t/14_progress_handler_func.t | 6 +++--- t/34_online_backup.t | 6 +++--- t/34_online_backup_func.t | 6 +++--- t/rt_25924_user_defined_func_unicode.t | 4 ++-- t/rt_25924_user_defined_func_unicode_func.t | 4 ++-- 16 files changed, 63 insertions(+), 58 deletions(-) diff --git a/SQLite.xs b/SQLite.xs index 9cd9d95..7f0fa6c 100644 --- a/SQLite.xs +++ b/SQLite.xs @@ -34,7 +34,7 @@ last_insert_rowid(dbh) OUTPUT: RETVAL -void +static int create_function(dbh, name, argc, func) SV *dbh char *name @@ -44,8 +44,10 @@ create_function(dbh, name, argc, func) DBD::SQLite::db::sqlite_create_function = 1 CODE: { - sqlite3_db_create_function(aTHX_ dbh, name, argc, func ); + RETVAL = sqlite3_db_create_function(aTHX_ dbh, name, argc, func ); } + OUTPUT: + RETVAL static int enable_load_extension(dbh, onoff) diff --git a/dbdimp.c b/dbdimp.c index 9c4524f..de2eeb8 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -1288,7 +1288,10 @@ sqlite3_db_create_collation(pTHX_ SV *dbh, const char *name, SV *func ) if ( rv != SQLITE_OK ) { char* const errmsg = form("sqlite_create_collation failed with error %s", sqlite3_errmsg(imp_dbh->db)); + sqlite_error(dbh, (imp_xxh_t*)imp_dbh, rv, errmsg); + return FALSE; } + return TRUE; } static int diff --git a/t/08_busy.t b/t/08_busy.t index d561fe5..febaf16 100644 --- a/t/08_busy.t +++ b/t/08_busy.t @@ -16,7 +16,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; } -plan tests => 11; +plan tests => 12; my $dbh = connect_ok( RaiseError => 1, @@ -77,7 +77,7 @@ if (!defined($pid)) { my $line = ; chomp($line); ok($line, "Ready"); - $dbh->sqlite_busy_timeout(10000); + ok($dbh->sqlite_busy_timeout(10000)); ok($dbh->do("INSERT INTO Blah VALUES (4, 'Test4' )")); $dbh->commit; wait; diff --git a/t/08_busy_func.t b/t/08_busy_func.t index cf7cebb..8eb6f94 100644 --- a/t/08_busy_func.t +++ b/t/08_busy_func.t @@ -9,7 +9,7 @@ BEGIN { } use t::lib::Test; -use Test::More tests => 11; +use Test::More tests => 12; use Test::NoWarnings; my $dbh = connect_ok( @@ -71,7 +71,7 @@ if (!defined($pid)) { my $line = ; chomp($line); ok($line, "Ready"); - $dbh->func(10000, 'busy_timeout'); + ok($dbh->func(10000, 'busy_timeout')); ok($dbh->do("INSERT INTO Blah VALUES (4, 'Test4' )")); $dbh->commit; wait; diff --git a/t/09_create_function.t b/t/09_create_function.t index 46b5cb3..ea1bb8a 100644 --- a/t/09_create_function.t +++ b/t/09_create_function.t @@ -15,7 +15,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; } -plan tests => 19; +plan tests => 28; sub now { return time(); @@ -59,7 +59,7 @@ sub noop { my $dbh = connect_ok( PrintError => 0 ); -$dbh->sqlite_create_function( "now", 0, \&now ); +ok($dbh->sqlite_create_function( "now", 0, \&now )); my $result = $dbh->selectrow_arrayref( "SELECT now()" ); ok( $result->[0], 'Got a result' ); @@ -68,35 +68,35 @@ $dbh->do( 'CREATE TEMP TABLE func_test ( a, b )' ); $dbh->do( 'INSERT INTO func_test VALUES ( 1, 3 )' ); $dbh->do( 'INSERT INTO func_test VALUES ( 0, 4 )' ); -$dbh->sqlite_create_function( "add2", 2, \&add2 ); +ok($dbh->sqlite_create_function( "add2", 2, \&add2 )); $result = $dbh->selectrow_arrayref( "SELECT add2(1,3)" ); is($result->[0], 4, "SELECT add2(1,3)" ); $result = $dbh->selectall_arrayref( "SELECT add2(a,b) FROM func_test" ); is_deeply( $result, [ [4], [4] ], "SELECT add2(a,b) FROM func_test" ); -$dbh->sqlite_create_function( "my_sum", -1, \&my_sum ); +ok($dbh->sqlite_create_function( "my_sum", -1, \&my_sum )); $result = $dbh->selectrow_arrayref( "SELECT my_sum( '2', 3, 4, '5')" ); is( $result->[0], 14, "SELECT my_sum( '2', 3, 4, '5')" ); -$dbh->sqlite_create_function( "error", -1, \&error ); +ok($dbh->sqlite_create_function( "error", -1, \&error )); $result = $dbh->selectrow_arrayref( "SELECT error( 'I died' )" ); ok( !$result ); like( $DBI::errstr, qr/function is dying: I died/ ); -$dbh->sqlite_create_function( "void_return", -1, \&void_return ); +ok($dbh->sqlite_create_function( "void_return", -1, \&void_return )); $result = $dbh->selectrow_arrayref( "SELECT void_return( 'I died' )" ); is_deeply( $result, [ undef ], "SELECT void_return( 'I died' )" ); -$dbh->sqlite_create_function( "return_null", -1, \&return_null ); +ok($dbh->sqlite_create_function( "return_null", -1, \&return_null )); $result = $dbh->selectrow_arrayref( "SELECT return_null()" ); is_deeply( $result, [ undef ], "SELECT return_null()" ); -$dbh->sqlite_create_function( "return2", -1, \&return2 ); +ok($dbh->sqlite_create_function( "return2", -1, \&return2 )); $result = $dbh->selectrow_arrayref( "SELECT return2()" ); is_deeply( $result, [ 2 ], "SELECT return2()" ); -$dbh->sqlite_create_function( "my_defined", 1, \&my_defined ); +ok($dbh->sqlite_create_function( "my_defined", 1, \&my_defined )); $result = $dbh->selectrow_arrayref( "SELECT my_defined(1)" ); is_deeply( $result, [ 1 ], "SELECT my_defined(1)" ); @@ -109,7 +109,7 @@ is_deeply( $result, [ 1 ], "SELECT my_defined('abc')" ); $result = $dbh->selectrow_arrayref( "SELECT my_defined(NULL)" ); is_deeply( $result, [ '0' ], "SELECT my_defined(NULL)" ); -$dbh->sqlite_create_function( "noop", 1, \&noop ); +ok($dbh->sqlite_create_function( "noop", 1, \&noop )); $result = $dbh->selectrow_arrayref( "SELECT noop(NULL)" ); is_deeply( $result, [ undef ], "SELECT noop(NULL)" ); diff --git a/t/09_create_function_func.t b/t/09_create_function_func.t index 5e2ec35..0b764ff 100644 --- a/t/09_create_function_func.t +++ b/t/09_create_function_func.t @@ -8,7 +8,7 @@ BEGIN { } use t::lib::Test; -use Test::More tests => 19; +use Test::More tests => 28; use Test::NoWarnings; sub now { @@ -53,7 +53,7 @@ sub noop { my $dbh = connect_ok( PrintError => 0 ); -$dbh->func( "now", 0, \&now, "create_function" ); +ok($dbh->func( "now", 0, \&now, "create_function" )); my $result = $dbh->selectrow_arrayref( "SELECT now()" ); ok( $result->[0], 'Got a result' ); @@ -62,35 +62,35 @@ $dbh->do( 'CREATE TEMP TABLE func_test ( a, b )' ); $dbh->do( 'INSERT INTO func_test VALUES ( 1, 3 )' ); $dbh->do( 'INSERT INTO func_test VALUES ( 0, 4 )' ); -$dbh->func( "add2", 2, \&add2, "create_function" ); +ok($dbh->func( "add2", 2, \&add2, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT add2(1,3)" ); is($result->[0], 4, "SELECT add2(1,3)" ); $result = $dbh->selectall_arrayref( "SELECT add2(a,b) FROM func_test" ); is_deeply( $result, [ [4], [4] ], "SELECT add2(a,b) FROM func_test" ); -$dbh->func( "my_sum", -1, \&my_sum, "create_function" ); +ok($dbh->func( "my_sum", -1, \&my_sum, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT my_sum( '2', 3, 4, '5')" ); is( $result->[0], 14, "SELECT my_sum( '2', 3, 4, '5')" ); -$dbh->func( "error", -1, \&error, "create_function" ); +ok($dbh->func( "error", -1, \&error, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT error( 'I died' )" ); ok( !$result ); like( $DBI::errstr, qr/function is dying: I died/ ); -$dbh->func( "void_return", -1, \&void_return, "create_function" ); +ok($dbh->func( "void_return", -1, \&void_return, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT void_return( 'I died' )" ); is_deeply( $result, [ undef ], "SELECT void_return( 'I died' )" ); -$dbh->func( "return_null", -1, \&return_null, "create_function" ); +ok($dbh->func( "return_null", -1, \&return_null, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT return_null()" ); is_deeply( $result, [ undef ], "SELECT return_null()" ); -$dbh->func( "return2", -1, \&return2, "create_function" ); +ok($dbh->func( "return2", -1, \&return2, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT return2()" ); is_deeply( $result, [ 2 ], "SELECT return2()" ); -$dbh->func( "my_defined", 1, \&my_defined, "create_function" ); +ok($dbh->func( "my_defined", 1, \&my_defined, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT my_defined(1)" ); is_deeply( $result, [ 1 ], "SELECT my_defined(1)" ); @@ -103,7 +103,7 @@ is_deeply( $result, [ 1 ], "SELECT my_defined('abc')" ); $result = $dbh->selectrow_arrayref( "SELECT my_defined(NULL)" ); is_deeply( $result, [ '0' ], "SELECT my_defined(NULL)" ); -$dbh->func( "noop", 1, \&noop, "create_function" ); +ok($dbh->func( "noop", 1, \&noop, "create_function" )); $result = $dbh->selectrow_arrayref( "SELECT noop(NULL)" ); is_deeply( $result, [ undef ], "SELECT noop(NULL)" ); diff --git a/t/10_create_aggregate.t b/t/10_create_aggregate.t index b9a8ec1..14c2d86 100644 --- a/t/10_create_aggregate.t +++ b/t/10_create_aggregate.t @@ -14,7 +14,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; } -plan tests => 16; +plan tests => 22; # Create the aggregate test packages SCOPE: { @@ -81,7 +81,7 @@ foreach my $val ( qw/NULL 1 'test'/ ) { $dbh->do( "INSERT INTO aggr_test VALUES ( $val )" ); } -$dbh->sqlite_create_aggregate( "newcount", 0, "count_aggr" ); +ok($dbh->sqlite_create_aggregate( "newcount", 0, "count_aggr" )); my $result = $dbh->selectrow_arrayref( "SELECT newcount() FROM aggr_test" ); ok( $result && $result->[0] == 3 ); @@ -99,7 +99,7 @@ ok( $result && !$result->[0] ); $result = $dbh->selectrow_arrayref( "SELECT newcount() FROM aggr_empty_test" ); ok( $result && !$result->[0] ); -$dbh->sqlite_create_aggregate( "defined", 1, 'obj_aggregate' ); +ok($dbh->sqlite_create_aggregate( "defined", 1, 'obj_aggregate' )); $result = $dbh->selectrow_arrayref( "SELECT defined(field) FROM aggr_test" ); ok( $result && $result->[0] == 2 ); $result = $dbh->selectrow_arrayref( "SELECT defined(field) FROM aggr_test" ); @@ -114,7 +114,7 @@ local $SIG{__WARN__} = sub { $last_warn = join "", @_ }; foreach my $fail ( qw/ new step finalize/ ) { $last_warn = ''; my $aggr = new fail_aggregate( $fail ); - $dbh->sqlite_create_aggregate( "fail_$fail", -1, $aggr ); + ok($dbh->sqlite_create_aggregate( "fail_$fail", -1, $aggr )); $result = $dbh->selectrow_arrayref( "SELECT fail_$fail() FROM aggr_test" ); # ok( !$result && $DBI::errstr =~ /$fail\(\) failed on request/ ); ok( !defined $result->[0] && $last_warn =~ /$fail\(\) failed on request/ ); @@ -129,7 +129,7 @@ foreach my $fail ( qw/ new step finalize/ ) { my $aggr = new fail_aggregate( 'undef' ); $last_warn = ''; -$dbh->sqlite_create_aggregate( "fail_undef", -1, $aggr ); +ok($dbh->sqlite_create_aggregate( "fail_undef", -1, $aggr )); $result = $dbh->selectrow_arrayref( "SELECT fail_undef() FROM aggr_test" ); # ok( !$result && $DBI::errstr =~ /new\(\) should return a blessed reference/ ); ok( !defined $result->[0] && $last_warn =~ /new\(\) should return a blessed reference/ ); diff --git a/t/10_create_aggregate_func.t b/t/10_create_aggregate_func.t index e8d3af5..94f140d 100644 --- a/t/10_create_aggregate_func.t +++ b/t/10_create_aggregate_func.t @@ -7,7 +7,7 @@ BEGIN { } use t::lib::Test; -use Test::More tests => 16; +use Test::More tests => 22; use Test::NoWarnings; # Create the aggregate test packages @@ -75,7 +75,7 @@ foreach my $val ( qw/NULL 1 'test'/ ) { $dbh->do( "INSERT INTO aggr_test VALUES ( $val )" ); } -$dbh->func( "newcount", 0, "count_aggr", "create_aggregate" ); +ok($dbh->func( "newcount", 0, "count_aggr", "create_aggregate" )); my $result = $dbh->selectrow_arrayref( "SELECT newcount() FROM aggr_test" ); ok( $result && $result->[0] == 3 ); @@ -93,7 +93,7 @@ ok( $result && !$result->[0] ); $result = $dbh->selectrow_arrayref( "SELECT newcount() FROM aggr_empty_test" ); ok( $result && !$result->[0] ); -$dbh->func( "defined", 1, 'obj_aggregate', "create_aggregate" ); +ok($dbh->func( "defined", 1, 'obj_aggregate', "create_aggregate" )); $result = $dbh->selectrow_arrayref( "SELECT defined(field) FROM aggr_test" ); ok( $result && $result->[0] == 2 ); $result = $dbh->selectrow_arrayref( "SELECT defined(field) FROM aggr_test" ); @@ -108,7 +108,7 @@ local $SIG{__WARN__} = sub { $last_warn = join "", @_ }; foreach my $fail ( qw/ new step finalize/ ) { $last_warn = ''; my $aggr = new fail_aggregate( $fail ); - $dbh->func( "fail_$fail", -1, $aggr, 'create_aggregate' ); + ok($dbh->func( "fail_$fail", -1, $aggr, 'create_aggregate' )); $result = $dbh->selectrow_arrayref( "SELECT fail_$fail() FROM aggr_test" ); # ok( !$result && $DBI::errstr =~ /$fail\(\) failed on request/ ); ok( !defined $result->[0] && $last_warn =~ /$fail\(\) failed on request/ ); @@ -123,7 +123,7 @@ foreach my $fail ( qw/ new step finalize/ ) { my $aggr = new fail_aggregate( 'undef' ); $last_warn = ''; -$dbh->func( "fail_undef", -1, $aggr, 'create_aggregate' ); +ok($dbh->func( "fail_undef", -1, $aggr, 'create_aggregate' )); $result = $dbh->selectrow_arrayref( "SELECT fail_undef() FROM aggr_test" ); # ok( !$result && $DBI::errstr =~ /new\(\) should return a blessed reference/ ); ok( !defined $result->[0] && $last_warn =~ /new\(\) should return a blessed reference/ ); diff --git a/t/13_create_collation.t b/t/13_create_collation.t index 53d9619..2096a0c 100644 --- a/t/13_create_collation.t +++ b/t/13_create_collation.t @@ -12,7 +12,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; if ( $] >= 5.008005 ) { - plan( tests => 9 ); + plan( tests => 11 ); } else { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } @@ -57,7 +57,7 @@ sub no_accents ($$) { $dbh = connect_ok( RaiseError => 1 ); -$dbh->sqlite_create_collation( "no_accents", \&no_accents ); +ok($dbh->sqlite_create_collation( "no_accents", \&no_accents )); $dbh->do( 'CREATE TEMP TABLE collate_test ( txt )' ); $dbh->do( "INSERT INTO collate_test VALUES ( '$_' )" ) foreach @words; @@ -79,7 +79,7 @@ is_deeply(\@sorted, $db_sorted, "collate no_accents (@sorted // @$db_sorted)"); $dbh->disconnect; $dbh = connect_ok( RaiseError => 1, unicode => 1 ); -$dbh->sqlite_create_collation( "no_accents", \&no_accents ); +ok($dbh->sqlite_create_collation( "no_accents", \&no_accents )); $dbh->do( 'CREATE TEMP TABLE collate_test ( txt )' ); $dbh->do( "INSERT INTO collate_test VALUES ( '$_' )" ) foreach @words_utf8; diff --git a/t/13_create_collation_func.t b/t/13_create_collation_func.t index 8341aa0..cd94f7e 100644 --- a/t/13_create_collation_func.t +++ b/t/13_create_collation_func.t @@ -10,7 +10,7 @@ use t::lib::Test; use Test::More; BEGIN { if ( $] >= 5.008005 ) { - plan( tests => 9 ); + plan( tests => 11 ); } else { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } @@ -55,7 +55,7 @@ sub no_accents ($$) { $dbh = connect_ok( RaiseError => 1 ); -$dbh->func( "no_accents", \&no_accents, "create_collation" ); +ok($dbh->func( "no_accents", \&no_accents, "create_collation" )); $dbh->do( 'CREATE TEMP TABLE collate_test ( txt )' ); $dbh->do( "INSERT INTO collate_test VALUES ( '$_' )" ) foreach @words; @@ -77,7 +77,7 @@ is_deeply(\@sorted, $db_sorted, "collate no_accents (@sorted // @$db_sorted)"); $dbh->disconnect; $dbh = connect_ok( RaiseError => 1, unicode => 1 ); -$dbh->func( "no_accents", \&no_accents, "create_collation" ); +ok($dbh->func( "no_accents", \&no_accents, "create_collation" )); $dbh->do( 'CREATE TEMP TABLE collate_test ( txt )' ); $dbh->do( "INSERT INTO collate_test VALUES ( '$_' )" ) foreach @words_utf8; diff --git a/t/14_progress_handler.t b/t/14_progress_handler.t index ffff439..92b6b78 100644 --- a/t/14_progress_handler.t +++ b/t/14_progress_handler.t @@ -14,7 +14,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; } -plan tests => 4; +plan tests => 6; my $N_OPCODES = 50; # how many opcodes before calling the progress handler @@ -27,7 +27,7 @@ sub progress_handler { # connect and register the progress handler my $dbh = connect_ok( RaiseError => 1 ); -$dbh->sqlite_progress_handler( $N_OPCODES, \&progress_handler ); +ok($dbh->sqlite_progress_handler( $N_OPCODES, \&progress_handler )); # populate a temporary table with random numbers $dbh->do( 'CREATE TEMP TABLE progress_test ( foo )' ); @@ -46,7 +46,7 @@ ok($n_callback); # unregister the progress handler, set counter back to zero, do more work -$dbh->sqlite_progress_handler( $N_OPCODES, undef ); +ok($dbh->sqlite_progress_handler( $N_OPCODES, undef )); $n_callback = 0; $result = $dbh->do( "SELECT * from progress_test ORDER BY foo DESC " ); diff --git a/t/14_progress_handler_func.t b/t/14_progress_handler_func.t index 9c6ba25..24b66cf 100644 --- a/t/14_progress_handler_func.t +++ b/t/14_progress_handler_func.t @@ -7,7 +7,7 @@ BEGIN { } use t::lib::Test; -use Test::More tests => 4; +use Test::More tests => 6; use Test::NoWarnings; my $N_OPCODES = 50; # how many opcodes before calling the progress handler @@ -21,7 +21,7 @@ sub progress_handler { # connect and register the progress handler my $dbh = connect_ok( RaiseError => 1 ); -$dbh->func( $N_OPCODES, \&progress_handler, "progress_handler" ); +ok($dbh->func( $N_OPCODES, \&progress_handler, "progress_handler" )); # populate a temporary table with random numbers $dbh->do( 'CREATE TEMP TABLE progress_test ( foo )' ); @@ -40,7 +40,7 @@ ok($n_callback); # unregister the progress handler, set counter back to zero, do more work -$dbh->func( $N_OPCODES, undef, "progress_handler" ); +ok($dbh->func( $N_OPCODES, undef, "progress_handler" )); $n_callback = 0; $result = $dbh->do( "SELECT * from progress_test ORDER BY foo DESC " ); diff --git a/t/34_online_backup.t b/t/34_online_backup.t index 5be1146..10a3708 100644 --- a/t/34_online_backup.t +++ b/t/34_online_backup.t @@ -11,7 +11,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; } -plan tests => 4; +plan tests => 6; # Connect to the test db and add some stuff: my $foo = connect_ok( RaiseError => 1 ); @@ -31,7 +31,7 @@ my $dbh = DBI->connect( { RaiseError => 1 } ); -$dbh->sqlite_backup_from_file('foo'); +ok($dbh->sqlite_backup_from_file('foo')); { my ($count) = $dbh->selectrow_array( @@ -47,7 +47,7 @@ $dbh->do( $dbh->do("INSERT INTO online_backup_test2 (foo) VALUES ($$)"); # backup to file (foo): -$dbh->sqlite_backup_to_file('foo'); +ok($dbh->sqlite_backup_to_file('foo')); $dbh->disconnect; diff --git a/t/34_online_backup_func.t b/t/34_online_backup_func.t index 36c3163..bf4c2c4 100644 --- a/t/34_online_backup_func.t +++ b/t/34_online_backup_func.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 6; use t::lib::Test; use DBI; @@ -25,7 +25,7 @@ my $dbh = DBI->connect( { RaiseError => 1 } ); -$dbh->func('foo', 'backup_from_file'); +ok($dbh->func('foo', 'backup_from_file')); { my ($count) = $dbh->selectrow_array( @@ -41,7 +41,7 @@ $dbh->do( $dbh->do("INSERT INTO online_backup_test2 (foo) VALUES ($$)"); # backup to file (foo): -$dbh->func('foo', 'backup_to_file'); +ok($dbh->func('foo', 'backup_to_file')); $dbh->disconnect; diff --git a/t/rt_25924_user_defined_func_unicode.t b/t/rt_25924_user_defined_func_unicode.t index f447add..a63b627 100644 --- a/t/rt_25924_user_defined_func_unicode.t +++ b/t/rt_25924_user_defined_func_unicode.t @@ -12,7 +12,7 @@ BEGIN { plan skip_all => 'requires DBI v1.608' if $DBI::VERSION < 1.608; if ( $] >= 5.008005 ) { - plan( tests => 15 ); + plan( tests => 16 ); } else { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } @@ -23,7 +23,7 @@ eval "require utf8"; die $@ if $@; my $dbh = connect_ok( unicode => 1 ); -$dbh->sqlite_create_function( "perl_uc", 1, \&perl_uc ); +ok($dbh->sqlite_create_function( "perl_uc", 1, \&perl_uc )); ok( $dbh->do(<<'END_SQL'), 'CREATE TABLE' ); CREATE TABLE foo ( diff --git a/t/rt_25924_user_defined_func_unicode_func.t b/t/rt_25924_user_defined_func_unicode_func.t index b57b377..f61365a 100644 --- a/t/rt_25924_user_defined_func_unicode_func.t +++ b/t/rt_25924_user_defined_func_unicode_func.t @@ -10,7 +10,7 @@ use t::lib::Test; use Test::More; BEGIN { if ( $] >= 5.008005 ) { - plan( tests => 15 ); + plan( tests => 16 ); } else { plan( skip_all => 'Unicode is not supported before 5.8.5' ); } @@ -21,7 +21,7 @@ eval "require utf8"; die $@ if $@; my $dbh = connect_ok( unicode => 1 ); -$dbh->func( "perl_uc", 1, \&perl_uc, "create_function" ); +ok($dbh->func( "perl_uc", 1, \&perl_uc, "create_function" )); ok( $dbh->do(<<'END_SQL'), 'CREATE TABLE' ); CREATE TABLE foo (