Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Improved test coverage for util.c. (CVS 2194) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ad451a2ddc7993035768f2801d590311 |
User & Date: | drh 2005-01-11 15:28:33.000 |
Context
2005-01-11
| ||
16:54 | Improved test coverage for vdbeaux.c. (CVS 2195) (check-in: 3f46cd7767 user: drh tags: trunk) | |
15:28 | Improved test coverage for util.c. (CVS 2194) (check-in: ad451a2ddc user: drh tags: trunk) | |
13:02 | Test cases to improve coverage of vdbe.c. (CVS 2193) (check-in: a6b4572207 user: danielk1977 tags: trunk) | |
Changes
Changes to src/test1.c.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** |
︙ | |||
2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 | 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC); return TCL_ERROR; } Tcl_AppendResult(interp, zFile, 0); return TCL_OK; } /* ** Usage: sqlite_set_magic DB MAGIC-NUMBER ** ** Set the db->magic value. This is used to test error recovery logic. */ static int sqlite_set_magic( void * clientData, Tcl_Interp *interp, int argc, char **argv ){ sqlite3 *db; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB MAGIC", 0); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; if( strcmp(argv[2], "SQLITE_MAGIC_OPEN")==0 ){ db->magic = SQLITE_MAGIC_OPEN; }else if( strcmp(argv[2], "SQLITE_MAGIC_CLOSED")==0 ){ db->magic = SQLITE_MAGIC_CLOSED; }else if( strcmp(argv[2], "SQLITE_MAGIC_BUSY")==0 ){ db->magic = SQLITE_MAGIC_BUSY; }else if( strcmp(argv[2], "SQLITE_MAGIC_ERROR")==0 ){ db->magic = SQLITE_MAGIC_ERROR; }else if( Tcl_GetInt(interp, argv[2], &db->magic) ){ return TCL_ERROR; } return TCL_OK; } /* ** Usage: tcl_variable_type VARIABLENAME ** ** Return the name of the internal representation for the ** value of the given variable. */ |
︙ | |||
2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 | 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 | + | { "sqlite_malloc_fail", (Tcl_CmdProc*)sqlite_malloc_fail }, { "sqlite_malloc_stat", (Tcl_CmdProc*)sqlite_malloc_stat }, #endif { "sqlite_bind", (Tcl_CmdProc*)test_bind }, { "breakpoint", (Tcl_CmdProc*)test_breakpoint }, { "sqlite3_key", (Tcl_CmdProc*)test_key }, { "sqlite3_rekey", (Tcl_CmdProc*)test_rekey }, { "sqlite_set_magic", (Tcl_CmdProc*)sqlite_set_magic }, }; static struct { char *zName; Tcl_ObjCmdProc *xProc; void *clientData; } aObjCmd[] = { { "sqlite3_bind_int", test_bind_int, 0 }, |
︙ |
Changes to src/util.c.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** |
︙ | |||
922 923 924 925 926 927 928 | 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 | + - + - - | ** Translate a single byte of Hex into an integer. */ static int hexToInt(int h){ if( h>='0' && h<='9' ){ return h - '0'; }else if( h>='a' && h<='f' ){ return h - 'a' + 10; }else{ |
︙ |
Changes to test/misc4.test.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | # #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for miscellanous features that were # left out of other test files. # |
︙ | |||
94 95 96 97 98 99 100 101 | 94 95 96 97 98 99 100 101 102 | - | INSERT INTO Table2 VALUES (1, 'a'); SELECT ID, Value FROM Table1 UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1,2 ORDER BY 1, 2; } } {{} {} 1 x 1 z} } ;# ifcapable compound |
Added test/safety.test.
|