B2G/gecko/content/base/test/unit/test_csputils.js
// helper to assert that an array has the given value somewhere.
helper to assert that an array has the given value somewhere.
helper to assert that an array has the given value somewhere .
function do_check_in_array(arr, val, stack) {
  if (!stack)
    stack = Components.stack.caller;
  var text = val + " in [" + arr.join(",") + "]";
  for(var i in arr) {
    dump(".......... " + i + "> " + arr[i] + "\n");
    if(arr[i] == val) {
      ++_passedChecks;
      dump("TEST-PASS | " + stack.filename + " | [" + stack.name + " : " +
           stack.lineNumber + "] " + text + "\n");
      return;
    }
  }
  do_throw(text, stack);
}
function do_check_in_array ( arr , val , stack ) { if ( ! stack ) stack = Components . stack . caller ; var text = val + " in [" + arr . join ( "," ) + "]" ; for ( var i in arr ) { dump ( ".......... " + i + "> " + arr [ i ] + "\n" ) ; if ( arr [ i ] == val ) { ++ _passedChecks ; dump ( "TEST-PASS | " + stack . filename + " | [" + stack . name + " : " + stack . lineNumber + "] " + text + "\n" ) ; return ; } } do_throw ( text , stack ) ; }
helper to assert that an array has the given value somewhere.
helper to assert that an array has the given value somewhere .
//succeed