/ Check-in [18680989]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem in loadext.test causing an error on OSX. This is not a real problem, just a case of the test script expecting a slightly different error message than the one returned. (CVS 6361)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 18680989b5365b0e35fadca5919dfced22433ff4
User & Date: danielk1977 2009-03-20 09:09:37
Context
2009-03-20
10:24
Fix a problem in thread005.test cause errors on osx. (CVS 6362) check-in: 56e6fca1 user: danielk1977 tags: trunk
09:09
Fix a problem in loadext.test causing an error on OSX. This is not a real problem, just a case of the test script expecting a slightly different error message than the one returned. (CVS 6361) check-in: 18680989 user: danielk1977 tags: trunk
2009-03-19
18:51
Fix a couple of fairly obscure cases where an assert() could fail following a malloc failure. (CVS 6360) check-in: cc0d9256 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/loadext.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is extension loading.
    13     13   #
    14         -# $Id: loadext.test,v 1.16 2008/10/13 17:09:11 drh Exp $
           14  +# $Id: loadext.test,v 1.17 2009/03/20 09:09:37 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   ifcapable !load_ext {
    20     20     finish_test
    21     21     return
................................................................................
    58     58   set dlerror_nosuchfile \
    59     59       {%s: cannot open shared object file: No such file or directory}
    60     60   set dlerror_notadll    {%s: file too short}
    61     61   set dlerror_nosymbol   {%s: undefined symbol: %s}
    62     62   
    63     63   if {$::tcl_platform(os) eq "Darwin"} {
    64     64     set dlerror_nosuchfile {dlopen(%s, 10): image not found}
    65         -  set dlerror_notadll    {dlopen(%1$s, 10): no suitable image found.  Did find:
    66         -	%1$s: file to short}
           65  +  set dlerror_notadll    {dlopen(%1$s, 10): no suitable image found.*}
    67     66     set dlerror_nosymbol   {dlsym(XXX, %2$s): symbol not found}
    68     67   }
    69     68   
    70     69   # Make sure the test extension actually exists.  If it does not
    71     70   # exist, try to create it.  If unable to create it, then skip this
    72     71   # test file.
    73     72   #
    74     73   if {![file exists $testextension]} {
    75     74     set srcdir [file dir $testdir]/src
    76     75     set testextsrc $srcdir/test_loadext.c
    77         -  if {[catch {
    78         -    exec gcc {*}[set gcc_shared] -Wall -I$srcdir -I. -g $testextsrc -o $testextension
    79         -  } msg]} {
           76  +
           77  +  set cmdline [concat exec gcc $gcc_shared]
           78  +  lappend cmdline -Wall -I$srcdir -I. -g $testextsrc -o $testextension
           79  +  
           80  +  if {[catch $cmdline msg]} {
    80     81       puts "Skipping loadext tests: Test extension not built..."
    81     82       puts $msg
    82     83       finish_test
    83     84       return
    84     85     }
    85     86   }
    86     87   
................................................................................
   145    146   do_test loadext-2.2 {
   146    147     set fd [open "${testextension}xx" w]
   147    148     puts $fd blah
   148    149     close $fd
   149    150     set rc [catch {
   150    151       sqlite3_load_extension db "${testextension}xx"
   151    152     } msg]
   152         -  list $rc $msg
   153         -} [list 1 [format $dlerror_notadll ${testextension}xx]]
          153  +  set expected_error_pattern [format $dlerror_notadll ${testextension}xx]
          154  +  list $rc [string match $expected_error_pattern $msg]
          155  +} [list 1 1]
   154    156   
   155    157   # Try to load an extension for which the file is present but the
   156    158   # entry point is not.
   157    159   #
   158    160   do_test loadext-2.3 {
   159    161     set rc [catch {
   160    162       sqlite3_load_extension db $testextension icecream