PageRenderTime 56ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 1ms

/trunk/src/sqlite/test/printf.test

#
Unknown | 3755 lines | 3730 code | 25 blank | 0 comment | 0 complexity | 4e9b81831e3368581a54224f96408596 MD5 | raw file
Possible License(s): BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. # 2001 September 15
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. # This file implements regression tests for SQLite library. The
  12. # focus of this file is testing the sqlite_*_printf() interface.
  13. #
  14. # $Id: printf.test,v 1.31 2009/02/01 00:21:10 drh Exp $
  15. set testdir [file dirname $argv0]
  16. source $testdir/tester.tcl
  17. do_test printf-1.1.1 {
  18. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  19. 1 1 1
  20. } {abc: 1 1 1 :xyz}
  21. do_test printf-1.1.2 {
  22. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  23. 1 1 1
  24. } {abc: ( 1) ( 1) ( 1) :xyz}
  25. do_test printf-1.1.3 {
  26. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  27. 1 1 1
  28. } {abc: (1 ) (1 ) (1 ) :xyz}
  29. do_test printf-1.1.4 {
  30. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  31. 1 1 1
  32. } {abc: ( +1) ( 1) ( 1) :xyz}
  33. do_test printf-1.1.5 {
  34. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  35. 1 1 1
  36. } {abc: (000001) (000001) (000001) :xyz}
  37. do_test printf-1.1.6 {
  38. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  39. 1 1 1
  40. } {abc: ( 1) ( 1) ( 1) :xyz}
  41. do_test printf-1.1.7 {
  42. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  43. 1 1 1
  44. } {abc: ( 1) ( 0x1) ( 01) :xyz}
  45. do_test printf-1.2.1 {
  46. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  47. 2 2 2
  48. } {abc: 2 2 2 :xyz}
  49. do_test printf-1.2.2 {
  50. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  51. 2 2 2
  52. } {abc: ( 2) ( 2) ( 2) :xyz}
  53. do_test printf-1.2.3 {
  54. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  55. 2 2 2
  56. } {abc: (2 ) (2 ) (2 ) :xyz}
  57. do_test printf-1.2.4 {
  58. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  59. 2 2 2
  60. } {abc: ( +2) ( 2) ( 2) :xyz}
  61. do_test printf-1.2.5 {
  62. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  63. 2 2 2
  64. } {abc: (000002) (000002) (000002) :xyz}
  65. do_test printf-1.2.6 {
  66. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  67. 2 2 2
  68. } {abc: ( 2) ( 2) ( 2) :xyz}
  69. do_test printf-1.2.7 {
  70. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  71. 2 2 2
  72. } {abc: ( 2) ( 0x2) ( 02) :xyz}
  73. do_test printf-1.3.1 {
  74. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  75. 5 5 5
  76. } {abc: 5 5 5 :xyz}
  77. do_test printf-1.3.2 {
  78. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  79. 5 5 5
  80. } {abc: ( 5) ( 5) ( 5) :xyz}
  81. do_test printf-1.3.3 {
  82. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  83. 5 5 5
  84. } {abc: (5 ) (5 ) (5 ) :xyz}
  85. do_test printf-1.3.4 {
  86. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  87. 5 5 5
  88. } {abc: ( +5) ( 5) ( 5) :xyz}
  89. do_test printf-1.3.5 {
  90. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  91. 5 5 5
  92. } {abc: (000005) (000005) (000005) :xyz}
  93. do_test printf-1.3.6 {
  94. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  95. 5 5 5
  96. } {abc: ( 5) ( 5) ( 5) :xyz}
  97. do_test printf-1.3.7 {
  98. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  99. 5 5 5
  100. } {abc: ( 5) ( 0x5) ( 05) :xyz}
  101. do_test printf-1.4.1 {
  102. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  103. 10 10 10
  104. } {abc: 10 a 12 :xyz}
  105. do_test printf-1.4.2 {
  106. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  107. 10 10 10
  108. } {abc: ( 10) ( a) ( 12) :xyz}
  109. do_test printf-1.4.3 {
  110. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  111. 10 10 10
  112. } {abc: (10 ) (a ) (12 ) :xyz}
  113. do_test printf-1.4.4 {
  114. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  115. 10 10 10
  116. } {abc: ( +10) ( a) ( 12) :xyz}
  117. do_test printf-1.4.5 {
  118. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  119. 10 10 10
  120. } {abc: (000010) (00000a) (000012) :xyz}
  121. do_test printf-1.4.6 {
  122. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  123. 10 10 10
  124. } {abc: ( 10) ( a) ( 12) :xyz}
  125. do_test printf-1.4.7 {
  126. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  127. 10 10 10
  128. } {abc: ( 10) ( 0xa) ( 012) :xyz}
  129. do_test printf-1.5.1 {
  130. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  131. 99 99 99
  132. } {abc: 99 63 143 :xyz}
  133. do_test printf-1.5.2 {
  134. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  135. 99 99 99
  136. } {abc: ( 99) ( 63) ( 143) :xyz}
  137. do_test printf-1.5.3 {
  138. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  139. 99 99 99
  140. } {abc: (99 ) (63 ) (143 ) :xyz}
  141. do_test printf-1.5.4 {
  142. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  143. 99 99 99
  144. } {abc: ( +99) ( 63) ( 143) :xyz}
  145. do_test printf-1.5.5 {
  146. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  147. 99 99 99
  148. } {abc: (000099) (000063) (000143) :xyz}
  149. do_test printf-1.5.6 {
  150. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  151. 99 99 99
  152. } {abc: ( 99) ( 63) ( 143) :xyz}
  153. do_test printf-1.5.7 {
  154. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  155. 99 99 99
  156. } {abc: ( 99) ( 0x63) ( 0143) :xyz}
  157. do_test printf-1.6.1 {
  158. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  159. 100 100 100
  160. } {abc: 100 64 144 :xyz}
  161. do_test printf-1.6.2 {
  162. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  163. 100 100 100
  164. } {abc: ( 100) ( 64) ( 144) :xyz}
  165. do_test printf-1.6.3 {
  166. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  167. 100 100 100
  168. } {abc: (100 ) (64 ) (144 ) :xyz}
  169. do_test printf-1.6.4 {
  170. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  171. 100 100 100
  172. } {abc: ( +100) ( 64) ( 144) :xyz}
  173. do_test printf-1.6.5 {
  174. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  175. 100 100 100
  176. } {abc: (000100) (000064) (000144) :xyz}
  177. do_test printf-1.6.6 {
  178. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  179. 100 100 100
  180. } {abc: ( 100) ( 64) ( 144) :xyz}
  181. do_test printf-1.6.7 {
  182. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  183. 100 100 100
  184. } {abc: ( 100) ( 0x64) ( 0144) :xyz}
  185. do_test printf-1.7.1 {
  186. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  187. 1000000 1000000 1000000
  188. } {abc: 1000000 f4240 3641100 :xyz}
  189. do_test printf-1.7.2 {
  190. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  191. 1000000 1000000 1000000
  192. } {abc: (1000000) ( f4240) (3641100) :xyz}
  193. do_test printf-1.7.3 {
  194. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  195. 1000000 1000000 1000000
  196. } {abc: (1000000) (f4240 ) (3641100) :xyz}
  197. do_test printf-1.7.4 {
  198. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  199. 1000000 1000000 1000000
  200. } {abc: (+1000000) ( f4240) (3641100) :xyz}
  201. do_test printf-1.7.5 {
  202. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  203. 1000000 1000000 1000000
  204. } {abc: (1000000) (0f4240) (3641100) :xyz}
  205. do_test printf-1.7.6 {
  206. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  207. 1000000 1000000 1000000
  208. } {abc: ( 1000000) ( f4240) (3641100) :xyz}
  209. do_test printf-1.7.7 {
  210. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  211. 1000000 1000000 1000000
  212. } {abc: (1000000) (0xf4240) (03641100) :xyz}
  213. do_test printf-1.8.1 {
  214. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  215. 999999999 999999999 999999999
  216. } {abc: 999999999 3b9ac9ff 7346544777 :xyz}
  217. do_test printf-1.8.2 {
  218. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  219. 999999999 999999999 999999999
  220. } {abc: (999999999) (3b9ac9ff) (7346544777) :xyz}
  221. do_test printf-1.8.3 {
  222. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  223. 999999999 999999999 999999999
  224. } {abc: (999999999) (3b9ac9ff) (7346544777) :xyz}
  225. do_test printf-1.8.4 {
  226. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  227. 999999999 999999999 999999999
  228. } {abc: (+999999999) (3b9ac9ff) (7346544777) :xyz}
  229. do_test printf-1.8.5 {
  230. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  231. 999999999 999999999 999999999
  232. } {abc: (999999999) (3b9ac9ff) (7346544777) :xyz}
  233. do_test printf-1.8.6 {
  234. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  235. 999999999 999999999 999999999
  236. } {abc: ( 999999999) (3b9ac9ff) (7346544777) :xyz}
  237. do_test printf-1.8.7 {
  238. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  239. 999999999 999999999 999999999
  240. } {abc: (999999999) (0x3b9ac9ff) (07346544777) :xyz}
  241. do_test printf-1.9.1 {
  242. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  243. 0 0 0
  244. } {abc: 0 0 0 :xyz}
  245. do_test printf-1.9.2 {
  246. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  247. 0 0 0
  248. } {abc: ( 0) ( 0) ( 0) :xyz}
  249. do_test printf-1.9.3 {
  250. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  251. 0 0 0
  252. } {abc: (0 ) (0 ) (0 ) :xyz}
  253. do_test printf-1.9.4 {
  254. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  255. 0 0 0
  256. } {abc: ( +0) ( 0) ( 0) :xyz}
  257. do_test printf-1.9.5 {
  258. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  259. 0 0 0
  260. } {abc: (000000) (000000) (000000) :xyz}
  261. do_test printf-1.9.6 {
  262. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  263. 0 0 0
  264. } {abc: ( 0) ( 0) ( 0) :xyz}
  265. do_test printf-1.9.7 {
  266. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  267. 0 0 0
  268. } {abc: ( 0) ( 0) ( 0) :xyz}
  269. # 0xffffffff == -1
  270. do_test printf-1.10.1 {
  271. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  272. 0xffffffff 0xffffffff 0xffffffff
  273. } {abc: -1 ffffffff 37777777777 :xyz}
  274. do_test printf-1.10.2 {
  275. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  276. 0xffffffff 0xffffffff 0xffffffff
  277. } {abc: ( -1) (ffffffff) (37777777777) :xyz}
  278. do_test printf-1.10.3 {
  279. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  280. 0xffffffff 0xffffffff 0xffffffff
  281. } {abc: (-1 ) (ffffffff) (37777777777) :xyz}
  282. do_test printf-1.10.4 {
  283. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  284. 0xffffffff 0xffffffff 0xffffffff
  285. } {abc: ( -1) (ffffffff) (37777777777) :xyz}
  286. do_test printf-1.10.5 {
  287. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  288. 0xffffffff 0xffffffff 0xffffffff
  289. } {abc: (-00001) (ffffffff) (37777777777) :xyz}
  290. do_test printf-1.10.6 {
  291. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  292. 0xffffffff 0xffffffff 0xffffffff
  293. } {abc: ( -1) (ffffffff) (37777777777) :xyz}
  294. do_test printf-1.10.7 {
  295. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  296. 0xffffffff 0xffffffff 0xffffffff
  297. } {abc: ( -1) (0xffffffff) (037777777777) :xyz}
  298. # 0xfffffffe == -2
  299. do_test printf-1.11.1 {
  300. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  301. 0xfffffffe 0xfffffffe 0xfffffffe
  302. } {abc: -2 fffffffe 37777777776 :xyz}
  303. do_test printf-1.11.2 {
  304. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  305. 0xfffffffe 0xfffffffe 0xfffffffe
  306. } {abc: ( -2) (fffffffe) (37777777776) :xyz}
  307. do_test printf-1.11.3 {
  308. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  309. 0xfffffffe 0xfffffffe 0xfffffffe
  310. } {abc: (-2 ) (fffffffe) (37777777776) :xyz}
  311. do_test printf-1.11.4 {
  312. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  313. 0xfffffffe 0xfffffffe 0xfffffffe
  314. } {abc: ( -2) (fffffffe) (37777777776) :xyz}
  315. do_test printf-1.11.5 {
  316. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  317. 0xfffffffe 0xfffffffe 0xfffffffe
  318. } {abc: (-00002) (fffffffe) (37777777776) :xyz}
  319. do_test printf-1.11.6 {
  320. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  321. 0xfffffffe 0xfffffffe 0xfffffffe
  322. } {abc: ( -2) (fffffffe) (37777777776) :xyz}
  323. do_test printf-1.11.7 {
  324. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  325. 0xfffffffe 0xfffffffe 0xfffffffe
  326. } {abc: ( -2) (0xfffffffe) (037777777776) :xyz}
  327. # 0xfffffffb == -5
  328. do_test printf-1.12.1 {
  329. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  330. 0xfffffffb 0xfffffffb 0xfffffffb
  331. } {abc: -5 fffffffb 37777777773 :xyz}
  332. do_test printf-1.12.2 {
  333. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  334. 0xfffffffb 0xfffffffb 0xfffffffb
  335. } {abc: ( -5) (fffffffb) (37777777773) :xyz}
  336. do_test printf-1.12.3 {
  337. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  338. 0xfffffffb 0xfffffffb 0xfffffffb
  339. } {abc: (-5 ) (fffffffb) (37777777773) :xyz}
  340. do_test printf-1.12.4 {
  341. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  342. 0xfffffffb 0xfffffffb 0xfffffffb
  343. } {abc: ( -5) (fffffffb) (37777777773) :xyz}
  344. do_test printf-1.12.5 {
  345. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  346. 0xfffffffb 0xfffffffb 0xfffffffb
  347. } {abc: (-00005) (fffffffb) (37777777773) :xyz}
  348. do_test printf-1.12.6 {
  349. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  350. 0xfffffffb 0xfffffffb 0xfffffffb
  351. } {abc: ( -5) (fffffffb) (37777777773) :xyz}
  352. do_test printf-1.12.7 {
  353. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  354. 0xfffffffb 0xfffffffb 0xfffffffb
  355. } {abc: ( -5) (0xfffffffb) (037777777773) :xyz}
  356. # 0xfffffff6 == -10
  357. do_test printf-1.13.1 {
  358. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  359. 0xfffffff6 0xfffffff6 0xfffffff6
  360. } {abc: -10 fffffff6 37777777766 :xyz}
  361. do_test printf-1.13.2 {
  362. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  363. 0xfffffff6 0xfffffff6 0xfffffff6
  364. } {abc: ( -10) (fffffff6) (37777777766) :xyz}
  365. do_test printf-1.13.3 {
  366. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  367. 0xfffffff6 0xfffffff6 0xfffffff6
  368. } {abc: (-10 ) (fffffff6) (37777777766) :xyz}
  369. do_test printf-1.13.4 {
  370. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  371. 0xfffffff6 0xfffffff6 0xfffffff6
  372. } {abc: ( -10) (fffffff6) (37777777766) :xyz}
  373. do_test printf-1.13.5 {
  374. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  375. 0xfffffff6 0xfffffff6 0xfffffff6
  376. } {abc: (-00010) (fffffff6) (37777777766) :xyz}
  377. do_test printf-1.13.6 {
  378. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  379. 0xfffffff6 0xfffffff6 0xfffffff6
  380. } {abc: ( -10) (fffffff6) (37777777766) :xyz}
  381. do_test printf-1.13.7 {
  382. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  383. 0xfffffff6 0xfffffff6 0xfffffff6
  384. } {abc: ( -10) (0xfffffff6) (037777777766) :xyz}
  385. # 0xffffff9d == -99
  386. do_test printf-1.14.1 {
  387. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  388. 0xffffff9d 0xffffff9d 0xffffff9d
  389. } {abc: -99 ffffff9d 37777777635 :xyz}
  390. do_test printf-1.14.2 {
  391. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  392. 0xffffff9d 0xffffff9d 0xffffff9d
  393. } {abc: ( -99) (ffffff9d) (37777777635) :xyz}
  394. do_test printf-1.14.3 {
  395. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  396. 0xffffff9d 0xffffff9d 0xffffff9d
  397. } {abc: (-99 ) (ffffff9d) (37777777635) :xyz}
  398. do_test printf-1.14.4 {
  399. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  400. 0xffffff9d 0xffffff9d 0xffffff9d
  401. } {abc: ( -99) (ffffff9d) (37777777635) :xyz}
  402. do_test printf-1.14.5 {
  403. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  404. 0xffffff9d 0xffffff9d 0xffffff9d
  405. } {abc: (-00099) (ffffff9d) (37777777635) :xyz}
  406. do_test printf-1.14.6 {
  407. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  408. 0xffffff9d 0xffffff9d 0xffffff9d
  409. } {abc: ( -99) (ffffff9d) (37777777635) :xyz}
  410. do_test printf-1.14.7 {
  411. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  412. 0xffffff9d 0xffffff9d 0xffffff9d
  413. } {abc: ( -99) (0xffffff9d) (037777777635) :xyz}
  414. # 0xffffff9c == -100
  415. do_test printf-1.15.1 {
  416. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  417. 0xffffff9c 0xffffff9c 0xffffff9c
  418. } {abc: -100 ffffff9c 37777777634 :xyz}
  419. do_test printf-1.15.2 {
  420. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  421. 0xffffff9c 0xffffff9c 0xffffff9c
  422. } {abc: ( -100) (ffffff9c) (37777777634) :xyz}
  423. do_test printf-1.15.3 {
  424. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  425. 0xffffff9c 0xffffff9c 0xffffff9c
  426. } {abc: (-100 ) (ffffff9c) (37777777634) :xyz}
  427. do_test printf-1.15.4 {
  428. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  429. 0xffffff9c 0xffffff9c 0xffffff9c
  430. } {abc: ( -100) (ffffff9c) (37777777634) :xyz}
  431. do_test printf-1.15.5 {
  432. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  433. 0xffffff9c 0xffffff9c 0xffffff9c
  434. } {abc: (-00100) (ffffff9c) (37777777634) :xyz}
  435. do_test printf-1.15.6 {
  436. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  437. 0xffffff9c 0xffffff9c 0xffffff9c
  438. } {abc: ( -100) (ffffff9c) (37777777634) :xyz}
  439. do_test printf-1.15.7 {
  440. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  441. 0xffffff9c 0xffffff9c 0xffffff9c
  442. } {abc: ( -100) (0xffffff9c) (037777777634) :xyz}
  443. # 0xff676981 == -9999999
  444. do_test printf-1.16.1 {
  445. sqlite3_mprintf_int {abc: %d %x %o :xyz}\
  446. 0xff676981 0xff676981 0xff676981
  447. } {abc: -9999999 ff676981 37731664601 :xyz}
  448. do_test printf-1.16.2 {
  449. sqlite3_mprintf_int {abc: (%6d) (%6x) (%6o) :xyz}\
  450. 0xff676981 0xff676981 0xff676981
  451. } {abc: (-9999999) (ff676981) (37731664601) :xyz}
  452. do_test printf-1.16.3 {
  453. sqlite3_mprintf_int {abc: (%-6d) (%-6x) (%-6o) :xyz}\
  454. 0xff676981 0xff676981 0xff676981
  455. } {abc: (-9999999) (ff676981) (37731664601) :xyz}
  456. do_test printf-1.16.4 {
  457. sqlite3_mprintf_int {abc: (%+6d) (%+6x) (%+6o) :xyz}\
  458. 0xff676981 0xff676981 0xff676981
  459. } {abc: (-9999999) (ff676981) (37731664601) :xyz}
  460. do_test printf-1.16.5 {
  461. sqlite3_mprintf_int {abc: (%06d) (%06x) (%06o) :xyz}\
  462. 0xff676981 0xff676981 0xff676981
  463. } {abc: (-9999999) (ff676981) (37731664601) :xyz}
  464. do_test printf-1.16.6 {
  465. sqlite3_mprintf_int {abc: (% 6d) (% 6x) (% 6o) :xyz}\
  466. 0xff676981 0xff676981 0xff676981
  467. } {abc: (-9999999) (ff676981) (37731664601) :xyz}
  468. do_test printf-1.16.7 {
  469. sqlite3_mprintf_int {abc: (%#6d) (%#6x) (%#6o) :xyz}\
  470. 0xff676981 0xff676981 0xff676981
  471. } {abc: (-9999999) (0xff676981) (037731664601) :xyz}
  472. do_test printf-2.1.1.1 {
  473. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 0.001
  474. } {abc: (0.0) :xyz}
  475. do_test printf-2.1.1.2 {
  476. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 0.001
  477. } {abc: (1.0e-03) :xyz}
  478. do_test printf-2.1.1.3 {
  479. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 0.001
  480. } {abc: (0.001) :xyz}
  481. do_test printf-2.1.1.4 {
  482. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 0.001
  483. } {abc: 1 1 (0.001) :xyz}
  484. do_test printf-2.1.1.5 {
  485. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 0.001
  486. } {abc: 1 1 (0.00100000) :xyz}
  487. do_test printf-2.1.1.6 {
  488. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 0.001
  489. } {abc: 1 1 (000000.001) :xyz}
  490. do_test printf-2.1.1.7 {
  491. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 0.001
  492. } {abc: 1 1 (0.0) :xyz}
  493. do_test printf-2.1.1.8 {
  494. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 0.001
  495. } {abc: 1 1 (1.0e-03) :xyz}
  496. do_test printf-2.1.1.9 {
  497. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 0.001
  498. } {abc: 1 1 (0.001) :xyz}
  499. do_test printf-2.1.2.1 {
  500. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 1.0e-20
  501. } {abc: (0.0) :xyz}
  502. do_test printf-2.1.2.2 {
  503. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 1.0e-20
  504. } {abc: (1.0e-20) :xyz}
  505. do_test printf-2.1.2.3 {
  506. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 1.0e-20
  507. } {abc: (1e-20) :xyz}
  508. do_test printf-2.1.2.4 {
  509. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 1.0e-20
  510. } {abc: 1 1 (1e-20) :xyz}
  511. do_test printf-2.1.2.5 {
  512. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 1.0e-20
  513. } {abc: 1 1 (1.00000e-20) :xyz}
  514. do_test printf-2.1.2.6 {
  515. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 1.0e-20
  516. } {abc: 1 1 (000001e-20) :xyz}
  517. do_test printf-2.1.2.7 {
  518. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 1.0e-20
  519. } {abc: 1 1 (0.0) :xyz}
  520. do_test printf-2.1.2.8 {
  521. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 1.0e-20
  522. } {abc: 1 1 (1.0e-20) :xyz}
  523. do_test printf-2.1.2.9 {
  524. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 1.0e-20
  525. } {abc: 1 1 (1e-20) :xyz}
  526. do_test printf-2.1.3.1 {
  527. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 1.0
  528. } {abc: (1.0) :xyz}
  529. do_test printf-2.1.3.2 {
  530. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 1.0
  531. } {abc: (1.0e+00) :xyz}
  532. do_test printf-2.1.3.3 {
  533. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 1.0
  534. } {abc: (1) :xyz}
  535. do_test printf-2.1.3.4 {
  536. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 1.0
  537. } {abc: 1 1 (1) :xyz}
  538. do_test printf-2.1.3.5 {
  539. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 1.0
  540. } {abc: 1 1 (1.00000) :xyz}
  541. do_test printf-2.1.3.6 {
  542. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 1.0
  543. } {abc: 1 1 (0000000001) :xyz}
  544. do_test printf-2.1.3.7 {
  545. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 1.0
  546. } {abc: 1 1 (1.0) :xyz}
  547. do_test printf-2.1.3.8 {
  548. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 1.0
  549. } {abc: 1 1 (1.0e+00) :xyz}
  550. do_test printf-2.1.3.9 {
  551. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 1.0
  552. } {abc: 1 1 (1) :xyz}
  553. do_test printf-2.1.4.1 {
  554. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 0.0
  555. } {abc: (0.0) :xyz}
  556. do_test printf-2.1.4.2 {
  557. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 0.0
  558. } {abc: (0.0e+00) :xyz}
  559. do_test printf-2.1.4.3 {
  560. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 0.0
  561. } {abc: (0) :xyz}
  562. do_test printf-2.1.4.4 {
  563. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 0.0
  564. } {abc: 1 1 (0) :xyz}
  565. do_test printf-2.1.4.5 {
  566. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 0.0
  567. } {abc: 1 1 (0.00000) :xyz}
  568. do_test printf-2.1.4.6 {
  569. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 0.0
  570. } {abc: 1 1 (0000000000) :xyz}
  571. do_test printf-2.1.4.7 {
  572. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 0.0
  573. } {abc: 1 1 (0.0) :xyz}
  574. do_test printf-2.1.4.8 {
  575. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 0.0
  576. } {abc: 1 1 (0.0e+00) :xyz}
  577. do_test printf-2.1.4.9 {
  578. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 0.0
  579. } {abc: 1 1 (0) :xyz}
  580. do_test printf-2.1.5.1 {
  581. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 100.0
  582. } {abc: (100.0) :xyz}
  583. do_test printf-2.1.5.2 {
  584. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 100.0
  585. } {abc: (1.0e+02) :xyz}
  586. do_test printf-2.1.5.3 {
  587. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 100.0
  588. } {abc: (1e+02) :xyz}
  589. do_test printf-2.1.5.4 {
  590. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 100.0
  591. } {abc: 1 1 (100) :xyz}
  592. do_test printf-2.1.5.5 {
  593. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 100.0
  594. } {abc: 1 1 (100.000) :xyz}
  595. do_test printf-2.1.5.6 {
  596. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 100.0
  597. } {abc: 1 1 (0000000100) :xyz}
  598. do_test printf-2.1.5.7 {
  599. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 100.0
  600. } {abc: 1 1 (100.0) :xyz}
  601. do_test printf-2.1.5.8 {
  602. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 100.0
  603. } {abc: 1 1 (1.0e+02) :xyz}
  604. do_test printf-2.1.5.9 {
  605. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 100.0
  606. } {abc: 1 1 (1e+02) :xyz}
  607. do_test printf-2.1.6.1 {
  608. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 9.99999
  609. } {abc: (10.0) :xyz}
  610. do_test printf-2.1.6.2 {
  611. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 9.99999
  612. } {abc: (1.0e+01) :xyz}
  613. do_test printf-2.1.6.3 {
  614. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 9.99999
  615. } {abc: (1e+01) :xyz}
  616. do_test printf-2.1.6.4 {
  617. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 9.99999
  618. } {abc: 1 1 (9.99999) :xyz}
  619. do_test printf-2.1.6.5 {
  620. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 9.99999
  621. } {abc: 1 1 (9.99999) :xyz}
  622. do_test printf-2.1.6.6 {
  623. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 9.99999
  624. } {abc: 1 1 (0009.99999) :xyz}
  625. do_test printf-2.1.6.7 {
  626. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 9.99999
  627. } {abc: 1 1 (10.0) :xyz}
  628. do_test printf-2.1.6.8 {
  629. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 9.99999
  630. } {abc: 1 1 (1.0e+01) :xyz}
  631. do_test printf-2.1.6.9 {
  632. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 9.99999
  633. } {abc: 1 1 (1e+01) :xyz}
  634. do_test printf-2.1.7.1 {
  635. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 -0.00543
  636. } {abc: (-0.0) :xyz}
  637. do_test printf-2.1.7.2 {
  638. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 -0.00543
  639. } {abc: (-5.4e-03) :xyz}
  640. do_test printf-2.1.7.3 {
  641. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 -0.00543
  642. } {abc: (-0.005) :xyz}
  643. do_test printf-2.1.7.4 {
  644. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 -0.00543
  645. } {abc: 1 1 (-0.00543) :xyz}
  646. do_test printf-2.1.7.5 {
  647. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 -0.00543
  648. } {abc: 1 1 (-0.00543000) :xyz}
  649. do_test printf-2.1.7.6 {
  650. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 -0.00543
  651. } {abc: 1 1 (-000.00543) :xyz}
  652. do_test printf-2.1.7.7 {
  653. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 -0.00543
  654. } {abc: 1 1 (-0.0) :xyz}
  655. do_test printf-2.1.7.8 {
  656. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 -0.00543
  657. } {abc: 1 1 (-5.4e-03) :xyz}
  658. do_test printf-2.1.7.9 {
  659. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 -0.00543
  660. } {abc: 1 1 (-0.005) :xyz}
  661. do_test printf-2.1.8.1 {
  662. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 -1.0
  663. } {abc: (-1.0) :xyz}
  664. do_test printf-2.1.8.2 {
  665. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 -1.0
  666. } {abc: (-1.0e+00) :xyz}
  667. do_test printf-2.1.8.3 {
  668. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 -1.0
  669. } {abc: (-1) :xyz}
  670. do_test printf-2.1.8.4 {
  671. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 -1.0
  672. } {abc: 1 1 (-1) :xyz}
  673. do_test printf-2.1.8.5 {
  674. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 -1.0
  675. } {abc: 1 1 (-1.00000) :xyz}
  676. do_test printf-2.1.8.6 {
  677. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 -1.0
  678. } {abc: 1 1 (-000000001) :xyz}
  679. do_test printf-2.1.8.7 {
  680. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 -1.0
  681. } {abc: 1 1 (-1.0) :xyz}
  682. do_test printf-2.1.8.8 {
  683. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 -1.0
  684. } {abc: 1 1 (-1.0e+00) :xyz}
  685. do_test printf-2.1.8.9 {
  686. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 -1.0
  687. } {abc: 1 1 (-1) :xyz}
  688. do_test printf-2.1.9.1 {
  689. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 -99.99999
  690. } {abc: (-100.0) :xyz}
  691. do_test printf-2.1.9.2 {
  692. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 -99.99999
  693. } {abc: (-1.0e+02) :xyz}
  694. do_test printf-2.1.9.3 {
  695. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 -99.99999
  696. } {abc: (-1e+02) :xyz}
  697. do_test printf-2.1.9.4 {
  698. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 -99.99999
  699. } {abc: 1 1 (-100) :xyz}
  700. do_test printf-2.1.9.5 {
  701. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 -99.99999
  702. } {abc: 1 1 (-100.000) :xyz}
  703. do_test printf-2.1.9.6 {
  704. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 -99.99999
  705. } {abc: 1 1 (-000000100) :xyz}
  706. do_test printf-2.1.9.7 {
  707. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 -99.99999
  708. } {abc: 1 1 (-100.0) :xyz}
  709. do_test printf-2.1.9.8 {
  710. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 -99.99999
  711. } {abc: 1 1 (-1.0e+02) :xyz}
  712. do_test printf-2.1.9.9 {
  713. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 -99.99999
  714. } {abc: 1 1 (-1e+02) :xyz}
  715. do_test printf-2.1.10.1 {
  716. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 3.14e+9
  717. } {abc: (3140000000.0) :xyz}
  718. do_test printf-2.1.10.2 {
  719. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 3.14e+9
  720. } {abc: (3.1e+09) :xyz}
  721. do_test printf-2.1.10.3 {
  722. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 3.14e+9
  723. } {abc: (3e+09) :xyz}
  724. do_test printf-2.1.10.4 {
  725. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 3.14e+9
  726. } {abc: 1 1 (3.14e+09) :xyz}
  727. do_test printf-2.1.10.5 {
  728. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 3.14e+9
  729. } {abc: 1 1 (3.14000e+09) :xyz}
  730. do_test printf-2.1.10.6 {
  731. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 3.14e+9
  732. } {abc: 1 1 (003.14e+09) :xyz}
  733. do_test printf-2.1.10.7 {
  734. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 3.14e+9
  735. } {abc: 1 1 (3140000000.0) :xyz}
  736. do_test printf-2.1.10.8 {
  737. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 3.14e+9
  738. } {abc: 1 1 (3.1e+09) :xyz}
  739. do_test printf-2.1.10.9 {
  740. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 3.14e+9
  741. } {abc: 1 1 (3e+09) :xyz}
  742. do_test printf-2.1.11.2 {
  743. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 -4.72732e+88
  744. } {abc: (-4.7e+88) :xyz}
  745. do_test printf-2.1.11.3 {
  746. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 -4.72732e+88
  747. } {abc: (-5e+88) :xyz}
  748. do_test printf-2.1.11.4 {
  749. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 -4.72732e+88
  750. } {abc: 1 1 (-4.72732e+88) :xyz}
  751. do_test printf-2.1.11.5 {
  752. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 -4.72732e+88
  753. } {abc: 1 1 (-4.72732e+88) :xyz}
  754. do_test printf-2.1.11.6 {
  755. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 -4.72732e+88
  756. } {abc: 1 1 (-4.72732e+88) :xyz}
  757. do_test printf-2.1.11.8 {
  758. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 -4.72732e+88
  759. } {abc: 1 1 (-4.7e+88) :xyz}
  760. do_test printf-2.1.11.9 {
  761. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 -4.72732e+88
  762. } {abc: 1 1 (-5e+88) :xyz}
  763. do_test printf-2.1.12.2 {
  764. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 9.87991e+143
  765. } {abc: (9.9e+143) :xyz}
  766. do_test printf-2.1.12.3 {
  767. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 9.87991e+143
  768. } {abc: (1e+144) :xyz}
  769. do_test printf-2.1.12.4 {
  770. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 9.87991e+143
  771. } {abc: 1 1 (9.87991e+143) :xyz}
  772. do_test printf-2.1.12.5 {
  773. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 9.87991e+143
  774. } {abc: 1 1 (9.87991e+143) :xyz}
  775. do_test printf-2.1.12.6 {
  776. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 9.87991e+143
  777. } {abc: 1 1 (9.87991e+143) :xyz}
  778. do_test printf-2.1.12.8 {
  779. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 9.87991e+143
  780. } {abc: 1 1 (9.9e+143) :xyz}
  781. do_test printf-2.1.12.9 {
  782. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 9.87991e+143
  783. } {abc: 1 1 (1e+144) :xyz}
  784. do_test printf-2.1.13.1 {
  785. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 -6.287291e-9
  786. } {abc: (-0.0) :xyz}
  787. do_test printf-2.1.13.2 {
  788. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 -6.287291e-9
  789. } {abc: (-6.3e-09) :xyz}
  790. do_test printf-2.1.13.3 {
  791. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 -6.287291e-9
  792. } {abc: (-6e-09) :xyz}
  793. do_test printf-2.1.13.4 {
  794. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 -6.287291e-9
  795. } {abc: 1 1 (-6.28729e-09) :xyz}
  796. do_test printf-2.1.13.5 {
  797. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 -6.287291e-9
  798. } {abc: 1 1 (-6.28729e-09) :xyz}
  799. do_test printf-2.1.13.6 {
  800. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 -6.287291e-9
  801. } {abc: 1 1 (-6.28729e-09) :xyz}
  802. do_test printf-2.1.13.7 {
  803. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 -6.287291e-9
  804. } {abc: 1 1 (-0.0) :xyz}
  805. do_test printf-2.1.13.8 {
  806. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 -6.287291e-9
  807. } {abc: 1 1 (-6.3e-09) :xyz}
  808. do_test printf-2.1.13.9 {
  809. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 -6.287291e-9
  810. } {abc: 1 1 (-6e-09) :xyz}
  811. do_test printf-2.1.14.1 {
  812. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 3.38826392e-110
  813. } {abc: (0.0) :xyz}
  814. do_test printf-2.1.14.2 {
  815. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 1 1 3.38826392e-110
  816. } {abc: (3.4e-110) :xyz}
  817. do_test printf-2.1.14.3 {
  818. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 1 1 3.38826392e-110
  819. } {abc: (3e-110) :xyz}
  820. do_test printf-2.1.14.4 {
  821. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 1 1 3.38826392e-110
  822. } {abc: 1 1 (3.38826e-110) :xyz}
  823. do_test printf-2.1.14.5 {
  824. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 1 1 3.38826392e-110
  825. } {abc: 1 1 (3.38826e-110) :xyz}
  826. do_test printf-2.1.14.6 {
  827. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 1 1 3.38826392e-110
  828. } {abc: 1 1 (3.38826e-110) :xyz}
  829. do_test printf-2.1.14.7 {
  830. sqlite3_mprintf_double {abc: %d %d (%1.1f) :xyz} 1 1 3.38826392e-110
  831. } {abc: 1 1 (0.0) :xyz}
  832. do_test printf-2.1.14.8 {
  833. sqlite3_mprintf_double {abc: %d %d (%1.1e) :xyz} 1 1 3.38826392e-110
  834. } {abc: 1 1 (3.4e-110) :xyz}
  835. do_test printf-2.1.14.9 {
  836. sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 3.38826392e-110
  837. } {abc: 1 1 (3e-110) :xyz}
  838. do_test printf-2.2.1.1 {
  839. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 0.001
  840. } {abc: (0.00100) :xyz}
  841. do_test printf-2.2.1.2 {
  842. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 0.001
  843. } {abc: (1.00000e-03) :xyz}
  844. do_test printf-2.2.1.3 {
  845. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 0.001
  846. } {abc: (0.001) :xyz}
  847. do_test printf-2.2.1.4 {
  848. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 0.001
  849. } {abc: 5 5 (0.001) :xyz}
  850. do_test printf-2.2.1.5 {
  851. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 0.001
  852. } {abc: 5 5 (0.00100000) :xyz}
  853. do_test printf-2.2.1.6 {
  854. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 0.001
  855. } {abc: 5 5 (000000.001) :xyz}
  856. do_test printf-2.2.1.7 {
  857. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 0.001
  858. } {abc: 5 5 (0.00100) :xyz}
  859. do_test printf-2.2.1.8 {
  860. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 0.001
  861. } {abc: 5 5 (1.00000e-03) :xyz}
  862. do_test printf-2.2.1.9 {
  863. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 0.001
  864. } {abc: 5 5 (0.001) :xyz}
  865. do_test printf-2.2.2.1 {
  866. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 1.0e-20
  867. } {abc: (0.00000) :xyz}
  868. do_test printf-2.2.2.2 {
  869. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 1.0e-20
  870. } {abc: (1.00000e-20) :xyz}
  871. do_test printf-2.2.2.3 {
  872. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 1.0e-20
  873. } {abc: (1e-20) :xyz}
  874. do_test printf-2.2.2.4 {
  875. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 1.0e-20
  876. } {abc: 5 5 (1e-20) :xyz}
  877. do_test printf-2.2.2.5 {
  878. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 1.0e-20
  879. } {abc: 5 5 (1.00000e-20) :xyz}
  880. do_test printf-2.2.2.6 {
  881. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 1.0e-20
  882. } {abc: 5 5 (000001e-20) :xyz}
  883. do_test printf-2.2.2.7 {
  884. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 1.0e-20
  885. } {abc: 5 5 (0.00000) :xyz}
  886. do_test printf-2.2.2.8 {
  887. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 1.0e-20
  888. } {abc: 5 5 (1.00000e-20) :xyz}
  889. do_test printf-2.2.2.9 {
  890. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 1.0e-20
  891. } {abc: 5 5 (1e-20) :xyz}
  892. do_test printf-2.2.3.1 {
  893. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 1.0
  894. } {abc: (1.00000) :xyz}
  895. do_test printf-2.2.3.2 {
  896. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 1.0
  897. } {abc: (1.00000e+00) :xyz}
  898. do_test printf-2.2.3.3 {
  899. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 1.0
  900. } {abc: ( 1) :xyz}
  901. do_test printf-2.2.3.4 {
  902. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 1.0
  903. } {abc: 5 5 (1) :xyz}
  904. do_test printf-2.2.3.5 {
  905. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 1.0
  906. } {abc: 5 5 (1.00000) :xyz}
  907. do_test printf-2.2.3.6 {
  908. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 1.0
  909. } {abc: 5 5 (0000000001) :xyz}
  910. do_test printf-2.2.3.7 {
  911. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 1.0
  912. } {abc: 5 5 (1.00000) :xyz}
  913. do_test printf-2.2.3.8 {
  914. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 1.0
  915. } {abc: 5 5 (1.00000e+00) :xyz}
  916. do_test printf-2.2.3.9 {
  917. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 1.0
  918. } {abc: 5 5 ( 1) :xyz}
  919. do_test printf-2.2.4.1 {
  920. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 0.0
  921. } {abc: (0.00000) :xyz}
  922. do_test printf-2.2.4.2 {
  923. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 0.0
  924. } {abc: (0.00000e+00) :xyz}
  925. do_test printf-2.2.4.3 {
  926. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 0.0
  927. } {abc: ( 0) :xyz}
  928. do_test printf-2.2.4.4 {
  929. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 0.0
  930. } {abc: 5 5 (0) :xyz}
  931. do_test printf-2.2.4.5 {
  932. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 0.0
  933. } {abc: 5 5 (0.00000) :xyz}
  934. do_test printf-2.2.4.6 {
  935. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 0.0
  936. } {abc: 5 5 (0000000000) :xyz}
  937. do_test printf-2.2.4.7 {
  938. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 0.0
  939. } {abc: 5 5 (0.00000) :xyz}
  940. do_test printf-2.2.4.8 {
  941. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 0.0
  942. } {abc: 5 5 (0.00000e+00) :xyz}
  943. do_test printf-2.2.4.9 {
  944. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 0.0
  945. } {abc: 5 5 ( 0) :xyz}
  946. do_test printf-2.2.5.1 {
  947. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 100.0
  948. } {abc: (100.00000) :xyz}
  949. do_test printf-2.2.5.2 {
  950. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 100.0
  951. } {abc: (1.00000e+02) :xyz}
  952. do_test printf-2.2.5.3 {
  953. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 100.0
  954. } {abc: ( 100) :xyz}
  955. do_test printf-2.2.5.4 {
  956. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 100.0
  957. } {abc: 5 5 (100) :xyz}
  958. do_test printf-2.2.5.5 {
  959. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 100.0
  960. } {abc: 5 5 (100.000) :xyz}
  961. do_test printf-2.2.5.6 {
  962. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 100.0
  963. } {abc: 5 5 (0000000100) :xyz}
  964. do_test printf-2.2.5.7 {
  965. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 100.0
  966. } {abc: 5 5 (100.00000) :xyz}
  967. do_test printf-2.2.5.8 {
  968. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 100.0
  969. } {abc: 5 5 (1.00000e+02) :xyz}
  970. do_test printf-2.2.5.9 {
  971. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 100.0
  972. } {abc: 5 5 ( 100) :xyz}
  973. do_test printf-2.2.6.1 {
  974. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 9.99999
  975. } {abc: (9.99999) :xyz}
  976. do_test printf-2.2.6.2 {
  977. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 9.99999
  978. } {abc: (9.99999e+00) :xyz}
  979. do_test printf-2.2.6.3 {
  980. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 9.99999
  981. } {abc: ( 10) :xyz}
  982. do_test printf-2.2.6.4 {
  983. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 9.99999
  984. } {abc: 5 5 (9.99999) :xyz}
  985. do_test printf-2.2.6.5 {
  986. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 9.99999
  987. } {abc: 5 5 (9.99999) :xyz}
  988. do_test printf-2.2.6.6 {
  989. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 9.99999
  990. } {abc: 5 5 (0009.99999) :xyz}
  991. do_test printf-2.2.6.7 {
  992. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 9.99999
  993. } {abc: 5 5 (9.99999) :xyz}
  994. do_test printf-2.2.6.8 {
  995. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 9.99999
  996. } {abc: 5 5 (9.99999e+00) :xyz}
  997. do_test printf-2.2.6.9 {
  998. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 9.99999
  999. } {abc: 5 5 ( 10) :xyz}
  1000. do_test printf-2.2.7.1 {
  1001. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 -0.00543
  1002. } {abc: (-0.00543) :xyz}
  1003. do_test printf-2.2.7.2 {
  1004. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 -0.00543
  1005. } {abc: (-5.43000e-03) :xyz}
  1006. do_test printf-2.2.7.3 {
  1007. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 -0.00543
  1008. } {abc: (-0.00543) :xyz}
  1009. do_test printf-2.2.7.4 {
  1010. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 -0.00543
  1011. } {abc: 5 5 (-0.00543) :xyz}
  1012. do_test printf-2.2.7.5 {
  1013. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 -0.00543
  1014. } {abc: 5 5 (-0.00543000) :xyz}
  1015. do_test printf-2.2.7.6 {
  1016. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 -0.00543
  1017. } {abc: 5 5 (-000.00543) :xyz}
  1018. do_test printf-2.2.7.7 {
  1019. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 -0.00543
  1020. } {abc: 5 5 (-0.00543) :xyz}
  1021. do_test printf-2.2.7.8 {
  1022. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 -0.00543
  1023. } {abc: 5 5 (-5.43000e-03) :xyz}
  1024. do_test printf-2.2.7.9 {
  1025. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 -0.00543
  1026. } {abc: 5 5 (-0.00543) :xyz}
  1027. do_test printf-2.2.8.1 {
  1028. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 -1.0
  1029. } {abc: (-1.00000) :xyz}
  1030. do_test printf-2.2.8.2 {
  1031. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 -1.0
  1032. } {abc: (-1.00000e+00) :xyz}
  1033. do_test printf-2.2.8.3 {
  1034. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 -1.0
  1035. } {abc: ( -1) :xyz}
  1036. do_test printf-2.2.8.4 {
  1037. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 -1.0
  1038. } {abc: 5 5 (-1) :xyz}
  1039. do_test printf-2.2.8.5 {
  1040. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 -1.0
  1041. } {abc: 5 5 (-1.00000) :xyz}
  1042. do_test printf-2.2.8.6 {
  1043. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 -1.0
  1044. } {abc: 5 5 (-000000001) :xyz}
  1045. do_test printf-2.2.8.7 {
  1046. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 -1.0
  1047. } {abc: 5 5 (-1.00000) :xyz}
  1048. do_test printf-2.2.8.8 {
  1049. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 -1.0
  1050. } {abc: 5 5 (-1.00000e+00) :xyz}
  1051. do_test printf-2.2.8.9 {
  1052. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 -1.0
  1053. } {abc: 5 5 ( -1) :xyz}
  1054. do_test printf-2.2.9.1 {
  1055. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 -99.99999
  1056. } {abc: (-99.99999) :xyz}
  1057. do_test printf-2.2.9.2 {
  1058. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 -99.99999
  1059. } {abc: (-1.00000e+02) :xyz}
  1060. do_test printf-2.2.9.3 {
  1061. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 -99.99999
  1062. } {abc: ( -100) :xyz}
  1063. do_test printf-2.2.9.4 {
  1064. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 -99.99999
  1065. } {abc: 5 5 (-100) :xyz}
  1066. do_test printf-2.2.9.5 {
  1067. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 -99.99999
  1068. } {abc: 5 5 (-100.000) :xyz}
  1069. do_test printf-2.2.9.6 {
  1070. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 -99.99999
  1071. } {abc: 5 5 (-000000100) :xyz}
  1072. do_test printf-2.2.9.7 {
  1073. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 -99.99999
  1074. } {abc: 5 5 (-99.99999) :xyz}
  1075. do_test printf-2.2.9.8 {
  1076. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 -99.99999
  1077. } {abc: 5 5 (-1.00000e+02) :xyz}
  1078. do_test printf-2.2.9.9 {
  1079. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 -99.99999
  1080. } {abc: 5 5 ( -100) :xyz}
  1081. do_test printf-2.2.10.1 {
  1082. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 3.14e+9
  1083. } {abc: (3140000000.00000) :xyz}
  1084. do_test printf-2.2.10.2 {
  1085. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 3.14e+9
  1086. } {abc: (3.14000e+09) :xyz}
  1087. do_test printf-2.2.10.3 {
  1088. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 3.14e+9
  1089. } {abc: (3.14e+09) :xyz}
  1090. do_test printf-2.2.10.4 {
  1091. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 3.14e+9
  1092. } {abc: 5 5 (3.14e+09) :xyz}
  1093. do_test printf-2.2.10.5 {
  1094. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 3.14e+9
  1095. } {abc: 5 5 (3.14000e+09) :xyz}
  1096. do_test printf-2.2.10.6 {
  1097. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 3.14e+9
  1098. } {abc: 5 5 (003.14e+09) :xyz}
  1099. do_test printf-2.2.10.7 {
  1100. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 3.14e+9
  1101. } {abc: 5 5 (3140000000.00000) :xyz}
  1102. do_test printf-2.2.10.8 {
  1103. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 3.14e+9
  1104. } {abc: 5 5 (3.14000e+09) :xyz}
  1105. do_test printf-2.2.10.9 {
  1106. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 3.14e+9
  1107. } {abc: 5 5 (3.14e+09) :xyz}
  1108. do_test printf-2.2.11.2 {
  1109. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 -4.72732e+88
  1110. } {abc: (-4.72732e+88) :xyz}
  1111. do_test printf-2.2.11.3 {
  1112. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 -4.72732e+88
  1113. } {abc: (-4.7273e+88) :xyz}
  1114. do_test printf-2.2.11.4 {
  1115. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 -4.72732e+88
  1116. } {abc: 5 5 (-4.72732e+88) :xyz}
  1117. do_test printf-2.2.11.5 {
  1118. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 -4.72732e+88
  1119. } {abc: 5 5 (-4.72732e+88) :xyz}
  1120. do_test printf-2.2.11.6 {
  1121. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 -4.72732e+88
  1122. } {abc: 5 5 (-4.72732e+88) :xyz}
  1123. do_test printf-2.2.11.8 {
  1124. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 -4.72732e+88
  1125. } {abc: 5 5 (-4.72732e+88) :xyz}
  1126. do_test printf-2.2.11.9 {
  1127. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 -4.72732e+88
  1128. } {abc: 5 5 (-4.7273e+88) :xyz}
  1129. do_test printf-2.2.12.2 {
  1130. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 9.87991e+143
  1131. } {abc: (9.87991e+143) :xyz}
  1132. do_test printf-2.2.12.3 {
  1133. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 9.87991e+143
  1134. } {abc: (9.8799e+143) :xyz}
  1135. do_test printf-2.2.12.4 {
  1136. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 9.87991e+143
  1137. } {abc: 5 5 (9.87991e+143) :xyz}
  1138. do_test printf-2.2.12.5 {
  1139. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 9.87991e+143
  1140. } {abc: 5 5 (9.87991e+143) :xyz}
  1141. do_test printf-2.2.12.6 {
  1142. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 9.87991e+143
  1143. } {abc: 5 5 (9.87991e+143) :xyz}
  1144. do_test printf-2.2.12.8 {
  1145. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 9.87991e+143
  1146. } {abc: 5 5 (9.87991e+143) :xyz}
  1147. do_test printf-2.2.12.9 {
  1148. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 9.87991e+143
  1149. } {abc: 5 5 (9.8799e+143) :xyz}
  1150. do_test printf-2.2.13.1 {
  1151. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 -6.287291e-9
  1152. } {abc: (-0.00000) :xyz}
  1153. do_test printf-2.2.13.2 {
  1154. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 -6.287291e-9
  1155. } {abc: (-6.28729e-09) :xyz}
  1156. do_test printf-2.2.13.3 {
  1157. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 -6.287291e-9
  1158. } {abc: (-6.2873e-09) :xyz}
  1159. do_test printf-2.2.13.4 {
  1160. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 -6.287291e-9
  1161. } {abc: 5 5 (-6.28729e-09) :xyz}
  1162. do_test printf-2.2.13.5 {
  1163. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 -6.287291e-9
  1164. } {abc: 5 5 (-6.28729e-09) :xyz}
  1165. do_test printf-2.2.13.6 {
  1166. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 -6.287291e-9
  1167. } {abc: 5 5 (-6.28729e-09) :xyz}
  1168. do_test printf-2.2.13.7 {
  1169. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 -6.287291e-9
  1170. } {abc: 5 5 (-0.00000) :xyz}
  1171. do_test printf-2.2.13.8 {
  1172. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 -6.287291e-9
  1173. } {abc: 5 5 (-6.28729e-09) :xyz}
  1174. do_test printf-2.2.13.9 {
  1175. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 -6.287291e-9
  1176. } {abc: 5 5 (-6.2873e-09) :xyz}
  1177. do_test printf-2.2.14.1 {
  1178. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 5 5 3.38826392e-110
  1179. } {abc: (0.00000) :xyz}
  1180. do_test printf-2.2.14.2 {
  1181. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 5 5 3.38826392e-110
  1182. } {abc: (3.38826e-110) :xyz}
  1183. do_test printf-2.2.14.3 {
  1184. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 5 5 3.38826392e-110
  1185. } {abc: (3.3883e-110) :xyz}
  1186. do_test printf-2.2.14.4 {
  1187. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 5 5 3.38826392e-110
  1188. } {abc: 5 5 (3.38826e-110) :xyz}
  1189. do_test printf-2.2.14.5 {
  1190. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 5 5 3.38826392e-110
  1191. } {abc: 5 5 (3.38826e-110) :xyz}
  1192. do_test printf-2.2.14.6 {
  1193. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 5 5 3.38826392e-110
  1194. } {abc: 5 5 (3.38826e-110) :xyz}
  1195. do_test printf-2.2.14.7 {
  1196. sqlite3_mprintf_double {abc: %d %d (%5.5f) :xyz} 5 5 3.38826392e-110
  1197. } {abc: 5 5 (0.00000) :xyz}
  1198. do_test printf-2.2.14.8 {
  1199. sqlite3_mprintf_double {abc: %d %d (%5.5e) :xyz} 5 5 3.38826392e-110
  1200. } {abc: 5 5 (3.38826e-110) :xyz}
  1201. do_test printf-2.2.14.9 {
  1202. sqlite3_mprintf_double {abc: %d %d (%5.5g) :xyz} 5 5 3.38826392e-110
  1203. } {abc: 5 5 (3.3883e-110) :xyz}
  1204. do_test printf-2.3.1.1 {
  1205. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 0.001
  1206. } {abc: (0.0010000000) :xyz}
  1207. do_test printf-2.3.1.2 {
  1208. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 0.001
  1209. } {abc: (1.0000000000e-03) :xyz}
  1210. do_test printf-2.3.1.3 {
  1211. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 0.001
  1212. } {abc: ( 0.001) :xyz}
  1213. do_test printf-2.3.1.4 {
  1214. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 0.001
  1215. } {abc: 10 10 (0.001) :xyz}
  1216. do_test printf-2.3.1.5 {
  1217. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 0.001
  1218. } {abc: 10 10 (0.00100000) :xyz}
  1219. do_test printf-2.3.1.6 {
  1220. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 0.001
  1221. } {abc: 10 10 (000000.001) :xyz}
  1222. do_test printf-2.3.1.7 {
  1223. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 0.001
  1224. } {abc: 10 10 (0.0010000000) :xyz}
  1225. do_test printf-2.3.1.8 {
  1226. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 0.001
  1227. } {abc: 10 10 (1.0000000000e-03) :xyz}
  1228. do_test printf-2.3.1.9 {
  1229. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 0.001
  1230. } {abc: 10 10 ( 0.001) :xyz}
  1231. do_test printf-2.3.2.1 {
  1232. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 1.0e-20
  1233. } {abc: (0.0000000000) :xyz}
  1234. do_test printf-2.3.2.2 {
  1235. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 1.0e-20
  1236. } {abc: (1.0000000000e-20) :xyz}
  1237. do_test printf-2.3.2.3 {
  1238. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 1.0e-20
  1239. } {abc: ( 1e-20) :xyz}
  1240. do_test printf-2.3.2.4 {
  1241. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 1.0e-20
  1242. } {abc: 10 10 (1e-20) :xyz}
  1243. do_test printf-2.3.2.5 {
  1244. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 1.0e-20
  1245. } {abc: 10 10 (1.00000e-20) :xyz}
  1246. do_test printf-2.3.2.6 {
  1247. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 1.0e-20
  1248. } {abc: 10 10 (000001e-20) :xyz}
  1249. do_test printf-2.3.2.7 {
  1250. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 1.0e-20
  1251. } {abc: 10 10 (0.0000000000) :xyz}
  1252. do_test printf-2.3.2.8 {
  1253. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 1.0e-20
  1254. } {abc: 10 10 (1.0000000000e-20) :xyz}
  1255. do_test printf-2.3.2.9 {
  1256. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 1.0e-20
  1257. } {abc: 10 10 ( 1e-20) :xyz}
  1258. do_test printf-2.3.3.1 {
  1259. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 1.0
  1260. } {abc: (1.0000000000) :xyz}
  1261. do_test printf-2.3.3.2 {
  1262. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 1.0
  1263. } {abc: (1.0000000000e+00) :xyz}
  1264. do_test printf-2.3.3.3 {
  1265. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 1.0
  1266. } {abc: ( 1) :xyz}
  1267. do_test printf-2.3.3.4 {
  1268. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 1.0
  1269. } {abc: 10 10 (1) :xyz}
  1270. do_test printf-2.3.3.5 {
  1271. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 1.0
  1272. } {abc: 10 10 (1.00000) :xyz}
  1273. do_test printf-2.3.3.6 {
  1274. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 1.0
  1275. } {abc: 10 10 (0000000001) :xyz}
  1276. do_test printf-2.3.3.7 {
  1277. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 1.0
  1278. } {abc: 10 10 (1.0000000000) :xyz}
  1279. do_test printf-2.3.3.8 {
  1280. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 1.0
  1281. } {abc: 10 10 (1.0000000000e+00) :xyz}
  1282. do_test printf-2.3.3.9 {
  1283. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 1.0
  1284. } {abc: 10 10 ( 1) :xyz}
  1285. do_test printf-2.3.4.1 {
  1286. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 0.0
  1287. } {abc: (0.0000000000) :xyz}
  1288. do_test printf-2.3.4.2 {
  1289. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 0.0
  1290. } {abc: (0.0000000000e+00) :xyz}
  1291. do_test printf-2.3.4.3 {
  1292. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 0.0
  1293. } {abc: ( 0) :xyz}
  1294. do_test printf-2.3.4.4 {
  1295. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 0.0
  1296. } {abc: 10 10 (0) :xyz}
  1297. do_test printf-2.3.4.5 {
  1298. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 0.0
  1299. } {abc: 10 10 (0.00000) :xyz}
  1300. do_test printf-2.3.4.6 {
  1301. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 0.0
  1302. } {abc: 10 10 (0000000000) :xyz}
  1303. do_test printf-2.3.4.7 {
  1304. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 0.0
  1305. } {abc: 10 10 (0.0000000000) :xyz}
  1306. do_test printf-2.3.4.8 {
  1307. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 0.0
  1308. } {abc: 10 10 (0.0000000000e+00) :xyz}
  1309. do_test printf-2.3.4.9 {
  1310. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 0.0
  1311. } {abc: 10 10 ( 0) :xyz}
  1312. do_test printf-2.3.5.1 {
  1313. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 100.0
  1314. } {abc: (100.0000000000) :xyz}
  1315. do_test printf-2.3.5.2 {
  1316. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 100.0
  1317. } {abc: (1.0000000000e+02) :xyz}
  1318. do_test printf-2.3.5.3 {
  1319. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 100.0
  1320. } {abc: ( 100) :xyz}
  1321. do_test printf-2.3.5.4 {
  1322. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 100.0
  1323. } {abc: 10 10 (100) :xyz}
  1324. do_test printf-2.3.5.5 {
  1325. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 100.0
  1326. } {ab

Large files files are truncated, but you can click here to view the full file