SQLite

Check-in [a3cc027fa7]
Login

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

Overview
Comment:Enhancements to the hex literal tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | hex-literal
Files: files | file ages | folders
SHA1: a3cc027fa7ca41da23ecd0770a075a48416af020
User & Date: mistachkin 2014-07-23 19:04:25.426
Context
2014-07-24
12:19
Add support for hexadecimal integer literals in the parser. (check-in: f8f79f2878 user: drh tags: trunk)
2014-07-23
19:04
Enhancements to the hex literal tests. (Closed-Leaf check-in: a3cc027fa7 user: mistachkin tags: hex-literal)
14:52
Remove a surplus function prototype. #ifdef code that is not used when hex integers are omitted at compile time. (check-in: a5b383e077 user: drh tags: hex-literal)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/hexlit.test.
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
hexlit1 157 0x200000000000000 144115188075855872
hexlit1 158 0x400000000000000 288230376151711744
hexlit1 159 0x800000000000000 576460752303423488
hexlit1 160 0X1000000000000000 1152921504606846976
hexlit1 161 0x2000000000000000 2305843009213693952
hexlit1 162 0X4000000000000000 4611686018427387904
hexlit1 163 0x8000000000000000 -9223372036854775808


hexlit1 200 0x001 1
hexlit1 201 0X002 2
hexlit1 202 0x003 3
hexlit1 203 0X004 4
hexlit1 204 0x005 5
hexlit1 205 0X006 6
hexlit1 206 0x007 7
hexlit1 207 0X008 8
hexlit1 208 0x009 9
hexlit1 209 0x00a 10
hexlit1 210 0x00A 10
hexlit1 211 0x00b 11
hexlit1 212 0x00B 11
hexlit1 213 0x00c 12
hexlit1 214 0x00C 12
hexlit1 215 0x00d 13
hexlit1 216 0x00D 13
hexlit1 217 0x00e 14
hexlit1 218 0x00E 14 
hexlit1 219 0x00f 15
hexlit1 220 0x00F 15


# String literals that look like hex do not get cast or coerced.
#
do_execsql_test hexlit-300 {
  CREATE TABLE t1(x INT, y REAL);
  INSERT INTO t1 VALUES('1234','4567'),('0x1234','0x4567');
  SELECT typeof(x), x, typeof(y), y, '#' FROM t1 ORDER BY rowid;







>

|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
















94
95
96
97
98
99
100
101
hexlit1 157 0x200000000000000 144115188075855872
hexlit1 158 0x400000000000000 288230376151711744
hexlit1 159 0x800000000000000 576460752303423488
hexlit1 160 0X1000000000000000 1152921504606846976
hexlit1 161 0x2000000000000000 2305843009213693952
hexlit1 162 0X4000000000000000 4611686018427387904
hexlit1 163 0x8000000000000000 -9223372036854775808
hexlit1 164 0XFFFFFFFFFFFFFFFF -1

for {set n 1} {$n < 0x10} {incr n} {
  hexlit1 200.$n.1 0X[format %03X $n] $n
  hexlit1 200.$n.2 0x[format %03X $n] $n
  hexlit1 200.$n.3 0X[format %03x $n] $n
  hexlit1 200.$n.4 0x[format %03x $n] $n
















}

# String literals that look like hex do not get cast or coerced.
#
do_execsql_test hexlit-300 {
  CREATE TABLE t1(x INT, y REAL);
  INSERT INTO t1 VALUES('1234','4567'),('0x1234','0x4567');
  SELECT typeof(x), x, typeof(y), y, '#' FROM t1 ORDER BY rowid;