SQLite

Check-in [90b42eba8e]
Login

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

Overview
Comment:Add testcase() macros for coverage in date.c. (CVS 6209)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 90b42eba8e02402c342e04236148bbd5e4d93eb8
User & Date: drh 2009-01-28 02:55:29.000
Context
2009-01-28
04:46
unify TCLLIBDIR handling with libtclsqlite3.so and use libtool to install it rather than custom tclinstaller.tcl ... this integrates better with autotools and avoids relinking issues (RPATH pointing to builddir) (CVS 6210) (check-in: 3a049ca761 user: vapier tags: trunk)
02:55
Add testcase() macros for coverage in date.c. (CVS 6209) (check-in: 90b42eba8e user: drh tags: trunk)
2009-01-26
21:43
use AC_MSG_xxx funcs rather than `echo` (CVS 6208) (check-in: ed08025ad2 user: vapier tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/date.c.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
** This file contains the C functions that implement date and time
** functions for SQLite.  
**
** There is only one exported symbol in this file - the function
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.100 2009/01/20 16:53:40 danielk1977 Exp $
**
** SQLite processes all times and dates as Julian Day numbers.  The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system. 
**
** 1970-01-01 00:00:00 is JD 2440587.5







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
** This file contains the C functions that implement date and time
** functions for SQLite.  
**
** There is only one exported symbol in this file - the function
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.101 2009/01/28 02:55:29 drh Exp $
**
** SQLite processes all times and dates as Julian Day numbers.  The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system. 
**
** 1970-01-01 00:00:00 is JD 2440587.5
882
883
884
885
886
887
888




889
890
891
892
893
894
895
          break;
        default:
          return;  /* ERROR.  return a NULL */
      }
      i++;
    }
  }




  if( n<sizeof(zBuf) ){
    z = zBuf;
  }else if( n>(u64)db->aLimit[SQLITE_LIMIT_LENGTH] ){
    sqlite3_result_error_toobig(context);
    return;
  }else{
    z = sqlite3DbMallocRaw(db, (int)n);







>
>
>
>







882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
          break;
        default:
          return;  /* ERROR.  return a NULL */
      }
      i++;
    }
  }
  testcase( n==sizeof(zBuf)-1 );
  testcase( n==sizeof(zBuf) );
  testcase( n==(u64)db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
  testcase( n==(u64)db->aLimit[SQLITE_LIMIT_LENGTH] );
  if( n<sizeof(zBuf) ){
    z = zBuf;
  }else if( n>(u64)db->aLimit[SQLITE_LIMIT_LENGTH] ){
    sqlite3_result_error_toobig(context);
    return;
  }else{
    z = sqlite3DbMallocRaw(db, (int)n);