os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/Configuration.ini
First public contribution.
2 // ////////////////////////////////////////////////////////////////////////
4 // Configuration tests - try changing the values of the default encoding
5 // and cache_size and page_size. From an integration test we can't really
6 // detect an effect of the _size settings, though we can read them back
7 // with the 'pragma' syntax.
9 // First check the defaults. If these change it will confuse the other tests
10 // so we might as well detect that change and generate a failure ASAP...
12 // First open a zero length database to check the defaults.
14 Open1=Z:\TEF_SQL\TestData\ReadOnly.db
15 Function2=ScalarFullSelect
19 Statement2=PRAGMA encoding;
21 Function3=ScalarFullSelect
25 Statement3=PRAGMA page_size;
27 Function4=ScalarFullSelect
29 Result4=DEFAULT_SOFT_HEAP_LIMIT
31 Statement4=PRAGMA cache_size;
35 // Check that gibberish in the configuration string prevents Create from
38 DefineConfig0=this is a load of old rubbish which should have no effect on settings
39 Delete1=C:\ConfigTest1.db
40 ExpectedError1=KErrNotFound
41 Create2=C:\ConfigTest1.db
42 ExpectedError2=KErrArgument
43 // The next line will PANIC the client because the Create will have failed due
44 // to the bad configuration line. That's ok, we're expecting it.
45 Exec3=Select * from SomeTable;
48 // Check that properly formatted configuration options work, but that
49 // page_size can't be changed for a pre-existing db, and a bad encoding
50 // has no effect. The cache_size is also not affected.
52 DefineConfig0=page_size=2048;cache_size=64;encoding=hatstand
53 // On a pre-existing database we can't change the page size, plus the
54 // bad encoding will have been ignored.
55 Open1=Z:\TEF_SQL\TestData\ReadOnly.db
57 // encoding will not have been changed from its default of utf-16
58 Function2=ScalarFullSelect
62 Statement2=PRAGMA encoding;
64 // page_size will not have been changed from its default of 1024..
65 Function3=ScalarFullSelect
69 Statement3=PRAGMA page_size;
71 // cache_size WILL NOT have changed.
72 Function4=ScalarFullSelect
76 Statement4=PRAGMA cache_size;
81 // Try changing all three config items to legal values, and check them.
83 DefineConfig0=page_size=2048;cache_size=34;encoding=UTF-8
84 // On a new database we can change the page size and the encoding.
85 // Not the cache_size.
86 Delete1=C:\ConfigTest2.db
87 ExpectedError1=KErrNotFound
89 Create2=C:\ConfigTest2.db
91 // encoding will not have been changed from its default of utf-16
92 Function3=ScalarFullSelect
96 Statement3=PRAGMA encoding;
98 // page_size will have been changed from its default of 1024..
99 Function4=ScalarFullSelect
103 Statement4=PRAGMA page_size;
105 // cache_size WILL have changed to 34..
106 Function5=ScalarFullSelect
110 Statement5=PRAGMA cache_size;
113 Delete7=C:\ConfigTest2.db
116 // Try setting page_size to a non-power-of-two (no effect), stick in some
117 // properly formatted by useless extras (no effect) and attempt to set
118 // cache_size (works) and an unsupported encoding (doesn't work).
120 DefineConfig0=page_size=4095;x=y;i=j;cache_size=43;encoding=UTF-16be
121 // On a new database we can change the page size and the encoding.
122 // But page_size is supposed to be a power of 2.
123 Delete1=C:\ConfigTest3.db
124 ExpectedError1=KErrNotFound
126 Create2=C:\ConfigTest3.db
128 // encoding will not have been changed from its default of utf-16
129 Function3=ScalarFullSelect
133 Statement3=PRAGMA encoding;
135 // page_size will not have been changed from its default of 1024..
136 Function4=ScalarFullSelect
140 Statement4=PRAGMA page_size;
142 // cache_size WILL have changed.
143 Function5=ScalarFullSelect
147 Statement5=PRAGMA cache_size;
150 Delete7=C:\ConfigTest3.db
154 // Try setting a legal page_size (works), a cache_size (doesn't work) and
155 // a legal character encoding (works).
157 DefineConfig0=page_size=512;cache_size=432;encoding=UTF-8
158 // On a new database we can change the page size, cache size and the
160 Delete1=C:\ConfigTest4.db
161 ExpectedError1=KErrNotFound
163 Create2=C:\ConfigTest4.db
165 // encoding will not have been changed from its default of utf-16
166 Function3=ScalarFullSelect
170 Statement3=PRAGMA encoding;
172 // page_size will not have been changed from its default of 1024..
173 Function4=ScalarFullSelect
177 Statement4=PRAGMA page_size;
179 // cache_size WILL have changed.
180 Function5=ScalarFullSelect
184 Statement5=PRAGMA cache_size;
187 Delete7=C:\ConfigTest4.db
190 // /////////////////////////////////////////////////////////////////////////
192 // The following tests create two functionally identical databases but one
193 // block uses UTF-8. Then check that the file sizes differ.
195 // Create a database with a single table containing a single cell containing
196 // the text content of the reference1.txt text file. Set UTF-16.
198 Delete0=C:\ConfigTest5.db
199 ExpectedError0=KErrNotFound
200 Create1=C:\ConfigTest5.db
202 // First check for our expected defaults.
203 Function2=ScalarFullSelect
207 Statement2=PRAGMA encoding;
209 Function3=ScalarFullSelect
213 Statement3=PRAGMA page_size;
215 Function4=ScalarFullSelect
217 Result4=DEFAULT_SOFT_HEAP_LIMIT
219 Statement4=PRAGMA cache_size;
221 Exec5=Create Table Sometable(f1 text);
222 Prepare6=Insert into Sometable values(:val);
224 StreamWriteBindText8=0,Z:\TEF_SQL\TestData\reference1.txt
229 Prepare12=select f1 from Sometable;
237 // Create a database with a single table containing a single cell containing
238 // the text content of the reference1.txt text file. Set UTF-8.
240 Delete0=C:\ConfigTest6.db
241 ExpectedError0=KErrNotFound
242 DefineConfig1=encoding=UTF-8
243 Create2=C:\ConfigTest6.db
245 // Check the defaults (plus our changed character encoding)
246 Function3=ScalarFullSelect
250 Statement3=PRAGMA encoding;
252 Function4=ScalarFullSelect
256 Statement4=PRAGMA page_size;
258 Function5=ScalarFullSelect
260 Result5=DEFAULT_SOFT_HEAP_LIMIT
262 Statement5=PRAGMA cache_size;
264 Exec6=Create Table Sometable(f1 text);
265 Prepare7=Insert into Sometable values(:val);
267 StreamWriteBindText9=0,Z:\TEF_SQL\TestData\reference1.txt
272 Prepare13=select f1 from Sometable;
280 // Check that the two databases created above (which are exactly equivalent)
281 // differ in size. That will suggest that the UTF-8/UTF-16
282 // encoding options have done their work. Through the SQLite APIs they generate
283 // identical output. It seems kind of overkill to have a whole code-driven
284 // test function to do this but I see no other way..
285 // Attempt an attach of UTF-16 to UTF-8 database - it will fail, that's an
286 // illegal operation.
288 Function0=FilesDifferBySize
289 FileA0=C:\ConfigTest5.db
290 FileB0=C:\ConfigTest6.db
291 Open1=C:\ConfigTest5.db
292 Exec2=Attach "C:\ConfigTest6.db" as ThatOne;
293 ExpectedError2=KSqlErrGeneral
294 LastErrorMessage3=attached databases must use the same text encoding as main database
295 // Delete will succeed because the attach didn't.
296 Delete4=C:\ConfigTest6.db
298 Delete6=C:\ConfigTest5.db