Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_cenums.js

  Sprache: JAVA
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


function TestCEnums() {
}

TestCEnums.prototype = {
  /* Boilerplate */
  QueryInterface: ChromeUtils.generateQI(["nsIXPCTestCEnums"]),

  testCEnumInput: function(input) {
    if (input != Ci.nsIXPCTestCEnums.shouldBe12Explicit)
    {
      throw new Error("Enum values do not match expected value");
    }
  },

  testCEnumOutput: function() {
    return Ci.nsIXPCTestCEnums.shouldBe8Explicit;
  },
};


function run_test() {
  // Load the component manifests.
  registerXPCTestComponents();

  // Test for each component.
  test_interface_consts();
  test_component(Cc["@mozilla.org/js/xpc/test/native/CEnums;1"].createInstance());
  test_component(xpcWrap(new TestCEnums()));
}

function test_interface_consts() {
  Assert.equal(Ci.nsIXPCTestCEnums.testConst, 1);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe1Explicit, 1);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe2Explicit, 2);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe4Explicit, 4);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe8Explicit, 8);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe12Explicit, 12);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe1Implicit, 1);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe2Implicit, 2);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe3Implicit, 3);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe5Implicit, 5);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe6Implicit, 6);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe2AgainImplicit, 2);
  Assert.equal(Ci.nsIXPCTestCEnums.shouldBe3AgainImplicit, 3);
}

function test_component(obj) {
  var o = obj.QueryInterface(Ci.nsIXPCTestCEnums);
  o.testCEnumInput(Ci.nsIXPCTestCEnums.shouldBe12Explicit);
  o.testCEnumInput(Ci.nsIXPCTestCEnums.shouldBe8Explicit | Ci.nsIXPCTestCEnums.shouldBe4Explicit);
  var a = o.testCEnumOutput();
  Assert.equal(a, Ci.nsIXPCTestCEnums.shouldBe8Explicit);
}


Messung V0.5 in Prozent
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik