Pastey EDS create_table init_records patch

# HG changeset patch
# User Guillermo Bonvehi 
# Date 1391759568 10800
# Node ID 9d4ffeb601e5c9e78f9dd5d4b849e66248a32622
# Parent  2c379fb63e7481d4e7aa1330b5d4789af612a163
EDS: create_table init_records parameters must be equal or greater than DEF_INIT_RECORDS

diff -r 2c379fb63e74 -r 9d4ffeb601e5 include/std/eds.e
--- a/include/std/eds.e Wed Jan 29 11:00:14 2014 -0500
+++ b/include/std/eds.e Fri Feb 07 04:52:48 2014 -0300
@@ -1609,8 +1609,8 @@
                return DB_EXISTS_ALREADY
        end if

-       if init_records < 1 then
-               init_records = 1
+       if init_records < DEF_INIT_RECORDS then
+               init_records = DEF_INIT_RECORDS
        end if
        init_index = math:min({init_records, MAX_INDEX})

diff -r 2c379fb63e74 -r 9d4ffeb601e5 tests/t_database.e
--- a/tests/t_database.e        Wed Jan 29 11:00:14 2014 -0500
+++ b/tests/t_database.e        Fri Feb 07 04:52:48 2014 -0300
@@ -372,6 +372,20 @@
 end procedure
 test_dump()

+procedure test_create_table_init_0()
+       sequence the_db = "create_table_init_0.edb"
+       db_fatal_id = routine_id( "db_fatal_error" )
+       db_close()
+       if file_exists( the_db ) then
+               delete_file( the_db )
+       end if
+       test_equal( "create " & the_db, DB_OK, db_create( the_db ) )
+       test_equal( "create " & the_db & " table", DB_OK, db_create_table( "table", 1 ) )
+       db_insert( "dummy", "data" )
+       db_close()
+       delete_file( the_db )
+end procedure
+test_create_table_init_0()


 test_report()