[ruby-oci8-commit] [506] trunk/ruby-oci8: fix code to test OCI8::CLOB.new(conn, '').

nobody at rubyforge.org nobody at rubyforge.org
Sat Apr 21 04:59:18 UTC 2012


Revision: 506
Author:   kubo
Date:     2012-04-21 04:59:17 +0000 (Sat, 21 Apr 2012)
Log Message:
-----------
fix code to test OCI8::CLOB.new(conn, '').

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/test/test_oci8.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-04-17 12:26:15 UTC (rev 505)
+++ trunk/ruby-oci8/ChangeLog	2012-04-21 04:59:17 UTC (rev 506)
@@ -1,3 +1,6 @@
+2012-04-21  KUBO Takehiro  <kubo at jiubao.org>
+	* test/test_oci8.rb: fix code to test OCI8::CLOB.new(conn, '').
+
 2012-04-17  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/lob.c: 1. fix an exception when OCI8::CLOB.new(conn, '')
 	    is called. 2. Reset the position of a newly created LOB.

Modified: trunk/ruby-oci8/test/test_oci8.rb
===================================================================
--- trunk/ruby-oci8/test/test_oci8.rb	2012-04-17 12:26:15 UTC (rev 505)
+++ trunk/ruby-oci8/test/test_oci8.rb	2012-04-21 04:59:17 UTC (rev 506)
@@ -322,14 +322,20 @@
     @conn.exec(sql)
     cursor = @conn.parse("INSERT INTO test_table VALUES (:1, :2, :3, :4)")
     0.upto(9) do |i|
-      val = format('%d', i) * 4096
+      val = case i
+            when 5; '' # empty string
+            else format('%d', i) * 4096
+            end
       cursor.exec(i, OCI8::CLOB.new(@conn, val), OCI8::NCLOB.new(@conn, val), OCI8::BLOB.new(@conn, val))
     end
     cursor.close
     cursor = @conn.exec("select * from test_table order by id")
     0.upto(9) do |i|
       rv = cursor.fetch
-      val = format('%d', i) * 4096
+      val = case i
+            when 5; '' # empty string
+            else format('%d', i) * 4096
+            end
       assert_equal(i, rv[0])
       assert_instance_of(OCI8::CLOB, rv[1])
       assert_instance_of(OCI8::NCLOB, rv[2])



More information about the ruby-oci8-commit mailing list