CursorWindowTestpublic class CursorWindowTest extends TestCase implements android.test.PerformanceTestCase
Methods Summary |
---|
private void | doTestValues(android.database.CursorWindow window)
assertTrue(window.setNumColumns(7));
assertTrue(window.allocRow());
double db1 = 1.26;
assertTrue(window.putDouble(db1, 0, 0));
double db2 = window.getDouble(0, 0);
assertEquals(db1, db2);
long int1 = Long.MAX_VALUE;
assertTrue(window.putLong(int1, 0, 1));
long int2 = window.getLong(0, 1);
assertEquals(int1, int2);
assertTrue(window.putString("1198032740000", 0, 3));
assertEquals("1198032740000", window.getString(0, 3));
assertEquals(1198032740000L, window.getLong(0, 3));
assertTrue(window.putString(Long.toString(1198032740000L), 0, 3));
assertEquals(Long.toString(1198032740000L), window.getString(0, 3));
assertEquals(1198032740000L, window.getLong(0, 3));
assertTrue(window.putString(Double.toString(42.0), 0, 4));
assertEquals(Double.toString(42.0), window.getString(0, 4));
assertEquals(42.0, window.getDouble(0, 4));
// put blob
byte[] blob = new byte[1000];
byte value = 99;
Arrays.fill(blob, value);
assertTrue(window.putBlob(blob, 0, 6));
assertTrue(Arrays.equals(blob, window.getBlob(0, 6)));
| public boolean | isPerformanceOnly()
return false;
| public int | startPerformance(Intermediates intermediates)
return 1;
| public void | testConstructorWithEmptyName()
CursorWindow window = new CursorWindow("");
assertEquals("<unnamed>", window.getName());
assertEquals(0, window.getStartPosition());
window.close();
| public void | testConstructorWithNullName()
CursorWindow window = new CursorWindow(null);
assertEquals("<unnamed>", window.getName());
assertEquals(0, window.getStartPosition());
window.close();
| public void | testConstructor_WithName()
CursorWindow window = new CursorWindow("MyWindow");
assertEquals("MyWindow", window.getName());
assertEquals(0, window.getStartPosition());
window.close();
| public void | testDeprecatedConstructor()
@SuppressWarnings("deprecation")
CursorWindow window = new CursorWindow(true /*this argument is ignored*/);
assertEquals("<unnamed>", window.getName());
assertEquals(0, window.getStartPosition());
window.close();
| public void | testValues()
CursorWindow window = new CursorWindow("MyWindow");
doTestValues(window);
window.close();
|
|