33 var dbq =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
34 .createInstance(
Ci.sbIDatabaseQuery);
36 var
ios =
Cc[
"@mozilla.org/network/io-service;1"]
37 .createInstance(
Ci.nsIIOService);
39 var
dir =
Cc[
"@mozilla.org/file/directory_service;1"]
40 .createInstance(
Ci.nsIProperties);
42 var testdir = dir.get(
"ProfD",
Ci.nsIFile);
44 var actualdir = testdir.clone();
45 actualdir.append(
"db_tests");
47 if(!actualdir.exists())
50 actualdir.create(
Ci.nsIFile.DIRECTORY_TYPE, 0700);
57 var
uri = ios.newFileURI(actualdir);
58 dbq.databaseLocation =
uri;
62 dbq.setDatabaseGUID(
"test_nullresultvalue");
63 dbq.addQuery(
"drop table nullresultvalue_test");
64 dbq.addQuery(
"create table nullresultvalue_test (name text, value text)");
65 dbq.addQuery(
"insert into nullresultvalue_test values('test 0', null)");
66 dbq.addQuery(
"insert into nullresultvalue_test values(NULL, 'testing... 1')");
67 dbq.addQuery(
"insert into nullresultvalue_test values(NULL, NULL)");
70 dbq.waitForCompletion();
73 dbq.addQuery(
"select * from nullresultvalue_test");
75 dbq.waitForCompletion();
77 var dbr = dbq.getResultObject();
79 var rowCount = dbr.getRowCount();
82 var
val = dbr.getRowCell(0, 0);
85 val = dbr.getRowCell(0, 1);
88 val = dbr.getRowCell(1, 0);
91 val = dbr.getRowCell(1, 1);
94 val = dbr.getRowCell(2, 0);
97 val = dbr.getRowCell(2, 1);
100 return Components.results.NS_OK;
function assertEqual(aExpected, aActual, aMessage)
this _dialogInput val(dateText)
function runTest()
Test file.