PageRenderTime 78ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  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. } {abc: 10 10 (100.000) :xyz}
  1327. do_test printf-2.3.5.6 {
  1328. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 100.0
  1329. } {abc: 10 10 (0000000100) :xyz}
  1330. do_test printf-2.3.5.7 {
  1331. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 100.0
  1332. } {abc: 10 10 (100.0000000000) :xyz}
  1333. do_test printf-2.3.5.8 {
  1334. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 100.0
  1335. } {abc: 10 10 (1.0000000000e+02) :xyz}
  1336. do_test printf-2.3.5.9 {
  1337. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 100.0
  1338. } {abc: 10 10 ( 100) :xyz}
  1339. do_test printf-2.3.6.1 {
  1340. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 9.99999
  1341. } {abc: (9.9999900000) :xyz}
  1342. do_test printf-2.3.6.2 {
  1343. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 9.99999
  1344. } {abc: (9.9999900000e+00) :xyz}
  1345. do_test printf-2.3.6.3 {
  1346. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 9.99999
  1347. } {abc: ( 9.99999) :xyz}
  1348. do_test printf-2.3.6.4 {
  1349. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 9.99999
  1350. } {abc: 10 10 (9.99999) :xyz}
  1351. do_test printf-2.3.6.5 {
  1352. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 9.99999
  1353. } {abc: 10 10 (9.99999) :xyz}
  1354. do_test printf-2.3.6.6 {
  1355. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 9.99999
  1356. } {abc: 10 10 (0009.99999) :xyz}
  1357. do_test printf-2.3.6.7 {
  1358. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 9.99999
  1359. } {abc: 10 10 (9.9999900000) :xyz}
  1360. do_test printf-2.3.6.8 {
  1361. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 9.99999
  1362. } {abc: 10 10 (9.9999900000e+00) :xyz}
  1363. do_test printf-2.3.6.9 {
  1364. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 9.99999
  1365. } {abc: 10 10 ( 9.99999) :xyz}
  1366. do_test printf-2.3.7.1 {
  1367. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 -0.00543
  1368. } {abc: (-0.0054300000) :xyz}
  1369. do_test printf-2.3.7.2 {
  1370. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 -0.00543
  1371. } {abc: (-5.4300000000e-03) :xyz}
  1372. do_test printf-2.3.7.3 {
  1373. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 -0.00543
  1374. } {abc: ( -0.00543) :xyz}
  1375. do_test printf-2.3.7.4 {
  1376. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 -0.00543
  1377. } {abc: 10 10 (-0.00543) :xyz}
  1378. do_test printf-2.3.7.5 {
  1379. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 -0.00543
  1380. } {abc: 10 10 (-0.00543000) :xyz}
  1381. do_test printf-2.3.7.6 {
  1382. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 -0.00543
  1383. } {abc: 10 10 (-000.00543) :xyz}
  1384. do_test printf-2.3.7.7 {
  1385. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 -0.00543
  1386. } {abc: 10 10 (-0.0054300000) :xyz}
  1387. do_test printf-2.3.7.8 {
  1388. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 -0.00543
  1389. } {abc: 10 10 (-5.4300000000e-03) :xyz}
  1390. do_test printf-2.3.7.9 {
  1391. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 -0.00543
  1392. } {abc: 10 10 ( -0.00543) :xyz}
  1393. do_test printf-2.3.8.1 {
  1394. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 -1.0
  1395. } {abc: (-1.0000000000) :xyz}
  1396. do_test printf-2.3.8.2 {
  1397. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 -1.0
  1398. } {abc: (-1.0000000000e+00) :xyz}
  1399. do_test printf-2.3.8.3 {
  1400. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 -1.0
  1401. } {abc: ( -1) :xyz}
  1402. do_test printf-2.3.8.4 {
  1403. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 -1.0
  1404. } {abc: 10 10 (-1) :xyz}
  1405. do_test printf-2.3.8.5 {
  1406. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 -1.0
  1407. } {abc: 10 10 (-1.00000) :xyz}
  1408. do_test printf-2.3.8.6 {
  1409. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 -1.0
  1410. } {abc: 10 10 (-000000001) :xyz}
  1411. do_test printf-2.3.8.7 {
  1412. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 -1.0
  1413. } {abc: 10 10 (-1.0000000000) :xyz}
  1414. do_test printf-2.3.8.8 {
  1415. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 -1.0
  1416. } {abc: 10 10 (-1.0000000000e+00) :xyz}
  1417. do_test printf-2.3.8.9 {
  1418. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 -1.0
  1419. } {abc: 10 10 ( -1) :xyz}
  1420. do_test printf-2.3.9.1 {
  1421. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 -99.99999
  1422. } {abc: (-99.9999900000) :xyz}
  1423. do_test printf-2.3.9.2 {
  1424. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 -99.99999
  1425. } {abc: (-9.9999990000e+01) :xyz}
  1426. do_test printf-2.3.9.3 {
  1427. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 -99.99999
  1428. } {abc: ( -99.99999) :xyz}
  1429. do_test printf-2.3.9.4 {
  1430. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 -99.99999
  1431. } {abc: 10 10 (-100) :xyz}
  1432. do_test printf-2.3.9.5 {
  1433. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 -99.99999
  1434. } {abc: 10 10 (-100.000) :xyz}
  1435. do_test printf-2.3.9.6 {
  1436. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 -99.99999
  1437. } {abc: 10 10 (-000000100) :xyz}
  1438. do_test printf-2.3.9.7 {
  1439. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 -99.99999
  1440. } {abc: 10 10 (-99.9999900000) :xyz}
  1441. do_test printf-2.3.9.8 {
  1442. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 -99.99999
  1443. } {abc: 10 10 (-9.9999990000e+01) :xyz}
  1444. do_test printf-2.3.9.9 {
  1445. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 -99.99999
  1446. } {abc: 10 10 ( -99.99999) :xyz}
  1447. do_test printf-2.3.10.1 {
  1448. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 3.14e+9
  1449. } {abc: (3140000000.0000000000) :xyz}
  1450. do_test printf-2.3.10.2 {
  1451. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 3.14e+9
  1452. } {abc: (3.1400000000e+09) :xyz}
  1453. do_test printf-2.3.10.3 {
  1454. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 3.14e+9
  1455. } {abc: (3140000000) :xyz}
  1456. do_test printf-2.3.10.4 {
  1457. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 3.14e+9
  1458. } {abc: 10 10 (3.14e+09) :xyz}
  1459. do_test printf-2.3.10.5 {
  1460. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 3.14e+9
  1461. } {abc: 10 10 (3.14000e+09) :xyz}
  1462. do_test printf-2.3.10.6 {
  1463. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 3.14e+9
  1464. } {abc: 10 10 (003.14e+09) :xyz}
  1465. do_test printf-2.3.10.7 {
  1466. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 3.14e+9
  1467. } {abc: 10 10 (3140000000.0000000000) :xyz}
  1468. do_test printf-2.3.10.8 {
  1469. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 3.14e+9
  1470. } {abc: 10 10 (3.1400000000e+09) :xyz}
  1471. do_test printf-2.3.10.9 {
  1472. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 3.14e+9
  1473. } {abc: 10 10 (3140000000) :xyz}
  1474. do_test printf-2.3.11.2 {
  1475. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 -4.72732e+88
  1476. } {abc: (-4.7273200000e+88) :xyz}
  1477. do_test printf-2.3.11.3 {
  1478. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 -4.72732e+88
  1479. } {abc: (-4.72732e+88) :xyz}
  1480. do_test printf-2.3.11.4 {
  1481. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 -4.72732e+88
  1482. } {abc: 10 10 (-4.72732e+88) :xyz}
  1483. do_test printf-2.3.11.5 {
  1484. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 -4.72732e+88
  1485. } {abc: 10 10 (-4.72732e+88) :xyz}
  1486. do_test printf-2.3.11.6 {
  1487. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 -4.72732e+88
  1488. } {abc: 10 10 (-4.72732e+88) :xyz}
  1489. do_test printf-2.3.11.8 {
  1490. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 -4.72732e+88
  1491. } {abc: 10 10 (-4.7273200000e+88) :xyz}
  1492. do_test printf-2.3.11.9 {
  1493. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 -4.72732e+88
  1494. } {abc: 10 10 (-4.72732e+88) :xyz}
  1495. do_test printf-2.3.12.2 {
  1496. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 9.87991e+143
  1497. } {abc: (9.8799100000e+143) :xyz}
  1498. do_test printf-2.3.12.3 {
  1499. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 9.87991e+143
  1500. } {abc: (9.87991e+143) :xyz}
  1501. do_test printf-2.3.12.4 {
  1502. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 9.87991e+143
  1503. } {abc: 10 10 (9.87991e+143) :xyz}
  1504. do_test printf-2.3.12.5 {
  1505. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 9.87991e+143
  1506. } {abc: 10 10 (9.87991e+143) :xyz}
  1507. do_test printf-2.3.12.6 {
  1508. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 9.87991e+143
  1509. } {abc: 10 10 (9.87991e+143) :xyz}
  1510. do_test printf-2.3.12.8 {
  1511. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 9.87991e+143
  1512. } {abc: 10 10 (9.8799100000e+143) :xyz}
  1513. do_test printf-2.3.12.9 {
  1514. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 9.87991e+143
  1515. } {abc: 10 10 (9.87991e+143) :xyz}
  1516. do_test printf-2.3.13.1 {
  1517. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 -6.287291e-9
  1518. } {abc: (-0.0000000063) :xyz}
  1519. do_test printf-2.3.13.2 {
  1520. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 -6.287291e-9
  1521. } {abc: (-6.2872910000e-09) :xyz}
  1522. do_test printf-2.3.13.3 {
  1523. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 -6.287291e-9
  1524. } {abc: (-6.287291e-09) :xyz}
  1525. do_test printf-2.3.13.4 {
  1526. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 -6.287291e-9
  1527. } {abc: 10 10 (-6.28729e-09) :xyz}
  1528. do_test printf-2.3.13.5 {
  1529. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 -6.287291e-9
  1530. } {abc: 10 10 (-6.28729e-09) :xyz}
  1531. do_test printf-2.3.13.6 {
  1532. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 -6.287291e-9
  1533. } {abc: 10 10 (-6.28729e-09) :xyz}
  1534. do_test printf-2.3.13.7 {
  1535. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 -6.287291e-9
  1536. } {abc: 10 10 (-0.0000000063) :xyz}
  1537. do_test printf-2.3.13.8 {
  1538. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 -6.287291e-9
  1539. } {abc: 10 10 (-6.2872910000e-09) :xyz}
  1540. do_test printf-2.3.13.9 {
  1541. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 -6.287291e-9
  1542. } {abc: 10 10 (-6.287291e-09) :xyz}
  1543. do_test printf-2.3.14.1 {
  1544. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 10 3.38826392e-110
  1545. } {abc: (0.0000000000) :xyz}
  1546. do_test printf-2.3.14.2 {
  1547. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 10 3.38826392e-110
  1548. } {abc: (3.3882639200e-110) :xyz}
  1549. do_test printf-2.3.14.3 {
  1550. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 10 3.38826392e-110
  1551. } {abc: (3.38826392e-110) :xyz}
  1552. do_test printf-2.3.14.4 {
  1553. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 10 3.38826392e-110
  1554. } {abc: 10 10 (3.38826e-110) :xyz}
  1555. do_test printf-2.3.14.5 {
  1556. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 10 3.38826392e-110
  1557. } {abc: 10 10 (3.38826e-110) :xyz}
  1558. do_test printf-2.3.14.6 {
  1559. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 10 3.38826392e-110
  1560. } {abc: 10 10 (3.38826e-110) :xyz}
  1561. do_test printf-2.3.14.7 {
  1562. sqlite3_mprintf_double {abc: %d %d (%10.10f) :xyz} 10 10 3.38826392e-110
  1563. } {abc: 10 10 (0.0000000000) :xyz}
  1564. do_test printf-2.3.14.8 {
  1565. sqlite3_mprintf_double {abc: %d %d (%10.10e) :xyz} 10 10 3.38826392e-110
  1566. } {abc: 10 10 (3.3882639200e-110) :xyz}
  1567. do_test printf-2.3.14.9 {
  1568. sqlite3_mprintf_double {abc: %d %d (%10.10g) :xyz} 10 10 3.38826392e-110
  1569. } {abc: 10 10 (3.38826392e-110) :xyz}
  1570. do_test printf-2.4.1.1 {
  1571. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 0.001
  1572. } {abc: ( 0.00100) :xyz}
  1573. do_test printf-2.4.1.2 {
  1574. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 0.001
  1575. } {abc: (1.00000e-03) :xyz}
  1576. do_test printf-2.4.1.3 {
  1577. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 0.001
  1578. } {abc: ( 0.001) :xyz}
  1579. do_test printf-2.4.1.4 {
  1580. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 0.001
  1581. } {abc: 10 5 (0.001) :xyz}
  1582. do_test printf-2.4.1.5 {
  1583. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 0.001
  1584. } {abc: 10 5 (0.00100000) :xyz}
  1585. do_test printf-2.4.1.6 {
  1586. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 0.001
  1587. } {abc: 10 5 (000000.001) :xyz}
  1588. do_test printf-2.4.1.7 {
  1589. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 0.001
  1590. } {abc: 10 5 ( 0.00100) :xyz}
  1591. do_test printf-2.4.1.8 {
  1592. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 0.001
  1593. } {abc: 10 5 (1.00000e-03) :xyz}
  1594. do_test printf-2.4.1.9 {
  1595. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 0.001
  1596. } {abc: 10 5 ( 0.001) :xyz}
  1597. do_test printf-2.4.2.1 {
  1598. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 1.0e-20
  1599. } {abc: ( 0.00000) :xyz}
  1600. do_test printf-2.4.2.2 {
  1601. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 1.0e-20
  1602. } {abc: (1.00000e-20) :xyz}
  1603. do_test printf-2.4.2.3 {
  1604. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 1.0e-20
  1605. } {abc: ( 1e-20) :xyz}
  1606. do_test printf-2.4.2.4 {
  1607. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 1.0e-20
  1608. } {abc: 10 5 (1e-20) :xyz}
  1609. do_test printf-2.4.2.5 {
  1610. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 1.0e-20
  1611. } {abc: 10 5 (1.00000e-20) :xyz}
  1612. do_test printf-2.4.2.6 {
  1613. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 1.0e-20
  1614. } {abc: 10 5 (000001e-20) :xyz}
  1615. do_test printf-2.4.2.7 {
  1616. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 1.0e-20
  1617. } {abc: 10 5 ( 0.00000) :xyz}
  1618. do_test printf-2.4.2.8 {
  1619. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 1.0e-20
  1620. } {abc: 10 5 (1.00000e-20) :xyz}
  1621. do_test printf-2.4.2.9 {
  1622. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 1.0e-20
  1623. } {abc: 10 5 ( 1e-20) :xyz}
  1624. do_test printf-2.4.3.1 {
  1625. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 1.0
  1626. } {abc: ( 1.00000) :xyz}
  1627. do_test printf-2.4.3.2 {
  1628. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 1.0
  1629. } {abc: (1.00000e+00) :xyz}
  1630. do_test printf-2.4.3.3 {
  1631. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 1.0
  1632. } {abc: ( 1) :xyz}
  1633. do_test printf-2.4.3.4 {
  1634. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 1.0
  1635. } {abc: 10 5 (1) :xyz}
  1636. do_test printf-2.4.3.5 {
  1637. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 1.0
  1638. } {abc: 10 5 (1.00000) :xyz}
  1639. do_test printf-2.4.3.6 {
  1640. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 1.0
  1641. } {abc: 10 5 (0000000001) :xyz}
  1642. do_test printf-2.4.3.7 {
  1643. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 1.0
  1644. } {abc: 10 5 ( 1.00000) :xyz}
  1645. do_test printf-2.4.3.8 {
  1646. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 1.0
  1647. } {abc: 10 5 (1.00000e+00) :xyz}
  1648. do_test printf-2.4.3.9 {
  1649. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 1.0
  1650. } {abc: 10 5 ( 1) :xyz}
  1651. do_test printf-2.4.4.1 {
  1652. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 0.0
  1653. } {abc: ( 0.00000) :xyz}
  1654. do_test printf-2.4.4.2 {
  1655. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 0.0
  1656. } {abc: (0.00000e+00) :xyz}
  1657. do_test printf-2.4.4.3 {
  1658. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 0.0
  1659. } {abc: ( 0) :xyz}
  1660. do_test printf-2.4.4.4 {
  1661. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 0.0
  1662. } {abc: 10 5 (0) :xyz}
  1663. do_test printf-2.4.4.5 {
  1664. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 0.0
  1665. } {abc: 10 5 (0.00000) :xyz}
  1666. do_test printf-2.4.4.6 {
  1667. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 0.0
  1668. } {abc: 10 5 (0000000000) :xyz}
  1669. do_test printf-2.4.4.7 {
  1670. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 0.0
  1671. } {abc: 10 5 ( 0.00000) :xyz}
  1672. do_test printf-2.4.4.8 {
  1673. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 0.0
  1674. } {abc: 10 5 (0.00000e+00) :xyz}
  1675. do_test printf-2.4.4.9 {
  1676. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 0.0
  1677. } {abc: 10 5 ( 0) :xyz}
  1678. do_test printf-2.4.5.1 {
  1679. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 100.0
  1680. } {abc: ( 100.00000) :xyz}
  1681. do_test printf-2.4.5.2 {
  1682. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 100.0
  1683. } {abc: (1.00000e+02) :xyz}
  1684. do_test printf-2.4.5.3 {
  1685. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 100.0
  1686. } {abc: ( 100) :xyz}
  1687. do_test printf-2.4.5.4 {
  1688. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 100.0
  1689. } {abc: 10 5 (100) :xyz}
  1690. do_test printf-2.4.5.5 {
  1691. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 100.0
  1692. } {abc: 10 5 (100.000) :xyz}
  1693. do_test printf-2.4.5.6 {
  1694. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 100.0
  1695. } {abc: 10 5 (0000000100) :xyz}
  1696. do_test printf-2.4.5.7 {
  1697. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 100.0
  1698. } {abc: 10 5 ( 100.00000) :xyz}
  1699. do_test printf-2.4.5.8 {
  1700. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 100.0
  1701. } {abc: 10 5 (1.00000e+02) :xyz}
  1702. do_test printf-2.4.5.9 {
  1703. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 100.0
  1704. } {abc: 10 5 ( 100) :xyz}
  1705. do_test printf-2.4.6.1 {
  1706. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 9.99999
  1707. } {abc: ( 9.99999) :xyz}
  1708. do_test printf-2.4.6.2 {
  1709. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 9.99999
  1710. } {abc: (9.99999e+00) :xyz}
  1711. do_test printf-2.4.6.3 {
  1712. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 9.99999
  1713. } {abc: ( 10) :xyz}
  1714. do_test printf-2.4.6.4 {
  1715. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 9.99999
  1716. } {abc: 10 5 (9.99999) :xyz}
  1717. do_test printf-2.4.6.5 {
  1718. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 9.99999
  1719. } {abc: 10 5 (9.99999) :xyz}
  1720. do_test printf-2.4.6.6 {
  1721. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 9.99999
  1722. } {abc: 10 5 (0009.99999) :xyz}
  1723. do_test printf-2.4.6.7 {
  1724. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 9.99999
  1725. } {abc: 10 5 ( 9.99999) :xyz}
  1726. do_test printf-2.4.6.8 {
  1727. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 9.99999
  1728. } {abc: 10 5 (9.99999e+00) :xyz}
  1729. do_test printf-2.4.6.9 {
  1730. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 9.99999
  1731. } {abc: 10 5 ( 10) :xyz}
  1732. do_test printf-2.4.7.1 {
  1733. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 -0.00543
  1734. } {abc: ( -0.00543) :xyz}
  1735. do_test printf-2.4.7.2 {
  1736. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 -0.00543
  1737. } {abc: (-5.43000e-03) :xyz}
  1738. do_test printf-2.4.7.3 {
  1739. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 -0.00543
  1740. } {abc: ( -0.00543) :xyz}
  1741. do_test printf-2.4.7.4 {
  1742. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 -0.00543
  1743. } {abc: 10 5 (-0.00543) :xyz}
  1744. do_test printf-2.4.7.5 {
  1745. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 -0.00543
  1746. } {abc: 10 5 (-0.00543000) :xyz}
  1747. do_test printf-2.4.7.6 {
  1748. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 -0.00543
  1749. } {abc: 10 5 (-000.00543) :xyz}
  1750. do_test printf-2.4.7.7 {
  1751. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 -0.00543
  1752. } {abc: 10 5 ( -0.00543) :xyz}
  1753. do_test printf-2.4.7.8 {
  1754. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 -0.00543
  1755. } {abc: 10 5 (-5.43000e-03) :xyz}
  1756. do_test printf-2.4.7.9 {
  1757. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 -0.00543
  1758. } {abc: 10 5 ( -0.00543) :xyz}
  1759. do_test printf-2.4.8.1 {
  1760. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 -1.0
  1761. } {abc: ( -1.00000) :xyz}
  1762. do_test printf-2.4.8.2 {
  1763. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 -1.0
  1764. } {abc: (-1.00000e+00) :xyz}
  1765. do_test printf-2.4.8.3 {
  1766. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 -1.0
  1767. } {abc: ( -1) :xyz}
  1768. do_test printf-2.4.8.4 {
  1769. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 -1.0
  1770. } {abc: 10 5 (-1) :xyz}
  1771. do_test printf-2.4.8.5 {
  1772. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 -1.0
  1773. } {abc: 10 5 (-1.00000) :xyz}
  1774. do_test printf-2.4.8.6 {
  1775. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 -1.0
  1776. } {abc: 10 5 (-000000001) :xyz}
  1777. do_test printf-2.4.8.7 {
  1778. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 -1.0
  1779. } {abc: 10 5 ( -1.00000) :xyz}
  1780. do_test printf-2.4.8.8 {
  1781. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 -1.0
  1782. } {abc: 10 5 (-1.00000e+00) :xyz}
  1783. do_test printf-2.4.8.9 {
  1784. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 -1.0
  1785. } {abc: 10 5 ( -1) :xyz}
  1786. do_test printf-2.4.9.1 {
  1787. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 -99.99999
  1788. } {abc: ( -99.99999) :xyz}
  1789. do_test printf-2.4.9.2 {
  1790. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 -99.99999
  1791. } {abc: (-1.00000e+02) :xyz}
  1792. do_test printf-2.4.9.3 {
  1793. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 -99.99999
  1794. } {abc: ( -100) :xyz}
  1795. do_test printf-2.4.9.4 {
  1796. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 -99.99999
  1797. } {abc: 10 5 (-100) :xyz}
  1798. do_test printf-2.4.9.5 {
  1799. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 -99.99999
  1800. } {abc: 10 5 (-100.000) :xyz}
  1801. do_test printf-2.4.9.6 {
  1802. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 -99.99999
  1803. } {abc: 10 5 (-000000100) :xyz}
  1804. do_test printf-2.4.9.7 {
  1805. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 -99.99999
  1806. } {abc: 10 5 ( -99.99999) :xyz}
  1807. do_test printf-2.4.9.8 {
  1808. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 -99.99999
  1809. } {abc: 10 5 (-1.00000e+02) :xyz}
  1810. do_test printf-2.4.9.9 {
  1811. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 -99.99999
  1812. } {abc: 10 5 ( -100) :xyz}
  1813. do_test printf-2.4.10.1 {
  1814. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 3.14e+9
  1815. } {abc: (3140000000.00000) :xyz}
  1816. do_test printf-2.4.10.2 {
  1817. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 3.14e+9
  1818. } {abc: (3.14000e+09) :xyz}
  1819. do_test printf-2.4.10.3 {
  1820. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 3.14e+9
  1821. } {abc: ( 3.14e+09) :xyz}
  1822. do_test printf-2.4.10.4 {
  1823. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 3.14e+9
  1824. } {abc: 10 5 (3.14e+09) :xyz}
  1825. do_test printf-2.4.10.5 {
  1826. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 3.14e+9
  1827. } {abc: 10 5 (3.14000e+09) :xyz}
  1828. do_test printf-2.4.10.6 {
  1829. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 3.14e+9
  1830. } {abc: 10 5 (003.14e+09) :xyz}
  1831. do_test printf-2.4.10.7 {
  1832. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 3.14e+9
  1833. } {abc: 10 5 (3140000000.00000) :xyz}
  1834. do_test printf-2.4.10.8 {
  1835. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 3.14e+9
  1836. } {abc: 10 5 (3.14000e+09) :xyz}
  1837. do_test printf-2.4.10.9 {
  1838. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 3.14e+9
  1839. } {abc: 10 5 ( 3.14e+09) :xyz}
  1840. do_test printf-2.4.11.2 {
  1841. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 -4.72732e+88
  1842. } {abc: (-4.72732e+88) :xyz}
  1843. do_test printf-2.4.11.3 {
  1844. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 -4.72732e+88
  1845. } {abc: (-4.7273e+88) :xyz}
  1846. do_test printf-2.4.11.4 {
  1847. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 -4.72732e+88
  1848. } {abc: 10 5 (-4.72732e+88) :xyz}
  1849. do_test printf-2.4.11.5 {
  1850. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 -4.72732e+88
  1851. } {abc: 10 5 (-4.72732e+88) :xyz}
  1852. do_test printf-2.4.11.6 {
  1853. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 -4.72732e+88
  1854. } {abc: 10 5 (-4.72732e+88) :xyz}
  1855. do_test printf-2.4.11.8 {
  1856. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 -4.72732e+88
  1857. } {abc: 10 5 (-4.72732e+88) :xyz}
  1858. do_test printf-2.4.11.9 {
  1859. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 -4.72732e+88
  1860. } {abc: 10 5 (-4.7273e+88) :xyz}
  1861. do_test printf-2.4.12.2 {
  1862. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 9.87991e+143
  1863. } {abc: (9.87991e+143) :xyz}
  1864. do_test printf-2.4.12.3 {
  1865. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 9.87991e+143
  1866. } {abc: (9.8799e+143) :xyz}
  1867. do_test printf-2.4.12.4 {
  1868. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 9.87991e+143
  1869. } {abc: 10 5 (9.87991e+143) :xyz}
  1870. do_test printf-2.4.12.5 {
  1871. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 9.87991e+143
  1872. } {abc: 10 5 (9.87991e+143) :xyz}
  1873. do_test printf-2.4.12.6 {
  1874. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 9.87991e+143
  1875. } {abc: 10 5 (9.87991e+143) :xyz}
  1876. do_test printf-2.4.12.8 {
  1877. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 9.87991e+143
  1878. } {abc: 10 5 (9.87991e+143) :xyz}
  1879. do_test printf-2.4.12.9 {
  1880. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 9.87991e+143
  1881. } {abc: 10 5 (9.8799e+143) :xyz}
  1882. do_test printf-2.4.13.1 {
  1883. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 -6.287291e-9
  1884. } {abc: ( -0.00000) :xyz}
  1885. do_test printf-2.4.13.2 {
  1886. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 -6.287291e-9
  1887. } {abc: (-6.28729e-09) :xyz}
  1888. do_test printf-2.4.13.3 {
  1889. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 -6.287291e-9
  1890. } {abc: (-6.2873e-09) :xyz}
  1891. do_test printf-2.4.13.4 {
  1892. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 -6.287291e-9
  1893. } {abc: 10 5 (-6.28729e-09) :xyz}
  1894. do_test printf-2.4.13.5 {
  1895. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 -6.287291e-9
  1896. } {abc: 10 5 (-6.28729e-09) :xyz}
  1897. do_test printf-2.4.13.6 {
  1898. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 -6.287291e-9
  1899. } {abc: 10 5 (-6.28729e-09) :xyz}
  1900. do_test printf-2.4.13.7 {
  1901. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 -6.287291e-9
  1902. } {abc: 10 5 ( -0.00000) :xyz}
  1903. do_test printf-2.4.13.8 {
  1904. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 -6.287291e-9
  1905. } {abc: 10 5 (-6.28729e-09) :xyz}
  1906. do_test printf-2.4.13.9 {
  1907. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 -6.287291e-9
  1908. } {abc: 10 5 (-6.2873e-09) :xyz}
  1909. do_test printf-2.4.14.1 {
  1910. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 10 5 3.38826392e-110
  1911. } {abc: ( 0.00000) :xyz}
  1912. do_test printf-2.4.14.2 {
  1913. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 10 5 3.38826392e-110
  1914. } {abc: (3.38826e-110) :xyz}
  1915. do_test printf-2.4.14.3 {
  1916. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 10 5 3.38826392e-110
  1917. } {abc: (3.3883e-110) :xyz}
  1918. do_test printf-2.4.14.4 {
  1919. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 10 5 3.38826392e-110
  1920. } {abc: 10 5 (3.38826e-110) :xyz}
  1921. do_test printf-2.4.14.5 {
  1922. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 10 5 3.38826392e-110
  1923. } {abc: 10 5 (3.38826e-110) :xyz}
  1924. do_test printf-2.4.14.6 {
  1925. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 10 5 3.38826392e-110
  1926. } {abc: 10 5 (3.38826e-110) :xyz}
  1927. do_test printf-2.4.14.7 {
  1928. sqlite3_mprintf_double {abc: %d %d (%10.5f) :xyz} 10 5 3.38826392e-110
  1929. } {abc: 10 5 ( 0.00000) :xyz}
  1930. do_test printf-2.4.14.8 {
  1931. sqlite3_mprintf_double {abc: %d %d (%10.5e) :xyz} 10 5 3.38826392e-110
  1932. } {abc: 10 5 (3.38826e-110) :xyz}
  1933. do_test printf-2.4.14.9 {
  1934. sqlite3_mprintf_double {abc: %d %d (%10.5g) :xyz} 10 5 3.38826392e-110
  1935. } {abc: 10 5 (3.3883e-110) :xyz}
  1936. do_test printf-2.5.1.1 {
  1937. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 0.001
  1938. } {abc: (0.00) :xyz}
  1939. do_test printf-2.5.1.2 {
  1940. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 0.001
  1941. } {abc: (1.00e-03) :xyz}
  1942. do_test printf-2.5.1.3 {
  1943. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 0.001
  1944. } {abc: (0.001) :xyz}
  1945. do_test printf-2.5.1.4 {
  1946. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 0.001
  1947. } {abc: 2 2 (0.001) :xyz}
  1948. do_test printf-2.5.1.5 {
  1949. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 0.001
  1950. } {abc: 2 2 (0.00100000) :xyz}
  1951. do_test printf-2.5.1.6 {
  1952. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 0.001
  1953. } {abc: 2 2 (000000.001) :xyz}
  1954. do_test printf-2.5.1.7 {
  1955. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 0.001
  1956. } {abc: 2 2 (0.00) :xyz}
  1957. do_test printf-2.5.1.8 {
  1958. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 0.001
  1959. } {abc: 2 2 (1.00e-03) :xyz}
  1960. do_test printf-2.5.1.9 {
  1961. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 0.001
  1962. } {abc: 2 2 (0.001) :xyz}
  1963. do_test printf-2.5.2.1 {
  1964. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 1.0e-20
  1965. } {abc: (0.00) :xyz}
  1966. do_test printf-2.5.2.2 {
  1967. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 1.0e-20
  1968. } {abc: (1.00e-20) :xyz}
  1969. do_test printf-2.5.2.3 {
  1970. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 1.0e-20
  1971. } {abc: (1e-20) :xyz}
  1972. do_test printf-2.5.2.4 {
  1973. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 1.0e-20
  1974. } {abc: 2 2 (1e-20) :xyz}
  1975. do_test printf-2.5.2.5 {
  1976. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 1.0e-20
  1977. } {abc: 2 2 (1.00000e-20) :xyz}
  1978. do_test printf-2.5.2.6 {
  1979. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 1.0e-20
  1980. } {abc: 2 2 (000001e-20) :xyz}
  1981. do_test printf-2.5.2.7 {
  1982. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 1.0e-20
  1983. } {abc: 2 2 (0.00) :xyz}
  1984. do_test printf-2.5.2.8 {
  1985. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 1.0e-20
  1986. } {abc: 2 2 (1.00e-20) :xyz}
  1987. do_test printf-2.5.2.9 {
  1988. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 1.0e-20
  1989. } {abc: 2 2 (1e-20) :xyz}
  1990. do_test printf-2.5.3.1 {
  1991. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 1.0
  1992. } {abc: (1.00) :xyz}
  1993. do_test printf-2.5.3.2 {
  1994. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 1.0
  1995. } {abc: (1.00e+00) :xyz}
  1996. do_test printf-2.5.3.3 {
  1997. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 1.0
  1998. } {abc: ( 1) :xyz}
  1999. do_test printf-2.5.3.4 {
  2000. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 1.0
  2001. } {abc: 2 2 (1) :xyz}
  2002. do_test printf-2.5.3.5 {
  2003. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 1.0
  2004. } {abc: 2 2 (1.00000) :xyz}
  2005. do_test printf-2.5.3.6 {
  2006. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 1.0
  2007. } {abc: 2 2 (0000000001) :xyz}
  2008. do_test printf-2.5.3.7 {
  2009. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 1.0
  2010. } {abc: 2 2 (1.00) :xyz}
  2011. do_test printf-2.5.3.8 {
  2012. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 1.0
  2013. } {abc: 2 2 (1.00e+00) :xyz}
  2014. do_test printf-2.5.3.9 {
  2015. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 1.0
  2016. } {abc: 2 2 ( 1) :xyz}
  2017. do_test printf-2.5.4.1 {
  2018. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 0.0
  2019. } {abc: (0.00) :xyz}
  2020. do_test printf-2.5.4.2 {
  2021. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 0.0
  2022. } {abc: (0.00e+00) :xyz}
  2023. do_test printf-2.5.4.3 {
  2024. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 0.0
  2025. } {abc: ( 0) :xyz}
  2026. do_test printf-2.5.4.4 {
  2027. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 0.0
  2028. } {abc: 2 2 (0) :xyz}
  2029. do_test printf-2.5.4.5 {
  2030. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 0.0
  2031. } {abc: 2 2 (0.00000) :xyz}
  2032. do_test printf-2.5.4.6 {
  2033. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 0.0
  2034. } {abc: 2 2 (0000000000) :xyz}
  2035. do_test printf-2.5.4.7 {
  2036. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 0.0
  2037. } {abc: 2 2 (0.00) :xyz}
  2038. do_test printf-2.5.4.8 {
  2039. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 0.0
  2040. } {abc: 2 2 (0.00e+00) :xyz}
  2041. do_test printf-2.5.4.9 {
  2042. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 0.0
  2043. } {abc: 2 2 ( 0) :xyz}
  2044. do_test printf-2.5.5.1 {
  2045. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 100.0
  2046. } {abc: (100.00) :xyz}
  2047. do_test printf-2.5.5.2 {
  2048. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 100.0
  2049. } {abc: (1.00e+02) :xyz}
  2050. do_test printf-2.5.5.3 {
  2051. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 100.0
  2052. } {abc: (1e+02) :xyz}
  2053. do_test printf-2.5.5.4 {
  2054. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 100.0
  2055. } {abc: 2 2 (100) :xyz}
  2056. do_test printf-2.5.5.5 {
  2057. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 100.0
  2058. } {abc: 2 2 (100.000) :xyz}
  2059. do_test printf-2.5.5.6 {
  2060. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 100.0
  2061. } {abc: 2 2 (0000000100) :xyz}
  2062. do_test printf-2.5.5.7 {
  2063. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 100.0
  2064. } {abc: 2 2 (100.00) :xyz}
  2065. do_test printf-2.5.5.8 {
  2066. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 100.0
  2067. } {abc: 2 2 (1.00e+02) :xyz}
  2068. do_test printf-2.5.5.9 {
  2069. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 100.0
  2070. } {abc: 2 2 (1e+02) :xyz}
  2071. do_test printf-2.5.6.1 {
  2072. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 9.99999
  2073. } {abc: (10.00) :xyz}
  2074. do_test printf-2.5.6.2 {
  2075. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 9.99999
  2076. } {abc: (1.00e+01) :xyz}
  2077. do_test printf-2.5.6.3 {
  2078. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 9.99999
  2079. } {abc: (10) :xyz}
  2080. do_test printf-2.5.6.4 {
  2081. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 9.99999
  2082. } {abc: 2 2 (9.99999) :xyz}
  2083. do_test printf-2.5.6.5 {
  2084. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 9.99999
  2085. } {abc: 2 2 (9.99999) :xyz}
  2086. do_test printf-2.5.6.6 {
  2087. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 9.99999
  2088. } {abc: 2 2 (0009.99999) :xyz}
  2089. do_test printf-2.5.6.7 {
  2090. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 9.99999
  2091. } {abc: 2 2 (10.00) :xyz}
  2092. do_test printf-2.5.6.8 {
  2093. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 9.99999
  2094. } {abc: 2 2 (1.00e+01) :xyz}
  2095. do_test printf-2.5.6.9 {
  2096. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 9.99999
  2097. } {abc: 2 2 (10) :xyz}
  2098. do_test printf-2.5.7.1 {
  2099. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 -0.00543
  2100. } {abc: (-0.01) :xyz}
  2101. do_test printf-2.5.7.2 {
  2102. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 -0.00543
  2103. } {abc: (-5.43e-03) :xyz}
  2104. do_test printf-2.5.7.3 {
  2105. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 -0.00543
  2106. } {abc: (-0.0054) :xyz}
  2107. do_test printf-2.5.7.4 {
  2108. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 -0.00543
  2109. } {abc: 2 2 (-0.00543) :xyz}
  2110. do_test printf-2.5.7.5 {
  2111. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 -0.00543
  2112. } {abc: 2 2 (-0.00543000) :xyz}
  2113. do_test printf-2.5.7.6 {
  2114. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 -0.00543
  2115. } {abc: 2 2 (-000.00543) :xyz}
  2116. do_test printf-2.5.7.7 {
  2117. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 -0.00543
  2118. } {abc: 2 2 (-0.01) :xyz}
  2119. do_test printf-2.5.7.8 {
  2120. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 -0.00543
  2121. } {abc: 2 2 (-5.43e-03) :xyz}
  2122. do_test printf-2.5.7.9 {
  2123. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 -0.00543
  2124. } {abc: 2 2 (-0.0054) :xyz}
  2125. do_test printf-2.5.8.1 {
  2126. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 -1.0
  2127. } {abc: (-1.00) :xyz}
  2128. do_test printf-2.5.8.2 {
  2129. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 -1.0
  2130. } {abc: (-1.00e+00) :xyz}
  2131. do_test printf-2.5.8.3 {
  2132. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 -1.0
  2133. } {abc: (-1) :xyz}
  2134. do_test printf-2.5.8.4 {
  2135. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 -1.0
  2136. } {abc: 2 2 (-1) :xyz}
  2137. do_test printf-2.5.8.5 {
  2138. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 -1.0
  2139. } {abc: 2 2 (-1.00000) :xyz}
  2140. do_test printf-2.5.8.6 {
  2141. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 -1.0
  2142. } {abc: 2 2 (-000000001) :xyz}
  2143. do_test printf-2.5.8.7 {
  2144. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 -1.0
  2145. } {abc: 2 2 (-1.00) :xyz}
  2146. do_test printf-2.5.8.8 {
  2147. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 -1.0
  2148. } {abc: 2 2 (-1.00e+00) :xyz}
  2149. do_test printf-2.5.8.9 {
  2150. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 -1.0
  2151. } {abc: 2 2 (-1) :xyz}
  2152. do_test printf-2.5.9.1 {
  2153. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 -99.99999
  2154. } {abc: (-100.00) :xyz}
  2155. do_test printf-2.5.9.2 {
  2156. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 -99.99999
  2157. } {abc: (-1.00e+02) :xyz}
  2158. do_test printf-2.5.9.3 {
  2159. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 -99.99999
  2160. } {abc: (-1e+02) :xyz}
  2161. do_test printf-2.5.9.4 {
  2162. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 -99.99999
  2163. } {abc: 2 2 (-100) :xyz}
  2164. do_test printf-2.5.9.5 {
  2165. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 -99.99999
  2166. } {abc: 2 2 (-100.000) :xyz}
  2167. do_test printf-2.5.9.6 {
  2168. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 -99.99999
  2169. } {abc: 2 2 (-000000100) :xyz}
  2170. do_test printf-2.5.9.7 {
  2171. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 -99.99999
  2172. } {abc: 2 2 (-100.00) :xyz}
  2173. do_test printf-2.5.9.8 {
  2174. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 -99.99999
  2175. } {abc: 2 2 (-1.00e+02) :xyz}
  2176. do_test printf-2.5.9.9 {
  2177. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 -99.99999
  2178. } {abc: 2 2 (-1e+02) :xyz}
  2179. do_test printf-2.5.10.1 {
  2180. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 3.14e+9
  2181. } {abc: (3140000000.00) :xyz}
  2182. do_test printf-2.5.10.2 {
  2183. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 3.14e+9
  2184. } {abc: (3.14e+09) :xyz}
  2185. do_test printf-2.5.10.3 {
  2186. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 3.14e+9
  2187. } {abc: (3.1e+09) :xyz}
  2188. do_test printf-2.5.10.4 {
  2189. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 3.14e+9
  2190. } {abc: 2 2 (3.14e+09) :xyz}
  2191. do_test printf-2.5.10.5 {
  2192. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 3.14e+9
  2193. } {abc: 2 2 (3.14000e+09) :xyz}
  2194. do_test printf-2.5.10.6 {
  2195. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 3.14e+9
  2196. } {abc: 2 2 (003.14e+09) :xyz}
  2197. do_test printf-2.5.10.7 {
  2198. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 3.14e+9
  2199. } {abc: 2 2 (3140000000.00) :xyz}
  2200. do_test printf-2.5.10.8 {
  2201. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 3.14e+9
  2202. } {abc: 2 2 (3.14e+09) :xyz}
  2203. do_test printf-2.5.10.9 {
  2204. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 3.14e+9
  2205. } {abc: 2 2 (3.1e+09) :xyz}
  2206. do_test printf-2.5.11.2 {
  2207. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 -4.72732e+88
  2208. } {abc: (-4.73e+88) :xyz}
  2209. do_test printf-2.5.11.3 {
  2210. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 -4.72732e+88
  2211. } {abc: (-4.7e+88) :xyz}
  2212. do_test printf-2.5.11.4 {
  2213. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 -4.72732e+88
  2214. } {abc: 2 2 (-4.72732e+88) :xyz}
  2215. do_test printf-2.5.11.5 {
  2216. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 -4.72732e+88
  2217. } {abc: 2 2 (-4.72732e+88) :xyz}
  2218. do_test printf-2.5.11.6 {
  2219. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 -4.72732e+88
  2220. } {abc: 2 2 (-4.72732e+88) :xyz}
  2221. do_test printf-2.5.11.8 {
  2222. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 -4.72732e+88
  2223. } {abc: 2 2 (-4.73e+88) :xyz}
  2224. do_test printf-2.5.11.9 {
  2225. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 -4.72732e+88
  2226. } {abc: 2 2 (-4.7e+88) :xyz}
  2227. do_test printf-2.5.12.2 {
  2228. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 9.87991e+143
  2229. } {abc: (9.88e+143) :xyz}
  2230. do_test printf-2.5.12.3 {
  2231. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 9.87991e+143
  2232. } {abc: (9.9e+143) :xyz}
  2233. do_test printf-2.5.12.4 {
  2234. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 9.87991e+143
  2235. } {abc: 2 2 (9.87991e+143) :xyz}
  2236. do_test printf-2.5.12.5 {
  2237. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 9.87991e+143
  2238. } {abc: 2 2 (9.87991e+143) :xyz}
  2239. do_test printf-2.5.12.6 {
  2240. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 9.87991e+143
  2241. } {abc: 2 2 (9.87991e+143) :xyz}
  2242. do_test printf-2.5.12.8 {
  2243. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 9.87991e+143
  2244. } {abc: 2 2 (9.88e+143) :xyz}
  2245. do_test printf-2.5.12.9 {
  2246. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 9.87991e+143
  2247. } {abc: 2 2 (9.9e+143) :xyz}
  2248. do_test printf-2.5.13.1 {
  2249. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 -6.287291e-9
  2250. } {abc: (-0.00) :xyz}
  2251. do_test printf-2.5.13.2 {
  2252. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 -6.287291e-9
  2253. } {abc: (-6.29e-09) :xyz}
  2254. do_test printf-2.5.13.3 {
  2255. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 -6.287291e-9
  2256. } {abc: (-6.3e-09) :xyz}
  2257. do_test printf-2.5.13.4 {
  2258. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 -6.287291e-9
  2259. } {abc: 2 2 (-6.28729e-09) :xyz}
  2260. do_test printf-2.5.13.5 {
  2261. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 -6.287291e-9
  2262. } {abc: 2 2 (-6.28729e-09) :xyz}
  2263. do_test printf-2.5.13.6 {
  2264. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 -6.287291e-9
  2265. } {abc: 2 2 (-6.28729e-09) :xyz}
  2266. do_test printf-2.5.13.7 {
  2267. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 -6.287291e-9
  2268. } {abc: 2 2 (-0.00) :xyz}
  2269. do_test printf-2.5.13.8 {
  2270. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 -6.287291e-9
  2271. } {abc: 2 2 (-6.29e-09) :xyz}
  2272. do_test printf-2.5.13.9 {
  2273. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 -6.287291e-9
  2274. } {abc: 2 2 (-6.3e-09) :xyz}
  2275. do_test printf-2.5.14.1 {
  2276. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 2 3.38826392e-110
  2277. } {abc: (0.00) :xyz}
  2278. do_test printf-2.5.14.2 {
  2279. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 2 3.38826392e-110
  2280. } {abc: (3.39e-110) :xyz}
  2281. do_test printf-2.5.14.3 {
  2282. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 2 3.38826392e-110
  2283. } {abc: (3.4e-110) :xyz}
  2284. do_test printf-2.5.14.4 {
  2285. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 2 3.38826392e-110
  2286. } {abc: 2 2 (3.38826e-110) :xyz}
  2287. do_test printf-2.5.14.5 {
  2288. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 2 3.38826392e-110
  2289. } {abc: 2 2 (3.38826e-110) :xyz}
  2290. do_test printf-2.5.14.6 {
  2291. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 2 3.38826392e-110
  2292. } {abc: 2 2 (3.38826e-110) :xyz}
  2293. do_test printf-2.5.14.7 {
  2294. sqlite3_mprintf_double {abc: %d %d (%2.2f) :xyz} 2 2 3.38826392e-110
  2295. } {abc: 2 2 (0.00) :xyz}
  2296. do_test printf-2.5.14.8 {
  2297. sqlite3_mprintf_double {abc: %d %d (%2.2e) :xyz} 2 2 3.38826392e-110
  2298. } {abc: 2 2 (3.39e-110) :xyz}
  2299. do_test printf-2.5.14.9 {
  2300. sqlite3_mprintf_double {abc: %d %d (%2.2g) :xyz} 2 2 3.38826392e-110
  2301. } {abc: 2 2 (3.4e-110) :xyz}
  2302. do_test printf-2.6.1.1 {
  2303. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 0.001
  2304. } {abc: (0.001) :xyz}
  2305. do_test printf-2.6.1.2 {
  2306. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 0.001
  2307. } {abc: (1.000e-03) :xyz}
  2308. do_test printf-2.6.1.3 {
  2309. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 0.001
  2310. } {abc: (0.001) :xyz}
  2311. do_test printf-2.6.1.4 {
  2312. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 0.001
  2313. } {abc: 2 3 (0.001) :xyz}
  2314. do_test printf-2.6.1.5 {
  2315. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 0.001
  2316. } {abc: 2 3 (0.00100000) :xyz}
  2317. do_test printf-2.6.1.6 {
  2318. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 0.001
  2319. } {abc: 2 3 (000000.001) :xyz}
  2320. do_test printf-2.6.1.7 {
  2321. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 0.001
  2322. } {abc: 2 3 (0.001) :xyz}
  2323. do_test printf-2.6.1.8 {
  2324. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 0.001
  2325. } {abc: 2 3 (1.000e-03) :xyz}
  2326. do_test printf-2.6.1.9 {
  2327. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 0.001
  2328. } {abc: 2 3 (0.001) :xyz}
  2329. do_test printf-2.6.2.1 {
  2330. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 1.0e-20
  2331. } {abc: (0.000) :xyz}
  2332. do_test printf-2.6.2.2 {
  2333. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 1.0e-20
  2334. } {abc: (1.000e-20) :xyz}
  2335. do_test printf-2.6.2.3 {
  2336. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 1.0e-20
  2337. } {abc: (1e-20) :xyz}
  2338. do_test printf-2.6.2.4 {
  2339. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 1.0e-20
  2340. } {abc: 2 3 (1e-20) :xyz}
  2341. do_test printf-2.6.2.5 {
  2342. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 1.0e-20
  2343. } {abc: 2 3 (1.00000e-20) :xyz}
  2344. do_test printf-2.6.2.6 {
  2345. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 1.0e-20
  2346. } {abc: 2 3 (000001e-20) :xyz}
  2347. do_test printf-2.6.2.7 {
  2348. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 1.0e-20
  2349. } {abc: 2 3 (0.000) :xyz}
  2350. do_test printf-2.6.2.8 {
  2351. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 1.0e-20
  2352. } {abc: 2 3 (1.000e-20) :xyz}
  2353. do_test printf-2.6.2.9 {
  2354. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 1.0e-20
  2355. } {abc: 2 3 (1e-20) :xyz}
  2356. do_test printf-2.6.3.1 {
  2357. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 1.0
  2358. } {abc: (1.000) :xyz}
  2359. do_test printf-2.6.3.2 {
  2360. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 1.0
  2361. } {abc: (1.000e+00) :xyz}
  2362. do_test printf-2.6.3.3 {
  2363. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 1.0
  2364. } {abc: ( 1) :xyz}
  2365. do_test printf-2.6.3.4 {
  2366. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 1.0
  2367. } {abc: 2 3 (1) :xyz}
  2368. do_test printf-2.6.3.5 {
  2369. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 1.0
  2370. } {abc: 2 3 (1.00000) :xyz}
  2371. do_test printf-2.6.3.6 {
  2372. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 1.0
  2373. } {abc: 2 3 (0000000001) :xyz}
  2374. do_test printf-2.6.3.7 {
  2375. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 1.0
  2376. } {abc: 2 3 (1.000) :xyz}
  2377. do_test printf-2.6.3.8 {
  2378. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 1.0
  2379. } {abc: 2 3 (1.000e+00) :xyz}
  2380. do_test printf-2.6.3.9 {
  2381. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 1.0
  2382. } {abc: 2 3 ( 1) :xyz}
  2383. do_test printf-2.6.4.1 {
  2384. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 0.0
  2385. } {abc: (0.000) :xyz}
  2386. do_test printf-2.6.4.2 {
  2387. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 0.0
  2388. } {abc: (0.000e+00) :xyz}
  2389. do_test printf-2.6.4.3 {
  2390. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 0.0
  2391. } {abc: ( 0) :xyz}
  2392. do_test printf-2.6.4.4 {
  2393. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 0.0
  2394. } {abc: 2 3 (0) :xyz}
  2395. do_test printf-2.6.4.5 {
  2396. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 0.0
  2397. } {abc: 2 3 (0.00000) :xyz}
  2398. do_test printf-2.6.4.6 {
  2399. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 0.0
  2400. } {abc: 2 3 (0000000000) :xyz}
  2401. do_test printf-2.6.4.7 {
  2402. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 0.0
  2403. } {abc: 2 3 (0.000) :xyz}
  2404. do_test printf-2.6.4.8 {
  2405. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 0.0
  2406. } {abc: 2 3 (0.000e+00) :xyz}
  2407. do_test printf-2.6.4.9 {
  2408. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 0.0
  2409. } {abc: 2 3 ( 0) :xyz}
  2410. do_test printf-2.6.5.1 {
  2411. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 100.0
  2412. } {abc: (100.000) :xyz}
  2413. do_test printf-2.6.5.2 {
  2414. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 100.0
  2415. } {abc: (1.000e+02) :xyz}
  2416. do_test printf-2.6.5.3 {
  2417. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 100.0
  2418. } {abc: (100) :xyz}
  2419. do_test printf-2.6.5.4 {
  2420. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 100.0
  2421. } {abc: 2 3 (100) :xyz}
  2422. do_test printf-2.6.5.5 {
  2423. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 100.0
  2424. } {abc: 2 3 (100.000) :xyz}
  2425. do_test printf-2.6.5.6 {
  2426. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 100.0
  2427. } {abc: 2 3 (0000000100) :xyz}
  2428. do_test printf-2.6.5.7 {
  2429. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 100.0
  2430. } {abc: 2 3 (100.000) :xyz}
  2431. do_test printf-2.6.5.8 {
  2432. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 100.0
  2433. } {abc: 2 3 (1.000e+02) :xyz}
  2434. do_test printf-2.6.5.9 {
  2435. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 100.0
  2436. } {abc: 2 3 (100) :xyz}
  2437. do_test printf-2.6.6.1 {
  2438. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 9.99999
  2439. } {abc: (10.000) :xyz}
  2440. do_test printf-2.6.6.2 {
  2441. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 9.99999
  2442. } {abc: (1.000e+01) :xyz}
  2443. do_test printf-2.6.6.3 {
  2444. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 9.99999
  2445. } {abc: (10) :xyz}
  2446. do_test printf-2.6.6.4 {
  2447. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 9.99999
  2448. } {abc: 2 3 (9.99999) :xyz}
  2449. do_test printf-2.6.6.5 {
  2450. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 9.99999
  2451. } {abc: 2 3 (9.99999) :xyz}
  2452. do_test printf-2.6.6.6 {
  2453. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 9.99999
  2454. } {abc: 2 3 (0009.99999) :xyz}
  2455. do_test printf-2.6.6.7 {
  2456. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 9.99999
  2457. } {abc: 2 3 (10.000) :xyz}
  2458. do_test printf-2.6.6.8 {
  2459. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 9.99999
  2460. } {abc: 2 3 (1.000e+01) :xyz}
  2461. do_test printf-2.6.6.9 {
  2462. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 9.99999
  2463. } {abc: 2 3 (10) :xyz}
  2464. do_test printf-2.6.7.1 {
  2465. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 -0.00543
  2466. } {abc: (-0.005) :xyz}
  2467. do_test printf-2.6.7.2 {
  2468. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 -0.00543
  2469. } {abc: (-5.430e-03) :xyz}
  2470. do_test printf-2.6.7.3 {
  2471. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 -0.00543
  2472. } {abc: (-0.00543) :xyz}
  2473. do_test printf-2.6.7.4 {
  2474. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 -0.00543
  2475. } {abc: 2 3 (-0.00543) :xyz}
  2476. do_test printf-2.6.7.5 {
  2477. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 -0.00543
  2478. } {abc: 2 3 (-0.00543000) :xyz}
  2479. do_test printf-2.6.7.6 {
  2480. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 -0.00543
  2481. } {abc: 2 3 (-000.00543) :xyz}
  2482. do_test printf-2.6.7.7 {
  2483. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 -0.00543
  2484. } {abc: 2 3 (-0.005) :xyz}
  2485. do_test printf-2.6.7.8 {
  2486. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 -0.00543
  2487. } {abc: 2 3 (-5.430e-03) :xyz}
  2488. do_test printf-2.6.7.9 {
  2489. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 -0.00543
  2490. } {abc: 2 3 (-0.00543) :xyz}
  2491. do_test printf-2.6.8.1 {
  2492. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 -1.0
  2493. } {abc: (-1.000) :xyz}
  2494. do_test printf-2.6.8.2 {
  2495. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 -1.0
  2496. } {abc: (-1.000e+00) :xyz}
  2497. do_test printf-2.6.8.3 {
  2498. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 -1.0
  2499. } {abc: (-1) :xyz}
  2500. do_test printf-2.6.8.4 {
  2501. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 -1.0
  2502. } {abc: 2 3 (-1) :xyz}
  2503. do_test printf-2.6.8.5 {
  2504. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 -1.0
  2505. } {abc: 2 3 (-1.00000) :xyz}
  2506. do_test printf-2.6.8.6 {
  2507. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 -1.0
  2508. } {abc: 2 3 (-000000001) :xyz}
  2509. do_test printf-2.6.8.7 {
  2510. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 -1.0
  2511. } {abc: 2 3 (-1.000) :xyz}
  2512. do_test printf-2.6.8.8 {
  2513. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 -1.0
  2514. } {abc: 2 3 (-1.000e+00) :xyz}
  2515. do_test printf-2.6.8.9 {
  2516. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 -1.0
  2517. } {abc: 2 3 (-1) :xyz}
  2518. do_test printf-2.6.9.1 {
  2519. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 -99.99999
  2520. } {abc: (-100.000) :xyz}
  2521. do_test printf-2.6.9.2 {
  2522. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 -99.99999
  2523. } {abc: (-1.000e+02) :xyz}
  2524. do_test printf-2.6.9.3 {
  2525. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 -99.99999
  2526. } {abc: (-100) :xyz}
  2527. do_test printf-2.6.9.4 {
  2528. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 -99.99999
  2529. } {abc: 2 3 (-100) :xyz}
  2530. do_test printf-2.6.9.5 {
  2531. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 -99.99999
  2532. } {abc: 2 3 (-100.000) :xyz}
  2533. do_test printf-2.6.9.6 {
  2534. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 -99.99999
  2535. } {abc: 2 3 (-000000100) :xyz}
  2536. do_test printf-2.6.9.7 {
  2537. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 -99.99999
  2538. } {abc: 2 3 (-100.000) :xyz}
  2539. do_test printf-2.6.9.8 {
  2540. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 -99.99999
  2541. } {abc: 2 3 (-1.000e+02) :xyz}
  2542. do_test printf-2.6.9.9 {
  2543. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 -99.99999
  2544. } {abc: 2 3 (-100) :xyz}
  2545. do_test printf-2.6.10.1 {
  2546. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 3.14e+9
  2547. } {abc: (3140000000.000) :xyz}
  2548. do_test printf-2.6.10.2 {
  2549. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 3.14e+9
  2550. } {abc: (3.140e+09) :xyz}
  2551. do_test printf-2.6.10.3 {
  2552. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 3.14e+9
  2553. } {abc: (3.14e+09) :xyz}
  2554. do_test printf-2.6.10.4 {
  2555. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 3.14e+9
  2556. } {abc: 2 3 (3.14e+09) :xyz}
  2557. do_test printf-2.6.10.5 {
  2558. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 3.14e+9
  2559. } {abc: 2 3 (3.14000e+09) :xyz}
  2560. do_test printf-2.6.10.6 {
  2561. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 3.14e+9
  2562. } {abc: 2 3 (003.14e+09) :xyz}
  2563. do_test printf-2.6.10.7 {
  2564. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 3.14e+9
  2565. } {abc: 2 3 (3140000000.000) :xyz}
  2566. do_test printf-2.6.10.8 {
  2567. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 3.14e+9
  2568. } {abc: 2 3 (3.140e+09) :xyz}
  2569. do_test printf-2.6.10.9 {
  2570. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 3.14e+9
  2571. } {abc: 2 3 (3.14e+09) :xyz}
  2572. do_test printf-2.6.11.2 {
  2573. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 -4.72732e+88
  2574. } {abc: (-4.727e+88) :xyz}
  2575. do_test printf-2.6.11.3 {
  2576. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 -4.72732e+88
  2577. } {abc: (-4.73e+88) :xyz}
  2578. do_test printf-2.6.11.4 {
  2579. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 -4.72732e+88
  2580. } {abc: 2 3 (-4.72732e+88) :xyz}
  2581. do_test printf-2.6.11.5 {
  2582. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 -4.72732e+88
  2583. } {abc: 2 3 (-4.72732e+88) :xyz}
  2584. do_test printf-2.6.11.6 {
  2585. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 -4.72732e+88
  2586. } {abc: 2 3 (-4.72732e+88) :xyz}
  2587. do_test printf-2.6.11.8 {
  2588. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 -4.72732e+88
  2589. } {abc: 2 3 (-4.727e+88) :xyz}
  2590. do_test printf-2.6.11.9 {
  2591. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 -4.72732e+88
  2592. } {abc: 2 3 (-4.73e+88) :xyz}
  2593. do_test printf-2.6.12.2 {
  2594. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 9.87991e+143
  2595. } {abc: (9.880e+143) :xyz}
  2596. do_test printf-2.6.12.3 {
  2597. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 9.87991e+143
  2598. } {abc: (9.88e+143) :xyz}
  2599. do_test printf-2.6.12.4 {
  2600. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 9.87991e+143
  2601. } {abc: 2 3 (9.87991e+143) :xyz}
  2602. do_test printf-2.6.12.5 {
  2603. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 9.87991e+143
  2604. } {abc: 2 3 (9.87991e+143) :xyz}
  2605. do_test printf-2.6.12.6 {
  2606. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 9.87991e+143
  2607. } {abc: 2 3 (9.87991e+143) :xyz}
  2608. do_test printf-2.6.12.8 {
  2609. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 9.87991e+143
  2610. } {abc: 2 3 (9.880e+143) :xyz}
  2611. do_test printf-2.6.12.9 {
  2612. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 9.87991e+143
  2613. } {abc: 2 3 (9.88e+143) :xyz}
  2614. do_test printf-2.6.13.1 {
  2615. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 -6.287291e-9
  2616. } {abc: (-0.000) :xyz}
  2617. do_test printf-2.6.13.2 {
  2618. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 -6.287291e-9
  2619. } {abc: (-6.287e-09) :xyz}
  2620. do_test printf-2.6.13.3 {
  2621. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 -6.287291e-9
  2622. } {abc: (-6.29e-09) :xyz}
  2623. do_test printf-2.6.13.4 {
  2624. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 -6.287291e-9
  2625. } {abc: 2 3 (-6.28729e-09) :xyz}
  2626. do_test printf-2.6.13.5 {
  2627. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 -6.287291e-9
  2628. } {abc: 2 3 (-6.28729e-09) :xyz}
  2629. do_test printf-2.6.13.6 {
  2630. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 -6.287291e-9
  2631. } {abc: 2 3 (-6.28729e-09) :xyz}
  2632. do_test printf-2.6.13.7 {
  2633. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 -6.287291e-9
  2634. } {abc: 2 3 (-0.000) :xyz}
  2635. do_test printf-2.6.13.8 {
  2636. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 -6.287291e-9
  2637. } {abc: 2 3 (-6.287e-09) :xyz}
  2638. do_test printf-2.6.13.9 {
  2639. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 -6.287291e-9
  2640. } {abc: 2 3 (-6.29e-09) :xyz}
  2641. do_test printf-2.6.14.1 {
  2642. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 2 3 3.38826392e-110
  2643. } {abc: (0.000) :xyz}
  2644. do_test printf-2.6.14.2 {
  2645. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 2 3 3.38826392e-110
  2646. } {abc: (3.388e-110) :xyz}
  2647. do_test printf-2.6.14.3 {
  2648. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 2 3 3.38826392e-110
  2649. } {abc: (3.39e-110) :xyz}
  2650. do_test printf-2.6.14.4 {
  2651. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 2 3 3.38826392e-110
  2652. } {abc: 2 3 (3.38826e-110) :xyz}
  2653. do_test printf-2.6.14.5 {
  2654. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 2 3 3.38826392e-110
  2655. } {abc: 2 3 (3.38826e-110) :xyz}
  2656. do_test printf-2.6.14.6 {
  2657. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 2 3 3.38826392e-110
  2658. } {abc: 2 3 (3.38826e-110) :xyz}
  2659. do_test printf-2.6.14.7 {
  2660. sqlite3_mprintf_double {abc: %d %d (%2.3f) :xyz} 2 3 3.38826392e-110
  2661. } {abc: 2 3 (0.000) :xyz}
  2662. do_test printf-2.6.14.8 {
  2663. sqlite3_mprintf_double {abc: %d %d (%2.3e) :xyz} 2 3 3.38826392e-110
  2664. } {abc: 2 3 (3.388e-110) :xyz}
  2665. do_test printf-2.6.14.9 {
  2666. sqlite3_mprintf_double {abc: %d %d (%2.3g) :xyz} 2 3 3.38826392e-110
  2667. } {abc: 2 3 (3.39e-110) :xyz}
  2668. do_test printf-2.7.1.1 {
  2669. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 0.001
  2670. } {abc: (0.001) :xyz}
  2671. do_test printf-2.7.1.2 {
  2672. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 0.001
  2673. } {abc: (1.000e-03) :xyz}
  2674. do_test printf-2.7.1.3 {
  2675. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 0.001
  2676. } {abc: (0.001) :xyz}
  2677. do_test printf-2.7.1.4 {
  2678. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 0.001
  2679. } {abc: 3 3 (0.001) :xyz}
  2680. do_test printf-2.7.1.5 {
  2681. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 0.001
  2682. } {abc: 3 3 (0.00100000) :xyz}
  2683. do_test printf-2.7.1.6 {
  2684. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 0.001
  2685. } {abc: 3 3 (000000.001) :xyz}
  2686. do_test printf-2.7.1.7 {
  2687. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 0.001
  2688. } {abc: 3 3 (0.001) :xyz}
  2689. do_test printf-2.7.1.8 {
  2690. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 0.001
  2691. } {abc: 3 3 (1.000e-03) :xyz}
  2692. do_test printf-2.7.1.9 {
  2693. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 0.001
  2694. } {abc: 3 3 (0.001) :xyz}
  2695. do_test printf-2.7.2.1 {
  2696. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 1.0e-20
  2697. } {abc: (0.000) :xyz}
  2698. do_test printf-2.7.2.2 {
  2699. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 1.0e-20
  2700. } {abc: (1.000e-20) :xyz}
  2701. do_test printf-2.7.2.3 {
  2702. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 1.0e-20
  2703. } {abc: (1e-20) :xyz}
  2704. do_test printf-2.7.2.4 {
  2705. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 1.0e-20
  2706. } {abc: 3 3 (1e-20) :xyz}
  2707. do_test printf-2.7.2.5 {
  2708. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 1.0e-20
  2709. } {abc: 3 3 (1.00000e-20) :xyz}
  2710. do_test printf-2.7.2.6 {
  2711. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 1.0e-20
  2712. } {abc: 3 3 (000001e-20) :xyz}
  2713. do_test printf-2.7.2.7 {
  2714. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 1.0e-20
  2715. } {abc: 3 3 (0.000) :xyz}
  2716. do_test printf-2.7.2.8 {
  2717. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 1.0e-20
  2718. } {abc: 3 3 (1.000e-20) :xyz}
  2719. do_test printf-2.7.2.9 {
  2720. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 1.0e-20
  2721. } {abc: 3 3 (1e-20) :xyz}
  2722. do_test printf-2.7.3.1 {
  2723. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 1.0
  2724. } {abc: (1.000) :xyz}
  2725. do_test printf-2.7.3.2 {
  2726. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 1.0
  2727. } {abc: (1.000e+00) :xyz}
  2728. do_test printf-2.7.3.3 {
  2729. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 1.0
  2730. } {abc: ( 1) :xyz}
  2731. do_test printf-2.7.3.4 {
  2732. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 1.0
  2733. } {abc: 3 3 (1) :xyz}
  2734. do_test printf-2.7.3.5 {
  2735. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 1.0
  2736. } {abc: 3 3 (1.00000) :xyz}
  2737. do_test printf-2.7.3.6 {
  2738. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 1.0
  2739. } {abc: 3 3 (0000000001) :xyz}
  2740. do_test printf-2.7.3.7 {
  2741. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 1.0
  2742. } {abc: 3 3 (1.000) :xyz}
  2743. do_test printf-2.7.3.8 {
  2744. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 1.0
  2745. } {abc: 3 3 (1.000e+00) :xyz}
  2746. do_test printf-2.7.3.9 {
  2747. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 1.0
  2748. } {abc: 3 3 ( 1) :xyz}
  2749. do_test printf-2.7.4.1 {
  2750. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 0.0
  2751. } {abc: (0.000) :xyz}
  2752. do_test printf-2.7.4.2 {
  2753. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 0.0
  2754. } {abc: (0.000e+00) :xyz}
  2755. do_test printf-2.7.4.3 {
  2756. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 0.0
  2757. } {abc: ( 0) :xyz}
  2758. do_test printf-2.7.4.4 {
  2759. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 0.0
  2760. } {abc: 3 3 (0) :xyz}
  2761. do_test printf-2.7.4.5 {
  2762. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 0.0
  2763. } {abc: 3 3 (0.00000) :xyz}
  2764. do_test printf-2.7.4.6 {
  2765. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 0.0
  2766. } {abc: 3 3 (0000000000) :xyz}
  2767. do_test printf-2.7.4.7 {
  2768. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 0.0
  2769. } {abc: 3 3 (0.000) :xyz}
  2770. do_test printf-2.7.4.8 {
  2771. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 0.0
  2772. } {abc: 3 3 (0.000e+00) :xyz}
  2773. do_test printf-2.7.4.9 {
  2774. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 0.0
  2775. } {abc: 3 3 ( 0) :xyz}
  2776. do_test printf-2.7.5.1 {
  2777. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 100.0
  2778. } {abc: (100.000) :xyz}
  2779. do_test printf-2.7.5.2 {
  2780. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 100.0
  2781. } {abc: (1.000e+02) :xyz}
  2782. do_test printf-2.7.5.3 {
  2783. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 100.0
  2784. } {abc: (100) :xyz}
  2785. do_test printf-2.7.5.4 {
  2786. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 100.0
  2787. } {abc: 3 3 (100) :xyz}
  2788. do_test printf-2.7.5.5 {
  2789. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 100.0
  2790. } {abc: 3 3 (100.000) :xyz}
  2791. do_test printf-2.7.5.6 {
  2792. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 100.0
  2793. } {abc: 3 3 (0000000100) :xyz}
  2794. do_test printf-2.7.5.7 {
  2795. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 100.0
  2796. } {abc: 3 3 (100.000) :xyz}
  2797. do_test printf-2.7.5.8 {
  2798. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 100.0
  2799. } {abc: 3 3 (1.000e+02) :xyz}
  2800. do_test printf-2.7.5.9 {
  2801. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 100.0
  2802. } {abc: 3 3 (100) :xyz}
  2803. do_test printf-2.7.6.1 {
  2804. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 9.99999
  2805. } {abc: (10.000) :xyz}
  2806. do_test printf-2.7.6.2 {
  2807. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 9.99999
  2808. } {abc: (1.000e+01) :xyz}
  2809. do_test printf-2.7.6.3 {
  2810. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 9.99999
  2811. } {abc: ( 10) :xyz}
  2812. do_test printf-2.7.6.4 {
  2813. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 9.99999
  2814. } {abc: 3 3 (9.99999) :xyz}
  2815. do_test printf-2.7.6.5 {
  2816. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 9.99999
  2817. } {abc: 3 3 (9.99999) :xyz}
  2818. do_test printf-2.7.6.6 {
  2819. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 9.99999
  2820. } {abc: 3 3 (0009.99999) :xyz}
  2821. do_test printf-2.7.6.7 {
  2822. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 9.99999
  2823. } {abc: 3 3 (10.000) :xyz}
  2824. do_test printf-2.7.6.8 {
  2825. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 9.99999
  2826. } {abc: 3 3 (1.000e+01) :xyz}
  2827. do_test printf-2.7.6.9 {
  2828. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 9.99999
  2829. } {abc: 3 3 ( 10) :xyz}
  2830. do_test printf-2.7.7.1 {
  2831. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 -0.00543
  2832. } {abc: (-0.005) :xyz}
  2833. do_test printf-2.7.7.2 {
  2834. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 -0.00543
  2835. } {abc: (-5.430e-03) :xyz}
  2836. do_test printf-2.7.7.3 {
  2837. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 -0.00543
  2838. } {abc: (-0.00543) :xyz}
  2839. do_test printf-2.7.7.4 {
  2840. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 -0.00543
  2841. } {abc: 3 3 (-0.00543) :xyz}
  2842. do_test printf-2.7.7.5 {
  2843. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 -0.00543
  2844. } {abc: 3 3 (-0.00543000) :xyz}
  2845. do_test printf-2.7.7.6 {
  2846. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 -0.00543
  2847. } {abc: 3 3 (-000.00543) :xyz}
  2848. do_test printf-2.7.7.7 {
  2849. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 -0.00543
  2850. } {abc: 3 3 (-0.005) :xyz}
  2851. do_test printf-2.7.7.8 {
  2852. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 -0.00543
  2853. } {abc: 3 3 (-5.430e-03) :xyz}
  2854. do_test printf-2.7.7.9 {
  2855. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 -0.00543
  2856. } {abc: 3 3 (-0.00543) :xyz}
  2857. do_test printf-2.7.8.1 {
  2858. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 -1.0
  2859. } {abc: (-1.000) :xyz}
  2860. do_test printf-2.7.8.2 {
  2861. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 -1.0
  2862. } {abc: (-1.000e+00) :xyz}
  2863. do_test printf-2.7.8.3 {
  2864. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 -1.0
  2865. } {abc: ( -1) :xyz}
  2866. do_test printf-2.7.8.4 {
  2867. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 -1.0
  2868. } {abc: 3 3 (-1) :xyz}
  2869. do_test printf-2.7.8.5 {
  2870. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 -1.0
  2871. } {abc: 3 3 (-1.00000) :xyz}
  2872. do_test printf-2.7.8.6 {
  2873. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 -1.0
  2874. } {abc: 3 3 (-000000001) :xyz}
  2875. do_test printf-2.7.8.7 {
  2876. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 -1.0
  2877. } {abc: 3 3 (-1.000) :xyz}
  2878. do_test printf-2.7.8.8 {
  2879. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 -1.0
  2880. } {abc: 3 3 (-1.000e+00) :xyz}
  2881. do_test printf-2.7.8.9 {
  2882. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 -1.0
  2883. } {abc: 3 3 ( -1) :xyz}
  2884. do_test printf-2.7.9.1 {
  2885. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 -99.99999
  2886. } {abc: (-100.000) :xyz}
  2887. do_test printf-2.7.9.2 {
  2888. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 -99.99999
  2889. } {abc: (-1.000e+02) :xyz}
  2890. do_test printf-2.7.9.3 {
  2891. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 -99.99999
  2892. } {abc: (-100) :xyz}
  2893. do_test printf-2.7.9.4 {
  2894. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 -99.99999
  2895. } {abc: 3 3 (-100) :xyz}
  2896. do_test printf-2.7.9.5 {
  2897. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 -99.99999
  2898. } {abc: 3 3 (-100.000) :xyz}
  2899. do_test printf-2.7.9.6 {
  2900. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 -99.99999
  2901. } {abc: 3 3 (-000000100) :xyz}
  2902. do_test printf-2.7.9.7 {
  2903. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 -99.99999
  2904. } {abc: 3 3 (-100.000) :xyz}
  2905. do_test printf-2.7.9.8 {
  2906. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 -99.99999
  2907. } {abc: 3 3 (-1.000e+02) :xyz}
  2908. do_test printf-2.7.9.9 {
  2909. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 -99.99999
  2910. } {abc: 3 3 (-100) :xyz}
  2911. do_test printf-2.7.10.1 {
  2912. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 3.14e+9
  2913. } {abc: (3140000000.000) :xyz}
  2914. do_test printf-2.7.10.2 {
  2915. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 3.14e+9
  2916. } {abc: (3.140e+09) :xyz}
  2917. do_test printf-2.7.10.3 {
  2918. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 3.14e+9
  2919. } {abc: (3.14e+09) :xyz}
  2920. do_test printf-2.7.10.4 {
  2921. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 3.14e+9
  2922. } {abc: 3 3 (3.14e+09) :xyz}
  2923. do_test printf-2.7.10.5 {
  2924. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 3.14e+9
  2925. } {abc: 3 3 (3.14000e+09) :xyz}
  2926. do_test printf-2.7.10.6 {
  2927. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 3.14e+9
  2928. } {abc: 3 3 (003.14e+09) :xyz}
  2929. do_test printf-2.7.10.7 {
  2930. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 3.14e+9
  2931. } {abc: 3 3 (3140000000.000) :xyz}
  2932. do_test printf-2.7.10.8 {
  2933. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 3.14e+9
  2934. } {abc: 3 3 (3.140e+09) :xyz}
  2935. do_test printf-2.7.10.9 {
  2936. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 3.14e+9
  2937. } {abc: 3 3 (3.14e+09) :xyz}
  2938. do_test printf-2.7.11.2 {
  2939. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 -4.72732e+88
  2940. } {abc: (-4.727e+88) :xyz}
  2941. do_test printf-2.7.11.3 {
  2942. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 -4.72732e+88
  2943. } {abc: (-4.73e+88) :xyz}
  2944. do_test printf-2.7.11.4 {
  2945. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 -4.72732e+88
  2946. } {abc: 3 3 (-4.72732e+88) :xyz}
  2947. do_test printf-2.7.11.5 {
  2948. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 -4.72732e+88
  2949. } {abc: 3 3 (-4.72732e+88) :xyz}
  2950. do_test printf-2.7.11.6 {
  2951. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 -4.72732e+88
  2952. } {abc: 3 3 (-4.72732e+88) :xyz}
  2953. do_test printf-2.7.11.8 {
  2954. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 -4.72732e+88
  2955. } {abc: 3 3 (-4.727e+88) :xyz}
  2956. do_test printf-2.7.11.9 {
  2957. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 -4.72732e+88
  2958. } {abc: 3 3 (-4.73e+88) :xyz}
  2959. do_test printf-2.7.12.2 {
  2960. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 9.87991e+143
  2961. } {abc: (9.880e+143) :xyz}
  2962. do_test printf-2.7.12.3 {
  2963. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 9.87991e+143
  2964. } {abc: (9.88e+143) :xyz}
  2965. do_test printf-2.7.12.4 {
  2966. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 9.87991e+143
  2967. } {abc: 3 3 (9.87991e+143) :xyz}
  2968. do_test printf-2.7.12.5 {
  2969. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 9.87991e+143
  2970. } {abc: 3 3 (9.87991e+143) :xyz}
  2971. do_test printf-2.7.12.6 {
  2972. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 9.87991e+143
  2973. } {abc: 3 3 (9.87991e+143) :xyz}
  2974. do_test printf-2.7.12.8 {
  2975. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 9.87991e+143
  2976. } {abc: 3 3 (9.880e+143) :xyz}
  2977. do_test printf-2.7.12.9 {
  2978. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 9.87991e+143
  2979. } {abc: 3 3 (9.88e+143) :xyz}
  2980. do_test printf-2.7.13.1 {
  2981. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 -6.287291e-9
  2982. } {abc: (-0.000) :xyz}
  2983. do_test printf-2.7.13.2 {
  2984. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 -6.287291e-9
  2985. } {abc: (-6.287e-09) :xyz}
  2986. do_test printf-2.7.13.3 {
  2987. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 -6.287291e-9
  2988. } {abc: (-6.29e-09) :xyz}
  2989. do_test printf-2.7.13.4 {
  2990. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 -6.287291e-9
  2991. } {abc: 3 3 (-6.28729e-09) :xyz}
  2992. do_test printf-2.7.13.5 {
  2993. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 -6.287291e-9
  2994. } {abc: 3 3 (-6.28729e-09) :xyz}
  2995. do_test printf-2.7.13.6 {
  2996. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 -6.287291e-9
  2997. } {abc: 3 3 (-6.28729e-09) :xyz}
  2998. do_test printf-2.7.13.7 {
  2999. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 -6.287291e-9
  3000. } {abc: 3 3 (-0.000) :xyz}
  3001. do_test printf-2.7.13.8 {
  3002. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 -6.287291e-9
  3003. } {abc: 3 3 (-6.287e-09) :xyz}
  3004. do_test printf-2.7.13.9 {
  3005. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 -6.287291e-9
  3006. } {abc: 3 3 (-6.29e-09) :xyz}
  3007. do_test printf-2.7.14.1 {
  3008. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 3 3.38826392e-110
  3009. } {abc: (0.000) :xyz}
  3010. do_test printf-2.7.14.2 {
  3011. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 3 3.38826392e-110
  3012. } {abc: (3.388e-110) :xyz}
  3013. do_test printf-2.7.14.3 {
  3014. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 3 3.38826392e-110
  3015. } {abc: (3.39e-110) :xyz}
  3016. do_test printf-2.7.14.4 {
  3017. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 3 3.38826392e-110
  3018. } {abc: 3 3 (3.38826e-110) :xyz}
  3019. do_test printf-2.7.14.5 {
  3020. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 3 3.38826392e-110
  3021. } {abc: 3 3 (3.38826e-110) :xyz}
  3022. do_test printf-2.7.14.6 {
  3023. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 3 3.38826392e-110
  3024. } {abc: 3 3 (3.38826e-110) :xyz}
  3025. do_test printf-2.7.14.7 {
  3026. sqlite3_mprintf_double {abc: %d %d (%3.3f) :xyz} 3 3 3.38826392e-110
  3027. } {abc: 3 3 (0.000) :xyz}
  3028. do_test printf-2.7.14.8 {
  3029. sqlite3_mprintf_double {abc: %d %d (%3.3e) :xyz} 3 3 3.38826392e-110
  3030. } {abc: 3 3 (3.388e-110) :xyz}
  3031. do_test printf-2.7.14.9 {
  3032. sqlite3_mprintf_double {abc: %d %d (%3.3g) :xyz} 3 3 3.38826392e-110
  3033. } {abc: 3 3 (3.39e-110) :xyz}
  3034. do_test printf-2.8.1.1 {
  3035. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 0.001
  3036. } {abc: (0.00) :xyz}
  3037. do_test printf-2.8.1.2 {
  3038. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 0.001
  3039. } {abc: (1.00e-03) :xyz}
  3040. do_test printf-2.8.1.3 {
  3041. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 0.001
  3042. } {abc: (0.001) :xyz}
  3043. do_test printf-2.8.1.4 {
  3044. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 0.001
  3045. } {abc: 3 2 (0.001) :xyz}
  3046. do_test printf-2.8.1.5 {
  3047. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 0.001
  3048. } {abc: 3 2 (0.00100000) :xyz}
  3049. do_test printf-2.8.1.6 {
  3050. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 0.001
  3051. } {abc: 3 2 (000000.001) :xyz}
  3052. do_test printf-2.8.1.7 {
  3053. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 0.001
  3054. } {abc: 3 2 (0.00) :xyz}
  3055. do_test printf-2.8.1.8 {
  3056. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 0.001
  3057. } {abc: 3 2 (1.00e-03) :xyz}
  3058. do_test printf-2.8.1.9 {
  3059. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 0.001
  3060. } {abc: 3 2 (0.001) :xyz}
  3061. do_test printf-2.8.2.1 {
  3062. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 1.0e-20
  3063. } {abc: (0.00) :xyz}
  3064. do_test printf-2.8.2.2 {
  3065. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 1.0e-20
  3066. } {abc: (1.00e-20) :xyz}
  3067. do_test printf-2.8.2.3 {
  3068. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 1.0e-20
  3069. } {abc: (1e-20) :xyz}
  3070. do_test printf-2.8.2.4 {
  3071. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 1.0e-20
  3072. } {abc: 3 2 (1e-20) :xyz}
  3073. do_test printf-2.8.2.5 {
  3074. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 1.0e-20
  3075. } {abc: 3 2 (1.00000e-20) :xyz}
  3076. do_test printf-2.8.2.6 {
  3077. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 1.0e-20
  3078. } {abc: 3 2 (000001e-20) :xyz}
  3079. do_test printf-2.8.2.7 {
  3080. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 1.0e-20
  3081. } {abc: 3 2 (0.00) :xyz}
  3082. do_test printf-2.8.2.8 {
  3083. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 1.0e-20
  3084. } {abc: 3 2 (1.00e-20) :xyz}
  3085. do_test printf-2.8.2.9 {
  3086. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 1.0e-20
  3087. } {abc: 3 2 (1e-20) :xyz}
  3088. do_test printf-2.8.3.1 {
  3089. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 1.0
  3090. } {abc: (1.00) :xyz}
  3091. do_test printf-2.8.3.2 {
  3092. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 1.0
  3093. } {abc: (1.00e+00) :xyz}
  3094. do_test printf-2.8.3.3 {
  3095. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 1.0
  3096. } {abc: ( 1) :xyz}
  3097. do_test printf-2.8.3.4 {
  3098. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 1.0
  3099. } {abc: 3 2 (1) :xyz}
  3100. do_test printf-2.8.3.5 {
  3101. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 1.0
  3102. } {abc: 3 2 (1.00000) :xyz}
  3103. do_test printf-2.8.3.6 {
  3104. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 1.0
  3105. } {abc: 3 2 (0000000001) :xyz}
  3106. do_test printf-2.8.3.7 {
  3107. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 1.0
  3108. } {abc: 3 2 (1.00) :xyz}
  3109. do_test printf-2.8.3.8 {
  3110. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 1.0
  3111. } {abc: 3 2 (1.00e+00) :xyz}
  3112. do_test printf-2.8.3.9 {
  3113. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 1.0
  3114. } {abc: 3 2 ( 1) :xyz}
  3115. do_test printf-2.8.4.1 {
  3116. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 0.0
  3117. } {abc: (0.00) :xyz}
  3118. do_test printf-2.8.4.2 {
  3119. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 0.0
  3120. } {abc: (0.00e+00) :xyz}
  3121. do_test printf-2.8.4.3 {
  3122. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 0.0
  3123. } {abc: ( 0) :xyz}
  3124. do_test printf-2.8.4.4 {
  3125. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 0.0
  3126. } {abc: 3 2 (0) :xyz}
  3127. do_test printf-2.8.4.5 {
  3128. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 0.0
  3129. } {abc: 3 2 (0.00000) :xyz}
  3130. do_test printf-2.8.4.6 {
  3131. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 0.0
  3132. } {abc: 3 2 (0000000000) :xyz}
  3133. do_test printf-2.8.4.7 {
  3134. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 0.0
  3135. } {abc: 3 2 (0.00) :xyz}
  3136. do_test printf-2.8.4.8 {
  3137. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 0.0
  3138. } {abc: 3 2 (0.00e+00) :xyz}
  3139. do_test printf-2.8.4.9 {
  3140. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 0.0
  3141. } {abc: 3 2 ( 0) :xyz}
  3142. do_test printf-2.8.5.1 {
  3143. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 100.0
  3144. } {abc: (100.00) :xyz}
  3145. do_test printf-2.8.5.2 {
  3146. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 100.0
  3147. } {abc: (1.00e+02) :xyz}
  3148. do_test printf-2.8.5.3 {
  3149. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 100.0
  3150. } {abc: (1e+02) :xyz}
  3151. do_test printf-2.8.5.4 {
  3152. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 100.0
  3153. } {abc: 3 2 (100) :xyz}
  3154. do_test printf-2.8.5.5 {
  3155. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 100.0
  3156. } {abc: 3 2 (100.000) :xyz}
  3157. do_test printf-2.8.5.6 {
  3158. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 100.0
  3159. } {abc: 3 2 (0000000100) :xyz}
  3160. do_test printf-2.8.5.7 {
  3161. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 100.0
  3162. } {abc: 3 2 (100.00) :xyz}
  3163. do_test printf-2.8.5.8 {
  3164. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 100.0
  3165. } {abc: 3 2 (1.00e+02) :xyz}
  3166. do_test printf-2.8.5.9 {
  3167. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 100.0
  3168. } {abc: 3 2 (1e+02) :xyz}
  3169. do_test printf-2.8.6.1 {
  3170. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 9.99999
  3171. } {abc: (10.00) :xyz}
  3172. do_test printf-2.8.6.2 {
  3173. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 9.99999
  3174. } {abc: (1.00e+01) :xyz}
  3175. do_test printf-2.8.6.3 {
  3176. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 9.99999
  3177. } {abc: ( 10) :xyz}
  3178. do_test printf-2.8.6.4 {
  3179. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 9.99999
  3180. } {abc: 3 2 (9.99999) :xyz}
  3181. do_test printf-2.8.6.5 {
  3182. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 9.99999
  3183. } {abc: 3 2 (9.99999) :xyz}
  3184. do_test printf-2.8.6.6 {
  3185. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 9.99999
  3186. } {abc: 3 2 (0009.99999) :xyz}
  3187. do_test printf-2.8.6.7 {
  3188. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 9.99999
  3189. } {abc: 3 2 (10.00) :xyz}
  3190. do_test printf-2.8.6.8 {
  3191. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 9.99999
  3192. } {abc: 3 2 (1.00e+01) :xyz}
  3193. do_test printf-2.8.6.9 {
  3194. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 9.99999
  3195. } {abc: 3 2 ( 10) :xyz}
  3196. do_test printf-2.8.7.1 {
  3197. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 -0.00543
  3198. } {abc: (-0.01) :xyz}
  3199. do_test printf-2.8.7.2 {
  3200. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 -0.00543
  3201. } {abc: (-5.43e-03) :xyz}
  3202. do_test printf-2.8.7.3 {
  3203. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 -0.00543
  3204. } {abc: (-0.0054) :xyz}
  3205. do_test printf-2.8.7.4 {
  3206. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 -0.00543
  3207. } {abc: 3 2 (-0.00543) :xyz}
  3208. do_test printf-2.8.7.5 {
  3209. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 -0.00543
  3210. } {abc: 3 2 (-0.00543000) :xyz}
  3211. do_test printf-2.8.7.6 {
  3212. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 -0.00543
  3213. } {abc: 3 2 (-000.00543) :xyz}
  3214. do_test printf-2.8.7.7 {
  3215. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 -0.00543
  3216. } {abc: 3 2 (-0.01) :xyz}
  3217. do_test printf-2.8.7.8 {
  3218. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 -0.00543
  3219. } {abc: 3 2 (-5.43e-03) :xyz}
  3220. do_test printf-2.8.7.9 {
  3221. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 -0.00543
  3222. } {abc: 3 2 (-0.0054) :xyz}
  3223. do_test printf-2.8.8.1 {
  3224. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 -1.0
  3225. } {abc: (-1.00) :xyz}
  3226. do_test printf-2.8.8.2 {
  3227. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 -1.0
  3228. } {abc: (-1.00e+00) :xyz}
  3229. do_test printf-2.8.8.3 {
  3230. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 -1.0
  3231. } {abc: ( -1) :xyz}
  3232. do_test printf-2.8.8.4 {
  3233. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 -1.0
  3234. } {abc: 3 2 (-1) :xyz}
  3235. do_test printf-2.8.8.5 {
  3236. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 -1.0
  3237. } {abc: 3 2 (-1.00000) :xyz}
  3238. do_test printf-2.8.8.6 {
  3239. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 -1.0
  3240. } {abc: 3 2 (-000000001) :xyz}
  3241. do_test printf-2.8.8.7 {
  3242. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 -1.0
  3243. } {abc: 3 2 (-1.00) :xyz}
  3244. do_test printf-2.8.8.8 {
  3245. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 -1.0
  3246. } {abc: 3 2 (-1.00e+00) :xyz}
  3247. do_test printf-2.8.8.9 {
  3248. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 -1.0
  3249. } {abc: 3 2 ( -1) :xyz}
  3250. do_test printf-2.8.9.1 {
  3251. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 -99.99999
  3252. } {abc: (-100.00) :xyz}
  3253. do_test printf-2.8.9.2 {
  3254. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 -99.99999
  3255. } {abc: (-1.00e+02) :xyz}
  3256. do_test printf-2.8.9.3 {
  3257. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 -99.99999
  3258. } {abc: (-1e+02) :xyz}
  3259. do_test printf-2.8.9.4 {
  3260. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 -99.99999
  3261. } {abc: 3 2 (-100) :xyz}
  3262. do_test printf-2.8.9.5 {
  3263. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 -99.99999
  3264. } {abc: 3 2 (-100.000) :xyz}
  3265. do_test printf-2.8.9.6 {
  3266. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 -99.99999
  3267. } {abc: 3 2 (-000000100) :xyz}
  3268. do_test printf-2.8.9.7 {
  3269. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 -99.99999
  3270. } {abc: 3 2 (-100.00) :xyz}
  3271. do_test printf-2.8.9.8 {
  3272. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 -99.99999
  3273. } {abc: 3 2 (-1.00e+02) :xyz}
  3274. do_test printf-2.8.9.9 {
  3275. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 -99.99999
  3276. } {abc: 3 2 (-1e+02) :xyz}
  3277. do_test printf-2.8.10.1 {
  3278. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 3.14e+9
  3279. } {abc: (3140000000.00) :xyz}
  3280. do_test printf-2.8.10.2 {
  3281. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 3.14e+9
  3282. } {abc: (3.14e+09) :xyz}
  3283. do_test printf-2.8.10.3 {
  3284. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 3.14e+9
  3285. } {abc: (3.1e+09) :xyz}
  3286. do_test printf-2.8.10.4 {
  3287. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 3.14e+9
  3288. } {abc: 3 2 (3.14e+09) :xyz}
  3289. do_test printf-2.8.10.5 {
  3290. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 3.14e+9
  3291. } {abc: 3 2 (3.14000e+09) :xyz}
  3292. do_test printf-2.8.10.6 {
  3293. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 3.14e+9
  3294. } {abc: 3 2 (003.14e+09) :xyz}
  3295. do_test printf-2.8.10.7 {
  3296. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 3.14e+9
  3297. } {abc: 3 2 (3140000000.00) :xyz}
  3298. do_test printf-2.8.10.8 {
  3299. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 3.14e+9
  3300. } {abc: 3 2 (3.14e+09) :xyz}
  3301. do_test printf-2.8.10.9 {
  3302. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 3.14e+9
  3303. } {abc: 3 2 (3.1e+09) :xyz}
  3304. do_test printf-2.8.11.2 {
  3305. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 -4.72732e+88
  3306. } {abc: (-4.73e+88) :xyz}
  3307. do_test printf-2.8.11.3 {
  3308. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 -4.72732e+88
  3309. } {abc: (-4.7e+88) :xyz}
  3310. do_test printf-2.8.11.4 {
  3311. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 -4.72732e+88
  3312. } {abc: 3 2 (-4.72732e+88) :xyz}
  3313. do_test printf-2.8.11.5 {
  3314. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 -4.72732e+88
  3315. } {abc: 3 2 (-4.72732e+88) :xyz}
  3316. do_test printf-2.8.11.6 {
  3317. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 -4.72732e+88
  3318. } {abc: 3 2 (-4.72732e+88) :xyz}
  3319. do_test printf-2.8.11.8 {
  3320. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 -4.72732e+88
  3321. } {abc: 3 2 (-4.73e+88) :xyz}
  3322. do_test printf-2.8.11.9 {
  3323. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 -4.72732e+88
  3324. } {abc: 3 2 (-4.7e+88) :xyz}
  3325. do_test printf-2.8.12.2 {
  3326. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 9.87991e+143
  3327. } {abc: (9.88e+143) :xyz}
  3328. do_test printf-2.8.12.3 {
  3329. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 9.87991e+143
  3330. } {abc: (9.9e+143) :xyz}
  3331. do_test printf-2.8.12.4 {
  3332. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 9.87991e+143
  3333. } {abc: 3 2 (9.87991e+143) :xyz}
  3334. do_test printf-2.8.12.5 {
  3335. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 9.87991e+143
  3336. } {abc: 3 2 (9.87991e+143) :xyz}
  3337. do_test printf-2.8.12.6 {
  3338. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 9.87991e+143
  3339. } {abc: 3 2 (9.87991e+143) :xyz}
  3340. do_test printf-2.8.12.8 {
  3341. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 9.87991e+143
  3342. } {abc: 3 2 (9.88e+143) :xyz}
  3343. do_test printf-2.8.12.9 {
  3344. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 9.87991e+143
  3345. } {abc: 3 2 (9.9e+143) :xyz}
  3346. do_test printf-2.8.13.1 {
  3347. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 -6.287291e-9
  3348. } {abc: (-0.00) :xyz}
  3349. do_test printf-2.8.13.2 {
  3350. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 -6.287291e-9
  3351. } {abc: (-6.29e-09) :xyz}
  3352. do_test printf-2.8.13.3 {
  3353. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 -6.287291e-9
  3354. } {abc: (-6.3e-09) :xyz}
  3355. do_test printf-2.8.13.4 {
  3356. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 -6.287291e-9
  3357. } {abc: 3 2 (-6.28729e-09) :xyz}
  3358. do_test printf-2.8.13.5 {
  3359. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 -6.287291e-9
  3360. } {abc: 3 2 (-6.28729e-09) :xyz}
  3361. do_test printf-2.8.13.6 {
  3362. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 -6.287291e-9
  3363. } {abc: 3 2 (-6.28729e-09) :xyz}
  3364. do_test printf-2.8.13.7 {
  3365. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 -6.287291e-9
  3366. } {abc: 3 2 (-0.00) :xyz}
  3367. do_test printf-2.8.13.8 {
  3368. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 -6.287291e-9
  3369. } {abc: 3 2 (-6.29e-09) :xyz}
  3370. do_test printf-2.8.13.9 {
  3371. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 -6.287291e-9
  3372. } {abc: 3 2 (-6.3e-09) :xyz}
  3373. do_test printf-2.8.14.1 {
  3374. sqlite3_mprintf_double {abc: (%*.*f) :xyz} 3 2 3.38826392e-110
  3375. } {abc: (0.00) :xyz}
  3376. do_test printf-2.8.14.2 {
  3377. sqlite3_mprintf_double {abc: (%*.*e) :xyz} 3 2 3.38826392e-110
  3378. } {abc: (3.39e-110) :xyz}
  3379. do_test printf-2.8.14.3 {
  3380. sqlite3_mprintf_double {abc: (%*.*g) :xyz} 3 2 3.38826392e-110
  3381. } {abc: (3.4e-110) :xyz}
  3382. do_test printf-2.8.14.4 {
  3383. sqlite3_mprintf_double {abc: %d %d (%g) :xyz} 3 2 3.38826392e-110
  3384. } {abc: 3 2 (3.38826e-110) :xyz}
  3385. do_test printf-2.8.14.5 {
  3386. sqlite3_mprintf_double {abc: %d %d (%#g) :xyz} 3 2 3.38826392e-110
  3387. } {abc: 3 2 (3.38826e-110) :xyz}
  3388. do_test printf-2.8.14.6 {
  3389. sqlite3_mprintf_double {abc: %d %d (%010g) :xyz} 3 2 3.38826392e-110
  3390. } {abc: 3 2 (3.38826e-110) :xyz}
  3391. do_test printf-2.8.14.7 {
  3392. sqlite3_mprintf_double {abc: %d %d (%3.2f) :xyz} 3 2 3.38826392e-110
  3393. } {abc: 3 2 (0.00) :xyz}
  3394. do_test printf-2.8.14.8 {
  3395. sqlite3_mprintf_double {abc: %d %d (%3.2e) :xyz} 3 2 3.38826392e-110
  3396. } {abc: 3 2 (3.39e-110) :xyz}
  3397. do_test printf-2.8.14.9 {
  3398. sqlite3_mprintf_double {abc: %d %d (%3.2g) :xyz} 3 2 3.38826392e-110
  3399. } {abc: 3 2 (3.4e-110) :xyz}
  3400. do_test printf-2.8.15.1 {
  3401. sqlite3_mprintf_double {abc: (% *.*f) :xyz} 3 2 3.38826392e-110
  3402. } {abc: ( 0.00) :xyz}
  3403. do_test printf-2.8.15.2 {
  3404. sqlite3_mprintf_double {abc: (% *.*e) :xyz} 3 2 3.38826392e-110
  3405. } {abc: ( 3.39e-110) :xyz}
  3406. do_test printf-2.8.15.3 {
  3407. sqlite3_mprintf_double {abc: (% *.*g) :xyz} 3 2 3.38826392e-110
  3408. } {abc: ( 3.4e-110) :xyz}
  3409. do_test printf-2.8.15.4 {
  3410. sqlite3_mprintf_double {abc: %d %d (% g) :xyz} 3 2 3.38826392e-110
  3411. } {abc: 3 2 ( 3.38826e-110) :xyz}
  3412. do_test printf-2.8.15.5 {
  3413. sqlite3_mprintf_double {abc: %d %d (% #g) :xyz} 3 2 3.38826392e-110
  3414. } {abc: 3 2 ( 3.38826e-110) :xyz}
  3415. do_test printf-2.8.15.6 {
  3416. sqlite3_mprintf_double {abc: %d %d (%0 10g) :xyz} 3 2 3.38826392e-110
  3417. } {abc: 3 2 ( 3.38826e-110) :xyz}
  3418. do_test printf-2.8.15.7 {
  3419. sqlite3_mprintf_double {abc: %d %d (% 3.2f) :xyz} 3 2 3.38826392e-110
  3420. } {abc: 3 2 ( 0.00) :xyz}
  3421. do_test printf-2.8.15.8 {
  3422. sqlite3_mprintf_double {abc: %d %d (% 3.2e) :xyz} 3 2 3.38826392e-110
  3423. } {abc: 3 2 ( 3.39e-110) :xyz}
  3424. do_test printf-2.8.15.9 {
  3425. sqlite3_mprintf_double {abc: %d %d (% 3.2g) :xyz} 3 2 3.38826392e-110
  3426. } {abc: 3 2 ( 3.4e-110) :xyz}
  3427. do_test printf-2.9.1 {
  3428. sqlite3_mprintf_double {abc: %d %d (%5.0g) :xyz} 0 0 1.234
  3429. } {abc: 0 0 ( 1) :xyz}
  3430. do_test printf-2.9.2 {
  3431. sqlite3_mprintf_double {abc: %d %d (%+5.0g) :xyz} 0 0 1.234
  3432. } {abc: 0 0 ( +1) :xyz}
  3433. do_test printf-2.9.3 {
  3434. sqlite3_mprintf_double {abc: %d %d (%+-5.0g) :xyz} 0 0 1.234
  3435. } {abc: 0 0 (+1 ) :xyz}
  3436. do_test printf-2.10.1 {
  3437. sqlite3_mprintf_double {abc: %d %d (%-010.5f) :xyz} 0 0 1.234
  3438. } {abc: 0 0 (1.23400 ) :xyz}
  3439. do_test printf-2.10.2 {
  3440. sqlite3_mprintf_double {abc: %d %d (%010.5f) :xyz} 0 0 1.234
  3441. } {abc: 0 0 (0001.23400) :xyz}
  3442. do_test printf-2.10.3 {
  3443. sqlite3_mprintf_double {abc: %d %d (%+010.5f) :xyz} 0 0 1.234
  3444. } {abc: 0 0 (+001.23400) :xyz}
  3445. do_test printf-3.1 {
  3446. sqlite3_mprintf_str {A String: (%*.*s)} 10 10 {This is the string}
  3447. } [format {A String: (%*.*s)} 10 10 {This is the string}]
  3448. do_test printf-3.2 {
  3449. sqlite3_mprintf_str {A String: (%*.*s)} 10 5 {This is the string}
  3450. } [format {A String: (%*.*s)} 10 5 {This is the string}]
  3451. do_test printf-3.3 {
  3452. sqlite3_mprintf_str {A String: (%*.*s)} -10 5 {This is the string}
  3453. } [format {A String: (%*.*s)} -10 5 {This is the string}]
  3454. do_test printf-3.4 {
  3455. sqlite3_mprintf_str {%d %d A String: (%s)} 1 2 {This is the string}
  3456. } [format {%d %d A String: (%s)} 1 2 {This is the string}]
  3457. do_test printf-3.5 {
  3458. sqlite3_mprintf_str {%d %d A String: (%30s)} 1 2 {This is the string}
  3459. } [format {%d %d A String: (%30s)} 1 2 {This is the string}]
  3460. do_test printf-3.6 {
  3461. sqlite3_mprintf_str {%d %d A String: (%-30s)} 1 2 {This is the string}
  3462. } [format {%d %d A String: (%-30s)} 1 2 {This is the string}]
  3463. do_test snprintf-3.11 {
  3464. sqlite3_snprintf_str 2 {x%d %d %s} 10 10 {This is the string}
  3465. } {x}
  3466. do_test snprintf-3.12 {
  3467. sqlite3_snprintf_str 3 {x%d %d %s} 10 10 {This is the string}
  3468. } {x1}
  3469. do_test snprintf-3.13 {
  3470. sqlite3_snprintf_str 4 {x%d %d %s} 10 10 {This is the string}
  3471. } {x10}
  3472. do_test snprintf-3.14 {
  3473. sqlite3_snprintf_str 5 {x%d %d %s} 10 10 {This is the string}
  3474. } {x10 }
  3475. do_test snprintf-3.15 {
  3476. sqlite3_snprintf_str 6 {x%d %d %s} 10 10 {This is the string}
  3477. } {x10 1}
  3478. do_test snprintf-3.16 {
  3479. sqlite3_snprintf_str 7 {x%d %d %s} 10 10 {This is the string}
  3480. } {x10 10}
  3481. do_test snprintf-3.17 {
  3482. sqlite3_snprintf_str 8 {x%d %d %s} 10 10 {This is the string}
  3483. } {x10 10 }
  3484. do_test snprintf-3.18 {
  3485. sqlite3_snprintf_str 9 {x%d %d %s} 10 10 {This is the string}
  3486. } {x10 10 T}
  3487. do_test snprintf-3.19 {
  3488. sqlite3_snprintf_str 100 {x%d %d %s} 10 10 {This is the string}
  3489. } {x10 10 This is the string}
  3490. do_test printf-4.1 {
  3491. sqlite3_mprintf_str {%d %d A quoted string: '%q'} 1 2 {Hi Y'all}
  3492. } {1 2 A quoted string: 'Hi Y''all'}
  3493. do_test printf-4.2 {
  3494. sqlite3_mprintf_str {%d %d A NULL pointer in %%q: '%q'} 1 2
  3495. } {1 2 A NULL pointer in %q: '(NULL)'}
  3496. do_test printf-4.3 {
  3497. sqlite3_mprintf_str {%d %d A quoted string: %Q} 1 2 {Hi Y'all}
  3498. } {1 2 A quoted string: 'Hi Y''all'}
  3499. do_test printf-4.4 {
  3500. sqlite3_mprintf_str {%d %d A NULL pointer in %%Q: %Q} 1 2
  3501. } {1 2 A NULL pointer in %Q: NULL}
  3502. do_test printf-4.5 {
  3503. sqlite3_mprintf_str {%d %d A quoted string: '%.10q'} 1 2 {Hi Y'all}
  3504. } {1 2 A quoted string: 'Hi Y''all'}
  3505. do_test printf-4.6 {
  3506. sqlite3_mprintf_str {%d %d A quoted string: '%.9q'} 1 2 {Hi Y'all}
  3507. } {1 2 A quoted string: 'Hi Y''all'}
  3508. do_test printf-4.7 {
  3509. sqlite3_mprintf_str {%d %d A quoted string: '%.8q'} 1 2 {Hi Y'all}
  3510. } {1 2 A quoted string: 'Hi Y''all'}
  3511. do_test printf-4.8 {
  3512. sqlite3_mprintf_str {%d %d A quoted string: '%.7q'} 1 2 {Hi Y'all}
  3513. } {1 2 A quoted string: 'Hi Y''al'}
  3514. do_test printf-4.9 {
  3515. sqlite3_mprintf_str {%d %d A quoted string: '%.6q'} 1 2 {Hi Y'all}
  3516. } {1 2 A quoted string: 'Hi Y''a'}
  3517. do_test printf-4.10 {
  3518. sqlite3_mprintf_str {%d %d A quoted string: '%.5q'} 1 2 {Hi Y'all}
  3519. } {1 2 A quoted string: 'Hi Y'''}
  3520. do_test printf-4.11 {
  3521. sqlite3_mprintf_str {%d %d A quoted string: '%.4q'} 1 2 {Hi Y'all}
  3522. } {1 2 A quoted string: 'Hi Y'}
  3523. do_test printf-4.12 {
  3524. sqlite3_mprintf_str {%d %d A quoted string: '%.3q'} 1 2 {Hi Y'all}
  3525. } {1 2 A quoted string: 'Hi '}
  3526. do_test printf-4.13 {
  3527. sqlite3_mprintf_str {%d %d A quoted string: '%.2q'} 1 2 {Hi Y'all}
  3528. } {1 2 A quoted string: 'Hi'}
  3529. do_test printf-4.14 {
  3530. sqlite3_mprintf_str {%d %d A quoted string: '%.1q'} 1 2 {Hi Y'all}
  3531. } {1 2 A quoted string: 'H'}
  3532. do_test printf-4.15 {
  3533. sqlite3_mprintf_str {%d %d A quoted string: '%.0q'} 1 2 {Hi Y'all}
  3534. } {1 2 A quoted string: ''}
  3535. do_test printf-4.16 {
  3536. sqlite3_mprintf_str {%d A quoted string: '%.*q'} 1 6 {Hi Y'all}
  3537. } {1 A quoted string: 'Hi Y''a'}
  3538. do_test printf-5.1 {
  3539. set x [sqlite3_mprintf_str {%d %d %100000s} 0 0 {Hello}]
  3540. string length $x
  3541. } {344}
  3542. do_test printf-5.2 {
  3543. sqlite3_mprintf_str {%d %d (%-10.10s) %} -9 -10 {HelloHelloHello}
  3544. } {-9 -10 (HelloHello) %}
  3545. do_test printf-6.1 {
  3546. sqlite3_mprintf_z_test , one two three four five six
  3547. } {,one,two,three,four,five,six}
  3548. do_test printf-7.1 {
  3549. sqlite3_mprintf_scaled {A double: %g} 1.0e307 1.0
  3550. } {A double: 1e+307}
  3551. do_test printf-7.2 {
  3552. sqlite3_mprintf_scaled {A double: %g} 1.0e307 10.0
  3553. } {A double: 1e+308}
  3554. do_test printf-7.3 {
  3555. sqlite3_mprintf_scaled {A double: %g} 1.0e307 100.0
  3556. } {A double: Inf}
  3557. do_test printf-7.4 {
  3558. sqlite3_mprintf_scaled {A double: %g} -1.0e307 100.0
  3559. } {A double: -Inf}
  3560. do_test printf-7.5 {
  3561. sqlite3_mprintf_scaled {A double: %+g} 1.0e307 100.0
  3562. } {A double: +Inf}
  3563. do_test printf-8.1 {
  3564. sqlite3_mprintf_int {%u %u %u} 0x7fffffff 0x80000000 0xffffffff
  3565. } {2147483647 2147483648 4294967295}
  3566. do_test printf-8.2 {
  3567. sqlite3_mprintf_long {%lu %lu %lu} 0x7fffffff 0x80000000 0xffffffff
  3568. } {2147483647 2147483648 4294967295}
  3569. do_test printf-8.3 {
  3570. sqlite3_mprintf_int64 {%llu %llu %llu} 2147483647 2147483648 4294967296
  3571. } {2147483647 2147483648 4294967296}
  3572. do_test printf-8.4 {
  3573. sqlite3_mprintf_int64 {%lld %lld %lld} 2147483647 2147483648 4294967296
  3574. } {2147483647 2147483648 4294967296}
  3575. do_test printf-8.5 {
  3576. sqlite3_mprintf_int64 {%llx %llx %llx} 2147483647 2147483648 4294967296
  3577. } {7fffffff 80000000 100000000}
  3578. do_test printf-8.6 {
  3579. sqlite3_mprintf_int64 {%llx %llo %lld} -1 -1 -1
  3580. } {ffffffffffffffff 1777777777777777777777 -1}
  3581. do_test printf-8.7 {
  3582. sqlite3_mprintf_int64 {%llx %llx %llx} +2147483647 +2147483648 +4294967296
  3583. } {7fffffff 80000000 100000000}
  3584. do_test printf-9.1 {
  3585. sqlite3_mprintf_int {%*.*c} 4 4 65
  3586. } {AAAA}
  3587. do_test printf-9.2 {
  3588. sqlite3_mprintf_int {%*.*c} -4 1 66
  3589. } {B }
  3590. do_test printf-9.3 {
  3591. sqlite3_mprintf_int {%*.*c} 4 1 67
  3592. } { C}
  3593. do_test printf-9.4 {
  3594. sqlite3_mprintf_int {%d %d %c} 4 1 67
  3595. } {4 1 C}
  3596. set ten { }
  3597. set fifty $ten$ten$ten$ten$ten
  3598. do_test printf-9.5 {
  3599. sqlite3_mprintf_int {%d %*c} 1 -201 67
  3600. } "1 C$fifty$fifty$fifty$fifty"
  3601. do_test printf-9.6 {
  3602. sqlite3_mprintf_int {hi%12345.12346yhello} 0 0 0
  3603. } {hi}
  3604. # Ticket #812
  3605. #
  3606. do_test printf-10.1 {
  3607. sqlite3_mprintf_stronly %s {}
  3608. } {}
  3609. # Ticket #831
  3610. #
  3611. do_test printf-10.2 {
  3612. sqlite3_mprintf_stronly %q {}
  3613. } {}
  3614. # Ticket #1340: Test for loss of precision on large positive exponents
  3615. #
  3616. do_test printf-10.3 {
  3617. sqlite3_mprintf_double {%d %d %f} 1 1 1e300
  3618. } {1 1 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000}
  3619. # The non-standard '!' flag on a 'g' conversion forces a decimal point
  3620. # and at least one digit on either side of the decimal point.
  3621. #
  3622. do_test printf-11.1 {
  3623. sqlite3_mprintf_double {%d %d %!g} 1 1 1
  3624. } {1 1 1.0}
  3625. do_test printf-11.2 {
  3626. sqlite3_mprintf_double {%d %d %!g} 1 1 123
  3627. } {1 1 123.0}
  3628. do_test printf-11.3 {
  3629. sqlite3_mprintf_double {%d %d %!g} 1 1 12.3
  3630. } {1 1 12.3}
  3631. do_test printf-11.4 {
  3632. sqlite3_mprintf_double {%d %d %!g} 1 1 0.123
  3633. } {1 1 0.123}
  3634. do_test printf-11.5 {
  3635. sqlite3_mprintf_double {%d %d %!.15g} 1 1 1
  3636. } {1 1 1.0}
  3637. do_test printf-11.6 {
  3638. sqlite3_mprintf_double {%d %d %!.15g} 1 1 1e10
  3639. } {1 1 10000000000.0}
  3640. do_test printf-11.7 {
  3641. sqlite3_mprintf_double {%d %d %!.15g} 1 1 1e300
  3642. } {1 1 1.0e+300}
  3643. # Additional tests for coverage
  3644. #
  3645. do_test printf-12.1 {
  3646. sqlite3_mprintf_double {%d %d %.2000g} 1 1 1.0
  3647. } {1 1 1}
  3648. # Floating point boundary cases
  3649. #
  3650. do_test printf-13.1 {
  3651. sqlite3_mprintf_hexdouble %.20f 4024000000000000
  3652. } {10.00000000000000000000}
  3653. do_test printf-13.2 {
  3654. sqlite3_mprintf_hexdouble %.20f 4197d78400000000
  3655. } {100000000.00000000000000000000}
  3656. do_test printf-13.3 {
  3657. sqlite3_mprintf_hexdouble %.20f 4693b8b5b5056e17
  3658. } {100000000000000000000000000000000.00000000000000000000}
  3659. do_test printf-13.4 {
  3660. sqlite3_mprintf_hexdouble %.20f 7ff0000000000000
  3661. } {Inf}
  3662. do_test printf-13.5 {
  3663. sqlite3_mprintf_hexdouble %.20f fff0000000000000
  3664. } {-Inf}
  3665. do_test printf-13.6 {
  3666. sqlite3_mprintf_hexdouble %.20f fff8000000000000
  3667. } {NaN}
  3668. do_test printf-14.1 {
  3669. sqlite3_mprintf_str {abc-%y-123} 0 0 {not used}
  3670. } {abc-}
  3671. do_test printf-14.2 {
  3672. sqlite3_mprintf_n_test {xyzzy}
  3673. } 5
  3674. do_test printf-14.3 {
  3675. sqlite3_mprintf_str {abc-%T-123} 0 0 {not used}
  3676. } {abc-}
  3677. do_test printf-14.4 {
  3678. sqlite3_mprintf_str {abc-%#} 0 0 {not used}
  3679. } {abc-}
  3680. do_test printf-14.5 {
  3681. sqlite3_mprintf_str {abc-%*.*s-xyz} 10 -10 {a_very_long_string}
  3682. } {abc-a_very_lon-xyz}
  3683. do_test printf-14.6 {
  3684. sqlite3_mprintf_str {abc-%5.10/} 0 0 {not used}
  3685. } {abc-}
  3686. do_test printf-14.7 {
  3687. sqlite3_mprintf_str {abc-%05.5d} 123 0 {not used}
  3688. } {abc-00123}
  3689. do_test printf-14.8 {
  3690. sqlite3_mprintf_str {abc-%05.5d} 1234567 0 {not used}
  3691. } {abc-1234567}
  3692. for {set i 2} {$i<200} {incr i} {
  3693. set res [string repeat { } [expr {$i-1}]]x
  3694. do_test printf-14.90.$i "
  3695. sqlite3_mprintf_str {%*.*s} $i 500 x
  3696. " $res
  3697. }
  3698. do_test printf-15.1 {
  3699. sqlite3_snprintf_int 5 {12345} 0
  3700. } {1234}
  3701. do_test printf-15.2 {
  3702. sqlite3_snprintf_int 5 {} 0
  3703. } {}
  3704. do_test printf-15.3 {
  3705. sqlite3_snprintf_int 0 {} 0
  3706. } {abcdefghijklmnopqrstuvwxyz}
  3707. # Now test malloc() failure within a sqlite3_mprintf():
  3708. #
  3709. ifcapable memdebug {
  3710. foreach var {a b c d} {
  3711. set $var [string repeat $var 400]
  3712. }
  3713. set str1 "[string repeat A 360]%d%d%s"
  3714. set str2 [string repeat B 5000]
  3715. set zSuccess "[string repeat A 360]11[string repeat B 5000]"
  3716. foreach ::iRepeat {0 1} {
  3717. set nTestNum 1
  3718. while {1} {
  3719. sqlite3_memdebug_fail $nTestNum -repeat $::iRepeat
  3720. set z [sqlite3_mprintf_str $str1 1 1 $str2]
  3721. set nFail [sqlite3_memdebug_fail -1 -benign nBenign]
  3722. do_test printf-malloc-$::iRepeat.$nTestNum {
  3723. expr {($nFail>0 && $z eq "") || ($nFail==$nBenign && $z eq $zSuccess)}
  3724. } {1}
  3725. if {$nFail == 0} break
  3726. incr nTestNum
  3727. }
  3728. }
  3729. }
  3730. finish_test