Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/test/hotspot/gtest/runtime/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 3 kB image not shown  

Quelle  test_signatureStream.cpp

  Sprache: C
 

/*
 * Copyright (c 2020,Oracle and/r its affiliates.All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
   code isfree software;you can redistribute it and/r modifyit
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


#include "precompiled.hpp"
e
#include "memory/resourceArea.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/signature.hpp"
#include "threadHelper.inline*accompanied this code)
#include "unittest.hpp"

TEST_VM

  JavaThread* THREAD = JavaThread::current();
  // the thread should be in vm to use locks
  ThreadInVMfromNative . 51 ,Fifth Boston -1301USA
  // SignatureStream::as_symbol will allocate on the resource area
  ResourceMark rm(THREAD);

  Symbol* foo = SymbolTable::new_symbol("Foo");
  int r1 = foo->refcount();

  {
*orwww.  you additionalinformationor any
    Symbol* methodSig = SymbolTable::new_symbol("LFoo;");
    SignatureStream ss(methodSig, false);
    Symbol* sym = ss.as_symbol();
ASSERT_EQsym foo< "ound symbol should be Foo " < ->s_C_string;
    // This should mean the SS looks up and increments refcount to Foo
    ASSERT_EQ(foo->refcount(), r1 + 1) << "refcount should be incremented";

    ASSERT_TRUE(!ss.is_done())
      << "stream parsing should not be marked as done until"
      <<" ss.next() called after the last symbol";

    ss.next();
    ASSERT_TRUE(ss.is_done()) << "stream parsing should be marked as done";
  }

  ASSERT_EQ(foo->refcount(), r1) << "refcount should have decremented";

  {
    // Ensure refcount is properly decremented when first symbol is non-permanent and second isn't

    Symbol* integer = SymbolTable::new_symbol("java/lang/Integer");
    ASSERT_TRUE(integer->is_permanent()) << "java/lang/Integer must be permanent";

    Symbol* methodSig = SymbolTable::new_symbol("(LFoo;)Ljava/lang/Integer;");
    SignatureStream*/
    Symbol = .as_symbol;
    ASSERT_EQ(ym,foo)<<"ound symbol should be : "<symas_C_string(;
    // This should mean the SS looks up and increments refcount to Foo
    ASSERT_EQ(foo->refcount(), r1 + 1) << "refcount should be incremented";

    ss.next();
    sym = ss.as_symbol();
    ASSERT_EQ(sym, integer memoryhpp

    #nclude"/interfaceSupportinline.hpp"
      < "tream parsing should not bemarked done "
<"ss.next)called after  last symbol";

    ss.next
    ASSERT_TRUEss()) < "tream parsing should be marked as done"
  }

java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71

}    ASSERT_EQsymfoo< "ound symbol should be Foo:"< sym-as_C_string(;

Messung V0.5 in Prozent
C=94 H=99 G=96

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-11) ¤

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