SQLite

Check-in [c9ffbfe343]
Login

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

Overview
Comment:Fix minor problems in the test scripts and harness. (CVS 5394)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c9ffbfe343b640051161301869698dd9f1f76cb7
User & Date: drh 2008-07-11 13:53:55.000
Context
2008-07-11
16:15
Additional test coverage for the btree module. Remove the failsafe() macro and replace it with ALWAYS() and NEVER(). (CVS 5395) (check-in: d7e2f0d2d4 user: drh tags: trunk)
13:53
Fix minor problems in the test scripts and harness. (CVS 5394) (check-in: c9ffbfe343 user: drh tags: trunk)
03:38
Remove an extra zeroPage() call that was left in the previous check-in by mistake. Ticket #3209. (CVS 5393) (check-in: c45d578e44 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test9.c.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
**
** This file contains obscure tests of the C-interface required
** for completeness. Test code is written in C for these cases
** as there is not much point in binding to Tcl.
**
** $Id: test9.c,v 1.5 2008/01/23 12:52:41 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include <stdlib.h>
#include <string.h>

/*







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
**
** This file contains obscure tests of the C-interface required
** for completeness. Test code is written in C for these cases
** as there is not much point in binding to Tcl.
**
** $Id: test9.c,v 1.6 2008/07/11 13:53:55 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include <stdlib.h>
#include <string.h>

/*
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  rc = sqlite3_open(":memory:", &db);
  if( rc!=SQLITE_OK ){
    zErrFunction = "sqlite3_open";
    goto error_out;
  }

  rc = sqlite3_create_collation(db, "collate", 456, 0, 0);
  if( rc!=SQLITE_ERROR ){
    sqlite3_close(db);
    zErrFunction = "sqlite3_create_collation";
    goto error_out;
  }

  sqlite3_close(db);
  return TCL_OK;







|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  rc = sqlite3_open(":memory:", &db);
  if( rc!=SQLITE_OK ){
    zErrFunction = "sqlite3_open";
    goto error_out;
  }

  rc = sqlite3_create_collation(db, "collate", 456, 0, 0);
  if( rc!=SQLITE_MISUSE ){
    sqlite3_close(db);
    zErrFunction = "sqlite3_create_collation";
    goto error_out;
  }

  sqlite3_close(db);
  return TCL_OK;
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.20 2008/07/09 16:51:52 drh Exp $

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

do_test misc7-1-misuse {
  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.21 2008/07/11 13:53:55 drh Exp $

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

do_test misc7-1-misuse {
  c_misuse_test
} {}
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
do_test misc7-18.1 {
  execsql {
    CREATE TABLE table_1 (col_10);
    CREATE TABLE table_2 (
      col_1, col_2, col_3, col_4, col_5,
      col_6, col_7, col_8, col_9, col_10
    );
    SELECT col_10
    FROM
      (SELECT table_1.col_10 AS col_10 FROM table_1),
      (SELECT table_1.col_10, table_2.col_9 AS qcol_9
         FROM table_1, table_2
        GROUP BY table_1.col_10, qcol_9);
  }
} {}

# Testing boundary conditions on sqlite3_status()







|

|







433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
do_test misc7-18.1 {
  execsql {
    CREATE TABLE table_1 (col_10);
    CREATE TABLE table_2 (
      col_1, col_2, col_3, col_4, col_5,
      col_6, col_7, col_8, col_9, col_10
    );
    SELECT a.col_10
    FROM
      (SELECT table_1.col_10 AS col_10 FROM table_1) a,
      (SELECT table_1.col_10, table_2.col_9 AS qcol_9
         FROM table_1, table_2
        GROUP BY table_1.col_10, qcol_9);
  }
} {}

# Testing boundary conditions on sqlite3_status()
Changes to test/mutex2.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2008 July 7
#
# 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.
#
#***********************************************************************
#
# Test scripts for deliberate failures of mutex routines.
#
# $Id: mutex2.test,v 1.4 2008/07/10 18:13:43 drh Exp $

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

# deinitialize
#
catch {db close}













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2008 July 7
#
# 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.
#
#***********************************************************************
#
# Test scripts for deliberate failures of mutex routines.
#
# $Id: mutex2.test,v 1.5 2008/07/11 13:53:55 drh Exp $

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

# deinitialize
#
catch {db close}
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  sqlite3_auto_extension_sqr
} {7}
do_test mutex2-2.6 {
  sqlite3_reset_auto_extension
} {}
do_test mutex2-2.7 {
  sqlite3_malloc 10000
} {00000000}
do_test mutex2-2.8 {
  sqlite3_realloc 0 10000
} {00000000}
do_test mutex2-2.9 {
  alloc_dealloc_mutex
} {0}
do_test mutex2-2.10 {
  vfs_initfail_test
} {}








|


|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  sqlite3_auto_extension_sqr
} {7}
do_test mutex2-2.6 {
  sqlite3_reset_auto_extension
} {}
do_test mutex2-2.7 {
  sqlite3_malloc 10000
} {0}
do_test mutex2-2.8 {
  sqlite3_realloc 0 10000
} {0}
do_test mutex2-2.9 {
  alloc_dealloc_mutex
} {0}
do_test mutex2-2.10 {
  vfs_initfail_test
} {}