B2G/gecko/storage/test/unit/test_statement_wrapper_automatically.js
/**
 * A convenience wrapper for do_check_eq.  Calls do_check_eq on aActualVal
 * and aReturnedVal, with one caveat.
 *
 * Date objects are converted before parameter binding to PRTime's (microsecs
 * since epoch).  They are not reconverted when retrieved from the database.
 * This function abstracts away this reconversion so that you can pass in,
 * for example:
 *
 *   checkVal(new Date(), aReturnedVal)                    // this
 *   checkVal(new Date().valueOf() * 1000.0, aReturnedVal) // instead of this
 *
 * Should any other types require conversion in the future, their conversions
 * may also be abstracted away here.
 *
 * @param aActualVal
 *        the value inserted into the database
 * @param aReturnedVal
 *        the value retrieved from the database
 */
A convenience wrapper for do_check_eq.

Date objects are converted before parameter binding to PRTime's (microsecs
since epoch).  They are not reconverted when retrieved from the database.
This function abstracts away this reconversion so that you can pass in,
for example.



Should any other types require conversion in the future, their conversions
may also be abstracted away here.

@param aActualVal
the value inserted into the database
@param aReturnedVal
the value retrieved from the database
A convenience wrapper for do_check_eq . Date objects are converted before parameter binding to PRTime ' s ( microsecs since epoch ) . They are not reconverted when retrieved from the database . This function abstracts away this reconversion so that you can pass in for example . Should any other types require conversion in the future their conversions may also be abstracted away here . @param aActualVal the value inserted into the database @param aReturnedVal the value retrieved from the database
function checkVal(aActualVal, aReturnedVal)
{
  if (aActualVal instanceof Date) aActualVal = aActualVal.valueOf() * 1000.0;
  do_check_eq(aActualVal, aReturnedVal);
}
function checkVal ( aActualVal , aReturnedVal ) { if ( aActualVal instanceof Date ) aActualVal = aActualVal . valueOf ( ) * 1000.0 ; do_check_eq ( aActualVal , aReturnedVal ) ; }
A convenience wrapper for do_check_eq.
A convenience wrapper for do_check_eq .