B2G/gecko/storage/test/unit/test_statement_wrapper_automatically.js
/**
 * Inserts aVal into our test table and checks that insertion was successful by
 * retrieving the newly inserted value from the database and comparing it
 * against aVal.  aVal is bound to two separate parameters, both of which are
 * checked against aVal.
 *
 * @param aVal
 *        value to insert into our test table and check
 */
Inserts aVal into our test table and checks that insertion was successful by
retrieving the newly inserted value from the database and comparing it
against aVal.  aVal is bound to two separate parameters, both of which are
checked against aVal.

@param aVal
value to insert into our test table and check
Inserts aVal into our test table and checks that insertion was successful by retrieving the newly inserted value from the database and comparing it against aVal . aVal is bound to two separate parameters both of which are checked against aVal . @param aVal value to insert into our test table and check
function insertAndCheckMultipleParams(aVal)
{
  clearTable();
  var stmt = createStatement("INSERT INTO test (val, alt_val) " +
                             "VALUES (:val, :val)");
  stmt.params.val = aVal;
  stmt.execute();
  stmt.finalize();
  ensureNumRows(1);
  stmt = createStatement("SELECT val, alt_val FROM test WHERE id = 1");
  do_check_true(stmt.step());
  checkVal(aVal, stmt.row.val);
  checkVal(aVal, stmt.row.alt_val);
  stmt.reset();
  stmt.finalize();
}
function insertAndCheckMultipleParams ( aVal ) { clearTable ( ) ; var stmt = createStatement ( "INSERT INTO test (val, alt_val) " + "VALUES (:val, :val)" ) ; stmt . params . val = aVal ; stmt . execute ( ) ; stmt . finalize ( ) ; ensureNumRows ( 1 ) ; stmt = createStatement ( "SELECT val, alt_val FROM test WHERE id = 1" ) ; do_check_true ( stmt . step ( ) ) ; checkVal ( aVal , stmt . row . val ) ; checkVal ( aVal , stmt . row . alt_val ) ; stmt . reset ( ) ; stmt . finalize ( ) ; }
Inserts aVal into our test table and checks that insertion was successful by
 retrieving the newly inserted value from the database and comparing it
 against aVal.
Inserts aVal into our test table and checks that insertion was successful by retrieving the newly inserted value from the database and comparing it against aVal .