Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/sqlite/sqlite-src-3170000/test/ieee754.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/sqlite-src-3170000/test/ieee754.test
diff --git a/third_party/sqlite/sqlite-src-3170000/test/ieee754.test b/third_party/sqlite/sqlite-src-3170000/test/ieee754.test
new file mode 100644
index 0000000000000000000000000000000000000000..bf0676429b7b30794e8c56a7da9e69658d7b5cda
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3170000/test/ieee754.test
@@ -0,0 +1,60 @@
+# 2015-11-06
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Tests of the iee754 extension
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+load_static_extension db ieee754
+
+foreach {id float rep} {
+ 1 1.0 1,0
+ 2 2.0 2,0
+ 3 0.5 1,-1
+ 4 1.5 3,-1
+ 5 0.0 0,-1075
+ 6 4.9406564584124654e-324 4503599627370497,-1075
+ 7 2.2250738585072009e-308 9007199254740991,-1075
+ 8 2.2250738585072014e-308 1,-1022
+} {
+ do_test ieee754-100-$id-1 {
+ db eval "SELECT ieee754($float);"
+ } "ieee754($rep)"
+ do_test ieee754-100-$id-2 {
+ db eval "SELECT ieee754($rep)==$float;"
+ } {1}
+ if {$float!=0.0} {
+ do_test ieee754-100-$id-3 {
+ db eval "SELECT ieee754(-$float);"
+ } "ieee754(-$rep)"
+ do_test ieee754-100-$id-4 {
+ db eval "SELECT ieee754(-$rep)==-$float;"
+ } {1}
+ }
+}
+
+do_test ieee754-110 {
+ string tolower [
+ db eval {SELECT ieee754(1,1024), ieee754(4503599627370495,972);}
+ ]
+} {inf 1.79769313486232e+308}
+do_test ieee754-111 {
+ string tolower [
+ db eval {SELECT ieee754(-1,1024), ieee754(-4503599627370495,972);}
+ ]
+} {-inf -1.79769313486232e+308}
+do_execsql_test ieee754-112 {
+ SELECT ieee754(4503599627370495,973) is null;
+} {1}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/test/icu.test ('k') | third_party/sqlite/sqlite-src-3170000/test/imposter1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698