Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  Main.java

  Sprache: JAVA
 

/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;

public class Main extends Base implements Comparator<Main> {
  // Whether to test local unwinding.
  private static boolean testLocal;

  // Unwinding another process, modelling debuggerd.
  private static boolean testRemote;

  // We fork ourself to create the secondary process for remote unwinding.
  private static boolean secondary;

  public static void main(String[] args) throws Exception {
      System.out.println("args: " + String.join(" ", Arrays.copyOfRange(args, 1, args.length)));

      System.loadLibrary(args[0]);
      for (int i = 1; i < args.length; i++) {
          if (args[i].equals("--test-local")) {
              testLocal = true;
          } else if (args[i].equals("--test-remote")) {
              testRemote = true;
          } else if (args[i].equals("--secondary")) {
              secondary = true;
          } else {
              System.out.println("Unknown argument: " + args[i]);
              System.exit(1);
          }
      }

      // Call test() via base class to test unwinding through multidex.
      new Main().$noinline$runTest();
  }

  public void test() {
      // Call unwind() via Arrays.binarySearch to test unwinding through framework.
      Main[] array = { thisthisthis };
      Arrays.binarySearch(array, 03this /* value */, this /* comparator */);
  }

  public int compare(Main lhs, Main rhs) {
      unwind();
      // Returning "equal" ensures that we terminate search
      // after first item and thus call unwind() only once.
      return 0;
  }

  public void unwind() {
      if (secondary) {
          sigstop();  // This is helper child process. Stop and wait for unwinding.
          return;     // Don't run the tests again in the secondary helper process.
      }

      if (testLocal) {
          System.out.println(unwindInProcess() ? "PASS" : "FAIL");
      }

      if (testRemote) {
          // Start a secondary helper process. It will stop itself when it is ready.
          int pid = startSecondaryProcess();
          // Wait for the secondary process to stop and then unwind it remotely.
          System.out.println(unwindOtherProcess(pid) ? "PASS" : "FAIL");
      }
  }

  public static native int startSecondaryProcess();
  public static native boolean sigstop();
  public static native boolean unwindInProcess();
  public static native boolean unwindOtherProcess(int pid);
}

Messung V0.5 in Prozent
C=85 H=97 G=91

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-06-29) ¤

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