Dear Massimo,

attaching a file with a few tcltest test-cases for testing DIO and Sqlite
interface classes. These test cases, except a few, can also be used to test
interfaces other than Sqlite too.

Also attached is a file with the results. There are 4 tests failing.

Will try add more test cases on a daily basis. Pls let me know if you would
like to receive them on incremental basis.

Best Regards,
Nagu.


On Sat, Aug 11, 2012 at 10:11 PM, Massimo Manghi <massimo.man...@unipr.it>wrote:

> I made more changes to dio_Sqlite.tcl. The class was found to fail in
> various circumstances (expecially in SqliteResult's methods) determining
> the number of rows affected  by a query and determining the set of fields
> in a table involved by a query.
>
> Since the author of dio_Sqlite treated 'select' queries is a distinctive
> way from other SQL queries, a new public variable 'select' was added to the
> properties of the class in order to handle consistently the 2 cases within
> SqliteResult. The number of rows affected rows is obtained from the
> 'changes' subcommand of Sqlite3 connector.
>
> Database's class fetch method was rewritten on a more simple (and I think
> correct) assumption that methods 'insert' and 'update' know how to actually
> .... insert and update rows, without the need of code duplication, also
> because both 'insert' and 'update' can be superseded in a class that
> inherits from Database. Therefore now 'fetch' simply calls 'insert' if a
> row for that key is not existing otherwise calls 'update'
>
> I'm attaching here the 2 files for test. I will allow 2 days before
> committing them
>
> A file with the Sqlite3 schema for the tables needed by class Session has
> been uploaded
>
>  -- Massimo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
> For additional commands, e-mail: rivet-dev-h...@tcl.apache.org
>
==== interface-01.01 Test interface command FAILED
==== Contents of test case:

                dbcmd interface
        
---- Result was:

---- Result should have been (exact matching):
Sqlite
==== interface-01.01 FAILED



==== exec02-01.01 Test exec command by executing various sql statements FAILED
==== Contents of test case:

                dbcmd exec {insert into t1 (a, b) values ('1', 'hello')}
                dbcmd count
        
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: -keyfield not specified in DIO object
    while executing
"table_check $args"
    (object "::dbcmd" method "::DIO::Database::count" body line 2)
    invoked from within
"dbcmd count"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $script"
---- errorCode: NONE
==== exec02-01.01 FAILED



==== insert-01.01 Test insert command FAILED
==== Contents of test case:

                dbcmd insert irec
                dbcmd count
        
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: wrong # args: should be "dbcmd insert table arrayName"
    (object "::dbcmd" method "::DIO::Database::insert" body line 1)
    invoked from within
"dbcmd insert irec"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $script"
---- errorCode: NONE
==== insert-01.01 FAILED



==== fetch-01.01 Test fetch command FAILED
==== Contents of test case:

                dbcmd insert irec1
                dbcmd insert irec2
                dbcmd fetch 2 orec
                array get orec
        
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: wrong # args: should be "dbcmd insert table arrayName"
    (object "::dbcmd" method "::DIO::Database::insert" body line 1)
    invoked from within
"dbcmd insert irec1"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $script"
---- errorCode: NONE
==== fetch-01.01 FAILED

Tests running in interp:  /opt/ActiveTcl-8.5/bin/tclsh
Tests located in:  /home/nagu/Downloads/dio/test
Tests running in:  /home/nagu/Downloads/dio/test
Temporary files stored in /home/nagu/Downloads/dio/test
Test files run in separate interpreters
Running tests that match:  *
Skipping test files that match:  l.*.test
Only running test files that match:  *.test
Tests began at Fri Aug 17 01:28:07 IST 2012
Error:  No test files remain after applying your match and skip patterns!

Tests ended at Fri Aug 17 01:28:07 IST 2012
diotest.tcl:    Total   10      Passed  6       Skipped 0       Failed  4
Sourced 0 Test Files.

Attachment: diotest.tcl
Description: Tcl script

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to