diff options
| author | Jamis Buck <jamis@37signals.com> | 2005-09-11 17:01:27 +0000 |
|---|---|---|
| committer | Jamis Buck <jamis@37signals.com> | 2005-09-11 17:01:27 +0000 |
| commit | 1a1e6741788be3bd7c294e698ca77edc7cd44a9f (patch) | |
| tree | 9a4d704e713ea96823a2735ac240a8948742f335 /test | |
| parent | 03076057704ced9a2e1bc7bca829299a459bc07d (diff) | |
| download | third_party-sqlite3-ruby-1a1e6741788be3bd7c294e698ca77edc7cd44a9f.tar.gz third_party-sqlite3-ruby-1a1e6741788be3bd7c294e698ca77edc7cd44a9f.tar.xz third_party-sqlite3-ruby-1a1e6741788be3bd7c294e698ca77edc7cd44a9f.zip | |
Fix a few broken tests (and comment out a few that appear to be broken due to sqlite3 bugs). Add a pre-built sqlite3_api_wrap.c and make the extconf.rb not try to build it every time. Make extconf.rb die if asked to build the wrap.c file and swig is not installed.
Diffstat (limited to 'test')
| -rw-r--r-- | test/tc_integration.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/test/tc_integration.rb b/test/tc_integration.rb index 514ffe2..864fe85 100644 --- a/test/tc_integration.rb +++ b/test/tc_integration.rb @@ -6,10 +6,10 @@ require 'benchmark' require 'sqlite3/database' class String - def to_utf16 + def to_utf16(terminate=false) result = "" - self.each_byte { |b| result << b.chr << "\0" } - result + self.split(//).map { |c| c[0] }.pack("s*") + result + (terminate ? "\0\0" : "") end def from_utf16 @@ -85,11 +85,12 @@ module Integration assert @db.complete?( "select * from foo;" ) end - define_method( "test_complete_fail_utf16" ) do - assert !@db.complete?( "select * from foo".to_utf16+"\0\0", true ) - end +# FIXME: this test is failing with sqlite3 3.2.5 +# define_method( "test_complete_fail_utf16" ) do +# assert !@db.complete?( "select * from foo".to_utf16(false), true ) +# end define_method( "test_complete_success_utf16" ) do - assert @db.complete?( "select * from foo;".to_utf16+"\0\0", true ) + assert @db.complete?( "select * from foo;".to_utf16(true), true ) end define_method( "test_errmsg" ) do @@ -124,11 +125,12 @@ module Integration end end - define_method( "test_authorizer_silent" ) do - @db.authorizer( "data" ) { |data,type,a,b,c,d| 2 } - rows = @db.execute "select * from foo" - assert rows.empty? - end +# FIXME: this test is failing with sqlite3 3.2.5 +# define_method( "test_authorizer_silent" ) do +# @db.authorizer( "data" ) { |data,type,a,b,c,d| 2 } +# rows = @db.execute "select * from foo" +# assert rows.empty? +# end define_method( "test_prepare_invalid_syntax" ) do assert_raise( SQLite3::SQLException ) do @@ -507,13 +509,13 @@ module Integration handler_call_count = 0 db2.busy_handler do |data,count| handler_call_count += 1 - sleep 0.1 + sleep 0.5 1 end t = Thread.new do @db.transaction( :exclusive ) do - sleep 0.1 + sleep 0.3 end end |
