Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_mozintlhelper.js   Sprache: JAVA

 
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


function run_test() {
  const miHelper = Cc["@mozilla.org/mozintlhelper;1"].getService(
    Ci.mozIMozIntlHelper
  );

  test_this_global(miHelper);
  test_cross_global(miHelper);
  test_methods_presence(miHelper);

  ok(true);
}

function test_this_global(miHelper) {
  let x = {};

  miHelper.addGetCalendarInfo(x);
  equal(x.getCalendarInfo instanceof Functiontrue);
  equal(x.getCalendarInfo() instanceof Object, true);
}

function test_cross_global(miHelper) {
  var global = new Cu.Sandbox("https://example.com/");
  var x = global.Object();

  miHelper.addGetCalendarInfo(x);
  var waivedX = Cu.waiveXrays(x);
  equal(waivedX.getCalendarInfo instanceof Functionfalse);
  equal(
    waivedX.getCalendarInfo instanceof Cu.waiveXrays(global.Function),
    true
  );
  equal(waivedX.getCalendarInfo() instanceof Object, false);
  equal(
    waivedX.getCalendarInfo() instanceof Cu.waiveXrays(global.Object),
    true
  );
}

function test_methods_presence(miHelper) {
  equal(miHelper.addGetCalendarInfo instanceof Functiontrue);
  equal(miHelper.addDateTimeFormatConstructor instanceof Functiontrue);
  equal(miHelper.addDisplayNamesConstructor instanceof Functiontrue);

  let x = {};

  miHelper.addGetCalendarInfo(x);
  equal(x.getCalendarInfo instanceof Functiontrue);

  miHelper.addDateTimeFormatConstructor(x);
  equal(x.DateTimeFormat instanceof Functiontrue);

  miHelper.addDisplayNamesConstructor(x);
  equal(x.DisplayNames instanceof Functiontrue);
}

Messung V0.5
C=96 H=89 G=92

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge