persistentstorage/sql/TEST/testexecute/SQLite/config/TypeConversion.ini
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:57:14 +0300
branchRCL_3
changeset 23 26645d81f48d
parent 0 08ec8eefde2f
permissions -rw-r--r--
Revision: 201035 Kit: 201035


// Called by TypeConversion.script. This config file contains information
// for type conversion tests. We put a bunch of data in a database, sometimes
// using the wrong type of Bind, then attempt to read it back, sometimes
// using the wrong ColumnXXXX method, and check for the expected result
// as defined by the spec.

[Top]
Delete0=C:\TypeConversion.db
ExpectedError0=KErrNotFound
Create1=C:\TypeConversion.db
NewBlock2=PopulateDB
NewBlock3=CheckContents
Close4=
Delete5=C:\TypeConversion.db
EndBlock6=


[PopulateDB]
Exec0=Create Table Tbl99(f1 int, f2 real, f3 text, f4 blob);
Prepare1=Insert into Tbl99(f1, f2, f3, f4) values(:f1, :f2, :f3, :f4);
ParameterIndex2=:f1
ParameterIndex3=:f2
ParameterIndex4=:f3
ParameterIndex5=:f4

// Put some basic data into the table. Nothing extreme here...
BindInt6=0,-417
BindReal7=1,2.95e15
BindTextFromFile8=2,Z:\TEF_SQL\TestData\reference1.txt
BindBinary9=3,Z:\TEF_SQL\TestData\reference1.bin
St_Exec10=
Reset11=

// Now put some entries into the table that do not match the expected types.
BindInt64_12=0,-123456789012345
BindInt13=1,47
BindBinary14=2,Z:\TEF_SQL\TestData\reference1.txt
BindTextFromFile15=3,Z:\TEF_SQL\TestData\reference1.bin
St_Exec16=
Reset17=

// Put some more basic data into the table. Nothing extreme here...
BindInt18=0,-1
BindReal19=1,1.50
BindText20=2,Once upon a time...
// Forget doing the binary this time.
St_Exec21=
Reset22=

// Outro
St_Close23=
EndBlock24=

[CheckContents]
Prepare0=select * from Tbl99;
ColumnIndex1=f1
ColumnIndex2=f2
ColumnIndex3=f3
ColumnIndex4=f4

// Try to read the data that was correctly put into the table into the
// wrong types.
Next5=
AtRow6=true
ColumnSize7=0,4
ColumnInt64_8=0,-417
// Maxint (32-bit)
ColumnInt9=1,2147483647
ColumnSize10=1,8
ColumnType11=2,
ColumnBinaryD12=2,
ColumnSize13=2,3626
ColumnSize14=3,8094
ColumnTextD15=3,
NoOperation16=

// Try to read the data that was incorrectly put into the table into the
// correct types. In the case of the ColumnText and Binary lines, we
// specify nothing where we would normally give text to match or a file
// because we expect nothing to be returned from ColumnText/Binary,
// but no error either.
Next17=KSqlAtRow
AtRow18=true
// We put a large negative int64 into an int. What do we get back?
ColumnSize19=0,8
ColumnInt20=0,-2147483648

// We put 47 as an integer into a real field. This should be easy..
ColumnSize21=1,8
ColumnReal22=1,47.000

// We used BindBinary to put the content of reference1.txt (actually
// UNICODE) in this text field. What do we get back?
ColumnSize23=2,7254
ColumnTextP24=2,

// We used 'BindText' to put binary (actually ascii) into this BLOB
// field from reference1.bin.
//
// We get size 4047, not 8094 because this has become a text field.
ColumnSize25=3,4047
ColumnType26=3,ESqlText
// This fails, or rather gives an empty buffer because it isn't a binary field
// anymore.
ColumnBinaryL27=3,
// This should work.
ColumnTextL28=3,Z:\TEF_SQL\TestData\reference1.bin

// Now for row 3. This is really just to test real->integer rounding.
Next29=KSqlAtRow
ColumnInt64_30=0,-1
ColumnInt31=1,2
ColumnTextP32=2,Once upon a time...

// Outro
Next33=KSqlAtEnd
AtRow34=false
St_Close35=
Close36=
EndBlock37=