SQLite

Check-in [a51946e66b]
Login

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

Overview
Comment:Changes to a couple of test scripts to handle the tcl 8.5 version of (file attributes -readonly) on mac. (CVS 4472)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a51946e66badab37cd54982265631bbc5e414f8e
User & Date: danielk1977 2007-10-05 15:53:29.000
Context
2007-10-05
16:16
Changes lemon so that the generated parser does not accept prior to seeing the EOF token. This is a lemon change only and does not effect SQLite. Ticket #2550. (CVS 4473) (check-in: 1c68d93412 user: drh tags: trunk)
15:53
Changes to a couple of test scripts to handle the tcl 8.5 version of (file attributes -readonly) on mac. (CVS 4472) (check-in: a51946e66b user: danielk1977 tags: trunk)
15:08
Do not attempt to use TryEnterCriticalSection() under win32. It causes too many compiler problems. Ticket #2685. (CVS 4471) (check-in: f795431c72 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/delete.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2001 September 15
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the DELETE FROM statement.
#
# $Id: delete.test,v 1.21 2006/01/03 00:33:50 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to delete from a non-existant table.
#
do_test delete-1.1 {













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2001 September 15
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the DELETE FROM statement.
#
# $Id: delete.test,v 1.22 2007/10/05 15:53:29 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to delete from a non-existant table.
#
do_test delete-1.1 {
305
306
307
308
309
310
311
312






313
  }
# v2 result: {0 {}}
} {1 {attempt to write a readonly database}}
do_test delete-8.6 {
  execsql {SELECT * FROM t3}
} {123}
integrity_check delete-8.7







finish_test








>
>
>
>
>
>

305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
  }
# v2 result: {0 {}}
} {1 {attempt to write a readonly database}}
do_test delete-8.6 {
  execsql {SELECT * FROM t3}
} {123}
integrity_check delete-8.7

# Need to do the following for tcl 8.5 on mac. On that configuration, the
# -readonly flag is taken so seriously that a subsequent [file delete -force]
# (required before the next test file can be executed) will fail.
#
catch {file attributes test.db -readonly 0}

finish_test
Changes to test/misc7.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 2006 September 4
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# $Id: misc7.test,v 1.15 2007/08/22 20:18:22 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

#do_test misc7-1 {
#  c_misuse_test
#} {}












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 2006 September 4
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# $Id: misc7.test,v 1.16 2007/10/05 15:53:29 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

#do_test misc7-1 {
#  c_misuse_test
#} {}
382
383
384
385
386
387
388




389
390
391
392
393
394
395
396
397
  catch {file attributes test.db-journal -permissions r--------}
  catch {file attributes test.db-journal -readonly 1}
  catchsql {
    SELECT count(*) FROM t3;
  }
} {1 {database is locked}}
do_test misc7-17.2 {




  catch {file attributes test.db-journal -permissions rw-------}
  catch {file attributes test.db-journal -readonly 0}
  catchsql {
    SELECT count(*) FROM t3;
  }
} {0 32}

set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1]
do_test misc7-17.3 {







>
>
>
>
|
|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
  catch {file attributes test.db-journal -permissions r--------}
  catch {file attributes test.db-journal -readonly 1}
  catchsql {
    SELECT count(*) FROM t3;
  }
} {1 {database is locked}}
do_test misc7-17.2 {
  # Note that the -readonly flag must be cleared before the -permissions
  # are set. Otherwise, when using tcl 8.5 on mac, the fact that the 
  # -readonly flag is set causes the attempt to set the permissions
  # to fail.
  catch {file attributes test.db-journal -readonly 0}
  catch {file attributes test.db-journal -permissions rw-------}
  catchsql {
    SELECT count(*) FROM t3;
  }
} {0 32}

set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1]
do_test misc7-17.3 {
Changes to test/temptable.test.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for temporary tables and indices.
#
# $Id: temptable.test,v 1.17 2006/01/24 00:15:16 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable !tempdb {
  finish_test
  return







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for temporary tables and indices.
#
# $Id: temptable.test,v 1.18 2007/10/05 15:53:29 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable !tempdb {
  finish_test
  return
406
407
408
409
410
411
412
413






414
file delete -force test2.db test2.db-journal
do_test temptable-7.1 {
  catchsql {
    ATTACH 'test2.db' AS two;
    CREATE TEMP TABLE two.abc(x,y);
  }
} {1 {temporary table name must be unqualified}}







finish_test








>
>
>
>
>
>

406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
file delete -force test2.db test2.db-journal
do_test temptable-7.1 {
  catchsql {
    ATTACH 'test2.db' AS two;
    CREATE TEMP TABLE two.abc(x,y);
  }
} {1 {temporary table name must be unqualified}}

# Need to do the following for tcl 8.5 on mac. On that configuration, the
# -readonly flag is taken so seriously that a subsequent [file delete -force]
# (required before the next test file can be executed) will fail.
#
catch {file attributes test.db -readonly 0}

finish_test