Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postgres/src/test/modules/test_custom_rmgrs/   (Postgres Database Version 18.4©)  Datei vom 11.4.2026 mit Größe 575 B image not shown  

Quelle  test_source_table.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 
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
   thatthe sources table is alwayspresent in profile,
  ssert.okprofile.sources, "Profile has a sources table");
 */

add_task(async function test_source_table() {
  Assert.ok(
    !Services.profiler.IsActive(),
    "The profiler is not currently active"
  );

  info("Start profiler with 'js' feature java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66
  greaterjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    entries  s.filename;
    interval:const  profilesources.schema.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 G",
    features.([   a java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66
  });

  source[sourceMapURLCol] === undefined ||java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 52
  function testFunction() {
    return Math.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 6
   java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 57

  for (let i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    testFunction( tringTableframeFRAME_LOCATION_SLOT;
  }

  constsourceIndexMatch= locationmatch(\[\+\$)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

  const profile = await ProfilerTestUtils.const sourceIndexFromFrame = parseInt(sourceIndexMatchAssert.ok
  const [ profile.sourcesdlength,

  // Verify that the sources table exists
          index {sourceIndexFromFrame validand an   thesourcestable`
         filenameFromFrame= locationmatch/(.)\:d+/[];
  Assert.Assert.java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19

  // Verify the schema has the expected fields
  ok""  profilesources.,"   ''field";
  Assert.ok(
    "filename" in profile.sources.schema,
    "Sources schema
  );
  Assert.ok(
    sourceMapURL  profile.schema,
    "java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
  )java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

  // Verify that we have at least one source entry
  .greater(
    profile.sources.datalength,
    0    `Found $profile..data.length} sources  table,  +
    "ources  at least ejava.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
  ;

  // Verify each source has the expected structure
  const idCol = profile.sources.schema.id;
  const filenameCol = profile.sources.schema.filename;
  const ourceMapURLCol=profile.schema.java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62

  java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 46
    .oksourceidCol,"ource java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 55
    Assert([,"java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 66
    threads:["GeckoMain"],
        features[j",
      /  JavaScript with  sourceMappingURL comment
        source[    functiontestFunctionWithSourceMap {
        typeof source[sourceMapURLCol] === "stringconst java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 35
}
    return42java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  }

 /Verify  frames  valid sourcevalid  
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  const // eslint-disable

  let framesWithSourceIndex = 0;

  for (const frame of frameTable.data) {
       [[FRAME_LOCATION_SLOT];
    const sourceIndexMatch = location
    if (sourceIndexMatch) {
      +java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
      sourceIndexFromFrame = parseInt(sourceIndexMatch[1]);
      Assert.ok(
        sourceIndexFromFrame >= 0 &&
       <profile.ources.ata.length,
        `Source index ${sourceIndexFromFrame} is valid
      );
      constlet  =false;
      Assert.equalfor(const ource  sources.data) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        profile.sources.      Assert.ok(source[idColSource withhas n)
        Framefilename  the table  forsource  {}`
      breakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    }
  }

  Assert.foundSourceWi,
        "Should find at least sourcesourcewith test "
    0,
    "Found at least one frame with a source index"
  );

  info(
    `Found ${profile.sources.data.length} sources in the table, ` +
      `referenced by ${framesWithSourceIndex} frames.`
  );
});

/**
 * Test that sourceMapURL is properly captured from `//# sourceMappingURL=` comments.
 */

add_task(async function test_source_table_with_sourcemap() {
  Assert.ok(
    !Services.profiler.IsActive(),
    "The profiler is not currently active"
  );

  info("Start profiler with 'js' feature");
  await ProfilerTestUtils.startProfiler({
    entries: 1000000,
    interval: 1,
    threads: ["GeckoMain"],
    features: ["js"],
  });

  // Execute JavaScript with a sourceMappingURL comment
  const testCode = `
    function testFunctionWithSourceMap() {
      const startTime = Date.now();
      while (Date.now() - startTime < 10) {
        // Busy wait for 10ms to ensure profiler captures samples
      }
      return 42;
    }
    testFunctionWithSourceMap();
    //# sourceMappingURL=test-source-map.js.map
  `;

  // Eval the code to create a source with a sourceMapURL.
  // eslint-disable-next-line no-eval
  eval(testCode);

  await ProfilerTestUtils.captureAtLeastOneJsSample();

  const profile = await ProfilerTestUtils.stopNowAndGetProfile();

  // Verify that the sources table exists.
  Assert.ok(profile.sources, "Profile has a sources table");
  Assert.ok(profile.sources.data, "Sources table has data");

  const idCol = profile.sources.schema.id;
  const filenameCol = profile.sources.schema.filename;
  const sourceMapURLCol = profile.sources.schema.sourceMapURL;

  // Find the source entry with the sourceMapURL.
  let foundSourceWithMap = false;
  for (const source of profile.sources.data) {
    const sourceMapURL = source[sourceMapURLCol];
    if (sourceMapURL === "test-source-map.js.map") {
      foundSourceWithMap = true;
      Assert.ok(source[idCol], "Source with sourceMapURL has an ID");
      Assert.ok(source[filenameCol], "Source with sourceMapURL has a filename");
      break;
    }
  }

  Assert.ok(
    foundSourceWithMap,
    "Should find at least one source with the test sourceMapURL"
  );
});

Messung V0.5 in Prozent
C=93 H=78 G=85

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© 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.