From: Matthias Klose Date: Mon, 9 Sep 2024 13:29:08 +0000 (+0200) Subject: openjdk-21 (21.0.5~6ea-1) unstable; urgency=medium X-Git-Tag: archive/raspbian/21.0.5_6ea-1+rpi1^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=311816481ecd4bd361c2fb45d46b3c58c40b70ac;p=openjdk-21.git openjdk-21 (21.0.5~6ea-1) unstable; urgency=medium * OpenJDK 21.0.5 early access, build 6. [ Vladimir Petko ] * d/p/reproducible-properties-timestamp.diff: Use PrivilegedAction to avoid SecurityManager exception. * Enable dtrace support. [dgit import unpatched openjdk-21 21.0.5~6ea-1] --- 311816481ecd4bd361c2fb45d46b3c58c40b70ac diff --cc debian/JAVA_HOME index 000000000,000000000,000000000..876e98953 new file mode 100644 --- /dev/null +++ b/debian/JAVA_HOME @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++ JAVA_HOME +++ +++1. Legacy use of JAVA_HOME +++ +++ As of the latest versions of java-common there really should +++ be no need for JAVA_HOME as Java(TM) should be completely +++ integrated with your Debian GNU/Linux system. +++ +++ +++2. Selecting OpenJDK 7 as the default Java(TM) implementation +++ +++ Please see README.alternatives for instructions on how +++ to make OpenJDK 7 executables and man pages the default on your system. diff --cc debian/JB-archive.applications.in index 000000000,000000000,000000000..7f20fd585 new file mode 100644 --- /dev/null +++ b/debian/JB-archive.applications.in @@@@ -1,0 -1,0 -1,0 +1,6 @@@@ +++java-archive +++ command=/usr/bin/java -jar +++ name=java-archive +++ can_open_multiple_files=false +++ requires_terminal=false +++ mime_types=application/java-archive,application/x-java-archive,application/x-jar diff --cc debian/JB-archive.keys.in index 000000000,000000000,000000000..743e3c8a2 new file mode 100644 --- /dev/null +++ b/debian/JB-archive.keys.in @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++application/java-archive +++ description=Java Archive +++ icon_filename=@basename@ +++ default_action_type=application +++ default_application_id=java-archive +++ short_list_application_user_additions=java-archive +++application/x-java-archive +++ description=Java Archive +++ icon_filename=@basename@ +++ default_action_type=application +++ default_application_id=java-archive +++ short_list_application_user_additions=java-archive +++application/x-jar +++ description=Java Archive +++ icon_filename=@basename@ +++ default_action_type=application +++ default_application_id=java-archive +++ short_list_application_user_additions=java-archive diff --cc debian/JB-archive.mime.in index 000000000,000000000,000000000..e354ead53 new file mode 100644 --- /dev/null +++ b/debian/JB-archive.mime.in @@@@ -1,0 -1,0 -1,0 +1,6 @@@@ +++application/java-archive +++ ext: jar +++application/x-java-archive +++ ext: jar +++application/x-jar +++ ext: jar diff --cc debian/JB-dbg.overrides.in index 000000000,000000000,000000000..970a5822a new file mode 100644 --- /dev/null +++ b/debian/JB-dbg.overrides.in @@@@ -1,0 -1,0 -1,0 +1,7 @@@@ +++# this are pre-stripped binaries (fastdebug) +++@basename@-dbg binary: stripped-library +++@basename@-dbg binary: debug-file-with-no-debug-symbols +++ +++# these are java's .debuginfo files ... +++@basename@-dbg binary: binary-with-bad-dynamic-table +++@basename@-dbg binary: statically-linked-binary diff --cc debian/JB-demo.menu.in index 000000000,000000000,000000000..58aec29c3 new file mode 100644 --- /dev/null +++ b/debian/JB-demo.menu.in @@@@ -1,0 -1,0 -1,0 +1,55 @@@@ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ FileChooser Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/FileChooserDemo; /@basedir@/bin/java -jar FileChooserDemo.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ Font2DTest Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/Font2DTest; /@basedir@/bin/java -jar Font2DTest.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ Java 2D Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/Java2D; /@basedir@/bin/java -jar Java2Demo.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ SampleTree Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/SampleTree; /@basedir@/bin/java -jar SampleTree.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ Stylepad Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/Stylepad; /@basedir@/bin/java -jar Stylepad.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ SwingSet2 Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/SwingSet2; /@basedir@/bin/java -jar SwingSet2.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" +++ +++?package(@basename@-demo):\ +++ needs="x11"\ +++ section="Applications/Programming"\ +++ title="@vendor@ Java @RELEASE@ TableExample Demo"\ +++ command="/bin/sh -c 'cd /@basedir@/demo/jfc/TableExample; /@basedir@/bin/java -jar TableExample.jar'"\ +++ icon="/usr/share/pixmaps/@basename@-app.xpm"\ +++ hints="Java2" diff --cc debian/JB-demo.overrides.in index 000000000,000000000,000000000..a6eddede1 new file mode 100644 --- /dev/null +++ b/debian/JB-demo.overrides.in @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++# jpda/examples.jar only contains source code +++@basename@-demo binary: codeless-jar usr/share/doc/openjdk-7-jre-headless/demo/jpda/examples.jar +++ +++# OpenJDK is correct despite any Debian policy +++@basename@-demo binary: unknown-java-class-version +++ +++# example jar file with sources and documentation +++@basename@-demo binary: codeless-jar +++ +++# example jar file with sources +++@basename@-demo binary: jar-contains-source +++ +++# allow repeated path segments, e.g. nbproject +++@basename@-demo binary: repeated-path-segment +++ +++# false positive: Java21 version (Class format: 65) +++# openjdk compiles examples using current Java version +++@basename@-demo: incompatible-java-bytecode-format diff --cc debian/JB-doc.doc-base.in index 000000000,000000000,000000000..619d9ae5d new file mode 100644 --- /dev/null +++ b/debian/JB-doc.doc-base.in @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++Document: @JDK@-doc +++Title: @vendor@ Java(TM) @RELEASE@ JDK, Standard Edition Documentation +++Author: @vendor@ +++Abstract: The Java @RELEASE@ Platform Documentation contains API specifications, +++ feature descriptions, developer guides, reference pages for JDK tools +++ and utilities, demos, and links to related information. +++Section: Programming +++ +++Format: HTML +++Index: /usr/share/doc/@basename@-jre-headless/api/index.html +++Files: /usr/share/doc/@basename@-jre-headless/api/*/*.html diff --cc debian/JB-doc.overrides.in index 000000000,000000000,000000000..90cba638b new file mode 100644 --- /dev/null +++ b/debian/JB-doc.overrides.in @@@@ -1,0 -1,0 -1,0 +1,5 @@@@ +++# Override due to upstream copyright +++@basename@-doc binary: spelling-error-in-copyright "GNU Public License" "GNU General Public License" +++# chromium and firefox snaps are unable to load scripts from /usr/share/javascript +++# LP: 2032992 +++@basename@-doc binary: embedded-javascript-library diff --cc debian/JB-fonts.defoma-hints.in index 000000000,000000000,000000000..80212e25b new file mode 100644 --- /dev/null +++ b/debian/JB-fonts.defoma-hints.in @@@@ -1,0 -1,0 -1,0 +1,187 @@@@ +++category truetype +++ +++# Sans +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf +++ Family = LucidaSans +++ FontName = LucidaSans +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = SansSerif +++ Weight = Book +++ Width = Variable +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiBold.ttf +++ Family = LucidaSans +++ FontName = LucidaSans-Demibold +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = SansSerif +++ Weight = Bold +++ Width = Variable +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaSansOblique.ttf +++ Family = LucidaSans +++ FontName = LucidaSans-Oblique +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = SansSerif +++ Weight = Thin +++ Width = Variable +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaSansDemiOblique.ttf +++ Family = LucidaSans +++ FontName = LucidaSans-Demibold-Oblique +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = SansSerif +++ Weight = Bold +++ Width = Variable +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++# Serif +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaBrightRegular.ttf +++ Family = LucidaBright +++ FontName = LucidaBright-Regular +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Roman +++ Weight = Book +++ Width = Variable +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaBrightItalic.ttf +++ Family = LucidaBright +++ FontName = LucidaBright-Italic +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Roman +++ Weight = Book +++ Width = Variable +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiBold.ttf +++ Family = Lucida-Bright +++ FontName = Lucida-Bright-Demi +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Roman +++ Weight = Bold +++ Width = Variable +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaBrightDemiItalic.ttf +++ Family = Lucida-Bright +++ FontName = Lucida-Bright-DemiItalic +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Roman +++ Weight = Demi +++ Width = Variable +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++# Mono +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterRegular.ttf +++ Family = LucidaSans-Typewriter +++ FontName = LucidaSans-Typewriter +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Typewriter +++ Weight = Book +++ Width = Fixed +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterOblique.ttf +++ Family = LucidaSans-Typewriter +++ FontName = LucidaSans-Typewriter-Oblique +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Typewriter +++ Weight = Book +++ Width = Fixed +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBold.ttf +++ Family = LucidaSans-Typewriter +++ FontName = LucidaSans-Typewriter-Bold +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Typewriter +++ Weight = Bold +++ Width = Fixed +++ Shape = NoSerif Upright +++ Foundry = Lucida +++ Priority = 15 +++end +++ +++begin /usr/share/fonts/truetype/ttf-lucida/LucidaTypewriterBoldOblique.ttf +++ Family = LucidaSans-Typewriter +++ FontName = LucidaSans-Typewriter-Bold-Oblique +++ Encoding = Unicode +++ Location = English +++ Charset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 ISO10646-1 +++ UniCharset = ISO8859-1 ISO8859-2 ISO8859-7 ISO8859-9 ISO8859-15 +++ GeneralFamily = Typewriter +++ Weight = Bold +++ Width = Fixed +++ Shape = NoSerif Oblique +++ Foundry = Lucida +++ Priority = 15 +++end diff --cc debian/JB-java.desktop.in index 000000000,000000000,000000000..eec5e5ca4 new file mode 100644 --- /dev/null +++ b/debian/JB-java.desktop.in @@@@ -1,0 -1,0 -1,0 +1,12 @@@@ +++[Desktop Entry] +++Name=@vendor@ Java @RELEASE@ Runtime +++Name[fi]=@vendor@ Java @RELEASE@ - ajonaikainen ympäristö +++Comment=@vendor@ Java @RELEASE@ Runtime +++Comment[fi]=@vendor@ Java @RELEASE@ - ajonaikainen ympäristö +++Keywords=java;runtime +++Exec=@java_launcher@ -jar +++Terminal=false +++Type=Application +++Icon=@basename@ +++MimeType=application/x-java-archive;application/java-archive;application/x-jar; +++NoDisplay=true diff --cc debian/JB-jconsole.desktop.in index 000000000,000000000,000000000..8a87820a2 new file mode 100644 --- /dev/null +++ b/debian/JB-jconsole.desktop.in @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++[Desktop Entry] +++Name=@vendor@ Java @RELEASE@ Console +++Name[fi]=@vendor@ Java @RELEASE@ - konsoli +++Comment=@vendor@ Java @RELEASE@ Monitoring & Management Console +++Comment[fi]=@vendor@ Java @RELEASE@ - valvonta- ja hallintakonsoli +++Keywords=java;console;monitoring +++Exec=/usr/bin/jconsole +++Terminal=false +++Type=Application +++Icon=@basename@ +++Categories=Application;System; diff --cc debian/JB-jdk-headless.overrides.in index 000000000,000000000,000000000..cb8adce21 new file mode 100644 --- /dev/null +++ b/debian/JB-jdk-headless.overrides.in @@@@ -1,0 -1,0 -1,0 +1,2 @@@@ +++# repeated lib due to upstream implementation directory layout +++@basename@-jdk-headless binary: repeated-path-segment diff --cc debian/JB-jdk-headless.postinst.in index 000000000,000000000,000000000..0e1ef5feb new file mode 100644 --- /dev/null +++ b/debian/JB-jdk-headless.postinst.in @@@@ -1,0 -1,0 -1,0 +1,75 @@@@ +++#!/bin/sh +++ +++set -e +++ +++multiarch=@multiarch@ +++priority=@priority@ +++basedir=/@basedir@ +++mandir=$basedir/man +++jdiralias=@jdiralias@ +++srcext=1.gz +++dstext=1.gz +++jdk_hl_tools='@jdk_hl_tools@' +++ +++case "$1" in +++configure) +++ # obsolete tool +++ if update-alternatives --list apt 2>/dev/null; then +++ update-alternatives --remove-all apt || true +++ fi +++ +++ if [ -z "$2" ]; then +++ update_alternatives=y +++ fi +++ if [ -n "$multiarch" ] && [ -n "$2" ]; then +++ for i in $jdk_hl_tools; do +++ if [ -z "$(update-alternatives --list $i 2>/dev/null | grep ^$basedir/)" ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ if [ "$update_alternatives" != y ] && [ $priority -gt 1060 ]; then +++ for i in $jre_tools; do +++ oldp=$(update-alternatives --query java | awk -v b=$basedir '/^Alternative:/ && $2~b {p=1} /^Priority:/ && p {print $2; exit}') +++ if [ -n "$oldp" ] && [ "$oldp" -le 1060 ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ +++ if [ "$update_alternatives" = y ]; then +++ if [ -n "$multiarch" ] && [ "$DPKG_MAINTSCRIPT_ARCH" != $(dpkg --print-architecture) ]; then +++ priority=$(expr $priority - 1) +++ fi +++ for i in $jdk_hl_tools; do +++ unset slave1 slave2 || true +++ if [ -e $mandir/man1/$i.$srcext ]; then +++ slave1="--slave \ +++ /usr/share/man/man1/$i.$dstext \ +++ $i.$dstext \ +++ $mandir/man1/$i.$srcext" +++ fi +++ if false && [ -e $mandir/ja/man1/$i.$srcext ]; then +++ slave2="--slave \ +++ /usr/share/man/ja/man1/$i.$dstext \ +++ ${i}_ja.$dstext \ +++ $mandir/ja/man1/$i.$srcext" +++ fi +++ update-alternatives \ +++ --install \ +++ /usr/bin/$i \ +++ $i \ +++ $basedir/bin/$i \ +++ $priority \ +++ $slave1 $slave2 +++ done +++ fi # update alternatives +++ +++ ;; +++esac +++ +++#DEBHELPER# +++ +++exit 0 diff --cc debian/JB-jdk-headless.preinst.in index 000000000,000000000,000000000..01698fc26 new file mode 100644 --- /dev/null +++ b/debian/JB-jdk-headless.preinst.in @@@@ -1,0 -1,0 -1,0 +1,23 @@@@ +++#!/bin/sh +++ +++set -e +++ +++multiarch=@multiarch@ +++old_basedir=/usr/lib/jvm/java-7-openjdk +++jdk_hl_tools='apt extcheck idlj jar jarsigner javac javadoc javah javap jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc' +++ +++case "$1" in +++ upgrade) +++ if [ -n "$multiarch" ] && [ -n "$2" ]; then +++ for i in $jdk_hl_tools; do +++ if [ -n "$(update-alternatives --list $i 2>/dev/null | grep ^$old_basedir/)" ]; then +++ update-alternatives --remove $i $old_basedir/bin/$i || true +++ fi +++ done +++ fi +++ ;; +++esac +++ +++#DEBHELPER# +++ +++exit 0 diff --cc debian/JB-jdk-headless.prerm.in index 000000000,000000000,000000000..80bf5030a new file mode 100644 --- /dev/null +++ b/debian/JB-jdk-headless.prerm.in @@@@ -1,0 -1,0 -1,0 +1,15 @@@@ +++#!/bin/sh -e +++ +++set -e +++ +++jdk_hl_tools='@jdk_hl_tools@' +++basedir=/@basedir@ +++ +++ +++if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then +++ for i in $jdk_hl_tools; do +++ update-alternatives --remove $i $basedir/bin/$i +++ done +++fi +++ +++#DEBHELPER# diff --cc debian/JB-jdk.menu.in index 000000000,000000000,000000000..14f11ec2d new file mode 100644 --- /dev/null +++ b/debian/JB-jdk.menu.in @@@@ -1,0 -1,0 -1,0 +1,7 @@@@ +++?package(@basename@-jdk):\ +++ needs="x11"\ +++ section="Applications/System/Administration"\ +++ title="@vendor@ Java @RELEASE@ Console"\ +++ command="/usr/bin/jconsole"\ +++ icon="/usr/share/pixmaps/@basename@.xpm"\ +++ hints="Java2" diff --cc debian/JB-jdk.postinst.in index 000000000,000000000,000000000..bdffbe3cc new file mode 100644 --- /dev/null +++ b/debian/JB-jdk.postinst.in @@@@ -1,0 -1,0 -1,0 +1,75 @@@@ +++#!/bin/sh +++ +++set -e +++ +++multiarch=@multiarch@ +++priority=@priority@ +++basedir=/@basedir@ +++mandir=$basedir/man +++jdiralias=@jdiralias@ +++srcext=1.gz +++dstext=1.gz +++jdk_tools='@jdk_tools@' +++ +++case "$1" in +++configure) +++ # obsolete tool +++ if update-alternatives --list apt 2>/dev/null; then +++ update-alternatives --remove-all apt || true +++ fi +++ +++ if [ -z "$2" ]; then +++ update_alternatives=y +++ fi +++ if [ -n "$multiarch" ] && [ -n "$2" ]; then +++ for i in $jdk_tools; do +++ if [ -z "$(update-alternatives --list $i 2>/dev/null | grep ^$basedir/)" ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ if [ "$update_alternatives" != y ] && [ $priority -gt 1060 ]; then +++ for i in $jre_tools; do +++ oldp=$(update-alternatives --query java | awk -v b=$basedir '/^Alternative:/ && $2~b {p=1} /^Priority:/ && p {print $2; exit}') +++ if [ -n "$oldp" ] && [ "$oldp" -le 1060 ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ +++ if [ "$update_alternatives" = y ]; then +++ if [ -n "$multiarch" ] && [ "$DPKG_MAINTSCRIPT_ARCH" != $(dpkg --print-architecture) ]; then +++ priority=$(expr $priority - 1) +++ fi +++ for i in $jdk_tools; do +++ unset slave1 slave2 || true +++ if [ -e $mandir/man1/$i.$srcext ]; then +++ slave1="--slave \ +++ /usr/share/man/man1/$i.$dstext \ +++ $i.$dstext \ +++ $mandir/man1/$i.$srcext" +++ fi +++ if false && [ -e $mandir/ja/man1/$i.$srcext ]; then +++ slave2="--slave \ +++ /usr/share/man/ja/man1/$i.$dstext \ +++ ${i}_ja.$dstext \ +++ $mandir/ja/man1/$i.$srcext" +++ fi +++ update-alternatives \ +++ --install \ +++ /usr/bin/$i \ +++ $i \ +++ $basedir/bin/$i \ +++ $priority \ +++ $slave1 $slave2 +++ done +++ fi # update alternatives +++ +++ ;; +++esac +++ +++#DEBHELPER# +++ +++exit 0 diff --cc debian/JB-jdk.prerm.in index 000000000,000000000,000000000..f51219574 new file mode 100644 --- /dev/null +++ b/debian/JB-jdk.prerm.in @@@@ -1,0 -1,0 -1,0 +1,15 @@@@ +++#!/bin/sh -e +++ +++set -e +++ +++jdk_tools='@jdk_tools@' +++basedir=/@basedir@ +++ +++ +++if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then +++ for i in $jdk_tools; do +++ update-alternatives --remove $i $basedir/bin/$i +++ done +++fi +++ +++#DEBHELPER# diff --cc debian/JB-jre-headless.overrides.in index 000000000,000000000,000000000..254c8998d new file mode 100644 --- /dev/null +++ b/debian/JB-jre-headless.overrides.in @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++# Strip libjvm.so with --strip-debug instead of --strip-unneeded. LP: #574997. +++@basename@-jre-headless binary: unstripped-binary-or-object +++ +++# Ignore the mouse cursors +++@basename@-jre-headless binary: image-file-in-usr-lib +++ +++# Just an empty directory +++@basename@-jre-headless binary: debug-suffix-not-dbg +++ +++# Upstream implementation +++@basename@-jre-headless binary: exit-in-shared-library +++@basename@-jre-headless binary: spelling-error-in-binary +++ +++# Override due to upstream copyright +++@basename@-jre-headless binary: spelling-error-in-copyright "GNU Public License" "GNU General Public License" +++ +++# repeated lib due to upstream implementation directory layout +++@basename@-jre-headless binary: repeated-path-segment diff --cc debian/JB-jre-headless.postinst.in index 000000000,000000000,000000000..b764c4742 new file mode 100644 --- /dev/null +++ b/debian/JB-jre-headless.postinst.in @@@@ -1,0 -1,0 -1,0 +1,106 @@@@ +++#!/bin/sh +++ +++set -e +++ +++multiarch=@multiarch@ +++priority=@priority@ +++basedir=/@basedir@ +++mandir=$basedir/man +++srcext=1.gz +++dstext=1.gz +++jre_tools='@jre_hl_tools@' +++ +++case "$1" in +++configure) +++ # fail early. java currently uses tricks to find its own shared +++ # libraries depending on the path of the binary. Will be changed +++ # in OpenJDK7 +++ if ! mountpoint -q /proc; then +++ echo >&2 "the java command requires a mounted proc fs (/proc)." +++ exit 1 +++ fi +++ +++ [ -d /etc/.java ] || mkdir -m 755 /etc/.java +++ [ -d /etc/.java/.systemPrefs ] || mkdir -m 755 /etc/.java/.systemPrefs +++ if [ ! -f /etc/.java/.systemPrefs/.system.lock ]; then +++ touch /etc/.java/.systemPrefs/.system.lock +++ chmod 644 /etc/.java/.systemPrefs/.system.lock +++ fi +++ if [ ! -f /etc/.java/.systemPrefs/.systemRootModFile ]; then +++ touch /etc/.java/.systemPrefs/.systemRootModFile +++ chmod 644 /etc/.java/.systemPrefs/.systemRootModFile +++ fi +++ +++ if [ -z "$2" ]; then +++ update_alternatives=y +++ fi +++ if [ -n "$multiarch" ] && [ -n "$2" ]; then +++ for i in $jre_tools; do +++ if [ -z "$(update-alternatives --list $i 2>/dev/null | grep ^$basedir/)" ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ if [ "$update_alternatives" != y ] && [ $priority -gt 1060 ]; then +++ for i in $jre_tools; do +++ oldp=$(update-alternatives --query java | awk -v b=$basedir '/^Alternative:/ && $2~b {p=1} /^Priority:/ && p {print $2; exit}') +++ if [ -n "$oldp" ] && [ "$oldp" -le 1060 ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ +++ if [ "$update_alternatives" = y ]; then +++ if [ -n "$multiarch" ] && [ "$DPKG_MAINTSCRIPT_ARCH" != $(dpkg --print-architecture) ]; then +++ priority=$(expr $priority - 1) +++ fi +++ for i in $jre_tools; do +++ unset slave1 slave2 || true +++ if [ -e $mandir/man1/$i.$srcext ]; then +++ slave1="--slave \ +++ /usr/share/man/man1/$i.$dstext \ +++ $i.$dstext \ +++ $mandir/man1/$i.$srcext" +++ fi +++ # disabled +++ if false && [ -e $mandir/ja/man1/$i.$srcext ]; then +++ slave2="--slave \ +++ /usr/share/man/ja/man1/$i.$dstext \ +++ ${i}_ja.$dstext \ +++ $mandir/ja/man1/$i.$srcext" +++ fi +++ update-alternatives \ +++ --install \ +++ /usr/bin/$i \ +++ $i \ +++ $basedir/bin/$i \ +++ $priority \ +++ $slave1 $slave2 +++ done +++ update-alternatives \ +++ --install /usr/bin/jexec jexec $basedir/lib/jexec $priority \ +++ --slave \ +++ /usr/share/binfmts/jar \ +++ jexec-binfmt \ +++ $basedir/lib/jar.binfmt +++ fi # update alternatives +++ +++ # register binfmt; ignore errors, the alternative may already be +++ # registered by another JRE. +++ if which update-binfmts >/dev/null && [ -r /usr/share/binfmts/jar ]; then +++ update-binfmts --package @basename@ --import jar || true +++ fi +++ +++ # Now that java is fully registered and configured, +++ # call update-ca-certificates-java +++ dpkg-trigger update-ca-certificates-java +++ +++ ;; +++ +++esac +++ +++#DEBHELPER# +++ +++exit 0 diff --cc debian/JB-jre-headless.postrm.in index 000000000,000000000,000000000..e605e9633 new file mode 100644 --- /dev/null +++ b/debian/JB-jre-headless.postrm.in @@@@ -1,0 -1,0 -1,0 +1,24 @@@@ +++#!/bin/sh +++ +++set -e +++ +++basedir=/@basedir@ +++multiarch=@multiarch@ +++jdirname=@jdirname@ +++etcdir=/@etcdir@ +++ +++case "$1" in +++purge) +++ if [ -z "$jdirname" ] || [ -z "$etcdir" ]; then +++ echo >&2 "$(basename $0): Internal error" +++ exit 1 +++ fi +++ rm -f $basedir/lib/*/classes.jsa +++ +++ # removals of config files in /etc is handled by dpkg +++ +++ # XXX should remove /etc/.java ??? +++ ;; +++esac +++ +++#DEBHELPER# diff --cc debian/JB-jre-headless.prerm.in index 000000000,000000000,000000000..89e7799d2 new file mode 100644 --- /dev/null +++ b/debian/JB-jre-headless.prerm.in @@@@ -1,0 -1,0 -1,0 +1,24 @@@@ +++#!/bin/sh +++ +++set -e +++ +++basedir=/@basedir@ +++jre_tools='@jre_hl_tools@' +++ +++if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then +++ for i in $jre_tools; do +++ update-alternatives --remove $i $basedir/bin/$i +++ done +++ +++ if which update-binfmts >/dev/null; then +++ # try to remove and ignore the error +++ if [ -e /var/lib/binfmts/@basename@ ]; then +++ update-binfmts --package @basename@ \ +++ --remove jar /usr/bin/jexec || true +++ fi +++ fi +++ +++ update-alternatives --remove jexec $basedir/lib/jexec +++fi +++ +++#DEBHELPER# diff --cc debian/JB-jre-zero.overrides.in index 000000000,000000000,000000000..056a1e4f1 new file mode 100644 --- /dev/null +++ b/debian/JB-jre-zero.overrides.in @@@@ -1,0 -1,0 -1,0 +1,9 @@@@ +++# Strip libjvm.so with --strip-debug instead of --strip-unneeded. LP: #574997. +++@basename@-jre-zero binary: unstripped-binary-or-object +++ +++# Upstream implementation +++@basename@-jre-zero binary: exit-in-shared-library +++@basename@-jre-zero binary: spelling-error-in-binary +++ +++# repeated lib due to upstream implementation directory layout +++@basename@-jre-zero binary: repeated-path-segment diff --cc debian/JB-jre.menu.in index 000000000,000000000,000000000..024b63fcf new file mode 100644 --- /dev/null +++ b/debian/JB-jre.menu.in @@@@ -1,0 -1,0 -1,0 +1,7 @@@@ +++?package(@basename@-jre):\ +++ needs="x11"\ +++ section="Applications/System/Administration"\ +++ title="@vendor@ Java @RELEASE@ Policy Tool"\ +++ command="/usr/bin/policytool"\ +++ icon="/usr/share/pixmaps/@basename@.xpm"\ +++ hints="Java2" diff --cc debian/JB-jre.overrides.in index 000000000,000000000,000000000..a63389387 new file mode 100644 --- /dev/null +++ b/debian/JB-jre.overrides.in @@@@ -1,0 -1,0 -1,0 +1,9 @@@@ +++# these are in the -jre-headless package, -jre depends on it +++@basename@-jre binary: desktop-command-not-in-package +++ +++# LP: #2012326 - in order to print allocation locations, +++# the libraries need to retain symbols +++@basename@-jre binary: unstripped-binary-or-object +++ +++# repeated lib due to upstream implementation directory layout +++@basename@-jre binary: repeated-path-segment diff --cc debian/JB-jre.postinst.in index 000000000,000000000,000000000..84edc96f7 new file mode 100644 --- /dev/null +++ b/debian/JB-jre.postinst.in @@@@ -1,0 -1,0 -1,0 +1,71 @@@@ +++#!/bin/sh +++ +++set -e +++ +++multiarch=@multiarch@ +++priority=@priority@ +++basedir=/@basedir@ +++mandir=$basedir/man +++srcext=1.gz +++dstext=1.gz +++jre_tools='@jre_tools@' +++ +++case "$1" in +++configure) +++ if [ -z "$2" ]; then +++ update_alternatives=y +++ fi +++ if [ -n "$multiarch" ] && [ -n "$2" ]; then +++ for i in $jre_tools; do +++ if [ -z "$(update-alternatives --list $i 2>/dev/null | grep ^$basedir/)" ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ if [ "$update_alternatives" != y ] && [ $priority -gt 1060 ]; then +++ for i in $jre_tools; do +++ oldp=$(update-alternatives --query java | awk -v b=$basedir '/^Alternative:/ && $2~b {p=1} /^Priority:/ && p {print $2; exit}') +++ if [ -n "$oldp" ] && [ "$oldp" -le 1060 ]; then +++ update_alternatives=y +++ break +++ fi +++ done +++ fi +++ +++ if [ "$update_alternatives" = y ]; then +++ if [ -n "$multiarch" ] && [ "$DPKG_MAINTSCRIPT_ARCH" != $(dpkg --print-architecture) ]; then +++ priority=$(expr $priority - 1) +++ fi +++ for i in $jre_tools; do +++ unset slave1 slave2 || true +++ if [ -e $mandir/man1/$i.$srcext ]; then +++ slave1="--slave \ +++ /usr/share/man/man1/$i.$dstext \ +++ $i.$dstext \ +++ $mandir/man1/$i.$srcext" +++ fi +++ # disabled +++ if false && [ -e $mandir/ja/man1/$i.$srcext ]; then +++ slave2="--slave \ +++ /usr/share/man/ja/man1/$i.$dstext \ +++ ${i}_ja.$dstext \ +++ $mandir/ja/man1/$i.$srcext" +++ fi +++ update-alternatives \ +++ --install \ +++ /usr/bin/$i \ +++ $i \ +++ $basedir/bin/$i \ +++ $priority \ +++ $slave1 $slave2 +++ done +++ fi # update alternatives +++ +++ ;; +++ +++esac +++ +++#DEBHELPER# +++ +++exit 0 diff --cc debian/JB-jre.prerm.in index 000000000,000000000,000000000..55cd79052 new file mode 100644 --- /dev/null +++ b/debian/JB-jre.prerm.in @@@@ -1,0 -1,0 -1,0 +1,14 @@@@ +++#!/bin/sh +++ +++set -e +++ +++basedir=/@basedir@ +++jre_tools='@jre_tools@' +++ +++if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then +++ for i in $jre_tools; do +++ update-alternatives --remove $i $basedir/bin/$i +++ done +++fi +++ +++#DEBHELPER# diff --cc debian/JB-source.overrides.in index 000000000,000000000,000000000..0fa2bd81a new file mode 100644 --- /dev/null +++ b/debian/JB-source.overrides.in @@@@ -1,0 -1,0 -1,0 +1,2 @@@@ +++# repeated lib due to upstream implementation directory layout +++@basename@-source binary: repeated-path-segment diff --cc debian/JB-testsupport.overrides.in index 000000000,000000000,000000000..a40a453d4 new file mode 100644 --- /dev/null +++ b/debian/JB-testsupport.overrides.in @@@@ -1,0 -1,0 -1,0 +1,2 @@@@ +++# servicability tests doing symbol lookups +++@basename@-testsupport: unstripped-binary-or-object diff --cc debian/README.Debian index 000000000,000000000,000000000..1d1e452c9 new file mode 100644 --- /dev/null +++ b/debian/README.Debian @@@@ -1,0 -1,0 -1,0 +1,65 @@@@ +++openjdk-9 for Debian/Ubuntu +++--------------------------- +++ +++The OpenJDK build is configured --with-additional-vms to build with +++different virtual machines. The original implementation of the hotspot +++VM is only available on the amd64, i386, lpia and sparc architectures. +++Other VM's: Zero, providing a byte code interpreter for every architecture. +++ +++To use a different VM other than the default, use +++ +++ java -zero +++ +++or for the java tools, use +++ +++ -J-zero. +++ +++To change the default permanently, edit /etc/java-9-openjdk/jvm.cfg. +++ +++The Zero VM can be found in the openjdk-9-jre-zero package (on the +++architectures where the Hotspot VM is available). +++ +++Please look for further documentation in the directory +++/usr/share/doc/openjdk-9-jre/ . +++ +++The package openjdk-9-jre-headless ships a cgi script +++/usr/lib/jvm/java-9-openjdk/bin/java-rmi.cgi that you must integrate +++into your webserver setup manually if you need it. It is not activated +++automatically. +++ +++ +++Note for non-reparenting window manager users +++--------------------------------------------- +++ +++If you are using a non-reparenting window manager, such as ratpoison, awesome +++or dwm, some Java graphical applications using the AWT toolkit will only +++display empty grey windows, as described in but #508650. +++ +++There are two solutions to work around this issue: +++1. mask your window manager as one of the non-reparenting ones supported by AWT, +++ using the wmname tool from the +++ suckless-tools package: +++ $ wmname LG3D +++2. set the environment variable _JAVA_AWT_WM_NONREPARENTING: +++ $ export _JAVA_AWT_WM_NONREPARENTING=true +++ +++You can automate these tasks by writing them to your ~/.xsessionrc: +++$ cat >> ~/.xsessionrc < Sun, 03 May 2009 13:58:10 +0200 +++ -- Torsten Werner Wed, 02 Apr 2008 11:46:53 +0200 diff --cc debian/README.alternatives.in index 000000000,000000000,000000000..19d46fb31 new file mode 100644 --- /dev/null +++ b/debian/README.alternatives.in @@@@ -1,0 -1,0 -1,0 +1,35 @@@@ +++Updating alternatives for JRE/JDK installations +++----------------------------------------------- +++ +++Packages providing a runtime or a development environment for the Java +++language all use symlinks in the /etc/alternatives directory to enable +++the system administrator to choose which programs to use for java, +++javac, javah, etc. +++ +++The update-java-alternatives script can be used to set all the JRE/JDK +++alternatives: +++ +++First, you have to decide which Java implementation to default to. +++ +++ update-java-alternatives --list +++ +++tells about the available runtime and/or development environments. The +++first column shows the names to be used in for the following examples. +++ +++- Set all runtime tools to point to the alternatives: +++ +++ update-java-alternatives --jre --set +++ +++- Set all runtime tools (headless only) to point to the +++ alternatives: +++ +++ update-java-alternatives --jre-headless --set +++ +++- Set all runtime and development tools to point to the +++ alternatives: +++ +++ update-java-alternatives --set +++ +++- Set all runtime and development tools to auto mode: +++ +++ update-java-alternatives --auto diff --cc debian/README.source index 000000000,000000000,000000000..87678eb78 new file mode 100644 --- /dev/null +++ b/debian/README.source @@@@ -1,0 -1,0 -1,0 +1,76 @@@@ +++Content of source package +++========================= +++"openjdk-8" is a composite source package: +++- Multiple tarballs from each Oracle mercurial repositories : +++ corba / hotspot / jaxp / jaxws / jdk-dfsg / langtools / openjdk +++- Tarball from JamVM . +++- Debian packaging scripts and patches. +++ +++Building a new OpenJDK-8 Debian package +++=================================================== +++Pre-requisites: +++- Mercurial +++- Bazaar +++ sudo aptitude install mercurial bzr +++ +++0) Clone OpenJDK debian packaging: +++ bzr branch lp:~openjdk/openjdk/openjdk7 openjdk7/ +++ or update existing repository clone: +++ (cd openjdk7/; bzr pull --remember lp:~openjdk/openjdk/openjdk7) +++ +++1) Clone IcedTea-7 HG: +++ hg clone http://icedtea.classpath.org/hg/icedtea7 icedtea-2.1.1/ +++ or update existing repository clone: +++ (cd icedtea7/; hg pull -u) +++ +++2) Download OpenJDK upstream tarballs and move them to $BUILD/ +++ export BUILD=7u3 +++ mkdir -p $BUILD/ +++ ( +++ cd icedtea-2.1.1/ +++ sh autogen.sh && ./configure --enable-jamvm +++ make download +++ ) +++ +++ mv icedtea-2.1.1/*.tar.gz $BUILD/ +++ ( +++ cd icedtea-2.1.1/ +++ make distclean +++ ) +++ +++3) Remove files with unclear license from jdk.tar.gz: +++ sh openjdk7/generate-dfsg-zip.sh $BUILD/jdk.tar.gz +++ sh openjdk7/generate-dfsg-zip.sh $BUILD/langtools.tar.gz +++ +++4) Check tarballs' name and version (for original directory name) +++ in openjdk7/generate-debian-orig.sh and package version in +++ openjdk7/changelog +++ +++5) Generate "orig" directory and "orig+debian" directory +++ sh openjdk7/generate-debian-orig.sh +++ +++Support for DEB_BUILD_OPTIONS +++============================= +++As described in Debian Policy §4.9.1, current package's debian/rules support +++the standardized environment variable DEB_BUILD_OPTIONS. This variable can +++contain several flags to change how a package is compiled and built. +++ +++ * nocheck: don't run jtreg test suites. +++ * nodocs: pass --disable-docs to IcedTea configure script, which +++ disable Javadoc generation. +++ * nostrip: debugging symbols should not be stripped from the +++ binary during installation +++ * parallel=X: package should be built using up to X parallel processes +++ * nobootstrap: don't use gcj to bootstrap OpenJDK but use existing OpenJDK +++ installed on current machine. +++ * noaltzero: don't build alternative Zero VM. +++ * noaltshark: don't build alternative Shark VM. +++ * noaltjamvm: don't build alternative Jamvm VM. +++ +++Sample usage: +++DEB_BUILD_OPTIONS="parallel=5 nocheck" debuild -i"(\.hg|\.bzr)" +++ +++ Build with 5 parallel processes and don't run jtreg test suites. +++ +++This also work with cowbuilder/pbuilder: +++DEB_BUILD_OPTIONS="parallel=5 nocheck" pdebuild -i"(\.hg|\.bzr)" --logfile ../build.log --pbuilder cowbuilder diff --cc debian/README.testsuite index 000000000,000000000,000000000..2330ed4a1 new file mode 100644 --- /dev/null +++ b/debian/README.testsuite @@@@ -1,0 -1,0 -1,0 +1,103 @@@@ +++Running regression tests +++------------------------ +++ +++Unpack openjdk-N-source package and install the openjdk-N-testsupport +++package. +++ +++Change directory to the source package and execute: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jtreg-autopkgtest.sh +++ +++to run regression tests. +++ +++The script does not set up a GUI environment. Please use +++./debian/tests/jdk-autopkgtest.sh for JDK tests that require a GUI. +++ +++Some examples: +++ +++- Run specific tests: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jtreg-autopkgtest.sh output-dir \ +++ -dir:test/hotspot/jtreg/ \ +++ sanity/BasicVMTest.java \ +++ runtime/6294277/SourceDebugExtension.java +++ +++- Run a group of tests (see TEST.groups for definitions): +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jtreg-autopkgtest.sh output-dir \ +++ -dir:test/hotspot/jtreg \ +++ :tier1 +++ +++- Run all tests in the subdirectory: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jtreg-autopkgtest.sh output-dir \ +++ test/hotspot/jtreg/runtime +++ +++ or +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jtreg-autopkgtest.sh output-dir \ +++ -dir:test/hotspot/jtreg/ \ +++ runtime +++ +++See the jtreg manual page for the overview of jtreg options. +++ +++More information is available in OpenJDK documentation[1] and OpenJDK +++developer guide[2]. +++ +++Running hotspot regression tests +++-------------------------------- +++ +++Change directory to the source package and execute: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/hotspot-autopkgtest.sh +++ +++Some examples: +++ +++- Run specific tests: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/hotspot-autopkgtest.sh \ +++ sanity/BasicVMTest.java \ +++ runtime/6294277/SourceDebugExtension.java +++ +++- Run a test group: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/hotspot-autopkgtest.sh \ +++ :tier2 +++ +++Running the script without any options executes tier1 hotspot tests. +++ +++Running jdk regression tests +++---------------------------- +++ +++Change directory to the source package and execute: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jdk-autopkgtest.sh +++ +++Some examples: +++ +++- Run specific tests: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jdk-autopkgtest.sh \ +++ java/lang/Long/GetLong.java \ +++ java/lang/Math/TanTests.java +++ +++- Run a test group: +++ +++ AUTOPKGTEST_TMP=. AUTOPKGTEST_ARTIFACTS=. \ +++ ./debian/tests/jdk-autopkgtest.sh \ +++ :tier2 +++ +++Running the script without any options executes tier1 jdk tests. +++ +++[1] https://openjdk.org/groups/build/doc/testing.html +++[2] https://openjdk.org/guide/#jtreg diff --cc debian/TODO index 000000000,000000000,000000000..e131d33b8 new file mode 100644 --- /dev/null +++ b/debian/TODO @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++to remove: +++hotspot-set-compiler.diff +++hotspot-warn-no-errformat.diff +++ +++evaluate: +++ld-symbolic-functions.diff still needed? +++hotspot-sparc-arch.diff +++pass-extra-flags.diff +++hotspot-disable-werror.diff +++hotspot-undefined-target-cpu.diff diff --cc debian/accessibility-atk.properties.disabled index 000000000,000000000,000000000..c1bdc487b new file mode 100644 --- /dev/null +++ b/debian/accessibility-atk.properties.disabled @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++# +++# The following line specifies the assistive technology classes +++# that should be loaded into the Java VM when the AWT is initailized. +++# Specify multiple classes by separating them with commas. +++# Note: the line below cannot end the file (there must be at +++# a minimum a blank line following it). +++# +++# Doesn't work, see LP: #935296 +++#assistive_technologies=org.GNOME.Accessibility.AtkWrapper +++ diff --cc debian/accessibility-atk.properties.enabled index 000000000,000000000,000000000..b58c49249 new file mode 100644 --- /dev/null +++ b/debian/accessibility-atk.properties.enabled @@@@ -1,0 -1,0 -1,0 +1,8 @@@@ +++# +++# The following line specifies the assistive technology classes +++# that should be loaded into the Java VM when the AWT is initailized. +++# Specify multiple classes by separating them with commas. +++# Note: the line below cannot end the file (there must be at +++# a minimum a blank line following it). +++# +++assistive_technologies=org.GNOME.Accessibility.AtkWrapper diff --cc debian/accessibility.properties index 000000000,000000000,000000000..e0095896c new file mode 100644 --- /dev/null +++ b/debian/accessibility.properties @@@@ -1,0 -1,0 -1,0 +1,9 @@@@ +++# +++# The following line specifies the assistive technology classes +++# that should be loaded into the Java VM when the AWT is initialized. +++# Specify multiple classes by separating them with commas. +++# Note: the line below cannot end the file (there must be at +++# a minimum a blank line following it). +++# +++assistive_technologies=org.GNOME.Accessibility.JavaBridge +++ diff --cc debian/apport-hook.py index 000000000,000000000,000000000..699248c66 new file mode 100644 --- /dev/null +++ b/debian/apport-hook.py @@@@ -1,0 -1,0 -1,0 +1,46 @@@@ +++'''Apport package hook for openjdk packages. +++ +++Copyright (C) 2017 Canonical Ltd. +++Author: Tiago Stürmer Daitx ''' +++ +++import os +++import re +++import sys +++from apport.hookutils import * +++ +++def si_units(size): +++ for unit in ['KiB', 'MiB', 'GiB']: +++ size /= 1024 +++ if size < 1024: +++ break +++ return '{0:.1f} {1}'.format(size, unit) +++ +++def add_info(report, ui=None): +++ attach_conffiles(report,'openjdk-21-jre-headless', ui=ui) +++ +++ if report['ProblemType'] == 'Crash' and 'ProcCwd' in report: +++ # attach hs_err_.pid file +++ cwd = report['ProcCwd'] +++ pid_line = re.search("Pid:\t(.*)\n", report["ProcStatus"]) +++ if pid_line: +++ pid = pid_line.groups()[0] +++ path = "%s/hs_err_pid%s.log" % (cwd, pid) +++ # make sure if exists +++ if os.path.exists(path): +++ content = read_file(path) +++ # truncate if bigger than 100 KB +++ # see LP: #1696814 +++ max_length = 100*1024 +++ if sys.getsizeof(content) < max_length: +++ report['HotspotError'] = content +++ report['Tags'] += ' openjdk-hs-err' +++ else: +++ report['HotspotError'] = content[:max_length] + \ +++ "\n[truncated by openjdk-11 apport hook]" + \ +++ "\n[max log size is %s, file size was %s]" % \ +++ (si_units(max_length), si_units(sys.getsizeof(content))) +++ report['Tags'] += ' openjdk-hs-err' +++ else: +++ report['HotspotError'] = "File not found: %s" % path +++ else: +++ report['HotspotError'] = "PID not found in ProcStatus entry." diff --cc debian/buildwatch.sh index 000000000,000000000,000000000..8521c4a60 new file mode 100644 --- /dev/null +++ b/debian/buildwatch.sh @@@@ -1,0 -1,0 -1,0 +1,67 @@@@ +++#! /bin/sh +++ +++# +++# Output something to stdout every so often so buildd won't kill +++# the build when building +++# +++ +++builddir=$1 +++ +++echo $$ > buildwatch.pid +++ +++time_unit="m" +++timer=0 +++sleep_for=3 +++time_up_at=180 +++upd_every=30 # use a multiple of $sleep_for +++ +++reset_timer() { timer=0; } +++inc_timer() { timer=$(expr $timer + $sleep_for); } +++time_up() { [ $timer -ge $time_up_at ]; } +++can_update() { [ $(expr $timer % $upd_every) -eq 0 ]; } +++do_sleep() { sleep ${sleep_for}${time_unit} && inc_timer; } +++ +++is_running() { +++ ps x | grep -v grep | egrep -qs $@ +++ return $? +++} +++ +++cleanup() { +++ # find any hs_err_pid files generated during the build and print them out +++ # this helps debugging what went wrong during builds +++ find . -type f -name 'hs_err_pid*.log' -printf "[$0] === HOTSPOT ERROR LOG ===\n[$0] %p (last modification at %t)\n" -exec cat {} \; +++} +++ +++for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done +++trap cleanup EXIT +++ +++while ! time_up; do +++ if [ ! -f buildwatch.pid ]; then +++ echo "[$0] pidfile removed" && break +++ fi +++ if ! is_running '/make'; then +++ echo "[$0] no make process detected (build done?)" && break +++ fi +++ +++ do_sleep +++ can_update || continue +++ +++ new_noisy=$(ls -l test/jtreg_output-* 2>&1 | md5sum) +++ new_quiet=$(ls -l $builddir/openjdk*/build/*/tmp/rt-orig.jar $builddir/openjdk*/build/*/lib/tools.jar $builddir/openjdk*/build/*/lib/ct.sym 2>&1 | md5sum) +++ if [ -n "$old_noisy" -a "$old_noisy" != "$new_noisy" ]; then +++ # jtreg updated test files, so it should be updating stdout in its own +++ # keep quiet and restart timer +++ reset_timer +++ elif [ -n "$old_quiet" -a "$old_quiet" != "$new_quiet" ]; then +++ reset_timer +++ echo "[$0] assembling jar file ..." +++ elif is_running '/cc1|jar|java|gij'; then +++ echo "[$0] compiler/java/jar running ..." +++ reset_timer +++ fi +++ old_noisy=$new_noisy +++ old_quiet=$new_quiet +++done +++ +++echo "[$0] exiting" +++rm -f buildwatch.pid diff --cc debian/changelog index 000000000,000000000,000000000..8ccf3c313 new file mode 100644 --- /dev/null +++ b/debian/changelog @@@@ -1,0 -1,0 -1,0 +1,5786 @@@@ +++openjdk-21 (21.0.5~6ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21.0.5 early access, build 6. +++ +++ [ Vladimir Petko ] +++ * d/p/reproducible-properties-timestamp.diff: Use PrivilegedAction +++ to avoid SecurityManager exception. +++ * Enable dtrace support. +++ +++ -- Matthias Klose Mon, 09 Sep 2024 15:29:08 +0200 +++ +++openjdk-21 (21.0.4+7-3) unstable; urgency=medium +++ +++ [ Vladimir Petko ] +++ * d/copyright-generator/strip-common-licenses.sh: Add GPLv3 to the +++ list of common licenses. +++ * d/p/jdk-8334895-proposed.patch: Fix typo in the patch description. +++ * d/JB-*.overrides.in: Update lintian overrides. +++ * d/s/lintian-override: Add source-contains-prebuilt-javascript-object +++ due to LP: 2032992. +++ * d/control.in: Remove duplicate Provides. +++ * d/control: Regenerate. +++ * d/t/problemlist.csv: Update problemlist.csv for July release +++ * d/t/jtreg-autopkgtest.{in,sh}: Increase jtreg test timeouts. +++ +++ [ Emmanuel Bourg ] +++ * Restore and update the reproducible-properties-timestamp patch. +++ +++ -- Matthias Klose Sat, 10 Aug 2024 10:08:49 +0200 +++ +++openjdk-21 (21.0.4+7-2) unstable; urgency=medium +++ +++ [ Vladimir Petko ] +++ * d/copyright: Regenerate copyright. +++ * d/watch: Use fixed googletest version. +++ * d/rules, d/t/*: Collate all excluded tests into d/problemlist.csv. +++ * d/rules: Enable fallback linker for Foreign Function and Memory API +++ on i386 and armhf. +++ * d/p/jdk-8336529-proposed.patch: Fix time_t migration issue on armhf. +++ openjdk is unable to set file last modified timestamp. +++ * d/rules: Enable fallback linker for architectures that do not +++ provide a native one. +++ * d/rules, d/control.in: Depend on pkgconf rather than pkg-config in +++ bookworm and later releases. This resolves lintian warning +++ build-depends-on-obsolete-package Build-Depends: pkg-config => pkgconf. +++ * d/rules: Drop autotools-dev dependency for the modern debhelper. +++ This resolves obsolete autotools-dev dependency lintian warning. +++ See #844191. +++ * d/t/control.in: allow stderr for smoke tests. +++ +++ -- Matthias Klose Tue, 30 Jul 2024 08:37:36 +0200 +++ +++openjdk-21 (21.0.4+7-1) unstable; urgency=high +++ +++ * OpenJDK 21.0.4 release, build 7. +++ - CVEs: +++ + CVE-2024-21147 +++ + CVE-2024-21145 +++ + CVE-2024-21140 +++ + CVE-2024-21131 +++ + CVE-2024-21138 +++ - Security Fixes: +++ + JDK-8316138: Added GlobalSign R46 and E46 root CA certificates. +++ + JDK-8326891: Native executables and libraries on Linux Use RPATH +++ instead of RUNPATH. +++ + JDK-8328638: Fallback option for POST-only OCSP requests. +++ +++ -- Matthias Klose Wed, 17 Jul 2024 09:31:36 +0200 +++ +++openjdk-21 (21.0.4~6ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21.0.4, build 6 (early access). +++ +++ [ Matthias Klose ] +++ * Build using GCC 10 for focal. +++ +++ [ Vladimir Petko ] +++ * Update patches for the snapshot build. +++ * d/p/jdk-8331541.patch: Add fix for the link failure against libjvm.so +++ on i386. Closes: #1070476. +++ +++ -- Matthias Klose Sat, 29 Jun 2024 07:21:02 +0200 +++ +++openjdk-21 (21.0.3+9-2) unstable; urgency=medium +++ +++ [ Vladimir Petko ] +++ * Re-enable running the tests during the build. +++ * d/p/8295111.patch: Apply upstream patch to resolve jpackage failure +++ to create a deb package. +++ * Add autopkgtest to test that JNI applications using the invocation API +++ can be linked. +++ * Add autopkgtest for libpcsclite initialisation. +++ +++ -- Matthias Klose Wed, 24 Apr 2024 15:34:38 +0200 +++ +++openjdk-21 (21.0.3+9-1) unstable; urgency=high +++ +++ * OpenJDK 21.0.3 release, build 9. +++ - CVE-2024-21011, 8319851: Improve exception logging. +++ - CVE-2024-21068, 8322122: Enhance generation of addresses. +++ - 8318340: Improve RSA key implementations. +++ - CVE-2024-21012, 8315708: Enhance HTTP/2 client usage. +++ * CVE-2024-21094, 8317507: Already fixed in November 2023: +++ C2 compilation fails with "Exceeded _node_regs array". +++ +++ [ Vladimir Petko ] +++ * d/p/jdk-8329983.patch: apply workaround for JDK-8329983, link failure +++ against libjvm.so on armhf due to undefined symbol. +++ +++ [ Matthias Klose ] +++ * Update the m68k-support patch. Closes: #1068873. +++ +++ -- Matthias Klose Wed, 17 Apr 2024 14:07:04 +0200 +++ +++openjdk-21 (21.0.3~7ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21.0.3, build 7 (early access). +++ +++ [ Matthias Klose ] +++ * Don't try to install jhsdb on armhf with a zero-only build. +++ * Remove the GTK 2.x bits. +++ * Update cups dependencies for time_t64. +++ +++ [ Pushkar Kulkarni ] +++ * Corrections to patch arch-add-ports.diff. +++ * Fix a typo in the vendor name derivation logic. +++ * Copyright generator fixes. +++ +++ [ Vladimir Petko ] +++ * d/p/jdk-8325028.patch: Apply upstream patch so that pipe channels +++ lazily set socket to non-blocking mode on first use by virtual thread. +++ * Fix installing the s390x build. +++ * Emit warning to install openjdk-*-jre package when fontmanager is +++ used, but only openjdk-*-jre-headless is installed. +++ * Add support to build --with-hsdis=binutils, but keep it off by default. +++ * Run the hotspot and jdk autopkg tests on all architectures. +++ * Add bash, lsb-release and xauth as dependencies for autopkg tests. +++ * Build openjdk-21-testsupport packages, containing the binaries +++ required to run the autopkg tests. +++ * d/t/{hotspot,jdk}-autopkgtest.{sh, in}: Set default arguments to +++ tier1 tests, otherwise pass user's arguments while setting correct +++ test directory and native path. +++ * Fix lintian override package name. +++ +++ -- Matthias Klose Thu, 21 Mar 2024 03:18:28 +0100 +++ +++openjdk-21 (21.0.3~6ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21.0.3, build 6 (early access). +++ +++ -- Matthias Klose Tue, 12 Mar 2024 11:04:33 +0100 +++ +++openjdk-21 (21.0.2+13-3) unstable; urgency=medium +++ +++ * libcups2, libfontconfig1: Make it a recommends in jre-headless, +++ a dependency in jre. +++ * Make the dependencies for libfontmanager.so and libjsound.so +++ recommendations in jre-headless, and dependencies in jre. +++ * Drop build dependencies on libgtk2 | libgtk3. +++ * Disable running the tests for the time_t64 bootstrap. +++ +++ -- Matthias Klose Mon, 11 Mar 2024 16:00:47 +0100 +++ +++openjdk-21 (21.0.2+13-2) unstable; urgency=medium +++ +++ [ Matthias Klose ] +++ * d/changelog: Whitespace cleanup. +++ * Update build dependency on libfontconfig-dev. +++ * Apply proposed patch for JDK-8307977. Addresses: #1034600. +++ +++ [ Vladimir Petko ] +++ * Apply proposed fix for JDK-8242564 to resolve Java 21 FTBFSes. +++ Closes: #1057500, #1057508, #1057519. +++ +++ -- Matthias Klose Wed, 24 Jan 2024 09:11:26 +0100 +++ +++openjdk-21 (21.0.2+13-1) unstable; urgency=high +++ +++ * OpenJDK 21.0.2 release, build 13. +++ - CVEs: +++ + CVE-2024-20918 +++ + CVE-2024-20919 +++ + CVE-2024-20921 +++ + CVE-2024-20945 +++ + CVE-2024-20952 +++ - Security fixes: +++ + JDK-8308204: Enhanced certificate processing. +++ + JDK-8314295: Enhance verification of verifier. +++ + JDK-8314307: Improve loop handling. +++ + JDK-8314468: Improve Compiler loops. +++ + JDK-8316976: Improve signature handling. +++ + JDK-8317547: Enhance TLS connection support. +++ +++ [ Pushkar Kulkarni ] +++ * debian/copyright: Fix whitespace issues. +++ * Minor improvements to the copyright-generator. +++ +++ [ Vladimir Petko ] +++ * d/copyright: Fix lintian warning. +++ * Generate d/watch to cope with early access and release builds. +++ +++ [ Matthias Klose ] +++ * Add sparc64 defines (patch by Adrian Glaubitz). Closes: #1057390. +++ * d/copyright: Fix source location. +++ * Update the arch-add-ports patch, taken from 22. +++ * Regenerate debian files. +++ +++ -- Matthias Klose Wed, 17 Jan 2024 13:14:57 +0100 +++ +++openjdk-21 (21.0.1+12-2) unstable; urgency=medium +++ +++ [ Vladimir Petko ] +++ * d/rules: pack external debug symbols with build-id, do not strip +++ JVM shared libraries. LP: #2012326, LP: #2016739. +++ +++ [ Pushkar Kulkarni ] +++ * debian/copyright: Update copyrights and notices, using a generator script. +++ +++ -- Matthias Klose Thu, 02 Nov 2023 11:20:35 +0100 +++ +++openjdk-21 (21.0.1+12-1) unstable; urgency=high +++ +++ * OpenJDK 21.0.1 release, build 12. +++ - CVE-2023-22081, CVE-2023-22025. +++ - Release notes: +++ https://www.oracle.com/java/technologies/javase/21-0-1-relnotes.html +++ +++ [ Matthias Klose ] +++ * Build-depend on OpenJDK 21 in releases where it already exists. +++ +++ [ Pushkar Kulkarni ] +++ * debian/copyright: Update copyrights and notices. +++ +++ [ Vladimir Petko ] +++ * d/p/build_test.patch: Use openjdk-17 patch for backports compatibility. +++ * d/watch: use release version format. +++ * d/copyright: include google test license. +++ * d/rules, d/watch: bundle google test library. +++ * d/patches: remove build_gtest.patch. +++ * d/tests: refresh problem lists. +++ * d/p/exclude_broken_tests.patch: drop patch. +++ +++ -- Matthias Klose Fri, 20 Oct 2023 09:45:32 +0200 +++ +++openjdk-21 (21+35-1) unstable; urgency=medium +++ +++ * OpenJDK 21 release build, (no changes). +++ +++ [ Matthias Klose ] +++ * Build-depend on the unversioned libfreetype-dev. +++ * Build zero on loong64. +++ * Change upstream VCS to https://github.com/openjdk/jdk21u. +++ +++ [ Pushkar Kulkarni ] +++ * Enable JdiListeningLocalhostExecutionControlTest.java again. +++ +++ [ Vladimir Petko ] +++ * Run tests on Ubuntu 22.04 LTS and 20.04 LTS. +++ +++ -- Matthias Klose Thu, 21 Sep 2023 06:39:23 +0200 +++ +++openjdk-21 (21~35ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 35 (first release candidate). +++ +++ [ Pushkar Kulkarni ] +++ * d/p/series - The jaw-classpath and jaw-optional patches help work around +++ the problem of an application being unable to load ATK wrapper classes +++ since the introduction of the JPMS(JDK9). With openjdk-8, these classes +++ were loaded as extension classes from jre/lib/ext. The best alternative +++ today is that the user makes sure java-atk-wrapper is installed, modifies +++ the accessibility.properties file to enable ATK and sets the CLASSPATH to +++ point to the location of the ATK jar. These patches have been dropped on +++ openjdk-11 and openjdk-17 previously. +++ +++ [ Matthias Klose ] +++ * Explicitly configure --without-jtreg with the nocheck profile +++ +++ -- Matthias Klose Thu, 24 Aug 2023 08:43:29 +0200 +++ +++openjdk-21 (21~32ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 32. +++ +++ [ Vladimir Petko ] +++ * d/t/jtreg-autopkgtest.{sh,in}: JDK-8232153 - set NSS_DEFAULT_DB_TYPE +++ to let sun/security/pkcs11/Secmod/AddTrustedCert.java pass. +++ * d/p/exclude-broken-tests.patch: quarantine pkcs11 tests failing with NSS 3.91. +++ * d/t/problems-armhf.txt: quarantine armhf failing tests: +++ - java/net/httpclient/ManyRequestsLegacy.java: SSL request timeout. +++ - java/util/Random/RandomTestBsi1999.java: deadlock in CI. +++ +++ -- Matthias Klose Thu, 20 Jul 2023 10:52:07 +0200 +++ +++openjdk-21 (21~30ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 30. +++ +++ * Link with --no-as-needed. Closes: #1031521. +++ * d/rules: Remove EXTRA_.*FLAGS_JDK macros. +++ * Fix FTCBFS: Add libffi-dev:native to B-D (Helmut Grohne). Closes: #1039946. +++ * Build using GCC 13. +++ +++ -- Matthias Klose Mon, 10 Jul 2023 14:11:47 +0200 +++ +++openjdk-21 (21~29ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 29. +++ +++ [ Vladimir Petko ] +++ * Fix bootstrapping with an OpenJDK 20 zero VM. +++ +++ -- Matthias Klose Fri, 30 Jun 2023 11:22:43 +0200 +++ +++openjdk-21 (21~28ea-2) unstable; urgency=medium +++ +++ * Update VCS attributes. +++ * Provide versioned java-runtime, java-runtime-headless, java-sdk +++ and java-sdk-headless virtual packages (Emmanuel Bourg). +++ * Add support for arc (untested), hppa (untested) and ia64. +++ * Configure --with-stdc++lib=static on ia64. +++ +++ -- Matthias Klose Thu, 29 Jun 2023 07:21:14 +0200 +++ +++openjdk-21 (21~28ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 28. +++ * Add support for alpha, m68k, ppc, sh, x32. +++ +++ -- Matthias Klose Mon, 26 Jun 2023 07:48:49 +0200 +++ +++openjdk-21 (21~27ea-4) unstable; urgency=medium +++ +++ * debian/rules: Correctly set BOOT_JDK_HOME. +++ +++ -- Matthias Klose Fri, 16 Jun 2023 20:53:53 +0200 +++ +++openjdk-21 (21~27ea-3) unstable; urgency=medium +++ +++ * Regenerate autopkg test scripts. +++ +++ -- Matthias Klose Fri, 16 Jun 2023 14:51:08 +0200 +++ +++openjdk-21 (21~27ea-2) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 27. +++ +++ [ Vladimir Petko ] +++ * Also disable tests on trixie. No jtreg7 yet. +++ * debian/copyright: Convert to a machine-readable format. +++ * debian/copyright: Align excludes statement with openjdk-17. +++ * debian/watch: Add ea repack suffix. +++ * Fix build on mipsel and mips64el. +++ * Move ct.sym from the jre into the jdk package. +++ +++ [ Matthias Klose ] +++ * Enable tests for trixie and unstable. +++ +++ -- Matthias Klose Fri, 16 Jun 2023 08:56:39 +0200 +++ +++openjdk-21 (21~26ea-2) unstable; urgency=medium +++ +++ [ Vladimir Petko ] +++ * d/rules: only compile google tests when with_check is enabled, +++ disable them for bullseye and jammy. +++ +++ -- Matthias Klose Mon, 12 Jun 2023 06:29:28 +0200 +++ +++openjdk-21 (21~26ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, Build 26. +++ +++ [ Vladimir Petko ] +++ * d/p/*: refresh patches. +++ * Copy OpenJDK 20 packaging changes: +++ - d/rules: pack external debug symbols with build-id, do not pack duplicate +++ symbols, do not strip JVM shared libraries (LP: #2012326, LP: #2016739). +++ - d/{control, compat}: update debhelper-compat version, add jtreg7 +++ dependencies, regenerate control. +++ - d/t/{jdk,hotspot,jaxp,lantools}: run tier1 and tier2 jtreg tests only, +++ add test options from OpenJDK makefile. +++ - d/t/*: fix test environment: add missing -nativepath (LP: #2001563). +++ - d/t/jdk: provide dbus session for the window manager (LP: #2001576). +++ - d/p/build_gtest.patch: build OpenJDK with the system googletest +++ (LP: #2012316). +++ * d/p/*: add patches for jtreg tests: +++ - misalign-pointer-for-armhf.patch: packaging-specific patch to fix test +++ failure introduced by d/p/m68k-support.diff. +++ - log-generated-classes-test.patch: workaround JDK-8166162. +++ - update-permission-test.patch: add security permissions for testng 7. +++ - ldap-timeout-test-use-ip.patch, test-use-ip-address.patch: +++ Ubuntu-specific patches to workaround missing DNS resolver on the build +++ machines. +++ - exclude_broken_tests.patch: quarantine failing tests. +++ * Enable ppc64el JRE zero build as JDK-8299476 is fixed. +++ * Known issues: +++ - amd64: test/jdk/sun/security/pkcs11/KeyStore/CertChainRemoval.java: +++ https://mail.openjdk.org/pipermail/jdk-dev/2023-May/007836.html +++ - s390x: test/hotspot/jtreg/runtime/NMT/VirtualAllocCommitMerge.java: +++ https://mail.openjdk.org/pipermail/hotspot-dev/2023-June/075316.html +++ +++ [ Matthias Klose ] +++ * Fix jaxp.properties installation. +++ * Bump standards version. +++ +++ -- Matthias Klose Sat, 10 Jun 2023 17:54:09 +0200 +++ +++openjdk-21 (21~14ea-1) UNRELEASED; urgency=medium +++ +++ [ Vladimir Petko ] +++ * OpenJDK 21 snapshot, Build 14. +++ * d/copyright, d/watch: implement uscan repackaging (LP: #2011749). +++ * d/rules: use --with-debug-symbols=none (LP: #2003820). +++ * debian/JB-jre-headless.postinst.in: trigger ca-certificates-java after jre +++ is set up. +++ +++ -- Matthias Klose Fri, 09 Jun 2023 17:15:22 +0200 +++ +++openjdk-21 (21~7ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, build 7. +++ * Don't build zero on ppc64el for now, see JDK-8298655. +++ +++ -- Matthias Klose Thu, 26 Jan 2023 10:32:21 +0100 +++ +++openjdk-21 (21~3ea-2) unstable; urgency=medium +++ +++ * Fix autopkg test dependencies. +++ +++ -- Matthias Klose Sat, 24 Dec 2022 15:35:45 +0100 +++ +++openjdk-21 (21~3ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, build 3. +++ +++ -- Matthias Klose Thu, 22 Dec 2022 21:06:42 +0100 +++ +++openjdk-21 (21~1ea-1) unstable; urgency=medium +++ +++ * OpenJDK 21 snapshot, build 1. +++ +++ -- Matthias Klose Mon, 12 Dec 2022 14:14:44 +0100 +++ +++openjdk-20 (20~26ea-1) unstable; urgency=medium +++ +++ * OpenJDK 20 snapshot, build 26 (rampdown phase one). +++ * Handle jtreg package name for backports. +++ +++ -- Matthias Klose Mon, 12 Dec 2022 12:34:21 +0100 +++ +++openjdk-20 (20~20ea-1) unstable; urgency=medium +++ +++ * OpenJDK 20 snapshot, build 20. +++ +++ -- Matthias Klose Fri, 21 Oct 2022 10:28:19 +0200 +++ +++openjdk-20 (20~17ea-2) unstable; urgency=medium +++ +++ * Also include the classlist file for zero builds. +++ +++ -- Matthias Klose Mon, 03 Oct 2022 11:18:06 +0200 +++ +++openjdk-20 (20~17ea-1) unstable; urgency=medium +++ +++ * OpenJDK 20 snapshot, build 17. +++ * Refresh patches. +++ +++ -- Matthias Klose Thu, 29 Sep 2022 19:40:13 +0200 +++ +++openjdk-19 (19+36-2) unstable; urgency=medium +++ +++ * Enable hotspot on riscv64. Closes: #1020545. +++ +++ -- Matthias Klose Wed, 28 Sep 2022 16:16:51 +0200 +++ +++openjdk-19 (19+36-1) unstable; urgency=medium +++ +++ * OpenJDK 19 release. +++ * Bump standards version. +++ +++ -- Matthias Klose Fri, 23 Sep 2022 14:55:13 +0200 +++ +++openjdk-19 (19~32ea-1) unstable; urgency=medium +++ +++ * OpenJDK 19 snapshot, build 32. +++ * Re-enable running the test suite. +++ * Only try to re-run failed tests once instead of three times. +++ +++ -- Matthias Klose Fri, 22 Jul 2022 10:25:56 +0200 +++ +++openjdk-19 (19~31ea-1) unstable; urgency=medium +++ +++ * OpenJDK 19 snapshot, build 31. +++ +++ -- Matthias Klose Sun, 17 Jul 2022 11:04:08 +0200 +++ +++openjdk-19 (19~23ea-1) unstable; urgency=medium +++ +++ * OpenJDK 19 snapshot, build 23. +++ +++ -- Matthias Klose Thu, 19 May 2022 11:55:51 +0200 +++ +++openjdk-19 (19~20ea-1) unstable; urgency=medium +++ +++ * OpenJDK 19 snapshot, build 20. +++ * Refresh patches. +++ +++ -- Matthias Klose Tue, 03 May 2022 18:32:32 +0200 +++ +++openjdk-18 (18~36ea-1) unstable; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 36 (first release candidate). +++ +++ -- Matthias Klose Thu, 17 Feb 2022 09:22:24 +0100 +++ +++openjdk-18 (18~32ea-1) unstable; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 32. +++ * Add jwebserver into the openjdk-jdk-headless package. +++ +++ -- Matthias Klose Fri, 21 Jan 2022 11:45:56 +0100 +++ +++openjdk-18 (18~20ea-1) unstable; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 20. +++ * Bump standards version. +++ +++ -- Matthias Klose Thu, 21 Oct 2021 08:36:16 +0200 +++ +++openjdk-18 (18~15ea-4) unstable; urgency=medium +++ +++ * Fix installation of the zero VM, now installed as zero, not as server. +++ +++ -- Matthias Klose Fri, 17 Sep 2021 18:43:49 +0200 +++ +++openjdk-18 (18~15ea-1) unstable; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 15. +++ +++ -- Matthias Klose Thu, 16 Sep 2021 10:10:47 +0200 +++ +++openjdk-18 (18~12ea-1) unstable; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 12. +++ * Encode the early-access status into the package version. +++ +++ -- Matthias Klose Thu, 26 Aug 2021 12:46:22 +0200 +++ +++openjdk-18 (18~2-1) experimental; urgency=medium +++ +++ * OpenJDK 18 snapshot, build 2. +++ * Only build using lto with GCC 11. +++ * Build using GCC 11 in recent distributions. +++ * Remove rimd, removed upstream. +++ +++ -- Matthias Klose Thu, 17 Jun 2021 15:00:57 +0200 +++ +++openjdk-17 (17~24-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 24. +++ * Drop the work around for JDK 8211105. +++ * Remove jaotc (the experimental JIT compiler), removed upstream. +++ * Add an (unapplied) patch to replace OASIS header files with ones +++ imported from NSPR and NSS. See #985765. Not reviewed, not applying. +++ +++ -- Matthias Klose Thu, 27 May 2021 11:26:59 +0200 +++ +++openjdk-17 (17~19-1) unstable; urgency=high +++ +++ * OpenJDK 17 snapshot, build 19. +++ - Fix JDK-8250568: Less ambiguous processing (CVE-2021-2161). +++ - Fix JDK-8249906: Enhance opening JARs (CVE-2021-2163). +++ +++ -- Matthias Klose Thu, 22 Apr 2021 09:51:43 +0200 +++ +++openjdk-17 (17~17-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 17. +++ * Refresh patches. +++ * Prefer to build using openjdk-17 instead of -16. Closes: #986526. +++ +++ -- Matthias Klose Thu, 08 Apr 2021 09:37:40 +0200 +++ +++openjdk-17 (17~15-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 15. +++ * Fix another upstream typo to build with external harfbuzz. Closes: #985668. +++ * Disable running the tests on mipsel and mips64el. Times out, and if it +++ succeeds, it taken at least five days to run. +++ +++ -- Matthias Klose Thu, 25 Mar 2021 10:31:15 +0100 +++ +++openjdk-17 (17~14-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 14. +++ * Don't use the triplet-prefixed binutils tools for backports. +++ * Simplify compiler selection for backports. +++ * Fix build with older glibc versions. See JDK-8262501. +++ * Apply untested patch suggested to fix mips issue. See #983878. +++ +++ -- Matthias Klose Thu, 18 Mar 2021 19:42:16 +0100 +++ +++openjdk-17 (17~11-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 11. +++ * Configure --with-copyright-year. Addresses: #956154. +++ * Restore the libpcsclite-dlopen patch. Closes: #983465. +++ * Don't run the testsuite on armel and riscv64. Crashing the buildds. +++ +++ -- Matthias Klose Thu, 25 Feb 2021 10:33:32 +0100 +++ +++openjdk-17 (17~10-2) unstable; urgency=medium +++ +++ * Fix the build logic, jaotc and jhsdb tools not available on all archs. +++ * Ship the jfc files used by jfr. +++ * reproducible-build-jmod.diff: Fall back to the unpatched behavior +++ for backports. +++ * Only build with system harfbuzz for recent releases. +++ +++ -- Matthias Klose Sat, 20 Feb 2021 12:02:45 +0100 +++ +++openjdk-17 (17~10-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 10. +++ * Fix building with OpenJDK 17 as the boot jdk. +++ * Build with Rules-Requires-Root: no. +++ * Move libawt_xawt.so, libjawt.so into the jre package. Addresses: #908058. +++ * Move the jfr binary from -jre-headless to -jdk-headless. Development tool. +++ +++ -- Matthias Klose Fri, 19 Feb 2021 13:12:19 +0100 +++ +++openjdk-17 (17~9-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 9. +++ * Enable running the tests. +++ * Remove the disable-doclint-by-default patch. Was not applied anymore +++ in 17. Closes: #982521. +++ +++ -- Matthias Klose Thu, 11 Feb 2021 10:13:25 +0000 +++ +++openjdk-17 (17~8-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 8. +++ * Don't try to apply the removed alpha-float-const patch. +++ * Drop the powerpcspe packaging bits. +++ +++ -- Matthias Klose Thu, 04 Feb 2021 14:35:28 +0100 +++ +++openjdk-17 (17~7-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 7. +++ * Update watch file. +++ * Use debugedit to generate unique build-id's and remove the openjdk-N-dbg +++ file conflicts. +++ * Remove KFreeBSD build support and patches, not updated since OpenJDK 8. +++ * Remove obsolete patches: alpha-float-const, libpcsclite-dlopen, +++ parallel-build-fix, s390x-thread-stack-size. +++ +++ -- Matthias Klose Thu, 28 Jan 2021 14:52:27 +0100 +++ +++openjdk-17 (17~5-1) unstable; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 5. +++ +++ -- Matthias Klose Tue, 19 Jan 2021 10:29:50 +0100 +++ +++openjdk-17 (17~4-0ubuntu1) hirsute; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 4. +++ +++ -- Matthias Klose Sat, 09 Jan 2021 17:25:46 +0100 +++ +++openjdk-17 (17~3-1) experimental; urgency=medium +++ +++ * OpenJDK 17 snapshot, build 3. +++ * OpenJDK 17 is supposed to be the next OpenJDK LTS release seeing extended +++ updates and security support. +++ +++ -- Matthias Klose Mon, 28 Dec 2020 13:57:12 +0100 +++ +++openjdk-16 (16~29-1) unstable; urgency=medium +++ +++ * OpenJDK 16 snapshot, build 29. +++ +++ -- Matthias Klose Mon, 28 Dec 2020 12:44:30 +0100 +++ +++openjdk-16 (16~27-2) unstable; urgency=medium +++ +++ * Fix installation on sparc64. +++ * Link with libatomic for more zero builds. +++ * Re-enable zero on armhf. +++ +++ -- Matthias Klose Fri, 04 Dec 2020 10:01:45 +0100 +++ +++openjdk-16 (16~27-1) unstable; urgency=medium +++ +++ * OpenJDK 16 snapshot, build 27. +++ * Bump standards version. +++ +++ -- Matthias Klose Thu, 03 Dec 2020 16:42:51 +0100 +++ +++openjdk-16 (16~14-1) experimental; urgency=medium +++ +++ * OpenJDK 16 snapshot, build 14. +++ * Build with system harfbuzz. +++ +++ -- Matthias Klose Sat, 07 Nov 2020 14:35:22 +0100 +++ +++openjdk-15 (15.0.1+9-3) unstable; urgency=medium +++ +++ * Don't enabled shenandoahgc explicitly. +++ +++ -- Matthias Klose Sat, 07 Nov 2020 08:54:13 +0100 +++ +++openjdk-15 (15.0.1+9-2) unstable; urgency=medium +++ +++ * Update debian/copyright. +++ * Configure --with-jvm-features=shenandoahgc for hotspot builds. +++ LP: #1902029. +++ * Replace the upstream test suite in the autopkg tests with two superficial +++ tests. It doesn't make any sense to run the whole test suite again, +++ after running it during the build. +++ +++ -- Matthias Klose Thu, 05 Nov 2020 16:55:34 +0100 +++ +++openjdk-15 (15.0.1+9-1) unstable; urgency=medium +++ +++ * OpenJDK 15.0.1 release, build 9. +++ * Build just zero on sparc64 (Adrian Glaubitz). Closes: #965342. +++ * Call strip-nondeterminism before computing jmod hashes (Julian Gilbey). +++ * Don't run the jdk tests as an autopkg test, taking too long. +++ Closes: #970606. +++ +++ -- Matthias Klose Wed, 21 Oct 2020 16:46:35 +0200 +++ +++openjdk-15 (15+36-1) unstable; urgency=medium +++ +++ * OpenJDK 15 release, build 36. +++ +++ -- Matthias Klose Wed, 16 Sep 2020 14:08:36 +0200 +++ +++openjdk-15 (15~32-2) unstable; urgency=medium +++ +++ * debian/copyright (remove licenses not found anymore in the sources): +++ - Little CMS, libpng, GIFLIB. +++ * Stop building zero on armhf, ftbfs. +++ +++ -- Matthias Klose Sun, 19 Jul 2020 10:36:08 +0200 +++ +++openjdk-15 (15~32-1) unstable; urgency=medium +++ +++ * OpenJDK 15 snapshot, build 32. +++ * Build again with -march=zEC12 on Ubuntu/s390x. +++ * Re-add missing parts of the riscv64 patch. +++ * Run the tests on release architectures. +++ +++ -- Matthias Klose Fri, 17 Jul 2020 15:30:05 +0200 +++ +++openjdk-15 (15~19-1) unstable; urgency=medium +++ +++ * OpenJDK 15 snapshot, build 19. +++ * Configure --with-jtreg=/usr/share/jtreg +++ * Build with -march=z13 -mtune=z15 on Ubuntu/s390x. +++ +++ -- Matthias Klose Thu, 16 Apr 2020 11:53:19 +0200 +++ +++openjdk-15 (15~18-1) unstable; urgency=medium +++ +++ * OpenJDK 15 snapshot, build 18. +++ - Stop shipping the rmic command. +++ * Make autopkgtests cross-test-friendly (Steve Langasek). LP: #1861467. +++ * d/tests/jtreg-autopkgtest.in: keep generated hs_err log files +++ with test artifacts to improve later debug (Tiago Stürmer Daitx). +++ * d/tests/jtdiff-autopkgtest.in: set default vm to correctly locate (Tiago +++ Stürmer Daitx) +++ * jhsdb isn't built on sh4 (Adrian Glaubitz). Addresses: #951774. +++ * Enable zero for armhf again. +++ * Enable running the tests again, jtreg now updated to 6.0. +++ +++ -- Matthias Klose Mon, 13 Apr 2020 21:16:21 +0200 +++ +++openjdk-15 (15~11-1) unstable; urgency=medium +++ +++ * OpenJDK 15 snapshot, build 11. +++ * Don't apply the disable-doclint-by-default patch, it should be possible +++ to disable those by command line options. +++ * Don't apply the reproducible-javadoc-timestamp patch. Needs an update. +++ * Refresh patches. +++ * Update all the provides for 15. +++ +++ -- Matthias Klose Fri, 21 Feb 2020 09:48:57 +0100 +++ +++openjdk-14 (14~36-1) unstable; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 36 (first release candidate). +++ * Regenerate the control file. Closes: #942783. +++ * Fix FTCBFS (Helmut Grohne). Closes: #949460. +++ - Missing Build-Depends: zlib1g-dev:native. +++ - Use triplet-prefixed objcopy and strip. +++ * Bump standards version. +++ +++ -- Matthias Klose Tue, 11 Feb 2020 09:08:15 +0100 +++ +++openjdk-14 (14~32-1) unstable; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 32. +++ * Make the generated character data source files reproducible (Emmanuel +++ Bourg). Addresses: #933339. +++ * Make the generated module-info.java files reproducible (Emmanuel Bourg). +++ Addresses: #933342. +++ * Make the generated copyright headers reproducible (Emmanuel Bourg). +++ Addresses: #933349. +++ * Make the build user reproducible (Emmanuel Bourg). Addresses: #933373. +++ +++ -- Matthias Klose Thu, 16 Jan 2020 23:31:42 +0100 +++ +++openjdk-14 (14~31-1) unstable; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 31. +++ * openjdk-14-dbg: Conflict with openjdk-13-dbg as well. Closes: #942783. +++ * Configure with --enable-deprecated-ports=yes on sparc64. Closes: #946723. +++ * disable Zero on sparc64. Closes: #946766. +++ +++ -- Matthias Klose Thu, 09 Jan 2020 15:19:43 +0100 +++ +++openjdk-14 (14~27-1) unstable; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 27. +++ * Fix the jtreg consistency check when building without jtreg. +++ * Don't call dh_strip_nondeterminism when building for older releases. +++ * Fix disabling the zero build on arm64 on trusty. +++ * Re-enable running the tests. +++ +++ -- Matthias Klose Sat, 14 Dec 2019 11:21:53 +0100 +++ +++openjdk-14 (14~19-1) unstable; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 19. +++ +++ -- Matthias Klose Thu, 17 Oct 2019 08:26:17 +0200 +++ +++openjdk-14 (14~18-1) experimental; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 18. +++ * Bump standards version. +++ * Use dh_strip_nondeterminism (Emmanuel Bourg). Addresses: #933389. +++ * Fix 8230708, server build on sparc64 (Adrian Glaubitz). Closes: #939565. +++ * Fix FTBFS with DEB_BUILD_PROFILES=nocheck (Helmut Grohne). +++ Addresses: #939521. +++ * Fix debug and src symlinks. Addresses: #893134, #910694, #910696. +++ +++ -- Matthias Klose Thu, 10 Oct 2019 11:05:23 +0200 +++ +++openjdk-14 (14~14-2) experimental; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 14. +++ * Don't build zero on armhf, still broken. +++ +++ -- Matthias Klose Thu, 12 Sep 2019 17:54:43 +0200 +++ +++openjdk-14 (14~13-1) experimental; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 13. +++ * Properly generate Breaks: rules for bionic (fix typo). +++ * Remove libgtk-3-dev from build-deps: libgtk-3-dev is not actually +++ required, package builds fine without it; libgtk2.0-0 or libgtk-3-0 +++ should be explicitly declared instead in bdeps and tests; +++ libxrandr-dev should be explicitly added as it is required and was +++ being included due to libgtk-3-dev dependency. +++ * Set minimum dependency on jtreg based on testsuite requirements. +++ * Fail during pre-build if installed jtreg version is lower then +++ the minimum required version. +++ * Improve and fix build tests and autopkgtests: +++ - Depend on default-jre-headless so jtreg will use the +++ JRE from /usr/default-java; remove JT_JAVA exports as it +++ no longer needs to be set. +++ - Update debian/tests/hotspot,jdk,langtools to ignore +++ jtreg-autopkgtest.sh return code. +++ - Create debian/tests/jtdiff-autopkgtest.in as it depends +++ on debian/rules variables. +++ - debian/tests/jtreg-autopkgtest.sh: +++ + Enable retry of failed tests to trim out flaky tests. +++ + Fix unbound variable. +++ + Keep .jtr files from failed tests only. +++ - debian/tests/jtdiff-autopkgtest.sh: +++ + Fail only if an actual regression is detected. +++ + Add the super-diff comparison from jtdiff. +++ - debian/rules: +++ + Preserve all JTreport directories in the test output +++ directory. +++ + Use JDK_DIR instead of JDK_TO_TEST for autopkgtest +++ generation. +++ + Package all .jtr files from JTwork as jtreg-autopkgtest.sh +++ makes sure it contains only failing tests. +++ * Bump standards version. +++ * Try to build zero on armhf again. +++ +++ -- Matthias Klose Fri, 06 Sep 2019 08:22:27 +0200 +++ +++openjdk-14 (14~6-0ubuntu1) eoan; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 6. +++ * Fix dependency generation on the libjpeg runtime. Addresses: #927965. +++ * Drop dependency on transitional libgl1-mesa-glx package. Addresses: #930611. +++ * Fix more build issues for Ubuntu precise builds. +++ * Don't install jhsdb on riscv64 (Aurelian Jarno). +++ * Tighten dependency on jtreg. +++ +++ -- Matthias Klose Thu, 18 Jul 2019 17:44:41 +0200 +++ +++openjdk-14 (14~3-1) experimental; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 3. +++ * Add riscv64 support for zero (Ed Nevill). +++ * Support using the Java ATK wrapper (Samuel Thibault). Addresses: #900912. +++ - patches/jaw-classpath.diff: Fix finding the Java ATK wrapper. +++ - patches/jaw-optional.diff: Make failing to load the Java ATK wrapper +++ non-fatal. +++ * Apply proposed fix for zero builds. +++ +++ -- Matthias Klose Fri, 28 Jun 2019 12:13:08 +0200 +++ +++openjdk-14 (14~1-1) experimental; urgency=medium +++ +++ * OpenJDK 14 snapshot, build 1. +++ +++ -- Matthias Klose Fri, 14 Jun 2019 10:09:16 +0200 +++ +++openjdk-13 (13~25-1) experimental; urgency=medium +++ +++ * OpenJDK 13 snapshot, build 25. +++ +++ -- Matthias Klose Fri, 14 Jun 2019 09:47:38 +0200 +++ +++openjdk-13 (13~24-1) experimental; urgency=medium +++ +++ * OpenJDK 13 snapshot, build 24. +++ +++ -- Matthias Klose Fri, 07 Jun 2019 09:58:37 +0200 +++ +++openjdk-13 (13~23-1) experimental; urgency=medium +++ +++ * OpenJDK 13 snapshot, build 23. +++ * Fix version number for updated jquery file. +++ * Print some information about the host configuration before starting +++ the build. +++ * Add a watch file (Emmanuel Bourg). +++ * Apply the updated patch for m68k support (Adrian Glaubitz). +++ Closes: #928167. +++ * Apply fix for 8222252, fixing 32bit builds. +++ +++ -- Matthias Klose Fri, 31 May 2019 10:12:20 +0200 +++ +++openjdk-13 (13~22-1) experimental; urgency=medium +++ +++ * OpenJDK 13 snapshot, build 22. +++ * Fix src.zip symlink. Addresses: #923118. +++ * Update patch for m68k support (Adrian Glaubitz). Closes: #928167. +++ * Configure with --with-version-pre='ea' for upstream tags which are +++ not upstream releases (has to be set manually). +++ * Refresh patches. +++ +++ -- Matthias Klose Mon, 27 May 2019 19:44:41 +0200 +++ +++openjdk-13 (13~18-1) experimental; urgency=medium +++ +++ * OpenJDK 13 snapshot, build 18. +++ * Add breaks to the openjdk-13-jre-headless package: +++ - For unattended upgrades: jetty9, netbeans, tomcat8, visualvm. +++ - For eclipse 3.8 removal: eclipse-platform. Addresses: #925071. +++ - For configuration with vendor flag: libreoffice-core. +++ * Add more -dbg package conflicts. Closes: #927745. +++ * Class data sharing is enabled during the build where available. +++ Just use the shipped classes.jsa files. Closes: #927441. +++ +++ -- Matthias Klose Thu, 25 Apr 2019 10:56:56 +0200 +++ +++openjdk-13 (13~17-2) experimental; urgency=medium +++ +++ * Fix the build of the -doc package. +++ * Don't build zero on armhf for now. +++ +++ -- Matthias Klose Fri, 19 Apr 2019 03:00:51 +0200 +++ +++openjdk-13 (13~17-1) experimental; urgency=medium +++ +++ [ Matthias Klose ] +++ * Build the alternate zero VM using the just built hotspot VM. +++ * Remove the icedtea-sound/pulseaudio build support. +++ * Remove some xulrunner build bits. +++ * Annotate the bootstrap dependency with :native. +++ * Fix installation of the -doc package. Closes: #926845, #926917. +++ +++ [ Tiago Stürmer Daitx ] +++ * Install swing.properties into /conf instead of /lib. +++ +++ -- Matthias Klose Thu, 18 Apr 2019 06:33:56 +0200 +++ +++openjdk-13 (13~14-1) experimental; urgency=medium +++ +++ [ Matthias Klose ] +++ * OpenJDK 13 build 14. +++ * Configure with vendor flags. +++ * Update package provides for 12 and 13. +++ +++ [ Tiago Stürmer Daitx ] +++ * Revert to GTK2 as default since GTK3 still has padding and +++ component issues. LP: #1770278. +++ - debian/patches/keep-gtk2-as-default.patch: revert upstream so +++ GTK2 is loaded before GTK3 when available. +++ - debian/rules, debian/control: Set jre to depend on libgtk2.0-0 +++ and alternatively to libgtk-3-0. +++ +++ -- Matthias Klose Thu, 28 Mar 2019 08:54:33 +0100 +++ +++openjdk-13 (13~13-1) experimental; urgency=medium +++ +++ * OpenJDK 13 build 13. +++ +++ -- Matthias Klose Thu, 21 Mar 2019 14:40:49 +0100 +++ +++openjdk-13 (13~12-1) experimental; urgency=medium +++ +++ * OpenJDK 13 build 12. +++ * Don't apply the m68k-support patch. Needs updates. +++ +++ -- Matthias Klose Sat, 16 Mar 2019 20:59:50 +0100 +++ +++openjdk-12 (12~33-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 33 (release candidate 2). +++ * Add support for DCEVM on am64 and i386. Addresses: #921419. +++ * openjdk-12-dbg: Conflict with openjdk-11-dbg. Some object files are +++ identical across OpenJDK versions. Closes: #919790. +++ * Check for nodoc instead of nodocs in DEB_BUILD_OPTIONS. Closes: #922761. +++ +++ -- Matthias Klose Tue, 26 Feb 2019 11:24:37 +0100 +++ +++openjdk-12 (12~32-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 32. +++ * Attribute test dependencies with . +++ +++ -- Matthias Klose Thu, 14 Feb 2019 17:15:22 +0100 +++ +++openjdk-12 (12~31-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 31. +++ * Configure with vendor flags. +++ +++ -- Matthias Klose Thu, 07 Feb 2019 11:50:45 +0100 +++ +++openjdk-12 (12~30-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 30. +++ +++ -- Matthias Klose Fri, 01 Feb 2019 23:30:59 +0100 +++ +++openjdk-12 (12~29-2) unstable; urgency=medium +++ +++ * Fix merging the packaging changes. +++ +++ -- Matthias Klose Fri, 25 Jan 2019 08:38:26 +0100 +++ +++openjdk-12 (12~29-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 29. +++ * Merge packaging changes from 11.0.2. +++ * Link zero on alpha with --no-relax (Michael Cree). Closes: #920161). +++ +++ -- Matthias Klose Thu, 24 Jan 2019 09:09:16 +0100 +++ +++openjdk-12 (12~28-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 28. +++ * jhsdb isn't built on alpha. +++ +++ -- Matthias Klose Thu, 17 Jan 2019 13:28:33 +0100 +++ +++openjdk-12 (12~27-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 27. +++ * Don't run the tests on alpha, causing build failure. +++ +++ -- Matthias Klose Thu, 10 Jan 2019 12:55:21 +0100 +++ +++openjdk-12 (12~25-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 25. +++ * Fix Zero on sparc64 (Adrian Glaubitz). Closes: #917008. +++ +++ -- Matthias Klose Sat, 22 Dec 2018 01:12:39 +0100 +++ +++openjdk-12 (12~24-2) unstable; urgency=medium +++ +++ * Pull patches for 8215353 and 8215374, fixing build on i386. +++ +++ -- Matthias Klose Fri, 14 Dec 2018 20:44:28 +0100 +++ +++openjdk-12 (12~24-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 24. +++ * Re-enable the bootcycle builds for hotspot targets. +++ * Enable bootcycle builds for zero targets. +++ +++ -- Matthias Klose Fri, 14 Dec 2018 19:18:49 +0100 +++ +++openjdk-12 (12~23-3) unstable; urgency=medium +++ +++ * Disable the bootcycle build. +++ +++ -- Matthias Klose Fri, 07 Dec 2018 01:23:44 +0100 +++ +++openjdk-12 (12~23-1) unstable; urgency=medium +++ +++ * OpenJDK 12 build 23. +++ * Update VCS attributes in the control file. Addresses: #909736. +++ * Re-enable the zero build on arm64 and ppc64el. +++ * Configure with --with-jni-libpath. +++ * Enable bootcycle builds for hotspot. +++ * Don't build the test-image target. +++ +++ -- Matthias Klose Thu, 06 Dec 2018 16:37:32 +0100 +++ +++openjdk-12 (12~22-0ubuntu2) disco; urgency=medium +++ +++ * OpenJDK 12 build 22. +++ * Disable zero build on arm64 and ppc64el, ftbfs. +++ +++ -- Matthias Klose Sun, 02 Dec 2018 21:34:27 +0100 +++ +++openjdk-11 (11.0.1+13-3) unstable; urgency=medium +++ +++ * Tighten dependency on debhelper on recent releases. Closes: #911694. +++ * Reproducible properties file header when SOURCE_DATE_EPOCH is specified. +++ Closes: #914278. +++ * Add SOURCE_DATE_EPOCH support to the javadoc tool. Closes: #783938. +++ * Disable AArch64 intrinsics for sin, cos and log. Closes: #910188. +++ LP: #1796982. +++ * Add support for DEB_BUILD_OPTIONS=terse. Closes: #912211. +++ +++ -- Matthias Klose Fri, 30 Nov 2018 11:40:28 +0100 +++ +++openjdk-11 (11.0.1+13-2) unstable; urgency=high +++ +++ * OpenJDK 11.0.1 release. +++ +++ [ Tiago Stürmer Daitx ] +++ * debian/rules: +++ - limit the tests that we run for the hotspot, langtools, +++ and jdk testsuites to improve build times and also to +++ prevent running unstable or failing tests. +++ - fix 'if' clause for definition of the TIME command. +++ - remove guava jar from test classpath, no longer required. +++ * debian/control, debian/control.in: add a breaks clause to +++ clojure1.8 <= 1.8.0-7ubuntu1~. +++ +++ -- Matthias Klose Wed, 17 Oct 2018 09:31:38 +0200 +++ +++openjdk-11 (11~28-3) unstable; urgency=medium +++ +++ * Build-depend on testng. +++ * Drop the jdk-freetypeScaler-crash patch. Closes: #905718. +++ * Don't run the tests on armel and mips*. Either too slow, or even +++ crashing the buildds. +++ +++ -- Matthias Klose Wed, 03 Oct 2018 04:24:27 +0200 +++ +++openjdk-11 (11~28-2) unstable; urgency=medium +++ +++ [ Matthias Klose ] +++ * Configure --with-jvm-features=zgc on amd64. Closes: #909560. +++ +++ [ Tiago Stürmer Daitx ] +++ * debian/rules: by default leave atk disabled, move accessibility bridge to +++ recommends. LP: #1788250. LP: #1788267. +++ * debian/control.in, debian/control: move accessibility bridge to +++ recommends, add testng and libguava-java as build dependencies. +++ * debian/rules: +++ - copy accessibility files to conf/ (thanks to Samuel Thibault). +++ - update test rules, set output to jtreg-test-output/ as test/ belongs +++ to openjdk source, add jaxp and nashorn, use ProblemList.txt from +++ each testsuite as the exclude list for jtreg, update regex to include +++ into the tarball failed jcstress tests in the Test.java#id123 format, +++ create a tarball with the JTreport directory, add guava jar file to +++ the test classpath. +++ * debian/excludelist.jdk.jtx, excludelist.langtools.jtx: removed, tests +++ now rely on the ProblemList.txt exclusion list that is included in-tree +++ and maintained upstream. +++ +++ -- Matthias Klose Tue, 25 Sep 2018 18:14:28 +0200 +++ +++openjdk-11 (11~28-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 27. +++ +++ -- Matthias Klose Tue, 04 Sep 2018 14:37:49 +0200 +++ +++openjdk-11 (11~27-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 27. +++ +++ -- Matthias Klose Mon, 20 Aug 2018 11:30:22 +0200 +++ +++openjdk-11 (11~24-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 24. +++ * jhsdb is not available on ia64 and m68k either. +++ * Update the m68k support (Adrian Glaubitz). Closes: #904204. +++ +++ -- Matthias Klose Fri, 27 Jul 2018 05:41:39 +0200 +++ +++openjdk-11 (11~23-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 23. +++ * Explicitly build-depend on libfontconfig1-dev, explicitly depend +++ on libfontconfig1. LP: #1780151. +++ * jhsdb is not available on armel, mipsel and mips64el. Closes: #903631. +++ * Build using GCC 8. +++ * Configure with --with-native-debug-symbols=internal. +++ +++ -- Matthias Klose Thu, 19 Jul 2018 20:03:05 +0200 +++ +++openjdk-11 (11~22-2) unstable; urgency=medium +++ +++ * jhsdb is not available on mips. +++ +++ -- Matthias Klose Fri, 13 Jul 2018 07:48:13 +0200 +++ +++openjdk-11 (11~22-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 22. +++ * jhsdb is not available on powerpc, s390x and x32. +++ +++ -- Matthias Klose Thu, 12 Jul 2018 17:00:12 +0200 +++ +++openjdk-11 (11~21-2) unstable; urgency=medium +++ +++ * jaotc is only available on amd64 and arm64. +++ +++ -- Matthias Klose Sun, 08 Jul 2018 08:22:34 +0200 +++ +++openjdk-11 (11~21-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 21. +++ * Fix the jre/jdk split again. +++ +++ -- Matthias Klose Fri, 06 Jul 2018 07:10:53 +0200 +++ +++openjdk-11 (11~19-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 19. +++ +++ -- Matthias Klose Mon, 25 Jun 2018 11:04:39 +0200 +++ +++openjdk-11 (11~18-2) unstable; urgency=medium +++ +++ * Fix the parallel build with multiple VM variants. +++ * Fix installation of the jre binaries. Closes: #901674. +++ +++ -- Matthias Klose Tue, 19 Jun 2018 06:17:22 +0200 +++ +++openjdk-11 (11~18-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 18. +++ * Apply fix to build on sparc64. Closes: #901410. +++ * Build again the client VM on i386, limiting parallel make to two cores. +++ +++ -- Matthias Klose Fri, 15 Jun 2018 14:09:40 +0200 +++ +++openjdk-11 (11~17-2) unstable; urgency=medium +++ +++ * Don't build the client VM on i386, fails since build 16. +++ +++ -- Matthias Klose Sat, 09 Jun 2018 21:03:00 +0200 +++ +++openjdk-11 (11~17-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 17. +++ +++ -- Matthias Klose Fri, 08 Jun 2018 21:14:46 +0200 +++ +++openjdk-11 (11~16-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 16. +++ +++ -- Matthias Klose Fri, 01 Jun 2018 13:21:38 +0200 +++ +++openjdk-11 (11~15-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 15. +++ +++ -- Matthias Klose Mon, 28 May 2018 10:57:30 +0200 +++ +++openjdk-11 (11~13-2) unstable; urgency=medium +++ +++ * Stop shipping the appletviewer binary. +++ +++ -- Matthias Klose Sun, 13 May 2018 20:09:17 -0400 +++ +++openjdk-11 (11~13-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 13. +++ +++ -- Matthias Klose Sun, 13 May 2018 14:41:09 -0400 +++ +++openjdk-11 (11~12-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 12. +++ * Fix ftbfs on powerpcspe, adjusting the MIN_FLOAT constant (Adrian Glaubitz). +++ Addresses: #897334. +++ * Remove classes.jsa files on package removal. Addresses: #897411. +++ +++ -- Matthias Klose Sat, 05 May 2018 17:31:20 +0200 +++ +++openjdk-11 (11~11-2) unstable; urgency=medium +++ +++ * Drop the alternative build dependency on OpenJDK 9. +++ * Fix again the build on x32, not passing -m32 to the compiler. +++ * Restore parts of the mips-sigset patch which are not yet upstream. +++ +++ -- Matthias Klose Sat, 28 Apr 2018 22:17:34 +0200 +++ +++openjdk-11 (11~11-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 11. +++ * Stop installing the policytool desktop file. LP: #1766843, +++ +++ -- Matthias Klose Fri, 27 Apr 2018 08:23:56 +0200 +++ +++openjdk-11 (11~9-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 9. +++ +++ [ Tiago Stürmer Daitx ] +++ * debian/rules: do not compress the element-list api docs as javadoc expects +++ this file to be uncompressed when using '-link' or '-linkoffline'. +++ Closes: #895587. +++ +++ -- Matthias Klose Sun, 15 Apr 2018 06:36:41 +0200 +++ +++openjdk-11 (11~8-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 8. +++ * Update the s390x-zEC12 patch. +++ * Drop obsolete patches. Closes: #895060. +++ +++ -- Matthias Klose Sun, 08 Apr 2018 10:58:36 +0200 +++ +++openjdk-11 (11~7-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 7. +++ * Build using gtk 3.0. +++ * Add again ia64 support (Adrian Glaubitz). Closes: #894064. +++ +++ -- Matthias Klose Mon, 02 Apr 2018 08:56:00 +0200 +++ +++openjdk-11 (11~5-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 5. +++ * Don't pass -m32/-m64 compiler flags explicitly on architectures not +++ understanding these (James Cowgill). Closes: #893089. +++ * Update the zero-x32 patch. +++ +++ -- Matthias Klose Thu, 22 Mar 2018 07:46:26 +0800 +++ +++openjdk-11 (11~4-2) unstable; urgency=medium +++ +++ * Update apport hook name for 11. LP: #1738579. +++ +++ -- Matthias Klose Thu, 15 Mar 2018 14:30:13 +0100 +++ +++openjdk-11 (11~4-1) unstable; urgency=medium +++ +++ * OpenJDK 11 build 4. +++ * Disable the m68k and x32 patches for now (needs an update). +++ * Build with -fpermissive on armel and armhf for now. +++ +++ -- Matthias Klose Thu, 15 Mar 2018 10:30:13 +0100 +++ +++openjdk-10 (10~46-1) unstable; urgency=medium +++ +++ * OpenJDK 10 build 46. +++ * Update patch for m68k (Adrian Glaubitz). Closes: #883570). +++ * Update patch for alpha (Adrian Glaubitz). Closes: #885018). +++ * Drop powerpcspe patch. Closes: #883493. +++ * Work around make-4.2 MAKEFLAGS issue. Closes: #891573. +++ +++ -- Matthias Klose Wed, 14 Mar 2018 18:10:28 +0100 +++ +++openjdk-10 (10~32-1) experimental; urgency=medium +++ +++ * OpenJDK 10 build 32. +++ +++ -- Matthias Klose Sun, 19 Nov 2017 17:52:21 +0100 +++ +++openjdk-9 (9.0.1+11-1) unstable; urgency=medium +++ +++ * OpenJDK 9.0.1+11 release. +++ * Bump standards version. +++ * Configure with an empty --with-version-pre setting. LP: #1722410. +++ * Remove JamVM packaging bits. Closes: #877523. +++ * Remove Shark packaging bits. +++ * Fix java/javac/jar lockups on SMP Alpha (Michael Cree). Closes: #875288. +++ * Fix crashes in i386 applications using JNI due to Hotspot workaround for +++ Exec Shield (Ben Hutchings). Closes: #876069. +++ * Re-enable building altzero architectures: Closes: #874292. +++ * Update the zero-sparc patch (Adrian Glaubitz). Closes: #874265. +++ * Fix recommendation of microhei/zenhei font packages. Closes: #868205. +++ * Move jmod files into the openjdk-jdk-headless package. Closes: #878272. +++ +++ -- Matthias Klose Fri, 27 Oct 2017 01:44:31 +0200 +++ +++openjdk-9 (9~b181-4) unstable; urgency=medium +++ +++ * Fix whitespace in debian/rules. Closes: #873104, #873117. +++ +++ -- Matthias Klose Thu, 24 Aug 2017 19:15:14 +0200 +++ +++openjdk-9 (9~b181-3) unstable; urgency=medium +++ +++ * Fix libjvm.so's .debug file names. +++ * Install an apport hook when building on Ubuntu and derivatives. +++ * Update the disable-doclint patch (Chris West). Closes: #866908. +++ * Configure --with-debug-level=release on m68k as well (Adrian Glaubitz). +++ Closes: #871316. +++ * Drop armel and sparc from the list of alternative zero archs (Adrian +++ Glaubitz). Closes: #871319. +++ * Simplify the zero-sparc patch (Adrian Glaubitz). Closes: #872756. +++ * Remove some obsolete unused patches. Closes: #871606. +++ +++ -- Matthias Klose Thu, 24 Aug 2017 00:42:22 +0200 +++ +++openjdk-9 (9~b181-2) unstable; urgency=medium +++ +++ * Update the jdk-8067331 patch (Adrian Glaubitz). Closes: #871009. +++ * Build zero on armhf again. +++ +++ -- Matthias Klose Mon, 07 Aug 2017 10:28:46 -0400 +++ +++openjdk-9 (9~b181-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b181. +++ * Don't hard-code multiarch-support dependency. Closes: #870521. +++ * Just configure m68k --with-debug-level=slowdebug. Closes: #868255. +++ * Fix atomic_copy64 on powerpc (Andrew Haley). Closes: #870403. +++ +++ -- Matthias Klose Fri, 04 Aug 2017 07:35:49 -0400 +++ +++openjdk-9 (9~b179-2) unstable; urgency=medium +++ +++ * Really configure --with-debug-level=slowdebug on Zero-only architectures. +++ Closes: #868255. +++ * Really enable the zero-sparc patch (Adrian Glaubitz). Closes: #864359. +++ * Try again building zero on arm64 with slowdebug. +++ +++ -- Matthias Klose Mon, 24 Jul 2017 13:20:10 +0200 +++ +++openjdk-9 (9~b179-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b179. +++ * Drop armel as a hotspot architecture. Closes: #864464. +++ * Configure --with-debug-level=slowdebug on Zero-only architectures. +++ Closes: #868255. +++ * Fix recommendation of microhei/zenhei font packages. Closes: #868205. +++ * Enable the zero-sparc patch (Adrian Glaubitz). Closes: #864359. +++ * Update the disable-doclint patch (Chris West). Closes: #866908. +++ * Disable the jamvm autopkg tests. +++ +++ -- Matthias Klose Sat, 22 Jul 2017 11:49:18 +0200 +++ +++openjdk-9 (9~b177-3) unstable; urgency=medium +++ +++ * Fix applying the s390x-thread-stack-size patch. +++ +++ -- Matthias Klose Fri, 07 Jul 2017 19:18:19 +0200 +++ +++openjdk-9 (9~b177-2) unstable; urgency=medium +++ +++ * Try to build zero again on amd64, arm64, ppc64el and s390x. +++ * Keep the conf/* symlinks in the JAVA_HOME directory. +++ Closes: #866924, #863080. +++ * Drop armel from the list of hotspot architectures. See #864464. +++ * Stop using deprecated GNOME libraries. Closes: #850268. +++ * Apply sparc64 build fixes (Adrian Glaubitz). Closes: #864351. +++ * Update the zero-sparc patch (Adrian Glaubitz). Closes: #864359. +++ * Update the m68k-support patch (Adrian Glaubitz). Closes: #864595. +++ * Disable generation of jvmti.html on m68k (Adrian Glaubitz). +++ Closes: #864596. +++ * Update the zero-sh patch (Adrian Glaubitz). Closes: #864643. +++ * Update the jdk-target-arch-define patch. Closes: #865129. +++ * Provide jvmdir symlink in /usr/lib/debug. Addresses: #867314. +++ * Fix pt_BR translation in awt message. Addresses: #863331. +++ * Drop the 8073754-stack-overflow-9-build patch. Closes: #864288. +++ * Use sigset_t to store the signals used by the JVM (James Cowgill). +++ Closes: #841173. +++ +++ -- Matthias Klose Fri, 07 Jul 2017 12:28:53 +0200 +++ +++openjdk-9 (9~b177-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b177. +++ +++ -- Matthias Klose Fri, 07 Jul 2017 02:18:33 +0000 +++ +++openjdk-9 (9~b170-2) unstable; urgency=medium +++ +++ * OpenJDK 9, b170. +++ +++ -- Matthias Klose Thu, 18 May 2017 11:57:43 -0700 +++ +++openjdk-9 (9~b169-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b169. +++ +++ -- Matthias Klose Sun, 14 May 2017 10:11:24 -0700 +++ +++openjdk-9 (9~b168-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b168. +++ +++ -- Matthias Klose Fri, 05 May 2017 14:33:09 +0200 +++ +++openjdk-9 (9~b164-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b164. +++ +++ -- Matthias Klose Sat, 08 Apr 2017 21:39:41 +0200 +++ +++openjdk-9 (9~b161-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b161. +++ * Don't build the zero JRE on Ubuntu/s390x. +++ * Fix changelog format. +++ +++ -- Matthias Klose Fri, 17 Mar 2017 00:09:34 +0100 +++ +++openjdk-9 (9~b159-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b159. +++ +++ -- Matthias Klose Fri, 03 Mar 2017 19:03:10 +0100 +++ +++openjdk-9 (9~b158-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b158. +++ * Add OpenJDK Stack Unwinder and Frame Decorator for gdb. +++ +++ -- Matthias Klose Sun, 26 Feb 2017 18:57:42 +0100 +++ +++openjdk-9 (9~b155-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b155. +++ +++ -- Matthias Klose Fri, 03 Feb 2017 07:56:11 +0100 +++ +++openjdk-9 (9~b154-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b154. +++ * Fix libjpeg dependency. Closes: #852420. +++ +++ -- Matthias Klose Thu, 26 Jan 2017 23:33:55 +0100 +++ +++openjdk-9 (9~b153-2) unstable; urgency=medium +++ +++ * Lower cpu requirements for Debian/s390x. +++ +++ -- Matthias Klose Sat, 21 Jan 2017 21:52:52 +0100 +++ +++openjdk-9 (9~b153-1) unstable; urgency=medium +++ +++ * OpenJDK 9, b153. +++ +++ -- Matthias Klose Fri, 20 Jan 2017 14:39:18 +0100 +++ +++openjdk-9 (9~b151-2) unstable; urgency=medium +++ +++ * Fix builds with zero and jamvm as an alternate VM. +++ +++ -- Matthias Klose Tue, 10 Jan 2017 15:40:20 +0100 +++ +++openjdk-9 (9~b151-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b151. +++ +++ -- Matthias Klose Sun, 08 Jan 2017 23:16:21 +0100 +++ +++openjdk-9 (9~b149-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b149. +++ +++ -- Matthias Klose Sat, 17 Dec 2016 10:58:22 +0100 +++ +++openjdk-9 (9~b148-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b148. +++ +++ -- Matthias Klose Mon, 12 Dec 2016 14:04:02 +0000 +++ +++openjdk-9 (9~b147-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b147. +++ * Use sigset_t to store the signals used by the JVM (James Cowgill). +++ Addresses: #841173. +++ +++ -- Matthias Klose Sat, 03 Dec 2016 15:41:51 +0100 +++ +++openjdk-9 (9~b144-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b144. +++ +++ -- Matthias Klose Fri, 11 Nov 2016 14:43:48 +0100 +++ +++openjdk-9 (9~b143-2) experimental; urgency=medium +++ +++ * Fix 8168567, unbreaking the build on arm64. +++ +++ -- Matthias Klose Mon, 07 Nov 2016 15:46:43 +0100 +++ +++openjdk-9 (9~b143-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b143. +++ +++ -- Matthias Klose Sun, 06 Nov 2016 22:36:28 +0100 +++ +++openjdk-9 (9~b142-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b142. +++ +++ -- Matthias Klose Sat, 29 Oct 2016 12:03:19 +0200 +++ +++openjdk-9 (9~b140-2) experimental; urgency=medium +++ +++ * Don't build zero on ppc64 and ppc64el (fails to build). +++ +++ -- Matthias Klose Wed, 19 Oct 2016 17:02:37 +0200 +++ +++openjdk-9 (9~b140-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b140. +++ +++ -- Matthias Klose Mon, 17 Oct 2016 12:01:47 +0200 +++ +++openjdk-9 (9~b139-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b139. +++ * Stop building zero on amd64, fails to build with hardening defaults. +++ +++ -- Matthias Klose Sun, 09 Oct 2016 10:03:18 +0200 +++ +++openjdk-9 (9~b136-1ubuntu1) yakkety; urgency=medium +++ +++ * 8165323: (fs) Files.getFileStore fails with "Mount point not found" in +++ chroot environment +++ +++ -- Matthias Klose Wed, 21 Sep 2016 16:20:45 +0200 +++ +++openjdk-9 (9~b136-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b136. +++ +++ -- Matthias Klose Mon, 19 Sep 2016 20:33:07 +0200 +++ +++openjdk-9 (9~b135-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b135. +++ +++ -- Matthias Klose Sat, 10 Sep 2016 03:56:51 +0200 +++ +++openjdk-9 (9~b134-2ubuntu1) yakkety; urgency=medium +++ +++ * Explicitly turn off stack-protector for zero builds. +++ +++ -- Matthias Klose Thu, 08 Sep 2016 17:21:13 +0200 +++ +++openjdk-9 (9~b134-2) experimental; urgency=medium +++ +++ * Build using GCC 6. +++ * Enable zero build on arm64 and ppc64el. +++ * Increase thread stack size for ppc* zero builds. +++ * Don't use Solaris compiler flags on sparc64. +++ * Port x32 zero patch. +++ * Don't use the just built jdk for zero builds. +++ * Don't use getFileStore() during the build, chroots throw an +++ exception while running jlink. +++ * Fix removal of jre-headless alternatives. Closes: #788445. +++ +++ -- Matthias Klose Mon, 05 Sep 2016 14:14:01 +0200 +++ +++openjdk-9 (9~b133-2) experimental; urgency=medium +++ +++ * Don't do bootcycle builds for zero builds. +++ * Fix macro settings for zero builds. +++ +++ -- Matthias Klose Wed, 31 Aug 2016 18:34:51 +0200 +++ +++openjdk-9 (9~b133-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b133. +++ +++ -- Matthias Klose Mon, 29 Aug 2016 14:25:48 +0200 +++ +++openjdk-9 (9~b130-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b130. +++ +++ -- Matthias Klose Sun, 07 Aug 2016 23:27:51 +0200 +++ +++openjdk-9 (9~b124-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b124. +++ * Fix an issue with libatk-wrapper (Samuel Thibault). Closes: #827796. +++ +++ -- Matthias Klose Sat, 28 May 2016 22:30:12 +0200 +++ +++openjdk-9 (9~b117-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b117. +++ * Fix zero builds, next try. +++ +++ -- Matthias Klose Thu, 05 May 2016 23:10:57 +0200 +++ +++openjdk-9 (9~b116-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b116. +++ +++ -- Matthias Klose Fri, 29 Apr 2016 00:41:04 +0200 +++ +++openjdk-9 (9~b115-2) experimental; urgency=medium +++ +++ * Fix zero builds: +++ - Backport 8132051, 8146518, 8150654, 8154210 from the hs repo. +++ - Apply proposed patch for 8153275. +++ * Set initial VMThreadStackSize to 1600 on s390x. +++ * Tighten openjdk build dependency on s390x. +++ +++ -- Matthias Klose Sat, 23 Apr 2016 23:09:19 +0200 +++ +++openjdk-9 (9~b115-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b115. +++ * Fix header file conflict. Closes: #816440. LP: #1550950. +++ +++ -- Matthias Klose Thu, 21 Apr 2016 23:48:04 +0200 +++ +++openjdk-9 (9~b114-0ubuntu1) xenial; urgency=medium +++ +++ * OpenJDK 9, b114. +++ +++ -- Matthias Klose Thu, 14 Apr 2016 21:02:34 +0200 +++ +++openjdk-9 (9~b113-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b113. +++ +++ -- Matthias Klose Wed, 13 Apr 2016 20:58:18 +0200 +++ +++openjdk-9 (9~b112-3) experimental; urgency=medium +++ +++ * Fix zero builds, apply proposed patch for JDK-8153275. +++ +++ -- Matthias Klose Fri, 01 Apr 2016 18:39:09 +0200 +++ +++openjdk-9 (9~b112-2) experimental; urgency=medium +++ +++ * OpenJDK 9, b112. +++ +++ -- Matthias Klose Thu, 31 Mar 2016 15:44:43 +0200 +++ +++openjdk-9 (9~b107-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b107. +++ * Build-depend on openjdk-9-jdk-headless . +++ * Build with GCC 5 on mips*. +++ * Split out an openjdk-9-jdk-headless package. +++ * Update libgconf/libgnome jre recommendations. Addresses: #813943. +++ * Update package reference in README. Addresses: #814605. +++ * Add french translation for policytool desktop file. Addresses: #813851. +++ * Install app icons again. +++ +++ -- Matthias Klose Sat, 27 Feb 2016 11:55:04 +0100 +++ +++openjdk-9 (9~b102-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b102. +++ +++ -- Matthias Klose Tue, 26 Jan 2016 13:33:16 +0100 +++ +++openjdk-9 (9~b101-2ubuntu2) xenial; urgency=medium +++ +++ * Don't build zero on arm64. +++ +++ -- Matthias Klose Sun, 17 Jan 2016 11:17:19 +0100 +++ +++openjdk-9 (9~b101-2ubuntu1) xenial; urgency=medium +++ +++ * Ignore installing jsadebugd.1. +++ +++ -- Matthias Klose Sun, 17 Jan 2016 10:33:06 +0100 +++ +++openjdk-9 (9~b101-2) experimental; urgency=medium +++ +++ * Disable the zero build on ppc64el, currently fails to build. +++ +++ -- Matthias Klose Sat, 16 Jan 2016 10:30:18 +0100 +++ +++openjdk-9 (9~b101-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b101. +++ * Fix cross builds. +++ * Build again using GCC 4.9 on mips*, fails to build with GCC 5. +++ +++ -- Matthias Klose Fri, 15 Jan 2016 12:25:14 +0100 +++ +++openjdk-9 (9~b96-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b96. +++ * openjdk-9-jdk: Fix typo in sdk provides. Addresses: #803150. +++ * Build using giflib 5. +++ * Build using GCC 5 everywhere. +++ +++ -- Matthias Klose Sun, 13 Dec 2015 17:45:17 +0100 +++ +++openjdk-9 (9~b94-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b94. +++ * Update configury for sparc64 (Steven Chamberlain). Addresses: #806202. +++ * Fix stripping packages (use bash instead of expr substring). +++ +++ -- Matthias Klose Tue, 01 Dec 2015 11:05:27 +0100 +++ +++openjdk-9 (9~b88-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b88. +++ +++ -- Matthias Klose Sun, 25 Oct 2015 02:38:14 +0200 +++ +++openjdk-9 (9~b87-2) wily; urgency=medium +++ +++ * Prefer openjdk-8-jdk for the build. +++ +++ -- Matthias Klose Tue, 20 Oct 2015 14:21:25 +0200 +++ +++openjdk-9 (9~b87-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b87. +++ * Build the client hotspot on i386. +++ +++ -- Matthias Klose Mon, 19 Oct 2015 17:58:08 +0200 +++ +++openjdk-9 (9~b80-2) experimental; urgency=medium +++ +++ * Fix build for armel, armhf and "unknown" zero architectures. +++ * Fix build error on AArch64. +++ +++ -- Matthias Klose Sat, 05 Sep 2015 20:16:45 +0200 +++ +++openjdk-9 (9~b80-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b80. +++ * Fix installing the openjdk.desktop file when cautious-launch is available. +++ * Define _alpha_ / _sh_ preprocessor macros instead of alpha / sh. +++ * Re-enable the atk bridge for releases with a fixed atk bridge. +++ * Make derivatives builds the same as the parent distro. +++ * Add m68k support for Zero (Andreas Schwab). +++ +++ -- Matthias Klose Fri, 04 Sep 2015 19:27:56 +0200 +++ +++openjdk-9 (9~b74-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b74. +++ * Fix jdk build on x32. +++ * JDK-8073754, increase stack size limits on powerpc and ppc64. +++ * Configure --with-boot-jdk-jvmargs="-XX:ThreadStackSize=2240" on +++ powerpc and ppc64. +++ +++ -- Matthias Klose Mon, 27 Jul 2015 20:43:48 +0200 +++ +++openjdk-9 (9~b71-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b71. +++ * openjdk-9-jre: Recommend the real libgconf2-4 and libgnome2-0 packages. +++ Addresses: #786594. +++ +++ -- Matthias Klose Mon, 06 Jul 2015 17:29:39 +0200 +++ +++openjdk-9 (9~b68-4) experimental; urgency=medium +++ +++ * Fix 32bit detection for the build jdk; try to build again for mips +++ and mipsel (James Cowgill). +++ * openjdk-jre-headless: Add dependency on the package containing the +++ mountpoint binary. +++ +++ -- Matthias Klose Mon, 22 Jun 2015 22:09:17 +0200 +++ +++openjdk-9 (9~b68-3) experimental; urgency=medium +++ +++ * Enable bootcycle zero builds everywhere. +++ * Re-enable running the testsuite. +++ +++ -- Matthias Klose Thu, 18 Jun 2015 23:55:33 +0200 +++ +++openjdk-9 (9~b68-2) experimental; urgency=medium +++ +++ * Fix 8080684, PPC64 little-endian build. +++ * Fix installation of zero based builds. +++ +++ -- Matthias Klose Wed, 17 Jun 2015 19:03:31 +0200 +++ +++openjdk-9 (9~b68-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b68. +++ * Fix the build on AArch64 (Ed Nevill). +++ +++ -- Matthias Klose Tue, 16 Jun 2015 11:39:02 +0200 +++ +++openjdk-9 (9~b64-1) experimental; urgency=medium +++ +++ * OpenJDK 9, b64. +++ * Fix build error in zero. +++ +++ -- Matthias Klose Mon, 18 May 2015 17:30:20 +0200 +++ +++openjdk-8 (8u45-b14-2) unstable; urgency=medium +++ +++ * Fix JamVM with 8u45. Closes: #766284. +++ +++ -- Matthias Klose Sun, 10 May 2015 19:28:41 +0200 +++ +++openjdk-8 (8u45-b14-1) unstable; urgency=medium +++ +++ * Update to 8u45-b14. +++ * Update AArch64 to (post) 8u45-b14. +++ * Make libnss3-dev installable on precise (Thorsten Glaser). LP: #1411630. +++ * Only install the openjdk-java.desktop file when using cautious-launcher. +++ +++ -- Matthias Klose Sun, 19 Apr 2015 16:31:44 +0200 +++ +++openjdk-8 (8u40-b27-1) unstable; urgency=medium +++ +++ * Update to 8u40-b27. +++ * Update AArch64 to (post) 8u40-b25. +++ * Fix libjavajpeg build using the system jpeg library. Closes: #760926. +++ +++ -- Matthias Klose Tue, 17 Mar 2015 01:19:45 +0100 +++ +++openjdk-8 (8u40~b22-1ubuntu1) vivid; urgency=medium +++ +++ * Update AArch64 to 8u40-b22. +++ * Update the alpha float patch. +++ * Fix JDK-8067330, ZERO_ARCHDEF incorrectly defined for PPC/PPC64 +++ architectures. +++ * Fix JDK-8067331, Zero: Atomic::xchg and Atomic::xchg_ptr need +++ full memory barrier. +++ * Build using OpenJDK-8. +++ +++ -- Matthias Klose Tue, 27 Jan 2015 14:59:00 +0100 +++ +++openjdk-8 (8u40~b22-1) unstable; urgency=medium +++ +++ * Update to 8u40-b22. +++ * Fix build on mips64 and mips64el. Closes: #776295. +++ * Don't strip libjvm.so to prevent rejection by ftp-master (work around, +++ but no fix in the archive). Addresses: #775760. +++ * Fix jamvm to work with recent security updates. Closes: #766284. +++ +++ -- Matthias Klose Mon, 26 Jan 2015 16:59:37 +0100 +++ +++openjdk-8 (8u40~b21-1) unstable; urgency=medium +++ +++ * Update to 8u40-b21. +++ +++ -- Matthias Klose Thu, 15 Jan 2015 12:14:18 +0100 +++ +++openjdk-8 (8u40~b10-1) unstable; urgency=medium +++ +++ * Fix libjpeg runtime dependency. +++ +++ -- Matthias Klose Thu, 16 Oct 2014 08:38:13 +0200 +++ +++openjdk-8 (8u40~b09-1) unstable; urgency=medium +++ +++ * Update to 8u40-b09. +++ * Update the AArch64 hotspot to 8u40-b09. +++ * Allow to build for Ubuntu 12.04 LTS. +++ * Change B-D to libjpeg-dev to finish the transition to libjpeg-turbo +++ (Ondřej Surý). Closes: #763490. +++ * Backport the fix for 8017773 OpenJDK returns incorrect TrueType +++ font metrics. Closes: #762323. +++ * Depend on libnss3 instead of libnss3-1d for recent releases. +++ Addresses: #760122. +++ +++ -- Matthias Klose Tue, 14 Oct 2014 12:39:18 +0200 +++ +++openjdk-8 (8u40~b04-2) unstable; urgency=medium +++ +++ * Remove AArch64 patch applied upstream. +++ * Update the kfresbsd jdk patch, still not forwarded upstream. +++ +++ -- Matthias Klose Tue, 09 Sep 2014 17:08:32 +0200 +++ +++openjdk-8 (8u40~b04-1) experimental; urgency=medium +++ +++ * Update to 8u40-b04. +++ * Backport 8050942, implement template interpreter for ppc64le. +++ * Build-depend on systemtap-sdt-dev. +++ +++ -- Matthias Klose Wed, 03 Sep 2014 21:11:27 +0200 +++ +++openjdk-8 (8u20-b26-1) experimental; urgency=medium +++ +++ * 8u20 build 26 is the final 8u20 release. +++ * Update the AArch64 hotspot. +++ * Fix applying the kfreebsd patch for JamVM. +++ * x32 build fixes. +++ * Allow openjdk-8-jdk as an alternative build dependency. +++ * Adjust timeouts for jtreg runs. +++ +++ -- Matthias Klose Wed, 20 Aug 2014 10:34:55 +0200 +++ +++openjdk-8 (8u20~b26-1) experimental; urgency=medium +++ +++ * Update to 8u20-b26. +++ * Update to JamVM 2.0.0. +++ * Update to IcedTea-Sound 1.0.1. +++ * Update toplevel configury to recognize zero archs alpha, mips*, +++ m68k, sh4. +++ * Update kfreebsd-support patches (Steven Chamberlain). +++ * Fix an uninitialized memory issue in adlc (Fridrich Strba). +++ * Move libjavagtk into the -jre package. +++ * Use the system libpcsclite library. +++ * Fix typo, ignoring boot cycle builds (Emmanuel Bourg). +++ * Derive the update version and the build number from the package +++ version (Emmanuel Bourg). +++ * Call quilt with --quiltrc -. Closes: #755710. +++ * openjdk-8-jdk: Fix src.zip symlink. Closes: #755869. +++ +++ -- Matthias Klose Thu, 31 Jul 2014 19:51:35 +0200 +++ +++openjdk-8 (8u20~b20-2) experimental; urgency=medium +++ +++ * Work around OpenJDK's build system which is not robust enough +++ to accept commas in *FLAGS. +++ * Pass extra flags for non-hotspot builds. +++ * Fix the zero build on i386. +++ * Don't add extra symlinks for the jni_{md,jawt}.h header files. +++ +++ -- Matthias Klose Fri, 11 Jul 2014 20:30:54 +0200 +++ +++openjdk-8 (8u20~b20-1) experimental; urgency=medium +++ +++ * Initial OpenJDK 8 packaging, based on 8u20-b20. +++ * Fix hotspot build system for GNU make 4.0 (Emmanuel Bourg). +++ * Drop rhino (build) dependencies (Emmanuel Bourg). +++ * Add java8 provides (Emmanuel Bourg). +++ * Add IcedTea patches to build with external jpeg, png and lcms +++ libraries (Emmanuel Bourg). +++ * Add keywords to the desktop files (Emmanuel Bourg). +++ * Remove the suggested dependency on sun-java6-fonts ((Emmanuel Bourg). +++ * Build hotspot on ppc64 and ppc64el. +++ * Add the IcedTea Sound tarball. +++ * Don't strip files when building the images. +++ * Update patches to pass the extra flags to the libsig and libsaproc builds. +++ * Use dh_strip's knowledge about build ids when available. +++ +++ -- Matthias Klose Wed, 09 Jul 2014 20:11:18 +0200 +++ +++openjdk-7 (7u55-2.4.7-2) unstable; urgency=medium +++ +++ * Fix the quoting of configure flags for the zero build. +++ * Update the java-access-bridge-security patch (Raphael Geissert). +++ * Don't hard code the compiler names in the AArch64 hotspot build. +++ * Build using GCC 4.9 where available. +++ * Add MIPS64(el) support (Yunqiang Su). Closes: #746207. +++ * Suggest fonts-indic instead of ttf-indic-fonts. Closes: #747694. +++ +++ -- Matthias Klose Fri, 16 May 2014 19:12:42 +0200 +++ +++openjdk-7 (7u55-2.4.7-1) unstable; urgency=high +++ +++ * IcedTea7 2.4.7 release. +++ * Security fixes +++ - S8023046: Enhance splashscreen support. +++ - S8025005: Enhance CORBA initializations. +++ - S8025010, CVE-2014-2412: Enhance AWT contexts. +++ - S8025030, CVE-2014-2414: Enhance stream handling. +++ - S8025152, CVE-2014-0458: Enhance activation set up. +++ - S8026067: Enhance signed jar verification. +++ - S8026163, CVE-2014-2427: Enhance media provisioning. +++ - S8026188, CVE-2014-2423: Enhance envelope factory. +++ - S8026200: Enhance RowSet Factory. +++ - S8026716, CVE-2014-2402: (aio) Enhance asynchronous channel handling. +++ - S8026736, CVE-2014-2398: Enhance Javadoc pages. +++ - S8026797, CVE-2014-0451: Enhance data transfers. +++ - S8026801, CVE-2014-0452: Enhance endpoint addressing. +++ - S8027766, CVE-2014-0453: Enhance RSA processing. +++ - S8027775: Enhance ICU code. +++ - S8027841, CVE-2014-0429: Enhance pixel manipulations. +++ - S8028385: Enhance RowSet Factory. +++ - S8029282, CVE-2014-2403: Enhance CharInfo set up. +++ - S8029286: Enhance subject delegation. +++ - S8029699: Update Poller demo. +++ - S8029730: Improve audio device additions. +++ - S8029735: Enhance service mgmt natives. +++ - S8029740, CVE-2014-0446: Enhance handling of loggers. +++ - S8029745, CVE-2014-0454: Enhance algorithm checking. +++ - S8029750: Enhance LCMS color processing (LCMS 2 only). +++ - S8029760, CVE-2013-6629: Enhance AWT image libraries (in-tree libjpeg). +++ - S8029844, CVE-2014-0455: Enhance argument validation. +++ - S8029854, CVE-2014-2421: Enhance JPEG decodings. +++ - S8029858, CVE-2014-0456: Enhance array copies. +++ - S8030731, CVE-2014-0460: Improve name service robustness. +++ - S8031330: Refactor ObjectFactory. +++ - S8031335, CVE-2014-0459: Better color profiling. +++ - S8031352, CVE-2013-6954: Enhance PNG handling (in-tree libpng). +++ - S8031394, CVE-2014-0457: (sl) Fix exception handling in ServiceLoader. +++ - S8031395: Enhance LDAP processing. +++ - S8032686, CVE-2014-2413: Issues with method invoke. +++ - S8033618, CVE-2014-1876: Correct logging output. +++ - S8034926, CVE-2014-2397: Attribute classes properly. +++ - S8036794, CVE-2014-0461: Manage JavaScript instances. +++ * AArch64 fixes. +++ +++ -- Matthias Klose Wed, 16 Apr 2014 15:37:40 +0200 +++ +++openjdk-7 (7u51-2.4.6-1) unstable; urgency=medium +++ +++ * IcedTea7 2.4.6 release. +++ * Explicitly use AC_MAINTAINER_MODE and automake-1.11 to create the +++ debian .orig tarball. Addresses: #740289. +++ * Apply patch from upstream to fix bold fonts in Swing applications using +++ GTK L&F (Ryan Tandy). LP: #937200. +++ * Explicitly build-depend on libkrb5-dev. +++ * On AArch64 don't use the hotsport backport for the zero build. +++ +++ -- Matthias Klose Tue, 01 Apr 2014 09:25:19 +0200 +++ +++openjdk-7 (7u51-2.4.6~pre1-1) unstable; urgency=medium +++ +++ * IcedTea7 2.4.6 prerelease. +++ * Fix icedtea-web build failure on kfreebsd-* (unable to find +++ sun.security.util.SecurityConstants). Steven Chamberlain. Closes: #739032. +++ * Update the AArch64 Hotspot. +++ +++ -- Matthias Klose Thu, 27 Mar 2014 17:24:45 +0100 +++ +++openjdk-7 (7u51-2.4.5-2) unstable; urgency=medium +++ +++ * Update the KFreeBSD patch (Steven Chamberlain). Closes: #736291. +++ +++ -- Matthias Klose Tue, 04 Feb 2014 13:28:10 +0100 +++ +++openjdk-7 (7u51-2.4.5-1) unstable; urgency=medium +++ +++ * IcedTea7 2.4.5 release. +++ * Build Hotspot client and server vms for AArch64. +++ +++ -- Matthias Klose Fri, 31 Jan 2014 06:13:20 -0500 +++ +++openjdk-7 (7u51-2.4.4-1) unstable; urgency=medium +++ +++ * IcedTea7 2.4.4 release. +++ * Security fixes +++ - S6727821: Enhance JAAS Configuration. +++ - S7068126, CVE-2014-0373: Enhance SNMP statuses. +++ - S8010935: Better XML handling. +++ - S8011786, CVE-2014-0368: Better applet networking. +++ - S8021257, S8025022, CVE-2013-5896 : com.sun.corba.se.** should be +++ on restricted package list. +++ - S8021271, S8021266, CVE-2014-0408: Better buffering in ObjC code. +++ - S8022904: Enhance JDBC Parsers. +++ - S8022927: Input validation for byte/endian conversions. +++ - S8022935: Enhance Apache resolver classes. +++ - S8022945: Enhance JNDI implementation classes. +++ - S8023057: Enhance start up image display. +++ - S8023069, CVE-2014-0411: Enhance TLS connections. +++ - S8023245, CVE-2014-0423: Enhance Beans decoding. +++ - S8023301: Enhance generic classes. +++ - S8023338: Update jarsigner to encourage timestamping. +++ - S8023672: Enhance jar file validation. +++ - S8024302: Clarify jar verifications. +++ - S8024306, CVE-2014-0416: Enhance Subject consistency. +++ - S8024530: Enhance font process resilience. +++ - S8024867: Enhance logging start up. +++ - S8025014: Enhance Security Policy. +++ - S8025018, CVE-2014-0376: Enhance JAX-P set up. +++ - S8025026, CVE-2013-5878: Enhance canonicalization. +++ - S8025034, CVE-2013-5907: Improve layout lookups. +++ - S8025448: Enhance listening events. +++ - S8025758, CVE-2014-0422: Enhance Naming management. +++ - S8025767, CVE-2014-0428: Enhance IIOP Streams. +++ - S8026172: Enhance UI Management. +++ - S8026176: Enhance document printing. +++ - S8026193, CVE-2013-5884: Enhance CORBA stub factories. +++ - S8026204: Enhance auth login contexts. +++ - S8026417, CVE-2013-5910: Enhance XML canonicalization. +++ - S8026502: java/lang/invoke/MethodHandleConstants.java fails on all +++ platforms. +++ - S8027201, CVE-2014-0376: Enhance JAX-P set up. +++ - S8029507, CVE-2013-5893: Enhance JVM method processing. +++ - S8029533: REGRESSION: closed/java/lang/invoke/8008140/Test8008140.java +++ fails agains. +++ * Remove alpha from stage1_gcj_archs. +++ * Use the langtools and jdk tarballs as provided by IcedTea. +++ * Hotspot is dead on sparc. Build the zero interpreter as the default. +++ * Blindly update the KF***BSD patches. +++ +++ -- Matthias Klose Wed, 15 Jan 2014 10:34:34 +0100 +++ +++openjdk-7 (7u45-2.4.3-5) unstable; urgency=medium +++ +++ * Run the jtreg tests on powerpcspe, tested by Roland Stigge. +++ * Fix zero builds on 64k page kernel configs. +++ * Fix more IcedTea bits to build on x32. +++ +++ -- Matthias Klose Sat, 11 Jan 2014 13:55:34 +0100 +++ +++openjdk-7 (7u45-2.4.3-4) unstable; urgency=low +++ +++ * Re-enable running the testsuite on powerpc. +++ * Run the testsuite on AArch64. +++ * Fix IcedTea bits to build on x32. +++ +++ -- Matthias Klose Sun, 22 Dec 2013 21:20:10 +0100 +++ +++openjdk-7 (7u45-2.4.3-3) unstable; urgency=low +++ +++ * Don't build on s390 anymore. +++ * Update hotspot-mips-align patch (Aurelien Jarno). Closes: #732528). +++ * Build for ppc64el. +++ * Try to build zero on x32. +++ * Configure with --enable-zero on sparc and sparc64. +++ +++ -- Matthias Klose Fri, 20 Dec 2013 14:42:38 +0100 +++ +++openjdk-7 (7u45-2.4.3-2.3) unstable; urgency=medium +++ +++ * Disable bootstrap build on alpha. Closes: #719671. +++ * Disable running the jdk jtreg tests on the hotspot architectures. +++ Hanging on the buildds. +++ * Re-enable the jexec patch, program logic confused by running jexec +++ outside the assumed java home. Closes: #731961. +++ * Don't apply the s390 patches on s390x. s390 is successfully dead. +++ * Fix zero builds on little endian architectures, taken from the trunk. +++ +++ -- Matthias Klose Thu, 12 Dec 2013 18:24:44 +0100 +++ +++openjdk-7 (7u45-2.4.3-1) unstable; urgency=medium +++ +++ * IcedTea7 2.4.3 release. +++ * Security fixes: +++ - S8006900, CVE-2013-3829: Add new date/time capability. +++ - S8008589: Better MBean permission validation. +++ - S8011071, CVE-2013-5780: Better crypto provider handling. +++ - S8011081, CVE-2013-5772: Improve jhat. +++ - S8011157, CVE-2013-5814: Improve CORBA portablility. +++ - S8012071, CVE-2013-5790: Better Building of Beans. +++ - S8012147: Improve tool support. +++ - S8012277: CVE-2013-5849: Improve AWT DataFlavor. +++ - S8012425, CVE-2013-5802: Transform TransformerFactory. +++ - S8013503, CVE-2013-5851: Improve stream factories. +++ - S8013506: Better Pack200 data handling. +++ - S8013510, CVE-2013-5809: Augment image writing code. +++ - S8013514: Improve stability of cmap class. +++ - S8013739, CVE-2013-5817: Better LDAP resource management. +++ - S8013744, CVE-2013-5783: Better tabling for AWT. +++ - S8014085: Better serialization support in JMX classes. +++ - S8014093, CVE-2013-5782: Improve parsing of images. +++ - S8014098: Better profile validation. +++ - S8014102, CVE-2013-5778: Improve image conversion. +++ - S8014341, CVE-2013-5803: Better service from Kerberos servers. +++ - S8014349, CVE-2013-5840: (cl) Class.getDeclaredClass problematic +++ in some class loader configurations. +++ - S8014530, CVE-2013-5825: Better digital signature processing. +++ - S8014534: Better profiling support. +++ - S8014987, CVE-2013-5842: Augment serialization handling. +++ - S8015614: Update build settings. +++ - S8015731: Subject java.security.auth.subject to improvements. +++ - S8015743, CVE-2013-5774: Address internet addresses. +++ - S8016256: Make finalization final. +++ - S8016653, CVE-2013-5804: javadoc should ignore ignoreable characters +++ in names. +++ - S8016675, CVE-2013-5797: Make Javadoc pages more robust. +++ - S8017196, CVE-2013-5850: Ensure Proxies are handled appropriately. +++ - S8017287, CVE-2013-5829: Better resource disposal. +++ - S8017291, CVE-2013-5830: Cast Proxies Aside. +++ - S8017298, CVE-2013-4002: Better XML support. +++ - S8017300, CVE-2013-5784: Improve Interface Implementation. +++ - S8017505, CVE-2013-5820: Better Client Service. +++ - S8019292: Better Attribute Value Exceptions. +++ - S8019617: Better view of objects. +++ - S8020293: JVM crash. +++ - S8021275, CVE-2013-5805: Better screening for ScreenMenu. +++ - S8021282, CVE-2013-5806: Better recycling of object instances. +++ - S8021286: Improve MacOS resourcing. +++ - S8021290, CVE-2013-5823: Better signature validation. +++ - S8022931, CVE-2013-5800: Enhance Kerberos exceptions. +++ - S8022940: Enhance CORBA translations. +++ - S8023683: Enhance class file parsing. +++ * Fix build failure on mips* (Aurelien Jarno). Closes: #729448). +++ * Run autoreconf. Closes: #724083. +++ * Merge the -jre-lib package into -jre-headless. Simplifies the packaging +++ and the savings were not as big as wanted, because the rt.jar is still +++ architecture dependant. Closes: #641049, #722510. +++ +++ -- Matthias Klose Sun, 08 Dec 2013 23:22:06 +0100 +++ +++openjdk-7 (7u25-2.3.12-4ubuntu3) saucy; urgency=low +++ +++ * Apply missing patch to fix arm64/AArch64 detection. +++ +++ -- Matthias Klose Fri, 11 Oct 2013 17:51:33 +0200 +++ +++openjdk-7 (7u25-2.3.12-4ubuntu2) saucy; urgency=low +++ +++ * openjdk-jre-headless: Loosen the dependency on -jre-lib. +++ +++ -- Matthias Klose Wed, 09 Oct 2013 16:29:15 +0200 +++ +++openjdk-7 (7u25-2.3.12-4ubuntu1) saucy; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Fri, 16 Aug 2013 12:09:47 +0200 +++ +++openjdk-7 (7u25-2.3.12-4) unstable; urgency=low +++ +++ * Add the hotspot patches for AArch64, which apparently were not +++ included in the IcedTea release by intent. +++ * Don't interpret arm64 as an ARM architecture, but as AArch64. So +++ much for Debian calling this port arm64 ... +++ * Use host macros instead of build macros for corba and hotspot config. +++ * Re-add multiarch library directories to the default library path. +++ Closes: #712567. +++ * Enable the two-stage build on alpha. Closes: #719671. +++ * Build for powerpcspe (Roland Stigge). Closes: #712686. +++ * Recommend fonts-dejavu-extra instead of ttf-dejavu-extra for current +++ releases. Closes: #718839. +++ +++ -- Matthias Klose Thu, 15 Aug 2013 21:26:51 +0200 +++ +++openjdk-7 (7u25-2.3.12-3) unstable; urgency=low +++ +++ * Fix kFreeBSD builds (Thanks to Christoph Egger for his help). +++ +++ -- Damien Raude-Morvan Mon, 12 Aug 2013 00:39:41 +0200 +++ +++openjdk-7 (7u25-2.3.12-2) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * Regenerate the hotspot-s390 patch. +++ +++ [ Damien Raude-Morvan ] +++ * Update kfreebsd patches. +++ +++ -- Matthias Klose Sat, 03 Aug 2013 20:22:41 +0200 +++ +++openjdk-7 (7u25-2.3.12-1) unstable; urgency=low +++ +++ * IcedTea7 2.3.12 release. +++ * Don't build with pulseaudio on arm64. +++ * Disable bootstraped build on s390 and sparc. +++ +++ -- Matthias Klose Fri, 02 Aug 2013 15:55:01 +0200 +++ +++openjdk-7 (7u25-2.3.10-2ubuntu1) saucy; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Mon, 15 Jul 2013 23:59:45 +0200 +++ +++openjdk-7 (7u25-2.3.10-2) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * Fix gcj-jdk build dependency on ia64 and s390. +++ * Build zero on arm64. +++ +++ [ Gianfranco Costamagna ] +++ * Fix build failure on kfreebsd (Closes: #714528) +++ +++ -- Matthias Klose Sun, 30 Jun 2013 17:12:28 +0200 +++ +++openjdk-7 (7u25-2.3.10-1) unstable; urgency=high +++ +++ * IcedTea7 2.3.10 release. +++ * Security fixes +++ * S6741606, CVE-2013-2407: Integrate Apache Santuario. +++ * S7158805, CVE-2013-2445: Better rewriting of nested subroutine calls. +++ * S7170730, CVE-2013-2451: Improve Windows network stack support. +++ * S8000638, CVE-2013-2450: Improve deserialization. +++ * S8000642, CVE-2013-2446: Better handling of objects for transportation. +++ * S8001032: Restrict object access. +++ * S8001033, CVE-2013-2452: Refactor network address handling in virtual +++ machine identifiers. +++ * S8001034, CVE-2013-1500: Memory management improvements. +++ * S8001038, CVE-2013-2444: Resourcefully handle resources. +++ * S8001043: Clarify definition restrictions. +++ * S8001308: Update display of applet windows. +++ * S8001309: Better handling of annotation interfaces. +++ * S8001318, CVE-2013-2447: Socket.getLocalAddress not consistent with +++ InetAddress.getLocalHost. +++ * S8001330, CVE-2013-2443: Improve on checking order (non-Zero builds only). +++ * S8003703, CVE-2013-2412: Update RMI connection dialog box. +++ * S8004288, CVE-2013-2449: (fs) Files.probeContentType problems. +++ * S8004584: Augment applet contextualization. +++ * S8005007: Better glyph processing. +++ * S8006328, CVE-2013-2448: Improve robustness of sound classes. +++ * S8006611: Improve scripting. +++ * S8007467: Improve robustness of JMX internal APIs. +++ * S8007471: Improve MBean notifications. +++ * S8007812, CVE-2013-2455: (reflect) Class.getEnclosingMethod problematic for some classes. +++ * S8007925: Improve cmsStageAllocLabV2ToV4curves. +++ * S8007926: Improve cmsPipelineDup. +++ * S8007927: Improve cmsAllocProfileSequenceDescription. +++ * S8007929: Improve CurvesAlloc. +++ * S8008120, CVE-2013-2457: Improve JMX class checking. +++ * S8008124, CVE-2013-2453: Better compliance testing. +++ * S8008128: Better API coherence for JMX. +++ * S8008132, CVE-2013-2456: Better serialization support. +++ * S8008585: Better JMX data handling. +++ * S8008593: Better URLClassLoader resource management. +++ * S8008603: Improve provision of JMX providers. +++ * S8008607: Better input checking in JMX. +++ * S8008611: Better handling of annotations in JMX. +++ * S8008615: Improve robustness of JMX internal APIs. +++ * S8008623: Better handling of MBeanServers. +++ * S8008744, CVE-2013-2407: Rework part of fix for JDK-6741606. +++ * S8008982: Adjust JMX for underlying interface changes. +++ * S8009004: Better implementation of RMI connections. +++ * S8009008: Better manage management-api. +++ * S8009013: Better handling of T2K glyphs. +++ * S8009034: Improve resulting notifications in JMX. +++ * S8009038: Improve JMX notification support. +++ * S8009057, CVE-2013-2448: Improve MIDI event handling. +++ * S8009067: Improve storing keys in KeyStore. +++ * S8009071, CVE-2013-2459: Improve shape handling. +++ * S8009235: Improve handling of TSA data. +++ * S8009424, CVE-2013-2458: Adapt Nashorn to JSR-292 implementation change. +++ * S8009554, CVE-2013-2454: Improve SerialJavaObject.getFields. +++ * S8009654: Improve stability of cmsnamed. +++ * S8010209, CVE-2013-2460: Better provision of factories. +++ * S8011243, CVE-2013-2470: Improve ImagingLib. +++ * S8011248, CVE-2013-2471: Better Component Rasters. +++ * S8011253, CVE-2013-2472: Better Short Component Rasters. +++ * S8011257, CVE-2013-2473: Better Byte Component Rasters. +++ * S8012375, CVE-2013-1571: Improve Javadoc framing. +++ * S8012421: Better positioning of PairPositioning. +++ * S8012438, CVE-2013-2463: Better image validation. +++ * S8012597, CVE-2013-2465: Better image channel verification. +++ * S8012601, CVE-2013-2469: Better validation of image layouts. +++ * S8014281, CVE-2013-2461: Better checking of XML signature. +++ * S8015997: Additional improvement in Javadoc framing. +++ * Breaks icedtea-netx (<< 1.4-2). +++ +++ -- Matthias Klose Fri, 28 Jun 2013 16:55:32 +0200 +++ +++openjdk-7 (7u21-2.3.9-5) unstable; urgency=low +++ +++ * Update kFreeBSD support (Guido Guenther). Closes: #708818. +++ * Stop building the transitional cacao package for sid. +++ +++ -- Matthias Klose Sat, 18 May 2013 20:13:33 +0200 +++ +++openjdk-7 (7u21-2.3.9-4) unstable; urgency=high +++ +++ * Build the transitional cacao package for sid as well. Apparently +++ some buildds are not updated to list wheezy as the code name for +++ the current distribution. +++ +++ -- Matthias Klose Thu, 02 May 2013 03:27:44 +0200 +++ +++openjdk-7 (7u21-2.3.9-3) unstable; urgency=high +++ +++ * Disable the cacao build again, causing build failures on i386 and s390. +++ * Build a transitional cacao jre package instead. +++ +++ -- Matthias Klose Tue, 30 Apr 2013 00:27:05 +0200 +++ +++openjdk-7 (7u21-2.3.9-2) unstable; urgency=high +++ +++ * On ia64, use gcj-4.7 for the bootstrap build. +++ * Drop the cacao jre from recommends to suggests. +++ * Re-enable cacao, was enabled in the 2.1.x series. +++ +++ -- Matthias Klose Sat, 27 Apr 2013 01:17:16 +0200 +++ +++openjdk-7 (7u21-2.3.9-1) unstable; urgency=high +++ +++ * IcedTea7 2.3.9 release. +++ * Security fixes: +++ - S6657673, CVE-2013-1518: Issues with JAXP. +++ - S7200507: Refactor Introspector internals. +++ - S8000724, CVE-2013-2417: Improve networking serialization. +++ - S8001031, CVE-2013-2419: Better font processing. +++ - S8001040, CVE-2013-1537: Rework RMI model. +++ - S8001322: Refactor deserialization. +++ - S8001329, CVE-2013-1557: Augment RMI logging. +++ - S8003335: Better handling of Finalizer thread. +++ - S8003445: Adjust JAX-WS to focus on API. +++ - S8003543, CVE-2013-2415: Improve processing of MTOM attachments. +++ - S8004261: Improve input validation. +++ - S8004336, CVE-2013-2431: Better handling of method handle intrinsic frames. +++ - S8004986, CVE-2013-2383: Better handling of glyph table. +++ - S8004987, CVE-2013-2384: Improve font layout. +++ - S8004994, CVE-2013-1569: Improve checking of glyph table. +++ - S8005432: Update access to JAX-WS. +++ - S8005943: (process) Improved Runtime.exec. +++ - S8006309: More reliable control panel operation. +++ - S8006435, CVE-2013-2424: Improvements in JMX. +++ - S8006790: Improve checking for windows. +++ - S8006795: Improve font warning messages. +++ - S8007406: Improve accessibility of AccessBridge. +++ - S8007617, CVE-2013-2420: Better validation of images. +++ - S8007667, CVE-2013-2430: Better image reading. +++ - S8007918, CVE-2013-2429: Better image writing. +++ - S8008140: Better method handle resolution. +++ - S8009049, CVE-2013-2436: Better method handle binding. +++ - S8009063, CVE-2013-2426: Improve reliability of ConcurrentHashMap. +++ - S8009305, CVE-2013-0401: Improve AWT data transfer. +++ - S8009677, CVE-2013-2423: Better setting of setters. +++ - S8009699, CVE-2013-2421: Methodhandle lookup. +++ - S8009814, CVE-2013-1488: Better driver management. +++ - S8009857, CVE-2013-2422: Problem with plugin. +++ * Backports: +++ - S7130662: GTK file dialog crashes with a NPE. +++ * Bug fixes +++ - PR1363: Fedora 19 / rawhide FTBFS SIGILL. +++ - PR1401: Fix Zero build on 2.3.8. +++ - Fix offset problem in ICU LETableReference. +++ - Change -Werror fix to preserve OpenJDK default. +++ - PR1303: Correct #ifdef to #if. +++ - PR1404: Failure to bootstrap with ecj 4.2. +++ +++ -- Matthias Klose Mon, 22 Apr 2013 03:27:08 +0200 +++ +++openjdk-7 (7u17-2.3.8-2) experimental; urgency=low +++ +++ * Remove Torsten Werner as uploader. +++ +++ -- Matthias Klose Mon, 01 Apr 2013 00:39:58 +0200 +++ +++openjdk-7 (7u17-2.3.8-1ubuntu1) raring; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Sun, 31 Mar 2013 20:10:05 +0200 +++ +++openjdk-7 (7u17-2.3.8-1) experimental; urgency=low +++ +++ * IcedTea7 2.3.8 release. +++ * Security fixes: +++ - S8007014, CVE-2013-0809: Improve image handling. +++ - S8007675, CVE-2013-1493: Improve color conversion. +++ * Backports: +++ - S8002344: Krb5LoginModule config class does not return proper KDC list +++ from DNS. +++ - S8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c. +++ - S8006179: JSR292 MethodHandles lookup with interface using findVirtual(). +++ - S8006882: Proxy generated classes in sun.proxy package breaks JMockit. +++ * Bug fixes: +++ - PR1303: Correct #ifdef to #if. +++ - PR1340: Simplify the rhino class rewriter to avoid use of concurrency. +++ - Revert 7017193 and add the missing free call, until a better fix is ready. +++ +++ -- Matthias Klose Sun, 31 Mar 2013 14:31:11 +0200 +++ +++openjdk-7 (7u15-2.3.7-1ubuntu2) raring; urgency=low +++ +++ * Security fixes: +++ - S8007014, CVE-2013-0809: Improve image handling +++ - S8007675, CVE-2013-1493: Improve color conversion +++ - debian/rules: updated to add 8007014.patch and 8007675.patch +++ +++ -- Jamie Strandboge Wed, 06 Mar 2013 14:12:03 -0600 +++ +++openjdk-7 (7u15-2.3.7-1ubuntu1) raring; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Wed, 20 Feb 2013 23:59:54 +0100 +++ +++openjdk-7 (7u15-2.3.7-1) experimental; urgency=low +++ +++ * IcedTea7 2.3.7 release. +++ * Security fixes: +++ - S8004937, CVE-2013-1484: Improve proxy construction. +++ - S8006439, CVE-2013-1485: Improve MethodHandles coverage. +++ - S8006446, CVE-2013-1486: Restrict MBeanServer access. +++ - S8006777, CVE-2013-0169: Improve TLS handling of invalid messages. +++ - S8007688: Blacklist known bad certificate. +++ * Backports: +++ - S8007393: Possible race condition after JDK-6664509. +++ - S8007611: logging behavior in applet changed. +++ * For zero builds, use the same hotspot version as in 2.1.6. +++ * Reenable bootstrap builds, except for alpha. +++ * Explicitly disable building on mips/mipsel. Not supported by the +++ Debian OpenJDK maintainers, the Debian mips porters, or the Debian +++ Java team. +++ +++ -- Matthias Klose Wed, 20 Feb 2013 23:33:58 +0100 +++ +++openjdk-7 (7u13-2.3.6-1) experimental; urgency=low +++ +++ * IcedTea7 2.3.6 release. +++ - Disable bootstrap builds, currently broken in IcedTea. +++ * Security fixes: +++ - S6563318, CVE-2013-0424: RMI data sanitization. +++ - S6664509, CVE-2013-0425: Add logging context. +++ - S6664528, CVE-2013-0426: Find log level matching its name or value given +++ at construction time. +++ - S6776941: CVE-2013-0427: Improve thread pool shutdown. +++ - S7141694, CVE-2013-0429: Improving CORBA internals. +++ - S7173145: Improve in-memory representation of splashscreens. +++ - S7186945: Unpack200 improvement. +++ - S7186946: Refine unpacker resource usage. +++ - S7186948: Improve Swing data validation. +++ - S7186952, CVE-2013-0432: Improve clipboard access. +++ - S7186954: Improve connection performance. +++ - S7186957: Improve Pack200 data validation. +++ - S7192392, CVE-2013-0443: Better validation of client keys. +++ - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages. +++ - S7192977, CVE-2013-0442: Issue in toolkit thread. +++ - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies. +++ - S7200491: Tighten up JTable layout code. +++ - S7200500: Launcher better input validation. +++ - S7201064: Better dialogue checking. +++ - S7201066, CVE-2013-0441: Change modifiers on unused fields. +++ - S7201068, CVE-2013-0435: Better handling of UI elements. +++ - S7201070: Serialization to conform to protocol. +++ - S7201071, CVE-2013-0433: InetSocketAddress serialization issue. +++ - S8000210: Improve JarFile code quality. +++ - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class. +++ - S8000540, CVE-2013-1475: Improve IIOP type reuse management. +++ - S8000631, CVE-2013-1476: Restrict access to class constructor. +++ - S8001235, CVE-2013-0434: Improve JAXP HTTP handling. +++ - S8001242: Improve RMI HTTP conformance. +++ - S8001307: Modify ACC_SUPER behavior. +++ - S8001972, CVE-2013-1478: Improve image processing. +++ - S8002325, CVE-2013-1480: Improve management of images. +++ * Fix font suggestion for indic fonts in wheezy. +++ * Fix fontconfig definitions for japanese and korean fonts, fixing +++ compilation of the fontconfig file. +++ * Add Built-Using: rhino attribute for the -lib package. +++ * Don't use concurrent features to rewrite the rhino jar file. +++ * Enable class data sharing for the hotspot server VM. +++ +++ -- Matthias Klose Tue, 12 Feb 2013 20:59:48 +0100 +++ +++openjdk-7 (7u9-2.3.4-1) experimental; urgency=low +++ +++ * IcedTea7 2.3.4 release. +++ * Security fixes +++ - S8004933, CVE-2012-3174: Improve MethodHandle interaction with libraries. +++ - S8006017, CVE-2013-0422: Improve lookup resolutions. +++ - S8006125: Update MethodHandles library interactions. +++ * Bug fixes +++ - S7197906: BlockOffsetArray::power_to_cards_back() needs to handle > 32 bit +++ shifts. +++ - G422525: Fix building with PaX enabled kernels. +++ +++ [ Matthias Klose ] +++ * Loosen OpenGL dependency. Closes: #695028. +++ * Fix error parsing drop files parameter from pcmanfm (Alberto Fernández +++ Martínez). Closes: #695992. +++ +++ [ Thorsten Glaser ] +++ * debian/rules: Use gcj-4.6-jdk for m68k builds. +++ * d/patches/text-relocations.patch: build with -fPIC on all archs. +++ +++ -- Matthias Klose Tue, 15 Jan 2013 23:38:48 +0100 +++ +++openjdk-7 (7u9-2.3.3-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Wed, 17 Oct 2012 15:16:51 +0200 +++ +++openjdk-7 (7u9-2.3.3-0ubuntu1) quantal-security; urgency=low +++ +++ * IcedTea7 2.3.3 release. +++ * Security fixes +++ - S6631398, CVE-2012-3216: FilePermission improved path checking. +++ - S7093490: adjust package access in rmiregistry. +++ - S7143535, CVE-2012-5068: ScriptEngine corrected permissions. +++ - S7158796, CVE-2012-5070: Tighten properties checking in EnvHelp. +++ - S7158807: Revise stack management with volatile call sites. +++ - S7163198, CVE-2012-5076: Tightened package accessibility. +++ - S7167656, CVE-2012-5077: Multiple Seeders are being created. +++ - S7169884, CVE-2012-5073: LogManager checks do not work correctly for +++ sub-types. +++ - S7169887, CVE-2012-5074: Tightened package accessibility. +++ - S7169888, CVE-2012-5075: Narrowing resource definitions in JMX RMI +++ connector. +++ - S7172522, CVE-2012-5072: Improve DomainCombiner checking. +++ - S7186286, CVE-2012-5081: TLS implementation to better adhere to RFC. +++ - S7189103, CVE-2012-5069: Executors needs to maintain state. +++ - S7189490: More improvements to DomainCombiner checking. +++ - S7189567, CVE-2012-5085: java net obselete protocol. +++ - S7192975, CVE-2012-5071: Issue with JMX reflection. +++ - S7195194, CVE-2012-5084: Better data validation for Swing. +++ - S7195549, CVE-2012-5087: Better bean object persistence. +++ - S7195917, CVE-2012-5086: XMLDecoder parsing at close-time should be +++ improved. +++ - S7195919, CVE-2012-5979: (sl) ServiceLoader can throw CCE without +++ needing to create instance. +++ - S7196190, CVE-2012-5088: Improve method of handling MethodHandles. +++ - S7198296, CVE-2012-5089: Refactor classloader usage. +++ - S7158800: Improve storage of symbol tables. +++ - S7158801: Improve VM CompileOnly option. +++ - S7158804: Improve config file parsing. +++ - S7198606, CVE-2012-4416: Improve VM optimization. +++ +++ -- Matthias Klose Wed, 17 Oct 2012 13:27:47 +0200 +++ +++openjdk-7 (7u7-2.3.2a-1ubuntu1) quantal; urgency=low +++ +++ * Build a transitional icedtea-7-jre-cacao package to ease upgrades. +++ +++ -- Matthias Klose Wed, 19 Sep 2012 17:42:39 +0200 +++ +++openjdk-7 (7u7-2.3.2a-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Sat, 15 Sep 2012 22:20:06 +0200 +++ +++openjdk-7 (7u7-2.3.2a-0ubuntu1) quantal; urgency=low +++ +++ * Repackage the source to drop the cacao tarball (and packaging files). +++ * Depend again on system provided tzdata-java and restore the zi +++ symlink on upgrade. LP: #1050404. +++ * libgnome2-0, libgnomevfs2-0, libgconf2-4 are not prepared for multiarch. +++ Don't depend on these so that openjdk-7 can be installed as a multiarch +++ package. +++ +++ -- Matthias Klose Sat, 15 Sep 2012 17:01:12 +0200 +++ +++openjdk-7 (7u7-2.3.2-1ubuntu2) quantal; urgency=low +++ +++ * Make the avian VM a known runtime. +++ +++ -- Matthias Klose Wed, 05 Sep 2012 11:58:35 +0200 +++ +++openjdk-7 (7u7-2.3.2-1ubuntu1) quantal; urgency=low +++ +++ * Fix 32bit hotspot build, don't set maximal heap space lower than +++ minimal heap space for the docs build. +++ * d/p/sane-library-paths.patch, d/p/ant-diagnostics.diff, +++ d/p/fix-race-cond-print.diff, d/p/gcc-hotspot-opt-O[02].diff, +++ d/p/gcc-mtune-generic.diff, d/p/openjdk-6986968.diff: Remove, not used. +++ * Remove unused shark/llvm-3.0 patches. +++ * d/p/zero-only-use-floating-point-if-floating-poi.patch: Remove, applied +++ upstream. +++ * Don't explicitly build with -march=i586 on i386 architectures. +++ * Re-apply zero-missing-headers.diff. +++ * Disable cacao builds, needs update for 7u7. +++ * For Ubuntu quantal, set priorities for alternatives higher than for +++ OpenJDK 6. +++ * Call update-alternatives when the existing priority for the alternative +++ is lower than the current one. +++ * Configure with --disable-downloading. +++ * Pass -avoid-version to libtool to create a JamVM libjvm.so without SONAME +++ version numbers to match the Hotspot Server/Client libjvm.so. LP: #850433. +++ * Revert the following change: Move libgnome2-0, libgnomevfs2-0, libgconf2-4 +++ from Depends of JRE package to Recommends (#661465). +++ The proper fix is to create a -jdk-headless package, or not depending on +++ these gnome packages at all (e.g. using XDG libraries). +++ +++ -- Matthias Klose Tue, 04 Sep 2012 12:08:31 +0200 +++ +++openjdk-7 (7u7-2.3.2-1) experimental; urgency=low +++ +++ * New upstream IcedTea7 2.3.2 release. +++ * Security fixes: +++ - CVE-2012-4681: Reintroduce PackageAccessible checks removed in 6788531. +++ - S7079902, CVE-2012-1711: Refine CORBA data models. +++ - S7143606, CVE-2012-1717: File.createTempFile should be improved +++ for temporary files created by the platform. +++ - S7143614, CVE-2012-1716: SynthLookAndFeel stability improvement. +++ - S7143617, CVE-2012-1713: Improve fontmanager layout lookup operations. +++ - S7143851, CVE-2012-1719: Improve IIOP stub and tie generation in RMIC. +++ - S7143872, CVE-2012-1718: Improve certificate extension processing. +++ - S7152811, CVE-2012-1723: Issues in client compiler. +++ - S7157609, CVE-2012-1724: Issues with loop. +++ - S7160757, CVE-2012-1725: Problem with hotspot/runtime_classfile. +++ - S7165628, CVE-2012-1726: Issues with java.lang.invoke.MethodHandles.Lookup. +++ * Bump version to 7u7 (OpenJDK), 2.3.2 (IcedTea). Closes: #685276. +++ * d/p/icedtea7-forest-jdk_7104625-XEvent_wrap_logging_calls_with_if.patch, +++ d/p/hotspot-sparc.diff: Remove, integrated upstream. +++ * d/p/{deb-multiarch,fix_extra_flags,hotspot-no-werror}.diff: +++ Add variants for hotspot and zero builds. +++ * d/p/default-jvm-cfg.diff, d/p/icedtea-4953367.patch, +++ d/p/icedtea-patch.diff, d/p/icedtea-pretend-memory.diff, +++ d/p/libpcsclite-dlopen.diff, d/p/nonreparenting-wm.diff: +++ Update for 2.3.2. +++ * Remove build support for Ubuntu releases earlier than hardy. +++ * d/update-shasum.sh: Only update the shasums of the -dfsg tarballs. +++ * Don't apply shark patches (not built anyway). +++ +++ -- Matthias Klose Sat, 01 Sep 2012 11:46:50 +0200 +++ +++openjdk-7 (7u3-2.1.7-1) unstable; urgency=high +++ +++ * IcedTea7 2.1.7 release: +++ * Security fixes: +++ - S8007014, CVE-2013-0809: Improve image handling. +++ - S8007675, CVE-2013-1493: Improve color conversion. +++ * Backports: +++ - S8002344: Krb5LoginModule config class does not return proper KDC list +++ from DNS. +++ - S8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c. +++ - S8006179: JSR292 MethodHandles lookup with interface using findVirtual(). +++ - S8006882: Proxy generated classes in sun.proxy package breaks JMockit. +++ * Bug fixes: +++ - PR1303: Correct #ifdef to #if +++ - Stop libraries being stripped in the OpenJDK build. +++ - PR1340: Simplify the rhino class rewriter to avoid use of concurrency. +++ - Revert 7017193 and add the missing free call, until a better fix is ready. +++ +++ -- Matthias Klose Sat, 30 Mar 2013 11:31:12 +0100 +++ +++openjdk-7 (7u3-2.1.6-1) unstable; urgency=high +++ +++ * IcedTea7 2.1.5 release: +++ * Security fixes: +++ - S6563318, CVE-2013-0424: RMI data sanitization. +++ - S6664509, CVE-2013-0425: Add logging context. +++ - S6664528, CVE-2013-0426: Find log level matching its name or value +++ given at construction time. +++ - S6776941: CVE-2013-0427: Improve thread pool shutdown. +++ - S7141694, CVE-2013-0429: Improving CORBA internals. +++ - S7173145: Improve in-memory representation of splashscreens. +++ - S7186945: Unpack200 improvement. +++ - S7186946: Refine unpacker resource usage. +++ - S7186948: Improve Swing data validation. +++ - S7186952, CVE-2013-0432: Improve clipboard access. +++ - S7186954: Improve connection performance. +++ - S7186957: Improve Pack200 data validation. +++ - S7192392, CVE-2013-0443: Better validation of client keys. +++ - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages. +++ - S7192977, CVE-2013-0442: Issue in toolkit thread. +++ - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective +++ proxies. +++ - S7200491: Tighten up JTable layout code. +++ - S7200493, CVE-2013-0444: Improve cache handling. +++ - S7200499: Better data validation for options. +++ - S7200500: Launcher better input validation. +++ - S7201064: Better dialogue checking. +++ - S7201066, CVE-2013-0441: Change modifiers on unused fields. +++ - S7201068, CVE-2013-0435: Better handling of UI elements. +++ - S7201070: Serialization to conform to protocol. +++ - S7201071, CVE-2013-0433: InetSocketAddress serialization issue. +++ - S8000210: Improve JarFile code quality. +++ - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class. +++ - S8000539, CVE-2013-0431: Introspect JMX data handling. +++ - S8000540, CVE-2013-1475: Improve IIOP type reuse management. +++ - S8000631, CVE-2013-1476: Restrict access to class constructor. +++ - S8001235, CVE-2013-0434: Improve JAXP HTTP handling. +++ - S8001242: Improve RMI HTTP conformance. +++ - S8001307: Modify ACC_SUPER behavior. +++ - S8001972, CVE-2013-1478: Improve image processing. +++ - S8002325, CVE-2013-1480: Improve management of images. +++ * Backports: +++ - S7054590: (JSR-292) MethodHandleProxies.asInterfaceInstance() +++ accepts private/protected nested interfaces. +++ - S7175616: Port fix for TimeZone from JDK 8 to JDK 7. +++ - S8002068: Build broken: corba code changes unable to use new +++ JDK 7 classes. +++ - S8004341: Two JCK tests fails with 7u11 b06. +++ - S8005615: Java Logger fails to load tomcat logger implementation (JULI). +++ * IcedTea7 2.1.6 release: +++ * Security fixes: +++ - S8004937, CVE-2013-1484: Improve proxy construction. +++ - S8006439, CVE-2013-1485: Improve MethodHandles coverage. +++ - S8006446, CVE-2013-1486: Restrict MBeanServer access. +++ - S8006777, CVE-2013-0169: Improve TLS handling of invalid messages. +++ - S8007688: Blacklist known bad certificate. +++ * Backports: +++ - S7123519: problems with certification path. +++ - S8007393: Possible race condition after JDK-6664509. +++ - S8007611: logging behavior in applet changed. +++ * Fix font suggestion for indic fonts in wheezy. +++ * Fix fontconfig definitions for japanese and korean fonts, fixing +++ compilation of the fontconfig file. +++ * Add Built-Using: rhino attribute for the -lib package. +++ * Don't use concurrent features to rewrite the rhino jar file. +++ * Enable class data sharing for the hotspot server VM. +++ * Enable bootstrap builds for alpha. +++ * Explicitly disable building on mips/mipsel. Not supported by the +++ Debian OpenJDK maintainers, the Debian mips porters, or the Debian +++ Java team. +++ +++ -- Matthias Klose Thu, 21 Feb 2013 03:38:13 +0100 +++ +++openjdk-7 (7u3-2.1.4-1) unstable; urgency=low +++ +++ * IcedTea7 2.1.4 release. +++ * Security fixes +++ - S8004933, CVE-2012-3174: Improve MethodHandle interaction with libraries +++ - S8006017, CVE-2013-0422: Improve lookup resolutions +++ - S8006125: Update MethodHandles library interactions +++ * Loosen OpenGL dependency. Closes: #695028. +++ * Fix error parsing drop files parameter from pcmanfm (Alberto Fernández +++ Martínez). Closes: #695992. +++ +++ -- Matthias Klose Wed, 16 Jan 2013 11:46:20 +0100 +++ +++openjdk-7 (7u3-2.1.3-1) unstable; urgency=low +++ +++ * IcedTea7 2.1.3 release. +++ * Security fixes +++ - S6631398, CVE-2012-3216: FilePermission improved path checking. +++ - S7093490: adjust package access in rmiregistry. +++ - S7143535, CVE-2012-5068: ScriptEngine corrected permissions. +++ - S7158796, CVE-2012-5070: Tighten properties checking in EnvHelp. +++ - S7158807: Revise stack management with volatile call sites. +++ - S7163198, CVE-2012-5076: Tightened package accessibility. +++ - S7167656, CVE-2012-5077: Multiple Seeders are being created. +++ - S7169884, CVE-2012-5073: LogManager checks do not work correctly for +++ sub-types. +++ - S7169887, CVE-2012-5074: Tightened package accessibility. +++ - S7169888, CVE-2012-5075: Narrowing resource definitions in JMX RMI +++ connector. +++ - S7172522, CVE-2012-5072: Improve DomainCombiner checking. +++ - S7186286, CVE-2012-5081: TLS implementation to better adhere to RFC. +++ - S7189103, CVE-2012-5069: Executors needs to maintain state. +++ - S7189490: More improvements to DomainCombiner checking. +++ - S7189567, CVE-2012-5085: java net obselete protocol. +++ - S7192975, CVE-2012-5071: Issue with JMX reflection. +++ - S7195194, CVE-2012-5084: Better data validation for Swing. +++ - S7195549, CVE-2012-5087: Better bean object persistence. +++ - S7195917, CVE-2012-5086: XMLDecoder parsing at close-time should be +++ improved. +++ - S7195919, CVE-2012-5979: (sl) ServiceLoader can throw CCE without +++ needing to create instance. +++ - S7196190, CVE-2012-5088: Improve method of handling MethodHandles. +++ - S7198296, CVE-2012-5089: Refactor classloader usage. +++ - S7158801: Improve VM CompileOnly option. +++ - S7158804: Improve config file parsing. +++ - S7198606, CVE-2012-4416: Improve VM optimization. +++ * Backports +++ - S7175845: "jar uf" changes file permissions unexpectedly. +++ - S7177216: native2ascii changes file permissions of input file. +++ - S7106773: 512 bits RSA key cannot work with SHA384 and SHA512. +++ - S7158800: Improve storage of symbol tables. +++ +++ -- Matthias Klose Wed, 17 Oct 2012 16:03:47 +0200 +++ +++openjdk-7 (7u3-2.1.2-2ubuntu1) precise-security; urgency=low +++ +++ * Make the avian VM a known runtime. +++ +++ -- Matthias Klose Sat, 08 Sep 2012 16:01:31 +0200 +++ +++openjdk-7 (7u3-2.1.2-2) unstable; urgency=high +++ +++ * Pass -avoid-version to libtool to create a JamVM libjvm.so without SONAME +++ version numbers to match the Hotspot Server/Client libjvm.so. LP: #850433. +++ +++ -- Matthias Klose Tue, 04 Sep 2012 17:55:43 +0200 +++ +++openjdk-7 (7u3-2.1.2-1) unstable; urgency=high +++ +++ * IcedTea7 2.1.2 release. +++ * Security fixes +++ - CVE-2012-4681, S7162473: Reintroduce PackageAccessible checks removed +++ in 6788531. +++ - S7162476, CVE-2012-1682: XMLDecoder security issue via ClassFinder. +++ - S7194567, CVE-2012-3136: Improve long term persistence of java.beans +++ objects. +++ - S7163201, CVE-2012-0547: Simplify toolkit internals references. +++ * d/p/hotspot-sparc.diff: Remove, integrated upstream. +++ * Stop running the mauve tests. +++ +++ -- Matthias Klose Mon, 03 Sep 2012 23:17:11 +0200 +++ +++openjdk-7 (7~u3-2.1.1-3) unstable; urgency=low +++ +++ * d/rules: Ensure we don't remove -02 (default) when -03 is disabled +++ (fix jamvm FTBFS on armhf without -02). +++ * d/patches/gcc-jdk-opt-O0.diff, d/patches/gcc-jdk-opt-O2.diff, +++ d/patches/gcc-no-hardening.diff, d/patches/gcc-opt-O2.diff: removed. +++ +++ -- Damien Raude-Morvan Wed, 25 Jul 2012 21:18:15 +0200 +++ +++openjdk-7 (7~u3-2.1.1-2) unstable; urgency=low +++ +++ * d/rules: On Debian Wheezy/Sid bump Build-Depends on libnss3-dev +++ (>= 2:3.13.4) and Depends on libnss3 (>= 2:3.13.4) (ie. with epoch). +++ (Closes: #679465). +++ * d/control: Suggests icedtea-7-plugin instead of icedtea6-plugin +++ (Closes: #680284). +++ * d/patches/7130140-MouseEvent-systemout.diff: Remove "MEvent. CASE!" from +++ console output. (Closes: #679036). +++ * Disable -O3 compile: cause wrong Math.* computations. +++ (Closes: #679292 and Closes: #678228). LP: #1044857. +++ * debian/patches/FreetypeFontScaler_getFontMetricsNative.diff: +++ Fix "OpenJDK returns the text height greater than font size". +++ (Closes: #657854) +++ +++ -- Damien Raude-Morvan Sat, 30 Jun 2012 18:17:51 +0200 +++ +++openjdk-7 (7~u3-2.1.1-1) unstable; urgency=medium +++ +++ * New upstream release with security fixes (Closes: #677486): +++ - S7079902, CVE-2012-1711: Refine CORBA data models +++ - S7110720: Issue with vm config file loadingIssue with +++ vm config file loading +++ - S7143606, CVE-2012-1717: File.createTempFile should be improved +++ for temporary files created by the platform. +++ - S7143614, CVE-2012-1716: SynthLookAndFeel stability improvement +++ - S7143617, CVE-2012-1713: Improve fontmanager layout lookup operations +++ - S7143851, CVE-2012-1719: Improve IIOP stub and tie generation in RMIC +++ - S7143872, CVE-2012-1718: Improve certificate extension processing +++ - S7145239: Finetune package definition restriction +++ - S7152811, CVE-2012-1723: Issues in client compiler +++ - S7157609, CVE-2012-1724: Issues with loop +++ - S7160677: missing else in fix for 7152811 +++ - S7160757, CVE-2012-1725: Problem with hotspot/runtime_classfile +++ - S7165628, CVE-2012-1726: Issues with +++ java.lang.invoke.MethodHandles.Lookup +++ * Patches merged upstream: +++ - debian/patches/arm-thumb-fix.diff +++ - debian/patches/gcc-4.7.diff +++ +++ [ James Page ] +++ * Cherry picked patch from openjdk-6 to fix handling of +++ ICC profiles (LP: #888123, #888129) (Closes: #676351). +++ +++ [ Damien Raude-Morvan ] +++ * Move libgnome2-0, libgnomevfs2-0, libgconf2-4 from Depends of JRE package +++ to Recommends (Closes: #661465). +++ * New jni_md_h_JNIEXPORT_visibility.patch to allow JNIEXPORT definition +++ to work with -fvisibility=hidden. (Closes: #670896). +++ +++ -- Damien Raude-Morvan Mon, 11 Jun 2012 21:01:10 +0200 +++ +++openjdk-7 (7~u3-2.1.1~pre1-2) unstable; urgency=low +++ +++ * Don't mark the -demo package as Multi-Arch same. Closes: #670038. +++ * Build using gcc-4.4 on mips, mipsel. +++ * Build again with older gcj version on s390 (4.6). +++ +++ -- Matthias Klose Thu, 03 May 2012 10:44:20 +0200 +++ +++openjdk-7 (7~u3-2.1.1~pre1-1ubuntu3) precise-proposed; urgency=low +++ +++ * Default to the ARM assembler interpreter instead to JamVM on +++ ARM. LP: #993380. +++ +++ -- Matthias Klose Wed, 02 May 2012 17:58:20 +0200 +++ +++openjdk-7 (7~u3-2.1.1~pre1-1ubuntu2) precise; urgency=low +++ +++ * Use the /usr/bin path for the policytool desktop file. LP: #980205. +++ Closes: #670037. +++ +++ -- Matthias Klose Thu, 12 Apr 2012 23:29:06 +0200 +++ +++openjdk-7 (7~u3-2.1.1~pre1-1ubuntu1) precise; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Wed, 11 Apr 2012 07:21:41 +0200 +++ +++openjdk-7 (7~u3-2.1.1~pre1-1) unstable; urgency=low +++ +++ * Update from the IcedTea7-2.1 release branch (20110410). +++ * Install desktop files again, using the common /usr/bin/java +++ interpreter name. +++ * Build-depend on libpng-dev for newer releases. Closes: #662452. +++ * Let dlopen handle finding the libpcsclite library. LP: #898689. +++ * Build-depend on fonts-ipafont-mincho, fixing a build failure in the +++ fontconfig compiler (find out why it breaks ...). +++ * Build using gcc-4.7/gcj-4.7 for sid/wheezy, fix build failure. +++ * Remove `-icedtea' suffix from the release identification. +++ * Fix arm thumb build, update taken from IcedTea6. +++ +++ -- Matthias Klose Tue, 10 Apr 2012 14:11:09 +0200 +++ +++openjdk-7 (7~u3-2.1-4) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * Don't install the binary fontconfig file. LP: #964303. +++ +++ [ Damien Raude-Morvan ] +++ * Remove libxp-dev check in configure.ac, it's not needed anymore +++ (Closes: #657260) and so drop build dependency on libxp-dev. +++ * Fix FTBFS with glib 2.32 by adding explicit dependency gthread-2.0.pc +++ (Closes: #665666). +++ * Use libpng-dev instead of libpng12-dev for wheezy/sid (Closes: #662453). +++ +++ -- Damien Raude-Morvan Mon, 09 Apr 2012 00:21:20 +0200 +++ +++openjdk-7 (7~u3-2.1-3) unstable; urgency=low +++ +++ * d/rules,Makefile.am: Improve handling of dpkg-buildflags: don't overwrite +++ CFLAGS of hotspot but use EXTRA_* flags into icedtea and openjdk Makefile. +++ (Closes: #661695). +++ * d/rules: Build everything with -03 opt level (jamvm, cacao and jdk) +++ * d/patches/kfreebsd-support-*.diff: Refresh kfreebsd patches and +++ fix FTBFS on k-i386 (ie. at least on a sid VM). +++ * Backport S7104625 as d/patches/icedtea7-forest-jdk_7104625*.patch +++ to check for logging to prevent wasted CPU (Closes: #651423). +++ +++ -- Damien Raude-Morvan Tue, 06 Mar 2012 01:09:09 +0100 +++ +++openjdk-7 (7~u3-2.1-2) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * Use NanumMyeongjo as the preferred korean font. LP: #792471. +++ * Fix crash in java.net.NetworkInterface.getNetworkInterfaces() when +++ ifr_ifindex exceeds 255. LP: #925218. S7078386. +++ * Use IPAfont as the preferred japanesse font. Closes: #646054. +++ * Build using gcj on alpha and armel. Closes: #655750. +++ +++ [ Damien Raude-Morvan ] +++ * d/patches/sparc-stubgenerator.diff: Fix FTBFS on sparc on +++ stubGenerator_sparc.cpp by using explicit class typedef +++ (Closes: #660871). +++ * d/patches/fix_extra_flags.diff: Improve support for hardened build, +++ also send flags to jdk build and send -Wl,-z,relro during hotspot link. +++ * Bump Standards-Version to 3.9.3: no changes needed. +++ * d/control: Don't use nonexistent dlopenjl:Recommends substvar, +++ replaced by dlopenhl:Recommends. +++ * d/*.{prerm,postrm}: Use set -e inside script instead of sh -e shebang. +++ * Cleanup lintian-overrides. +++ +++ -- Damien Raude-Morvan Wed, 29 Feb 2012 00:52:49 +0100 +++ +++openjdk-7 (7~u3-2.1-1ubuntu2) precise; urgency=low +++ +++ * Make sure that the nss.cfg doesn't mention any library path. +++ LP: #939361, #939419. +++ * Disable the accessibility wrapper, doesn't work yet. LP: #935296. +++ +++ -- Matthias Klose Fri, 24 Feb 2012 15:10:12 +0100 +++ +++openjdk-7 (7~u3-2.1-1ubuntu1) precise; urgency=low +++ +++ [ Damien Raude-Morvan ] +++ * d/patches/jexec.diff: Dropped, uneeded and not compatible with multi-arch. +++ * d/rules: Use dpkg-buildflags to enable hardened build. +++ (Closes: #660021). +++ +++ [ Matthias Klose ] +++ * Merge r522 from openjdk6: +++ - Make upgrades from non-multiarch to multiarch builds more silent. +++ - Fix order of grant decls in java.policy. +++ - Make doc files multi-arch installable. +++ - JB-archive.applications.in: Use /usr/bin/java by default. Maybe +++ should be moved to the default-jdk package. +++ * Explicitly look for the gthread-2.0 pkgconfig module. +++ +++ -- Matthias Klose Wed, 22 Feb 2012 14:07:16 +0100 +++ +++openjdk-7 (7~u3-2.1-1) unstable; urgency=low +++ +++ * Update icedtea7 2.1 (OpenJDK7 ~u3 release): +++ - Check for logging to prevent wasted CPU (Closes: #651423). +++ * Fix following security issues: +++ - S7082299, CVE-2011-3571: Fix in AtomicReferenceArray +++ - S7088367, CVE-2011-3563: Fix issues in java sound +++ - S7110683, CVE-2012-0502: Issues with some KeyboardFocusManager method +++ - S7110687, CVE-2012-0503: Issues with TimeZone class +++ - S7110700, CVE-2012-0505: Enhance exception throwing mechanism in +++ ObjectStreamClass +++ - S7110704, CVE-2012-0506: Issues with some method in corba +++ - S7112642, CVE-2012-0497: Incorrect checking for graphics rendering object +++ - S7118283, CVE-2012-0501: Better input parameter checking in zip file +++ processing +++ - S7126960, CVE-2011-5035: Add property to limit number of request headers +++ to the HTTP Server +++ +++ [ Matthias Klose ] +++ * openjdk-7-jre-lib: Mark as Multi-Arch: foreign. +++ +++ [ Damien Raude-Morvan ] +++ * Merge r501-521 from openjdk6: +++ - Fix plugin name in jinfo file. +++ - Fix build flags for cppInterpreter_arm.o. +++ - Use java-atk-wrapper instead of java-access-bridge for accessibility. +++ - Make the java.policy file multi-arch installable. +++ - Don't install desktop and menu files for multiarch builds. +++ Needs a better solution. +++ - Don't install an alternative for the deprecated apt tool. +++ - Make the upgrade from a non-multiarch installation location more +++ robust; don't depend on version numbers, but check the path of the +++ alternatives. +++ - Disable test for armel and powerpc (broken on buildd) +++ * d/rules: Make symbolic links to src.zip on /usr/lib/jvm/java-7-openjdk-amd64 +++ like openjdk-6-jdk (Closes: #649618). +++ * d/rules: Pass -n to gzip when compressing manpages to be Multi-Arch: same safe. +++ * d/rules: Add build-arch/build-indep target. +++ * d/rules: Re-enable Cacao VM! +++ * d/{rules,control}: Only rhino 1.7R3 is supported by openjdk7, update B-D. +++ * d/patches/hotspot-s390.diff: Update for latest Hotspot. +++ * d/patches/icedtea-patch.diff: Move nssLibraryDirectory handling to d/rules. +++ * d/rules: Remove --with-*-drop-zip options, as code drops are embedded. +++ * d/patches/hsx23-zero.patch, patches/shark-compiler-fixes.patch: +++ Fix FTBFS for Zero under Hotspot >= v22. +++ * d/patches/kfreebsd-*: Refreshed. +++ * d/control: Make openjdk-7-source:all package binNMU-able by using +++ Depends ">=" on openjdk-7-jre (ie. src.zip won't change). +++ +++ -- Damien Raude-Morvan Wed, 15 Feb 2012 20:55:52 +0100 +++ +++openjdk-7 (7~b147-2.0-1) unstable; urgency=low +++ +++ * New upstream IcedTea7 release. +++ - S7000600, CVE-2011-3547: InputStream skip() information leak. +++ - S7019773, CVE-2011-3548: mutable static AWTKeyStroke.ctor. +++ - S7023640, CVE-2011-3551: Java2D TransformHelper integer overflow. +++ - S7032417, CVE-2011-3552: excessive default UDP socket limit under +++ SecurityManager. +++ - S7046794, CVE-2011-3553: JAX-WS stack-traces information leak. +++ - S7046823, CVE-2011-3544: missing SecurityManager checks in scripting +++ engine. +++ - S7055902, CVE-2011-3521: IIOP deserialization code execution. +++ - S7057857, CVE-2011-3554: insufficient pack200 JAR files uncompress error +++ checks. +++ - S7064341, CVE-2011-3389: HTTPS: block-wise chosen-plaintext attack +++ against SSL/TLS (BEAST). +++ - S7070134, CVE-2011-3558: HotSpot crashes with sigsegv from PorterStemmer. +++ - S7077466, CVE-2011-3556: RMI DGC server remote code execution. +++ - S7083012, CVE-2011-3557: RMI registry privileged code execution. +++ - S7096936, CVE-2011-3560: missing checkSetFactory calls in +++ HttpsURLConnection. +++ +++ [ Matthias Klose ] +++ * Merge debian packaging r501 from openjdk-6: +++ - Tighten inter-package dependencies for Debian builds. Closes: #641240. +++ * Build-depend on wdiff. +++ +++ -- Damien Raude-Morvan Sat, 01 Oct 2011 10:53:15 +0200 +++ +++openjdk-7 (7~b147-2.0~pre6-2) unstable; urgency=low +++ +++ * d/rules: Fix java.policy to include jre/lib/ext/* files (instead of +++ non-existant ext/*). It'll restore privilegied access from sunpkcs11.jar +++ to sun.* code. +++ * d/patches/s390_hotspot_fix.diff: Update to fix FTBFS on s390. +++ +++ -- Damien Raude-Morvan Sat, 01 Oct 2011 10:53:15 +0200 +++ +++openjdk-7 (7~b147-2.0~pre6-1) unstable; urgency=low +++ +++ * Update to IcedTea7 (20110928). +++ +++ [ Matthias Klose ] +++ * Merge debian packaging r496 from openjdk-6: +++ - Fix dangling java-1.7.0-openjdk symlink for non-multiarch builds. +++ +++ [ Damien Raude-Morvan ] +++ * d/rules: --disable-compile-against-syscalls for kFreeBSD (since there is +++ no epoll support). +++ * Update patches: +++ - d/patches/sun-awt-buildsystem.diff: Drop, merged upstream. +++ - d/patches/icedtea-override-redirect-compiz.patch: Refresh. +++ - d/patches/s390_hotspot_fix.diff: Extracted (instead of direct patch). +++ * Add Build-Depends on libattr1-dev. +++ +++ -- Damien Raude-Morvan Wed, 28 Sep 2011 17:19:33 +0200 +++ +++openjdk-7 (7~b147-2.0~pre5-1) unstable; urgency=low +++ +++ * Update to IcedTea7 (20110914). +++ - d/patches/jdk-no-mapfile.diff: Drop, merged in icedtea7-forest +++ (for real this time). +++ - d/patches/sun-awt-buildsystem.diff: Fix icedtea7-forest awt build. +++ * d/patches/kfreebsd-support-jdk.diff: Refresh. +++ * d/patches/icedtea-patch.diff: Remove usage of nssLibraryDirectory because +++ while it works for nss3, it fails for softokn3 (since the latter is +++ in nss/ subdirectory). Without this parameter, openjdk-7 will rely on +++ default ld.so behavior. (Closes: #637337, #638008) +++ In openjdk-6, nssLibraryDirectory was not used to load softokn3 (Secmod). +++ * d/control: openjdk-7-jre Provides java7-runtime, openjdk-7-jre-headless +++ Provides java7-runtime-headless and openjdk-7-jdk Provides java7-jdk. +++ (Closes: #641668). +++ +++ -- Damien Raude-Morvan Mon, 19 Sep 2011 16:33:15 +0200 +++ +++openjdk-7 (7~b147-2.0~pre4-1) unstable; urgency=low +++ +++ * Update to IcedTea7 (20110906): +++ - JamVM: support for armhf and other various fixes. +++ * Upload to unstable. +++ * Regenerate control file for debian unstable. +++ * Makefile.am: Force JAVA_HOME for ant call to --with-jdk-home value (without +++ this, it defaults to existing JAVA_HOME env or /usr/bin/java link) +++ +++ -- Damien Raude-Morvan Mon, 05 Sep 2011 23:50:43 +0200 +++ +++openjdk-7 (7~b147-2.0~pre3-3ubuntu2) oneiric; urgency=low +++ +++ * Merge debian packaging r491 from openjdk-6: +++ - Move the -lib files into a different location so that the java-7-openjdk +++ name can be used as a symlink. +++ - Symlink the jre/cmm directory, instead of the files inside. Closes: #639883. +++ +++ -- Matthias Klose Thu, 01 Sep 2011 21:08:45 +0200 +++ +++openjdk-7 (7~b147-2.0~pre3-3ubuntu1) oneiric; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Sun, 28 Aug 2011 23:42:18 +0200 +++ +++openjdk-7 (7~b147-2.0~pre3-3) experimental; urgency=low +++ +++ * Merge debian packaging r485:489 from openjdk-6: +++ - Build using GCC-4.4 on sparc and sparc64. +++ - Enable testsuite runs in s390x. +++ * Merge debian packaging r490 from openjdk-6: +++ - Set plugin name for the jinfo file. Closes: #638548, +++ - Disable the mauve testsuite on i386. +++ - Make the installation multiarch aware. +++ +++ -- Matthias Klose Sun, 28 Aug 2011 20:42:54 +0200 +++ +++openjdk-7 (7~b147-2.0~pre3-2) experimental; urgency=low +++ +++ * d/patches/jdk-no-mapfile.diff: Re-add was not merged into +++ current (e46d527097f1) revision but latter. +++ +++ -- Damien Raude-Morvan Mon, 22 Aug 2011 00:11:33 +0200 +++ +++openjdk-7 (7~b147-2.0~pre3-1) experimental; urgency=low +++ +++ * Update to IcedTea7 (20110821): +++ - JamVM updates. +++ - S7070134,S7044738,S7068051,S7073913: Fix random segfaults +++ and related invalid results from loop unroll optimization. +++ - d/patches/jdk-no-mapfile.diff: Drop, merged in icedtea7-forest. +++ +++ [ Matthias Klose ] +++ * Build using GCC-4.4 on mips/mipsel. Closes: #628620. +++ * Merge debian packaging r482:485 from openjdk-6: +++ - Call dbus-launch --exit-with-session in testsuite. Closes: #612394. +++ - Build for s390x using Zero. +++ +++ [ Damien Raude-Morvan ] +++ * d/patches/kfreebsd-support-hotspot.diff: Add workaround +++ to handle #637378. +++ * d/generate-dfsg-zip.sh: Update to also handle langtools.tar.gz. +++ Closes: #623693. +++ +++ -- Damien Raude-Morvan Sun, 21 Aug 2011 20:08:50 +0200 +++ +++openjdk-7 (7~b147-2.0~pre2-3) experimental; urgency=low +++ +++ * d/patches/kfreebsd-support-hotspot.diff: Fix access to CPU registry under +++ kfreebsd-amd64. +++ +++ -- Damien Raude-Morvan Sun, 07 Aug 2011 12:22:47 +0200 +++ +++openjdk-7 (7~b147-2.0~pre2-2) experimental; urgency=low +++ +++ * d/patches/kfreebsd-support-jamvm.diff: Add support for kfreebsd-amd64. +++ * d/patches/kfreebsd-support-hotspot.diff: Small fixes for Hotspot on +++ kfreebsd-i386. +++ * Split d/patches/hotspot-s390.diff and zero-missing-headers.diff. +++ * Re-add missing changes from last upload: +++ - patches/use-idx_t.patch: Edit upstream patch to avoid FTBFS on s390. +++ - Makefile.{am,im}: Force bootclasspath (useful when building from +++ openjdk-6). +++ +++ -- Damien Raude-Morvan Sat, 06 Aug 2011 23:50:58 +0200 +++ +++openjdk-7 (7~b147-2.0~pre2-1) experimental; urgency=low +++ +++ * Update to icedtea7-forest snapshot (20110804): +++ - d/patches/pr753.diff: drop, merged in icedtea7-forest. +++ - d/patches/pr757.diff: drop, merged in icedtea7-forest. +++ - d/patches/zero-jsr292-fixes.diff: drop, merged in icedtea7-forest. +++ - d/patches/no-compiler-path.diff: drop, now handled correctly icedtea7's +++ configure and openjdk's Makefile (by CC and CXX environment variables). +++ - Updated JamVM to the 2011-08-01 revision. +++ +++ [ Damien Raude-Morvan ] +++ * d/patches/zero-fpu-control-is-noop.diff: Remove ShouldNotCallThis from +++ os_linux_zero.cpp (fix crash under i386). +++ * d/rules: Enable support for GNU/kFreeBSD arch: +++ - d/patches/kfreebsd-support-*: Update with latest fixes. +++ - d/patches/kfreebsd-sync-issues.diff: hack to force some wait +++ until we fix sync issues. +++ - d/rules: Enable shark for GNU/kFreeBSD. +++ * d/rules: Use DEB_HOST_ARCH_CPU for jvmarch/archdir. Thanks to +++ Jérémie Koenig for patch. +++ * d/patches/jexec.diff: Update for openjdk-7. +++ * d/JB-jdk.overrides.in: Fix override for new Lintian 2.5.0 path handling. +++ * d/icedtea-7-jre-jamvm.overrides: As for others libjvm.so, we use +++ --strip-debug instead of --strip-unneeded. +++ * d/source.lintian-overrides: Drop, not used anymore in openjdk-7. +++ +++ [ Matthias Klose ] +++ * Merge debian packaging r472:482 from openjdk-6: +++ - openjdk-6-jre-headless: Depend on icedtea-6-jre-jamvm, if it's +++ the default VM. +++ - Use gcj-4.4 as the stage1 java VM on mips and mipsel. +++ - Make JamVM the default VM on Ubuntu oneiric/ARM. +++ +++ -- Matthias Klose Thu, 04 Aug 2011 11:38:01 +0200 +++ +++openjdk-7 (7~b147-2.0~pre1-1) experimental; urgency=low +++ +++ * New b147 code drop (OpenJDK7 RC1). +++ +++ [ Matthias Klose ] +++ * Fix build on sparc64. +++ * Recognize 32bit user space on sparc. +++ * Build shark using llvm-2.9. +++ +++ [ Damien Raude-Morvan ] +++ * d/patches/zero-jsr292-fixes.diff: Fixes on Zero/Shark for JSR 292 support +++ from Chris Phillips . +++ * d/generate-dfsg-zip.sh: Update for OpenJDK7 as a first step to get #623693 +++ fixed. +++ * d/patches/kfreebsd-*: WiP patches for GNU/kFreeBSD support +++ (not yet enabled by default). +++ +++ -- Matthias Klose Sun, 17 Jul 2011 16:08:51 +0200 +++ +++openjdk-7 (7~b143-2.0~pre1-2) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Tue, 12 Jul 2011 14:30:01 +0200 +++ +++openjdk-7 (7~b143-2.0~pre1-1ubuntu1) oneiric; urgency=low +++ +++ * Fix zero builds on non-ix86 architectures. +++ * Fix build on sparc. +++ * Build using jpeg8. +++ +++ -- Matthias Klose Tue, 12 Jul 2011 14:25:24 +0200 +++ +++openjdk-7 (7~b143-2.0~pre1-1) experimental; urgency=low +++ +++ [ Damien Raude-Morvan ] +++ * New b143 code drop. +++ * Drop d/patches/7031385.diff: Merged upstream. +++ * Drop d/patches/jamvm-oj7.patch: Merged upstream. +++ * Manpages are now ja_JP.UTF-8 instead of ja_JP.eucJP +++ +++ [ Matthias Klose ] +++ * Apply fix for IcedTea issue #753, #757. +++ * Update s390 hotspot build fixes. +++ * Re-enable zero on i386. +++ +++ -- Matthias Klose Sun, 10 Jul 2011 14:28:17 +0200 +++ +++openjdk-7 (7~b136-2.0~pre1-2) experimental; urgency=low +++ +++ * Disable zero on i386. +++ +++ -- Matthias Klose Sun, 29 May 2011 12:37:03 +0200 +++ +++openjdk-7 (7~b136-2.0~pre1-1ubuntu1) oneiric; urgency=low +++ +++ * Upload to oneiric. +++ +++ -- Matthias Klose Sun, 29 May 2011 07:59:01 +0200 +++ +++openjdk-7 (7~b136-2.0~pre1-1) experimental; urgency=low +++ +++ [ Matthias Klose ] +++ * Fix non-bootstrap builds. +++ * Merge debian packaging r469:472 from openjdk-6. +++ * Run jtreg tests using JamVM too. +++ * Don't run the jtreg tests with the NSS security provider enabled. +++ * Update JamVM to 20110528. +++ * Re-enable the zero build, keep the shark builds disabled. +++ +++ [ Damien Raude-Morvan ] +++ * Only apply jamvm-oj7.patch when jamvm build in enabled. +++ +++ -- Matthias Klose Sat, 28 May 2011 17:17:23 +0200 +++ +++openjdk-7 (7~b136-1.14+debian1-1) experimental; urgency=low +++ +++ * New upstream release: Icedtea 1.14. +++ - debian/patches/jamvm-oj7.patch: support new instruction +++ (JVM_FindClassFromBootLoader) in JamVM. +++ - Makefile.am: Fix some missing depends between +++ patch and extract targets. +++ * debian/patches/nonreparenting-wm.diff: Update. +++ * Replace B-D on libxalan2-java by xsltproc for bootstrapping JMVTI. +++ * Don't use GCJ_SUFFIX=4.6 for sid/wheezy/oneiric as GCJ version +++ is not homogeneous between arch. +++ * Enable JamVM support: +++ - d/control: Add B-D on libtool. +++ +++ -- Damien Raude-Morvan Thu, 26 May 2011 23:03:56 +0200 +++ +++openjdk-7 (7~b136-1.14~pre0-4) experimental; urgency=low +++ +++ * Re-add build dependency on fastjar. +++ * Fix dependency on liblcms2-2. +++ +++ -- Matthias Klose Sun, 08 May 2011 10:21:21 +0200 +++ +++openjdk-7 (7~b136-1.14~pre0-3) experimental; urgency=low +++ +++ * Fix liblcms dependency for -jre-headless package. +++ +++ -- Damien Raude-Morvan Sat, 07 May 2011 17:20:15 +0200 +++ +++openjdk-7 (7~b136-1.14~pre0-2ubuntu2) oneiric; urgency=low +++ +++ * Re-add build dependency on fastjar. +++ +++ -- Matthias Klose Sun, 08 May 2011 02:51:47 +0200 +++ +++openjdk-7 (7~b136-1.14~pre0-2) experimental; urgency=low +++ +++ * Fix build failure on i386 with GCC 4.6. +++ +++ -- Matthias Klose Fri, 06 May 2011 17:10:00 +0200 +++ +++openjdk-7 (7~b136-1.14~pre0-1) experimental; urgency=low +++ +++ [ Damien Raude-Morvan ] +++ * New b136 code drop: +++ - d/rules: Use jaxp-1_4_5-dev1.zip as jaxp-drop-zip. +++ - d/patches/icedtea-pretend-memory.diff: Refreshed. +++ +++ [ Matthias Klose ] +++ * Fix -jre-lib dependency on -jre. Closes: #624846. +++ * Add lcms configury. +++ +++ -- Matthias Klose Thu, 05 May 2011 21:08:55 +0200 +++ +++openjdk-7 (7~b130-1.14~pre0-2) experimental; urgency=low +++ +++ * Remove obsolete conflicts. Closes: #624090. +++ * Add copyright for the rewriter class. Addresses part of #623693. +++ * Lower priorities for the alternatives below these of OpenJDK 6, +++ as long as OpenJDK 7 is not yet released. +++ * Don't build HotSpot with -Werror on architectures other than amd64 +++ and i386. +++ +++ -- Matthias Klose Wed, 27 Apr 2011 23:03:45 +0200 +++ +++openjdk-7 (7~b130-1.14~pre0-1) experimental; urgency=low +++ +++ * New b130 code drop. +++ * Merge debian packaging r464:469 from openjdk-6. +++ * Do not bump the epoch, package was never uploaded to any official +++ repository. +++ +++ -- Matthias Klose Wed, 20 Apr 2011 21:46:32 +0200 +++ +++openjdk-7 (1:7~b129-1.14~pre0-1) experimental; urgency=low +++ +++ * New b129 code drop. +++ * Bump epoch to 1 and use ~ to indicate that's not openjdk-7 final relaase. +++ +++ -- Damien Raude-Morvan Mon, 14 Feb 2011 00:34:45 +0100 +++ +++openjdk-7 (7b128-1.14~pre0-1) UNRELEASED; urgency=low +++ +++ * New b128 code drop. +++ * Exclude "release" file for dh_install. +++ +++ -- Damien Raude-Morvan Mon, 07 Feb 2011 23:45:13 +0100 +++ +++openjdk-7 (7b126-1.14~pre0-1) UNRELEASED; urgency=low +++ +++ * Merge debian packaging r446:464 from openjdk-6 +++ but keep the following changes : +++ - Replace DISABLE_PRECOMPILED_HEADER=1 by USE_PRECOMPILED_HEADER=0 +++ - Use "ant, ant-optionnal" for all distrel +++ - Drop "with_hotspot" variable (only one hotspot supported by IcedTea7) +++ - Drop --enable-xrender (not supported by IcedTea7) +++ * New b125 code drop: +++ - d/rules: Use new archives by --with-*-src-zip +++ * Refresh patches: +++ - d/patches/shebang.diff: Year updated +++ - d/patches/ld-symbolic-functions.diff and +++ d/patches/no-compiler-path.diff: Changed corba generic Makefiles. +++ - d/patches/default-jvm-cfg.diff and d/patches/set-exec-name.diff: +++ Upstream merged "solaris" and "linux" java.c and java_md.c +++ * Drop patches: +++ - d/patches/too-many-args-ftbfs.diff (merged upstream) +++ - d/patches/sparc.diff (merges upstream) +++ - d/patches/hotspot-include-fixes.diff (includeDB dropped upstream) +++ +++ -- Damien Raude-Morvan Mon, 24 Jan 2011 00:18:38 +0100 +++ +++openjdk-7 (7b106~pre1-0lucid2) lucid; urgency=low +++ +++ * Build for lucid. +++ +++ -- Matthias Klose Thu, 09 Sep 2010 15:32:13 +0200 +++ +++openjdk-7 (7b106~pre1-0ubuntu2) maverick; urgency=low +++ +++ * Build openjdk-7 snapshot (7b106) +++ * Symlink timezone data. +++ * Disable shark builds, currently broken in 7b106. +++ +++ -- Matthias Klose Tue, 07 Sep 2010 04:56:48 +0200 +++ +++openjdk-7 (7b89-1.13-0ubuntu1) maverick; urgency=low +++ +++ * Update to the IcedTea 1.13 release. +++ * openjdk-7-jre: Recommend ttf-dejavu-extra. LP: #569396. +++ +++ -- Matthias Klose Fri, 30 Jul 2010 01:19:45 +0200 +++ +++openjdk-7 (7b89~pre1-0lucid3) lucid; urgency=low +++ +++ * Include docs in the -doc package. LP: #600834. +++ * Update from the IcedTea6 trunk. +++ - Plugin and netx fixes. +++ - Don't link the plugin against the libxul libraries. Closes: #576361. +++ - More plugin cpu usage fixes. Closes: #584335, #587049. +++ - Plugin: fixes AppletContext.getApplets(). +++ * Fix Vcs-Bzr location. Closes: #530883. +++ * Search for unversioned llvm-config tool. +++ * Don't set XFILESEARCHPATH and NLSPATH on startup. LP: #586641. +++ * Fix chinese font metrics and prefer using 'WenQuanYi Micro Hei' font. +++ LP: #472845. +++ * Strip libjvm.so with --strip-debug instead of --strip-unneeded. +++ LP: #574997. +++ * Fix inter-package dependencies. +++ +++ -- Matthias Klose Thu, 15 Jul 2010 18:12:17 +0200 +++ +++openjdk-7 (7b89~pre1-0lucid1) lucid; urgency=low +++ +++ [ Damien Raude-Morvan ] +++ * Merge debian packaging r403:430 from openjdk-6. +++ * Add myself to Uploaders. +++ * Build openjdk-7 snapshot (7b89) +++ * Use ant+ant-optional (IcedTea7 support ant 1.8). +++ * Merge debian packaging r431:436 from openjdk-6. +++ +++ [ Matthias Klose ] +++ * Merge debian packaging r430:445 from openjdk-6. +++ * Update debian patches to 7b89. +++ * Reenable the two stage build. +++ * Reenable building cacao. +++ * Reenable building zero. +++ +++ -- Matthias Klose Tue, 13 Jul 2010 10:32:11 +0200 +++ +++openjdk-7 (7b77-0ubuntu1~ppa1) lucid; urgency=low +++ +++ * Build openjdk-7 snapshot (7b77). +++ * Merge debian packaging r391:403 from openjdk-6. +++ +++ -- Matthias Klose Mon, 21 Dec 2009 16:58:34 +0100 +++ +++openjdk-7 (7b72-0ubuntu1~ppa1) karmic; urgency=low +++ +++ * Build openjdk-7 snapshot (7b72). +++ * Merge debian packaging r371:391 from openjdk-6. +++ * Disable the zero build for now. +++ +++ -- Matthias Klose Sat, 03 Oct 2009 16:35:27 +0200 +++ +++openjdk-7 (7b66-0ubuntu1~ppa1) karmic; urgency=low +++ +++ * Build openjdk-7 snapshot (7b66). +++ * Merge debian packaging r362:371 from openjdk-6. +++ +++ -- Matthias Klose Thu, 06 Aug 2009 12:40:00 +0200 +++ +++openjdk-7 (7b59-0ubuntu1) karmic; urgency=low +++ +++ * Reenable the build of zero. +++ * Reapply fontconfig patch. +++ * Apply icedtea-cacao-no-mmap-first-page patch. +++ +++ -- Matthias Klose Fri, 29 May 2009 10:19:26 +0200 +++ +++openjdk-7 (7b59-0ubuntu1~ppa1) karmic; urgency=low +++ +++ * Build openjdk-7 snapshot (7b59). +++ * Merge debian packaging r205:362 from openjdk-6. +++ +++ -- Matthias Klose Wed, 27 May 2009 12:09:16 +0200 +++ +++openjdk-7 (7b40-0ubuntu2) jaunty; urgency=low +++ +++ * Add build dependency on libxrender-dev. +++ * Don't use fastjar on ia64, working around a build failure. +++ * Add configury for shark builds. +++ +++ -- Matthias Klose Thu, 04 Dec 2008 16:26:15 +0100 +++ +++openjdk-7 (7b40-0ubuntu1) jaunty; urgency=low +++ +++ * Build openjdk-7 snapshot (7b40). +++ * Update packaging for openjdk-7. +++ +++ -- Matthias Klose Tue, 02 Dec 2008 14:27:03 +0100 +++ +++openjdk-6 (6b22-1.10.1-0ubuntu1) natty; urgency=low +++ +++ * IcedTea6 1.10.1 release. +++ +++ -- Matthias Klose Tue, 05 Apr 2011 12:20:36 +0200 +++ +++openjdk-6 (6b22-1.10.1~pre1-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Sat, 26 Mar 2011 10:43:49 +0100 +++ +++openjdk-6 (6b22-1.10.1~pre1-0ubuntu1) natty; urgency=low +++ +++ * Update from the IcedTea6-1.10 release branch (20110325). +++ * Add multiarch directories to the default library path. LP: #737603. +++ +++ -- Matthias Klose Fri, 25 Mar 2011 16:33:57 +0100 +++ +++openjdk-6 (6b22-1.10-3) experimental; urgency=low +++ +++ * Fix JamVM build on mips/mipsel (Robert Lougher). +++ * Re-enable the JamVM build on mips/mipsel. +++ +++ -- Matthias Klose Sun, 06 Mar 2011 15:01:54 +0100 +++ +++openjdk-6 (6b22-1.10-2) experimental; urgency=low +++ +++ * Mention that IcedTea is copyrigh GPLv2 + "CLASSPATH" EXCEPTION. +++ Closes: #611269. +++ * Don't run the jdk checks for the alternate builds (hotspot and +++ langtools checks are still run). +++ * Disable the JamVM build on mips/mipsel. +++ +++ -- Matthias Klose Sat, 05 Mar 2011 16:13:40 +0100 +++ +++openjdk-6 (6b22-1.10-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Fri, 04 Mar 2011 16:12:50 +0100 +++ +++openjdk-6 (6b22-1.10-0ubuntu2) natty; urgency=low +++ +++ * Disable the jdk tests with the Shark, JamVM and Cacao VMs. +++ +++ -- Matthias Klose Fri, 04 Mar 2011 15:32:50 +0100 +++ +++openjdk-6 (6b22-1.10-0ubuntu1) natty; urgency=low +++ +++ * IcedTea6 1.10 release. +++ +++ -- Matthias Klose Thu, 03 Mar 2011 09:32:19 +0100 +++ +++openjdk-6 (6b21~pre3-0ubuntu1) natty; urgency=low +++ +++ * Update from the IcedTea6 trunk (20110224). +++ * icedtea-6-jre-jamvm: Build JamVM as an alternative VM, +++ start with `java -jamvm'. +++ +++ -- Matthias Klose Thu, 24 Feb 2011 02:45:56 +0100 +++ +++openjdk-6 (6b21~pre2-0ubuntu1) natty; urgency=low +++ +++ * Update from the IcedTea6 trunk (20110217). +++ * Update hotspot hs20 (not yet enabled). +++ * Add ppc64 packaging bits. +++ +++ -- Matthias Klose Fri, 18 Feb 2011 15:55:41 +0100 +++ +++openjdk-6 (6b21~pre1-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Sat, 22 Jan 2011 15:34:21 +0100 +++ +++openjdk-6 (6b21~pre1-0ubuntu1) natty; urgency=low +++ +++ * Update to 6b21. +++ +++ -- Matthias Klose Sat, 22 Jan 2011 14:28:28 +0100 +++ +++openjdk-6 (6b20-1.10~pre3-0ubuntu4) natty; urgency=low +++ +++ * Fix shark build on powerpc. +++ +++ -- Matthias Klose Fri, 24 Dec 2010 11:06:32 +0100 +++ +++openjdk-6 (6b20-1.10~pre3-0ubuntu3) natty; urgency=low +++ +++ * Update from the IcedTea6 trunk (20101223). +++ +++ -- Matthias Klose Thu, 23 Dec 2010 14:27:17 +0100 +++ +++openjdk-6 (6b20-1.10~pre3-0ubuntu1) natty; urgency=low +++ +++ * Update from the IcedTea6 trunk (20101126). +++ * Update hotspot hs19. +++ * Fix build failures on ia64, s390 and sparc64. +++ +++ -- Matthias Klose Fri, 26 Nov 2010 16:38:16 +0100 +++ +++openjdk-6 (6b20-1.10~pre2-0ubuntu7~ppa1) natty; urgency=low +++ +++ * Reenable shark on amd64, but build using llvm-2.7. +++ +++ -- Matthias Klose Thu, 21 Oct 2010 23:59:30 +0200 +++ +++openjdk-6 (6b20-1.10~pre2-0ubuntu5) natty; urgency=low +++ +++ * Don't try to set up an alternative for javaws +++ +++ -- Matthias Klose Thu, 21 Oct 2010 17:38:48 +0200 +++ +++openjdk-6 (6b20-1.10~pre2-0ubuntu3) natty; urgency=low +++ +++ * Stop building zero/shark on amd64. Fails the self tests. +++ +++ -- Matthias Klose Thu, 21 Oct 2010 13:49:56 +0200 +++ +++openjdk-6 (6b20-1.10~pre2-0ubuntu2) natty; urgency=low +++ +++ * Don't include OpenJDK's javaws either. +++ * openjdk-6-jre: Recommend icedtea-netx. +++ +++ -- Matthias Klose Thu, 21 Oct 2010 08:34:07 +0200 +++ +++openjdk-6 (6b20-1.10~pre2-0ubuntu1) natty; urgency=low +++ +++ * Update from the IcedTea6 trunk (20101020). +++ * Remove the plugin and javaws from the packaging, removed upstream. +++ +++ -- Matthias Klose Wed, 20 Oct 2010 17:45:09 +0200 +++ +++openjdk-6 (6b20-1.10~pre1-0ubuntu2) natty; urgency=low +++ +++ * Build with hotspot 19. +++ +++ -- Matthias Klose Thu, 14 Oct 2010 11:28:38 +0200 +++ +++openjdk-6 (6b20-1.10~pre1-0ubuntu1) natty; urgency=low +++ +++ * Snapshot, taken from the IcedTea6 trunk (20101013). +++ +++ -- Matthias Klose Wed, 13 Oct 2010 08:36:44 +0200 +++ +++openjdk-6 (6b20-1.9.2-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Wed, 24 Nov 2010 05:29:43 +0100 +++ +++openjdk-6 (6b20-1.9.2-0ubuntu1) maverick-security; urgency=low +++ +++ * IcedTea6 1.9.2 release. +++ - CVE-2010-3860: Fix IcedTea System property information leak via +++ public static. +++ * Build using Hotspot hs19. +++ * Start metacity using dbus-launch, when running the testsuite. LP: #632594. +++ +++ -- Matthias Klose Sun, 21 Nov 2010 18:30:39 +0100 +++ +++openjdk-6 (6b20-1.9.1-1ubuntu3) maverick-security; urgency=low +++ +++ * Move all japanese man pages belonging to the jre into the -jre package. +++ Closes: #600765. +++ * Add -jdk replaces for -jre and -jre-headless. Closes: #600809. +++ +++ -- Matthias Klose Wed, 20 Oct 2010 12:51:34 +0200 +++ +++openjdk-6 (6b20-1.9.1-1ubuntu1) maverick-security; urgency=low +++ +++ * Fix upgrade to symlinked timezone data. Closes: #600359. +++ * Move all japanese man pages belonging to the jre into the -jre package. +++ Closes: #600765. +++ +++ -- Matthias Klose Mon, 18 Oct 2010 16:07:48 +0200 +++ +++openjdk-6 (6b20-1.9.1-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Tue, 12 Oct 2010 15:07:35 +0200 +++ +++openjdk-6 (6b20-1.9.1-0ubuntu1) maverick-security; urgency=low +++ +++ * IcedTea6 1.9.1 release. +++ - Security updates: +++ - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation. +++ - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition. +++ - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities. +++ - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free. +++ - S6938813, CVE-2010-3557: OpenJDK Swing mutable static. +++ - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information +++ leak. +++ - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability. +++ - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution. +++ - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution. +++ - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies. +++ - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe +++ reflection usage. +++ - S6623943: javax.swing.TimerQueue's thread occasionally fails to start. +++ - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows +++ receiving connections from any host. +++ - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue +++ (Http request splitting). +++ - S6952603, CVE-2010-3551: NetworkInterface reveals local network +++ address to untrusted code. +++ - S6961084, CVE-2010-3541: limit setting of some request headers in +++ HttpURLConnection. +++ - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to +++ mismatch in character counts. +++ - S6980004, CVE-2010-3573: limit HTTP request cookie headers in +++ HttpURLConnection. +++ - S6981426, CVE-2010-3574: limit use of TRACE method in +++ HttpURLConnection. +++ - Plugin fixes. +++ - Backports from newer IcedTea releases. +++ +++ -- Matthias Klose Tue, 12 Oct 2010 12:13:40 +0200 +++ +++openjdk-6 (6b20-1.9-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Tue, 07 Sep 2010 21:19:21 +0200 +++ +++openjdk-6 (6b20-1.9-0ubuntu1) maverick; urgency=low +++ +++ * IcedTea6 1.9 release. +++ +++ -- Matthias Klose Tue, 07 Sep 2010 18:13:20 +0200 +++ +++openjdk-6 (6b20~pre2-0ubuntu2) maverick; urgency=low +++ +++ * Update from the IcedTea6 trunk. +++ * Really let the build fail on armel. +++ +++ -- Matthias Klose Fri, 30 Jul 2010 16:55:38 +0200 +++ +++openjdk-6 (6b20~pre2-0ubuntu1) maverick; urgency=high +++ +++ * Update from the IcedTea6 trunk. +++ - (CVE-2010-2783): IcedTea 'Extended JNLP Services' arbitrary file access. +++ - (CVE-2010-2548): IcedTea incomplete property access check for unsigned +++ applications +++ * openjdk-6-jre: Recommend ttf-dejavu-extra. LP: #569396. +++ * Explicitely fail the build on armel. The ARM assembler interpreter is +++ disabled and would a 3-5x performance regression compared to the current +++ 6b18 armel binaries in the archive. +++ +++ -- Matthias Klose Thu, 29 Jul 2010 00:10:53 +0200 +++ +++openjdk-6 (6b20~pre1-2) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Thu, 15 Jul 2010 13:55:02 +0200 +++ +++openjdk-6 (6b20~pre1-1ubuntu1) maverick; urgency=low +++ +++ * Include docs in the -doc package. LP: #600834. +++ * Update from the IcedTea6 trunk. +++ - Plugin and netx fixes. +++ - Don't link the plugin against the libxul libraries. Closes: #576361. +++ - More plugin cpu usage fixes. Closes: #584335, #587049. +++ - Plugin: fixes AppletContext.getApplets(). +++ * Fix Vcs-Bzr location. Closes: #530883. +++ * Search for unversioned llvm-config tool. +++ * Don't set XFILESEARCHPATH and NLSPATH on startup. LP: #586641. +++ * Fix chinese font metrics and prefer using 'WenQuanYi Micro Hei' font. +++ LP: #472845. +++ * Strip libjvm.so with --strip-debug instead of --strip-unneeded. +++ LP: #574997. +++ +++ -- Matthias Klose Thu, 15 Jul 2010 12:40:10 +0200 +++ +++openjdk-6 (6b20~pre1-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Mon, 28 Jun 2010 00:50:58 +0200 +++ +++openjdk-6 (6b20~pre1-0ubuntu2) maverick; urgency=low +++ +++ * Shark & CACAO build fixes. +++ +++ -- Matthias Klose Fri, 25 Jun 2010 02:27:10 +0200 +++ +++openjdk-6 (6b20~pre1-0ubuntu1) maverick; urgency=low +++ +++ * Update to 6b20 code drop. +++ +++ -- Matthias Klose Wed, 14 Apr 2010 02:53:37 +0200 +++ +++openjdk-6 (6b18-1.8-4) unstable; urgency=low +++ +++ * Update from the 1.8 branch. +++ - Plugin and netx fixes. +++ - Don't link the plugin against the libxul libraries. Closes: #576361. +++ - More plugin cpu usage fixes. Closes: #584335, #587049. +++ - Plugin: fixes AppletContext.getApplets(). +++ - Fix race conditions in plugin initialization code that were causing +++ hangs when loading multiple applets in parallel. +++ * Fix Vcs-Bzr location. Closes: #530883. +++ * Search for unversioned llvm-config tool. +++ * Don't set XFILESEARCHPATH and NLSPATH on startup. LP: #586641. +++ * Fix chinese font metrics and prefer using 'WenQuanYi Micro Hei' font. +++ LP: #472845. +++ * Strip libjvm.so with --strip-debug instead of --strip-unneeded. +++ LP: #574997. +++ * Don't turn on the ARM assembler interpreter when building the shark +++ VM. +++ +++ -- Matthias Klose Thu, 15 Jul 2010 00:40:13 +0200 +++ +++openjdk-6 (6b18-1.8-3) unstable; urgency=low +++ +++ * Update from the 1.8 branch. +++ - Plugin fixes. LP: #597714. +++ * Add powerpcspe build fixes (Sebastian Andrzej Siewior). Closes: #586359. +++ * Work around build failure on buildds configured with low ARG_MAX +++ (Giovanni Mascellani). Closes: #575254. +++ +++ -- Matthias Klose Sun, 27 Jun 2010 10:16:27 +0200 +++ +++openjdk-6 (6b18-1.8-2ubuntu3) maverick; urgency=low +++ +++ * Update from the 1.8 branch. +++ - Plugin fixes. LP: #597714. +++ * Add powerpcspe build fixes (Sebastian Andrzej Siewior). Closes: #586359. +++ * Work around build failure on buildds configured with low ARG_MAX +++ (Giovanni Mascellani). Closes: #575254. +++ +++ -- Matthias Klose Sun, 27 Jun 2010 10:16:27 +0200 +++ +++openjdk-6 (6b18-1.8-2ubuntu2) maverick; urgency=low +++ +++ * Search for unversioned llvm-config tool. +++ +++ -- Matthias Klose Sun, 02 May 2010 12:03:01 +0200 +++ +++openjdk-6 (6b18-1.8-2ubuntu1) maverick; urgency=low +++ +++ * Upload to maverick. +++ +++ -- Matthias Klose Sun, 02 May 2010 11:23:16 +0200 +++ +++openjdk-6 (6b18-1.8-2) unstable; urgency=low +++ +++ * Update from the 1.8 branch. +++ - Fix build on Hitachi SH. Closes: #575346. +++ - Shark and Zero fixes. +++ * Build shark using llvm-2.7. +++ * Don't use shark to run the test harness when testing the shark build. +++ * README.Debian: Add paragraph about debugging the IcedTea NPPlugin. +++ +++ -- Matthias Klose Sat, 01 May 2010 12:35:19 +0200 +++ +++openjdk-6 (6b18-1.8-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Wed, 14 Apr 2010 02:53:37 +0200 +++ +++openjdk-6 (6b18-1.8-0ubuntu1) lucid; urgency=low +++ +++ * Update IcedTea6 to the icedtea6-1.8 release. +++ * Fix builds on Ubuntu/dapper and Debian/lenny. +++ * On hppa, configure --without-rhino --disable-plugin. +++ * Fix Hitachi SH configury. Closes: #575346. +++ * Start a window manager when running the tests. Prefer metacity, +++ as more tests pass with it. +++ * Let XToolkit.isTraySupported() return true, if Compiz is running. +++ Works around sun#6438179. LP: #300948. +++ * Make /jre/lib/security/nss.cfg a config file. +++ * Fail in the configuration of the packages, if /proc is not mounted. +++ java currently uses tricks to find its own shared libraries depending +++ on the path of the binary. Will be changed in OpenJDK7. Closes: #576453. +++ * Fix PR icedtea/469, testsuite failures with the NSS based security +++ provider. LP: #556549. +++ * Do not pass LD_LIBRARY_PATH from the plugin to the java process. +++ While libnss3.so gets loaded from /usr/lib, the dependent libraries +++ are loaded from MOZILLA_FIVE_HOME (See #561216 for the wrong firefox +++ config). LP: #561124. +++ Closes as well: LP: #551328, #554909, #560829, #549010, #553452. +++ * Always build shark with hs14. +++ +++ -- Matthias Klose Wed, 14 Apr 2010 01:53:33 +0200 +++ +++openjdk-6 (6b18~pre4-1ubuntu1) lucid; urgency=low +++ +++ * Build-depend on xulrunner-1.9.2-dev instead of xulrunner-dev, +++ unexpectedly demoted to universe. +++ * icedtea6-plugin: Hardcode dependency on xulrunner-1.9.2. No way +++ to do better? See #552780. +++ * Fix builds on Ubuntu hardy. +++ +++ -- Matthias Klose Wed, 31 Mar 2010 22:21:49 +0200 +++ +++openjdk-6 (6b18~pre4-1) unstable; urgency=high +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Wed, 31 Mar 2010 16:35:18 +0200 +++ +++openjdk-6 (6b18~pre4-0ubuntu2) lucid; urgency=low +++ +++ * Fix typo in NPPlugin code. LP: #552287. +++ +++ -- Matthias Klose Wed, 31 Mar 2010 10:41:11 +0200 +++ +++openjdk-6 (6b18~pre4-0ubuntu1) lucid; urgency=low +++ +++ [ Matthias Klose ] +++ * Update IcedTea6 form the 1.8 branch. +++ * SECURITY UPDATE: multiple upstream vulnerabilities. Upstream fixes: +++ - (CVE-2010-0837): JAR "unpack200" must verify input parameters (6902299). +++ - (CVE-2010-0845): No ClassCastException for HashAttributeSet constructors +++ if run with -Xcomp (6894807). +++ - (CVE-2010-0838): CMM readMabCurveData Buffer Overflow Vulnerability +++ (6899653). +++ - (CVE-2010-0082): Loader-constraint table allows arrays instead of +++ only the base-classes (6626217). +++ - (CVE-2010-0095): Subclasses of InetAddress may incorrectly interpret +++ network addresses (6893954) [ZDI-CAN-603]. +++ - (CVE-2010-0085): File TOCTOU deserialization vulnerability (6736390). +++ - (CVE-2010-0091): Unsigned applet can retrieve the dragged information +++ before drop action occurs (6887703). +++ - (CVE-2010-0088): Inflater/Deflater clone issues (6745393). +++ - (CVE-2010-0084): Policy/PolicyFile leak dynamic ProtectionDomains +++ (6633872). +++ - (CVE-2010-0092): AtomicReferenceArray causes SIGSEGV -> SEGV_MAPERR +++ error (6888149). +++ - (CVE-2010-0094): Deserialization of RMIConnectionImpl objects should +++ enforce stricter checks (6893947) [ZDI-CAN-588]. +++ - (CVE-2010-0093): System.arraycopy unable to reference elements +++ beyond Integer.MAX_VALUE bytes (6892265). +++ - (CVE-2010-0840): Applet Trusted Methods Chaining Privilege Escalation +++ Vulnerability (6904691). +++ - (CVE-2010-0848): AWT Library Invalid Index Vulnerability (6914823). +++ - (CVE-2010-0847): ImagingLib arbitrary code execution vulnerability +++ (6914866). +++ - (CVE-2009-3555): TLS: MITM attacks via session renegotiation. +++ - 6639665: ThreadGroup finalizer allows creation of false root +++ ThreadGroups. +++ - 6898622: ObjectIdentifer.equals is not capable of detecting incorrectly. +++ encoded CommonName OIDs. +++ - 6910590: Application can modify command array in ProcessBuilder. +++ - 6909597: JPEGImageReader stepX Integer Overflow Vulnerability. +++ - 6932480: Crash in CompilerThread/Parser. Unloaded array klass? +++ - 6898739: TLS renegotiation issue. +++ +++ [ Torsten Werner ] +++ * Switch off IPV6_V6ONLY for IN6_IS_ADDR_UNSPECIFIED addresses, too. +++ (Closes: #575163) +++ +++ -- Matthias Klose Wed, 31 Mar 2010 02:34:04 +0200 +++ +++openjdk-6 (6b18~pre3-1) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * Update IcedTea build infrastructure (20100321). +++ * Update support for SH4 (Nobuhiro Iwamatsu). +++ * Handle renaming of the plugin name. +++ +++ [ Torsten Werner ] +++ * Improve patch for IPv4 mapped IPv6 addresses even more. +++ (Closes: #573742) +++ +++ -- Matthias Klose Sun, 21 Mar 2010 22:52:12 +0100 +++ +++openjdk-6 (6b18~pre2-1ubuntu2) lucid; urgency=low +++ +++ * Fix build failure on ARM. +++ +++ -- Matthias Klose Fri, 12 Mar 2010 15:19:13 +0100 +++ +++openjdk-6 (6b18~pre2-1ubuntu1) lucid; urgency=low +++ +++ * Upload to lucid. +++ +++ -- Matthias Klose Wed, 10 Mar 2010 23:34:57 +0100 +++ +++openjdk-6 (6b18~pre2-1) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20100310). +++ * Disable building the plugin the plugin on alpha (borked xulrunner +++ packaging using binary indep packages). +++ * Use a two stage build on alpha. +++ * Add note about the reparenting WM workaround. Closes: #573026. +++ * Prefer Sazanami instead of Kochi for Japanese fonts (Hideki Yamane). +++ Closes: #572511. +++ * openjdk-6-doc: Don't compress package-list files. Closes: #567899. +++ +++ -- Matthias Klose Wed, 10 Mar 2010 11:19:19 +0100 +++ +++openjdk-6 (6b18~pre1-4) unstable; urgency=low +++ +++ * Improve patch for IPv4 mapped IPv6 addresses. +++ +++ -- Torsten Werner Sun, 07 Mar 2010 01:14:36 +0100 +++ +++openjdk-6 (6b18~pre1-3) unstable; urgency=low +++ +++ * Add a patch for improved handling of IPv4 mapped IPv6 addresses. +++ (Closes: #560056, #561930, #563699, #563946) +++ +++ -- Torsten Werner Tue, 02 Mar 2010 23:46:57 +0100 +++ +++openjdk-6 (6b18~pre1-2) unstable; urgency=low +++ +++ * Change Build-Depends: ant1.7-optional because of a bus error in gij. +++ +++ -- Torsten Werner Mon, 01 Mar 2010 07:17:16 +0100 +++ +++openjdk-6 (6b18~pre1-1ubuntu1) lucid; urgency=low +++ +++ * Ignore error code running ant -diagnostics. +++ * Build-depend on ant-optional. +++ * Disable the cacao build on armel, fails to build with the non +++ bootstrap build. +++ +++ -- Matthias Klose Sat, 20 Feb 2010 15:36:06 +0100 +++ +++openjdk-6 (6b18~pre1-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Fri, 19 Feb 2010 21:52:32 +0100 +++ +++openjdk-6 (6b18~pre1-0ubuntu1) lucid; urgency=low +++ +++ * New Openjdk6 b18 source code drop. +++ * Use mangled copy of rhino. Closes: #512970. LP: #255149. +++ +++ -- Matthias Klose Fri, 19 Feb 2010 18:17:23 +0100 +++ +++openjdk-6 (6b17-1.7-1ubuntu1) lucid; urgency=low +++ +++ * ARM Thumb2 updates. +++ * Test build using Hotspt hs14 on ix86. +++ +++ -- Matthias Klose Sun, 31 Jan 2010 21:56:59 +0100 +++ +++openjdk-6 (6b18~pre1-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Fri, 19 Feb 2010 21:52:32 +0100 +++ +++openjdk-6 (6b18~pre1-0ubuntu1) lucid; urgency=low +++ +++ * New Openjdk6 b18 source code drop. +++ * Use mangled copy of rhino. Closes: #512970. LP: #255149. +++ +++ -- Matthias Klose Fri, 19 Feb 2010 18:17:23 +0100 +++ +++openjdk-6 (6b17-1.7-1ubuntu1) lucid; urgency=low +++ +++ * ARM Thumb2 updates. +++ * Test build using Hotspt hs14 on ix86. +++ +++ -- Matthias Klose Sun, 31 Jan 2010 21:56:59 +0100 +++ +++openjdk-6 (6b17-1.7-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Wed, 27 Jan 2010 23:44:47 +0100 +++ +++openjdk-6 (6b17-1.7-0ubuntu1) lucid; urgency=low +++ +++ * IcedTea6 1.7 release. +++ * Don't try to load libjpeg7; still building with libjpeg62. Closes: #563999. +++ * Run the testsuite on sh4. +++ * Ubuntu only: Implement an execute bit checker for the Non-Exec Policy +++ - debian/JB-java.desktop.in: update mime handler to use new launcher. +++ * armel: Apply the thumb2 patches from the trunk, plus proposed patches +++ for the trunk. +++ +++ -- Matthias Klose Wed, 27 Jan 2010 22:48:24 +0100 +++ +++openjdk-6 (6b17-0ubuntu1) lucid; urgency=low +++ +++ * Build from the IcedTea6-1.7 branch. +++ * Don't build the plugin on sparc64. +++ * Enable the NPPlugin. +++ * Add support for SH4 (Nobuhiro Iwamatsu). +++ * Fix crash in the ARM assembler interpreter (Edward Nevill). +++ +++ -- Matthias Klose Wed, 06 Jan 2010 15:52:50 +0100 +++ +++openjdk-6 (6b17~pre3-1ubuntu2) lucid; urgency=low +++ +++ * Update IcedTea build infrastructure (20091224). +++ * Explicitely build-depend on x11-xkb-utils (xkbcomp is needed by +++ xvfb-run). +++ +++ -- Matthias Klose Thu, 24 Dec 2009 12:43:00 +0100 +++ +++openjdk-6 (6b17~pre3-1ubuntu1) lucid; urgency=low +++ +++ * Upload to lucid. +++ +++ -- Matthias Klose Fri, 18 Dec 2009 10:40:05 +0100 +++ +++openjdk-6 (6b17~pre3-1) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20091218). +++ * Install docs into the openjdk-6-jre-headless directory instead of +++ openjdk-6-jre. +++ +++ -- Matthias Klose Fri, 18 Dec 2009 10:00:08 +0100 +++ +++openjdk-6 (6b17~pre2-1ubuntu1) lucid; urgency=low +++ +++ * Update IcedTea build infrastructure (20091215). +++ * Fix cacao build on armel with current optimization defaults. +++ +++ -- Matthias Klose Tue, 15 Dec 2009 16:41:12 +0100 +++ +++openjdk-6 (6b17~pre2-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Mon, 09 Nov 2009 21:50:52 +0100 +++ +++openjdk-6 (6b17~pre2-0ubuntu3) lucid; urgency=low +++ +++ * Security updates: +++ - (CVE-2009-3728) ICC_Profile file existence detection information leak +++ (6631533). +++ - (CVE-2009-3885) BMP parsing DoS with UNC ICC links (6632445). +++ - (CVE-2009-3881) resurrected classloaders can still have children +++ (6636650). +++ - (CVE-2009-3882) Numerous static security flaws in Swing (findbugs) +++ (6657026). +++ - (CVE-2009-3883) Mutable statics in Windows PL&F (findbugs) (6657138). +++ - (CVE-2009-3880) UI logging information leakage (6664512). +++ - (CVE-2009-3879) GraphicsConfiguration information leak (6822057). +++ - (CVE-2009-3884) zoneinfo file existence information leak (6824265). +++ - (CVE-2009-2409) deprecate MD2 in SSL cert validation (Kaminsky) (6861062). +++ - (CVE-2009-3873) JPEG Image Writer quantization problem (6862968). +++ - (CVE-2009-3875) MessageDigest.isEqual introduces timing attack +++ vulnerabilities (6863503). +++ - (CVE-2009-3876, CVE-2009-3877) OpenJDK ASN.1/DER input stream parser +++ denial of service (6864911). +++ - (CVE-2009-3869) JRE AWT setDifflCM stack overflow (6872357). +++ - (CVE-2009-3874) ImageI/O JPEG heap overflow (6874643. +++ - (CVE-2009-3871) JRE AWT setBytePixels heap overflow (6872358). +++ * Update IcedTea build infrastructure (20091109). +++ * Use hs16 on armel. +++ +++ -- Matthias Klose Mon, 09 Nov 2009 17:48:43 +0100 +++ +++openjdk-6 (6b17~pre2-0ubuntu2) lucid; urgency=low +++ +++ * Don't use hs16 on armel and sparc. +++ +++ -- Matthias Klose Mon, 02 Nov 2009 15:33:00 +0100 +++ +++openjdk-6 (6b17~pre2-0ubuntu1) lucid; urgency=low +++ +++ * New code drop (b17). +++ * Bump hotspot to hs16. +++ * Update IcedTea build infrastructure (20091031). +++ * Set priority of default -jre and -jdk packages to optional. +++ * Fix binary-all to binary-any dependencies. Closes: #550680. +++ +++ -- Matthias Klose Sat, 31 Oct 2009 19:30:54 +0100 +++ +++openjdk-6 (6b16-1.6.1-2) unstable; urgency=medium +++ +++ * Build-depend on xulrunner-dev (>= 1.9.1.3-3). +++ +++ -- Matthias Klose Sun, 11 Oct 2009 21:34:48 +0200 +++ +++openjdk-6 (6b16-1.6.1-1ubuntu3) karmic; urgency=low +++ +++ [Matthias Klose] +++ * On armel and powerpc, build an additional VM using shark in the +++ openjdk-6-jre-zero package (java -shark ). Requires llvm-2.6. +++ * Hide the desktop menu entry for WebStart. LP: #222180. +++ * Don't provide java-virtual-machine anymore. +++ +++ [Edward Nevill] +++ * Avoid stack overflows in the arm interpreter. +++ +++ -- Matthias Klose Thu, 08 Oct 2009 12:41:46 +0200 +++ +++openjdk-6 (6b16-1.6.1-1ubuntu2) karmic; urgency=low +++ +++ * Support PKCS11 cryptography via NSS, now allowing import of all +++ certificates from ca-certificates. +++ * Remove Michael Koch from uploaders, request by himself. +++ * Add the doc dir symlink for openjdk-6-jre-zero when the package +++ is built with shark support. +++ +++ -- Matthias Klose Mon, 28 Sep 2009 21:55:08 +0200 +++ +++openjdk-6 (6b16-1.6.1-1ubuntu1) karmic; urgency=low +++ +++ * Fix dependency on the java bridge packages. +++ * debian/rules: Conditionalize stuff so that the recent release +++ is never mentioned. +++ * Remove obsolete patches in debian/patches. +++ * Rebuild on armel to fix up libffi for the soft float abi. +++ * For jaunty builds, fix IcedTeaPlugin failure to start with xulrunner 1.9.1 +++ (LP: #359407). +++ - debian/patches/icedtea-plugin-use-runtime-nsIProcess-IID.diff: Add. +++ - debian/rules: Apply it for jaunty builds. +++ * Use pulseaudio as default serviceprovider for +++ javax.sound.midi.MidiSystem and javax.sound.sampled.AudioSystem. +++ LP: #407299. +++ +++ -- Matthias Klose Sat, 26 Sep 2009 16:01:48 +0200 +++ +++openjdk-6 (6b16-1.6.1-1) unstable; urgency=low +++ +++ * Upload to Debian unstable. +++ +++ -- Matthias Klose Tue, 15 Sep 2009 02:17:03 +0200 +++ +++openjdk-6 (6b16-1.6.1-0ubuntu1) karmic; urgency=low +++ +++ * Update IcedTea6 to the 1.6.1 release. +++ * Work around GCC PR target/41327, build the JDK on s390 with -O2. +++ +++ -- Matthias Klose Thu, 10 Sep 2009 01:55:08 +0200 +++ +++openjdk-6 (6b16-1.6-1) unstable; urgency=low +++ +++ * Update IcedTea6 to the 1.6 release. +++ * Fix GCC build dependencies. +++ +++ -- Matthias Klose Wed, 09 Sep 2009 22:18:38 +0200 +++ +++openjdk-6 (6b16-1.6~pre2-1) unstable; urgency=low +++ +++ * Upload to unstable. +++ +++ -- Matthias Klose Fri, 28 Aug 2009 19:04:31 +0200 +++ +++openjdk-6 (6b16-1.6~pre2-0ubuntu1) karmic; urgency=low +++ +++ * Update IcedTea from the 1.6 release branch: +++ - Fix buffer overflow in debugger's socket handler (Kees Cook). +++ https://bugs.openjdk.java.net/show_bug.cgi?id=100103. LP: #409736. +++ - plugin fixes. +++ * Move the pulseaudio recommendation to a suggestion, don't build-depend +++ on pulseaudio. Closes: #539394. LP: #361408. +++ * Build for armv6 (on armel). +++ +++ [ Kees Cook ] +++ * debian/rules: Re-enable fortification and stack protector +++ (LP: #330713). +++ * Adding stack markings to the x86 assembly for not using executable +++ stack. LP: #419018. +++ +++ -- Matthias Klose Fri, 28 Aug 2009 18:51:34 +0200 +++ +++openjdk-6 (6b16-1.6~pre1-0ubuntu1) karmic; urgency=low +++ +++ * Test build (icedtea6-1.6 release branch). +++ +++ -- Matthias Klose Fri, 21 Aug 2009 19:44:42 +0200 +++ +++openjdk-6 (6b16~pre5-0ubuntu2) karmic; urgency=low +++ +++ * Add explicit build dependency on libgtk2.0-dev. +++ +++ -- Matthias Klose Thu, 06 Aug 2009 11:39:14 +0200 +++ +++openjdk-6 (6b16~pre5-0ubuntu1) karmic; urgency=low +++ +++ * Bump hotspot to hs14b16. +++ * Update IcedTea build infrastructure (20090805). +++ * patches/java-access-bridge-security.patch: Update. +++ * Build-depend on xulrunner-dev instead of xulrunner-1.9-dev on karmic. +++ * Don't recommend the jck fonts anymore, just suggest them; the appropriate +++ fonts are installed as dependencies of the language packs. +++ +++ -- Matthias Klose Thu, 06 Aug 2009 10:27:09 +0200 +++ +++openjdk-6 (6b16~pre4-0ubuntu7) karmic; urgency=low +++ +++ * Build using GCC-4.4 on sparc as well, require 4.4.1. +++ +++ -- Matthias Klose Thu, 23 Jul 2009 18:23:14 +0200 +++ +++openjdk-6 (6b16~pre4-0ubuntu6) karmic; urgency=low +++ +++ * Fix build failure building the zero VM. +++ +++ -- Matthias Klose Thu, 16 Jul 2009 09:49:36 -0400 +++ +++openjdk-6 (6b16~pre4-0ubuntu5) karmic; urgency=low +++ +++ [Matthias Klose] +++ * Update IcedTea build infrastructure (20090715). +++ * Tighten build dependency on llvm-dev. +++ +++ [Edward Nevill] +++ * Add armv4 compatibility. +++ +++ -- Matthias Klose Wed, 15 Jul 2009 15:40:44 -0400 +++ +++openjdk-6 (6b16~pre4-0ubuntu4) karmic; urgency=low +++ +++ [Edward Nevill] +++ * Added Bytecode Interpreter Generator. +++ * Added ARM templates for above. +++ * Removed old optimised ARM assebler. +++ * Added -g0 because of problems with ld linking -g. +++ * Changed alignment to 64 now that as bug is fixed. +++ +++ [Matthias Klose] +++ * Update IcedTea build infrastructure (20090710). +++ * Let the -jre package depend on the access-bridge package, not the +++ -jre-headless package. LP: #395074. +++ * Suggested by Ed Nevill: +++ - Pass -timeout:3 when running the jtreg testsuite on zero architectures. +++ - Pass -Xmx256M -vmoption:-Xmx256M on armel for the jtreg testsuite run. +++ * Tighten build dependency on llvm-dev. +++ +++ -- Matthias Klose Fri, 03 Jul 2009 18:32:50 +0200 +++ +++openjdk-6 (6b16~pre4-0ubuntu3) karmic; urgency=low +++ +++ * Update zero-port-opt patch on armel. +++ +++ -- Matthias Klose Wed, 24 Jun 2009 10:48:48 +0200 +++ +++openjdk-6 (6b16~pre4-0ubuntu2) karmic; urgency=low +++ +++ * Update IcedTea build infrastructure (20090623). +++ * Reapply the zero-port-opt patch on armel. +++ * Do not use the IPA Mona font family by default. Closes: #521233. +++ * Build cacao with -fno-strict-aliasing. +++ +++ -- Matthias Klose Tue, 23 Jun 2009 16:23:38 +0200 +++ +++openjdk-6 (6b16-4) unstable; urgency=medium +++ +++ * Build the zero binary package when building with shark. +++ * Build-depend on cpio. Closes: #532963. +++ +++ -- Matthias Klose Tue, 16 Jun 2009 07:52:19 +0200 +++ +++openjdk-6 (6b16-3) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20090612). +++ * Install the libaccess-bridge-java* symlinks again. +++ * Build zero on ix86 architectures with JIT support (shark). To use the zero +++ build without shark, use the `-Xint' option to operate in interpreted-only +++ mode. +++ +++ -- Matthias Klose Fri, 12 Jun 2009 17:31:34 +0200 +++ +++openjdk-6 (6b16-2) unstable; urgency=low +++ +++ * Don't install libaccess-bridge-java* symlinks until +++ libaccess-bridge-java-jni is available on all architectures. +++ * Add missing build dependency on cacao-source. +++ +++ -- Matthias Klose Mon, 18 May 2009 14:02:59 +0200 +++ +++openjdk-6 (6b16-1) unstable; urgency=low +++ +++ * Upload to unstable, based in 6b16 and IcedTea 1.5. +++ +++ -- Matthias Klose Sun, 17 May 2009 23:02:46 +0200 +++ +++openjdk-6 (6b16~pre3-0ubuntu1) karmic; urgency=low +++ +++ * Update to hotspot hs14b15. +++ * Provide symlink for libjava-access-bridge-jni.so. LP: #375347. +++ +++ -- Matthias Klose Fri, 15 May 2009 00:41:24 +0200 +++ +++openjdk-6 (6b16~pre2-0ubuntu3) karmic; urgency=low +++ +++ * Update IcedTea build infrastructure (20090513). +++ * Fix build failure when xvfb-run doesn't work, trying to access a +++ non-existing directory. +++ +++ -- Matthias Klose Wed, 13 May 2009 23:01:23 +0200 +++ +++openjdk-6 (6b16~pre2-0ubuntu2) karmic; urgency=low +++ +++ * Add libffi-dev as architecture independent build dependency. +++ +++ -- Matthias Klose Mon, 11 May 2009 08:41:42 +0200 +++ +++openjdk-6 (6b16~pre2-0ubuntu1) karmic; urgency=low +++ +++ * Update to re-tagged code drop (b16). +++ * Update IcedTea build infrastructure (20090510). +++ * Remove patches integrated in IcedTea. +++ * Remove GCJ Web Plugin support. +++ * Remove build infrastructure to build additional VM's, integrated +++ in IcedTea. +++ * Stop building the openjdk-6-source-files package. +++ * README.Debian: Document using the different VM's. +++ * Use GCC-4.3 on sparc, ICE with GCC-4.4. +++ * Fix problem with the ARM assembler interpreter, when executing a 'new' +++ bytecode with a double on the top of the stack (Edward Nevill). +++ * Run the testsuite for the zero build on ix86 architectures. +++ +++ -- Matthias Klose Sun, 10 May 2009 23:37:42 +0200 +++ +++openjdk-6 (6b16~pre1-0ubuntu1) karmic; urgency=low +++ +++ * New code drop (b16). +++ * Update IcedTea build infrastructure (20090429). +++ * Merge changes from 6b14-1.4.1. +++ * Fix section names (using the java section). +++ * Remove all UTF-8 sequence definitions from the font configuration. +++ +++ -- Matthias Klose Wed, 29 Apr 2009 11:33:07 +0200 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu9) jaunty; urgency=low +++ +++ * Reenable the testsuite (revert the change in last upload). +++ * Apply fix for the ARM bytecode interpreter (Edward Nevill). +++ +++ -- Matthias Klose Sat, 18 Apr 2009 11:24:27 +0200 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu7) jaunty; urgency=low +++ +++ * Don't use some indian fonts with diverging font metrics for the +++ latin-1.UTF-8 encoding. LP: #289784. +++ * Disable running the testsuite for this build (no code changes compared +++ to the previous upload). +++ +++ -- Matthias Klose Tue, 14 Apr 2009 11:46:25 +0200 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu6) jaunty; urgency=low +++ +++ * Fix native2ascii jdk test case, which let the jdk testsuite fail. +++ +++ -- Matthias Klose Fri, 10 Apr 2009 11:58:44 +0200 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu5) jaunty; urgency=low +++ +++ [Matthias Klose] +++ * Update to the final CACAO 0.99.4 release. +++ * Security Vulnerability Fixes for OpenJDK: +++ - 6522586: Enforce limits on Font creation. +++ - 6536193: flaw in UTF8XmlOutput. +++ - 6610888: Potential use of cleared of incorrect acc in JMX Monitor. +++ - 6610896: JMX Monitor handles thread groups incorrectly. +++ - 6630639: lightweight HttpServer leaks file descriptors on no-data +++ connections. +++ - 6632886: Font.createFont can be persuaded to leak temporary files. +++ - 6636360: compiler/6595044/Main.java test fails with 64bit java on +++ solaris-sparcv9 with SIGSEGV. +++ - 6652463: MediaSize constructors allow to redefine the mapping of +++ standard MediaSizeName values. +++ - 6652929: Font.createFont(int,File) trusts File.getPath. +++ - 6656633: getNotificationInfo methods static mutable (findbugs). +++ - 6658158: Mutable statics in SAAJ (findbugs). +++ - 6658163: txw2.DatatypeWriter.BUILDIN is a mutable static (findbugs). +++ - 6691246: Thread context class loader can be set using JMX remote +++ ClientNotifForwarded. +++ - 6717680: LdapCtx does not close the connection if initialization fails. +++ - 6721651: Security problem with out-of-the-box management. +++ - 6737315: LDAP serialized data vulnerability. +++ - 6792554: Java JAR Pack200 header checks are insufficent. +++ - 6804996: JWS PNG Decoding Integer Overflow [V-flrhat2ln8]. +++ - 6804997: JWS GIF Decoding Heap Corruption [V-r687oxuocp]. +++ - 6804998: JRE GIF Decoding Heap Corruption [V-y6g5jlm8e1]. +++ * Add security patch for the lcms library. +++ * Add accessibility patches java-access-bridge-security.patch and +++ accessible-toolkit.patch. +++ * Merge fixes for testsuite failures from the IcedTea6 branch. +++ * Merge the proxy support for the plugin from the IcedTea6 branch. +++ * Merge http://icedtea.classpath.org/hg/release/icedtea6-1.4.1/rev/546ef0cdee06 +++ (TJ). LP: #344705. +++ * Add a Xb-Npp-Description for the IcedTea plugin. LP: #272010. +++ +++ [Edward Nevill] +++ * Put VFP back in - selects VFP / novfp autmatically +++ * More assembler optimisations +++ +++ -- Matthias Klose Thu, 09 Apr 2009 14:14:12 +0200 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu4) jaunty; urgency=low +++ +++ * Disable the additional zero JVM on sparc. +++ * patches/hotspot/default/icedtea-includedb.patch: Add missing include in +++ openjdk/hotspot/src/share/vm/includeDB_core. +++ * Fix build failure of the zero VM on lpia with a fixed GCC. +++ +++ -- Matthias Klose Fri, 13 Mar 2009 16:39:27 +0100 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu3) jaunty; urgency=low +++ +++ * Build the Zero/Shark VM as an additional JVM (call as `java -zero'). +++ +++ -- Matthias Klose Sat, 07 Mar 2009 20:54:28 +0100 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu2) jaunty; urgency=low +++ +++ * Fix zero-port-opt patching (build failure on armel). +++ +++ -- Matthias Klose Thu, 05 Mar 2009 18:19:18 +0100 +++ +++openjdk-6 (6b14-1.4.1-0ubuntu1) jaunty; urgency=low +++ +++ * Update IcedTea to the 1.4.1 release. +++ * Build the Cacao VM as an additional JVM (call as `java -cacao'). +++ * Build in separate build directory. +++ +++ -- Matthias Klose Thu, 05 Mar 2009 15:16:02 +0100 +++ +++openjdk-6 (6b14-1.5~pre1-5) unstable; urgency=low +++ +++ * Fix build failure on armel. +++ * Require the final cacao-0.99.4 release. +++ * Add /usr/lib/jni to the library path. Closes: #517338. +++ +++ -- Matthias Klose Tue, 17 Mar 2009 09:37:20 +0100 +++ +++openjdk-6 (6b14-1.5~pre1-4) unstable; urgency=low +++ +++ * Disable the additional zero JVM on sparc. +++ * Fix casts in hotspot on s390. Closes: #518823. +++ * Add special flags for javac on s390 to work around a VM problem with bad +++ code generation during inlining. +++ * Run the testsuites for the default VM on all architectures. +++ * Update IcedTea (20090314). +++ +++ -- Matthias Klose Sat, 14 Mar 2009 18:29:49 +0100 +++ +++openjdk-6 (6b14-1.5~pre1-3) unstable; urgency=low +++ +++ * Don't configure the additional zero JVM with --enable-shark, currently +++ fails to build. +++ * Don't build the JDK when building the additional zero JVM. +++ +++ -- Matthias Klose Sat, 07 Mar 2009 21:11:16 +0100 +++ +++openjdk-6 (6b14-1.5~pre1-2) experimental; urgency=low +++ +++ * Build the Zero/Shark VM as an additional JVM (call as `java -zero'). +++ +++ -- Matthias Klose Fri, 06 Mar 2009 11:16:07 +0100 +++ +++openjdk-6 (6b14-1.5~pre1-0ubuntu1) jaunty; urgency=low +++ +++ * Update hotspot to 14.0-b10. +++ * Update IcedTea (20090305). +++ * Build the Cacao VM as an additional JVM (call as `java -cacao'). +++ * Build in separate build directory. +++ +++ -- Matthias Klose Thu, 05 Mar 2009 15:16:02 +0100 +++ +++openjdk-6 (6b14-0ubuntu17) jaunty; urgency=low +++ +++ [ Edward Nevill ] +++ * Remove VFP from asm loop +++ * Disble the mauve testsuite for armel. +++ +++ [Matthias Klose] +++ * Update IcedTea (20090302). +++ +++ -- Matthias Klose Mon, 02 Mar 2009 16:18:01 +0100 +++ +++openjdk-6 (6b14-0ubuntu16) jaunty; urgency=low +++ +++ * Regenerate auto files. +++ +++ -- Matthias Klose Wed, 18 Feb 2009 15:20:10 +0100 +++ +++openjdk-6 (6b14-0ubuntu15) jaunty; urgency=low +++ +++ [ Edward Nevill ] +++ * Added ARM assembler interpreter loop +++ * mauve and jtreg removed again for alpha release +++ +++ [Matthias Klose] +++ * Update IcedTea (20090218). +++ +++ -- Matthias Klose Wed, 18 Feb 2009 13:35:02 +0100 +++ +++openjdk-6 (6b14-0ubuntu14) jaunty; urgency=low +++ +++ * Configure with --disable-nio2 on armel as well. +++ +++ -- Matthias Klose Fri, 13 Feb 2009 10:13:55 +0100 +++ +++openjdk-6 (6b14-0ubuntu13) jaunty; urgency=low +++ +++ * Really configure with --disable-nio2. +++ +++ -- Matthias Klose Thu, 12 Feb 2009 17:26:43 +0100 +++ +++openjdk-6 (6b14-0ubuntu12) jaunty; urgency=low +++ +++ * Configure with --disable-nio2. +++ * Run mauve and jtreg testsuites on armel. +++ +++ -- Matthias Klose Wed, 11 Feb 2009 13:00:15 +0100 +++ +++openjdk-6 (6b14-0ubuntu11) jaunty; urgency=low +++ +++ [Edward Nevill] +++ * Performance improvements for the zero build (currently applied +++ on armel only). +++ +++ [Matthias Klose] +++ * Update IcedTea (20090210). +++ +++ -- Matthias Klose Tue, 10 Feb 2009 15:29:22 +0100 +++ +++openjdk-6 (6b14-0ubuntu10) jaunty; urgency=low +++ +++ * Explicitely remove PulseAudioMuteControl.java. +++ +++ -- Matthias Klose Mon, 26 Jan 2009 22:09:21 +0100 +++ +++openjdk-6 (6b14-0ubuntu9.1) jaunty; urgency=low +++ +++ * Test build. +++ +++ -- Matthias Klose Sun, 25 Jan 2009 17:03:51 +0100 +++ +++openjdk-6 (6b14-0ubuntu9) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20090125). +++ * Run the jtreg testsuite for cacao builds, save all test logs. +++ +++ -- Matthias Klose Sun, 25 Jan 2009 15:40:52 +0100 +++ +++openjdk-6 (6b14-0ubuntu8) jaunty; urgency=low +++ +++ * Fix merge error, don't apply patches twice. +++ +++ -- Matthias Klose Mon, 19 Jan 2009 01:15:19 +0100 +++ +++openjdk-6 (6b14-0ubuntu7) jaunty; urgency=low +++ +++ * debian/rules: Call dh_desktop. LP: #309999. +++ * Add dependency on libjpeg62 for the -headless package. LP: #318383. +++ * Test some jtreg tests which fail in samevm mode in a separate VM. +++ * Build all with -fno-stack-protector -U_FORTIFY_SOURCE. +++ * Include jtr files of failed tests in the -jdk package. +++ +++ -- Matthias Klose Mon, 19 Jan 2009 00:23:22 +0100 +++ +++openjdk-6 (6b14-0ubuntu6) jaunty; urgency=low +++ +++ * The -source package now contains all source files. Closes: #504568. +++ * The 6b14 build fixes the following security related issues (sun bug number, +++ CVE, description): +++ - 6588160, CVE-2008-5348: jaas krb5 client leaks OS-level UDP sockets. +++ - 6497740, CVE-2009-5349: Limit the size of RSA public keys. +++ - 6484091, CVE-2008-5350: FileSystemView leaks directory info. +++ - 4486841, CVE-2008-5351: UTF-8 decoder needed adhere to Unicode 3.0.1 +++ fixes. +++ - 6755943, CVE-2008-5352: JAR decompression should enforce stricter header +++ checks. +++ - 6734167, CVE-2008-5353: Calendar.readObject allows elevation of +++ privileges. +++ - 6733959, CVE-2008-5354: Insufficient checks for "Main-Class" manifest +++ entry in JAR files +++ - 6751322, CVE-2008-5356: Sun Java JRE TrueType Font Parsing Heap Overflow. +++ - 6733336, CVE-2008-5357: Crash on malformed font. +++ - 6766136, CVE-2008-5358: corrupted gif image may cause crash in java +++ splashscreen library. +++ - 6726779, CVE-2008-5359: ConvolveOp on USHORT raster can cause the JVM +++ crash. +++ - 6721753, CVE-2008-5360: File.createTempFile produces guessable file names. +++ - 6592792: Add com.sun.xml.internal to the "package.access" property in +++ $JAVA_HOME/lib/security/java.security. +++ * Regenerate the control file. +++ +++ -- Matthias Klose Tue, 13 Jan 2009 15:04:36 +0100 +++ +++openjdk-6 (6b14-0ubuntu2~ppa1) intrepid; urgency=low +++ +++ * Upload to the OpenJDK PPA for intrepid. +++ +++ -- Matthias Klose Tue, 13 Jan 2009 13:28:38 +0100 +++ +++openjdk-6 (6b14-0ubuntu5) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20090113). +++ * Rebuild with updated nss/nspr packages. +++ * Update debug patches. +++ * debian/patches/nonreparenting-wm.diff: If the _JAVA_AWT_WM_NONREPARENTING +++ environment variable is set, disable all workarounds causing blank windows +++ in non-reparentizing window managers (Bernhard R. Link). Closes: #508650. +++ * Fix location of plugin for Debian. Closes: #505726. +++ * Let the -jdk package provide java-compiler. Closes: #507641. +++ +++ -- Matthias Klose Tue, 13 Jan 2009 10:18:44 +0100 +++ +++openjdk-6 (6b14-0ubuntu4) jaunty; urgency=low +++ +++ * Use a default jvm.cfg not only for java, but for all jdk tools. +++ LP: #288616. +++ * Update IcedTea build infrastructure (20081223). +++ +++ -- Matthias Klose Tue, 23 Dec 2008 09:24:23 +0100 +++ +++openjdk-6 (6b14-0ubuntu3) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20081217). +++ * Add support for PARISC. +++ * Use a default jvm.cfg if the jvm.cfg doesn't yet exist after unpacking +++ the runtime package. LP: #288616. +++ +++ -- Matthias Klose Wed, 17 Dec 2008 09:58:26 +0100 +++ +++openjdk-6 (6b14~pre1-0ubuntu2) jaunty; urgency=low +++ +++ * Install hotspot tarball in -source-files package. +++ * Fix build failure on sparc. +++ +++ -- Matthias Klose Fri, 05 Dec 2008 09:43:51 +0100 +++ +++openjdk-6 (6b14~pre1-0ubuntu1) jaunty; urgency=low +++ +++ * New code drop (b14). +++ * Update IcedTea build infrastructure (20081204). +++ +++ -- Matthias Klose Thu, 04 Dec 2008 11:40:56 +0100 +++ +++openjdk-6 (6b13~pre2-0ubuntu2) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20081203). +++ - Fix build failures on zero based architectures. +++ * Add build dependency on libxrender-dev. +++ * Don't use fastjar on ia64, working around a build failure. +++ +++ -- Matthias Klose Wed, 03 Dec 2008 18:43:23 +0100 +++ +++openjdk-6 (6b13~pre2-0ubuntu1) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20081202). +++ - Add Dec 3 OpenJDK security patches +++ * Build with --with-hotspot-build, update patches for this config. +++ +++ -- Matthias Klose Wed, 03 Dec 2008 01:05:54 +0100 +++ +++openjdk-6 (6b13~pre1-0ubuntu4) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20081122). +++ - Fixes for the IcedTeaPlugin. LP: #300254. +++ +++ -- Matthias Klose Sat, 22 Nov 2008 10:42:10 +0100 +++ +++openjdk-6 (6b13~pre1-0ubuntu3) jaunty; urgency=low +++ +++ * Fix versioned conflict on icedtea-gcjwebplugin. LP: #284299. +++ * Update IcedTea build infrastructure (20081121). +++ - Fixes for the IcedTeaPlugin. +++ * Configure with pulseaudio in jaunty. +++ +++ -- Matthias Klose Fri, 21 Nov 2008 07:46:10 +0100 +++ +++openjdk-6 (6b13~pre1-0ubuntu2) jaunty; urgency=low +++ +++ * Update IcedTea build infrastructure (20081117). +++ * Use openjdk-6 as stage1 compiler on armel for a faster build. +++ +++ -- Matthias Klose Mon, 17 Nov 2008 18:43:17 +0100 +++ +++openjdk-6 (6b13~pre1-0ubuntu1) jaunty; urgency=low +++ +++ * New code drop (b13). +++ - In the langtools area, besides a few miscellaneous bug fixes (6760834, +++ 6725036, 6657499), all the langtools regression tests now pass out of +++ the box (6728697, 6707027) and if using the most recent version of +++ jtreg, the langtools regression tests can be run in the much faster +++ "same vm" mode of jtreg, enabled with the -s option (6749967, 6748541, +++ 6748546, 6748601, 6759775, 6759795, 6759796, 6759996, 6760805, 6760930). +++ - Gervill update, including applying a patch from IcedTea (6758986, +++ 6748247, 6748251). +++ - Publishing a few dozen additional existing regression tests as open +++ source (6601457, 6759433, 6740185). +++ - JMX and monitoring fixes (6651382, 6616825, 6756202, 6754672). +++ - Man page updates (6757036, 6392810, 6504867, 6326773). +++ - Assorted other fixes (6746055, 6621697, 6756569, 6356642, 6761678). +++ * Update IcedTea build infrastructure (20081111). +++ - Fix freeze in midi app, LP: #275672. +++ - Fixes in the IcedTeaPlugin: LP: #282570, LP: #282570, LP: #285729, +++ LP: #291377, LP: #37330, LP: #239533. +++ - Fix vertical text metrics with freetype scaler. LP: #289784. +++ * Build-depend on ecj-gcj instead of ecj on architectures using +++ gij/gcj as the bootstrap system. +++ * Fixed in 6b12: Stack overflow running Kea. LP: #244731. +++ +++ -- Matthias Klose Tue, 11 Nov 2008 12:39:16 +0100 +++ +++openjdk-6 (6b12-1~exp1) experimental; urgency=low +++ +++ * Update IcedTea build infrastructure (20081025). +++ +++ -- Matthias Klose Sat, 25 Oct 2008 23:35:14 +0200 +++ +++openjdk-6 (6b12-0ubuntu6) intrepid; urgency=low +++ +++ * Make the dependency on ca-certificates-java unversioned. +++ * Merge from IcedTea: +++ - plugin/icedtea/netscape/javascript/JSObject.java: Make +++ long constructor public. +++ +++ -- Matthias Klose Fri, 24 Oct 2008 23:06:32 +0200 +++ +++openjdk-6 (6b12-0ubuntu5) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081024). +++ - Add --pkgversion= configure option. +++ - IcedTeaPlugin fixes. +++ - Fix xjc regressions. +++ * openjdk-jre-headless: Depend on ca-certificates-java. +++ * Configure with --pkgversion= to encode the package +++ version in the -version output and in vm dumps. +++ * cacao: Handle VM options Xverify:all and Xverify:none. +++ +++ -- Matthias Klose Fri, 24 Oct 2008 13:39:29 +0200 +++ +++openjdk-6 (6b12-0) experimental; urgency=low +++ +++ * Upload to experimental. +++ * Pretend the availability of at least 384MB RAM; better swap on the +++ buildds than failing the build. +++ +++ -- Matthias Klose Sun, 19 Oct 2008 11:15:28 +0200 +++ +++openjdk-6 (6b12-0ubuntu4) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081019). +++ - plugin fix (Make applet size factors doubles instead of ints). +++ * Don't fail the build when the jtreg summary is missing. +++ * openjdk-6-source-files: Fix priority and section of the binary package. +++ * Fix section of the plugin package. +++ +++ -- Matthias Klose Sun, 19 Oct 2008 09:29:03 +0200 +++ +++openjdk-6 (6b12-0ubuntu3) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081018). +++ - Fix LiveConnect issues in the web plugin. LP: #282762. +++ - Fail the build, if patches don't apply. +++ * Show xvfb and xauth failures in the build log, when running the testsuites. +++ * Kill processes which still hang after running the testsuite. Closes: #493339. +++ * Run the testsuite in parallel, reducing build time. +++ * openjdk-headless: Depend instead of recommending tzdata-java. +++ +++ -- Matthias Klose Sat, 18 Oct 2008 17:15:14 +0200 +++ +++openjdk-6 (6b12-0ubuntu2) intrepid; urgency=low +++ +++ * icedtea6-plugin: Versioned conflict with icedtea-gcjwebplugin. LP: #184299. +++ * Don't configure --with-alt-jar=/usr/bin/fastjar on hotspot archs +++ and cacao builds. Working around a problem generating rt.jar. Manually +++ add the netscape/javascript files in zero builds. +++ * Update IcedTea build infrastructure (20081017). +++ - configury updates. +++ - IcedTeaPlugin update. +++ * openjdk-6-jdk: Suggest visualvm. +++ * Remove cacao patches found in cacao 0.99.4~20081012. +++ +++ -- Matthias Klose Fri, 17 Oct 2008 13:25:45 +0200 +++ +++openjdk-6 (6b12-0ubuntu1) intrepid; urgency=low +++ +++ * Update IcedTea to the 1.3.0 release. +++ * Apply upstream patch to fix upstream issue 6758986. +++ +++ -- Matthias Klose Wed, 15 Oct 2008 19:49:05 +0000 +++ +++openjdk-6 (6b12~pre2-1) experimental; urgency=low +++ +++ * Upload to experimental. +++ +++ -- Matthias Klose Sun, 12 Oct 2008 11:16:03 +0000 +++ +++openjdk-6 (6b12~pre2-0ubuntu3) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081015). +++ * Add netscape/javascript class files to rt.jar. LP: #282762. +++ * Be more verbose in the icedtea6-plugin package description. +++ * Fix some lintian warnings. +++ +++ -- Matthias Klose Wed, 15 Oct 2008 12:45:59 +0200 +++ +++openjdk-6 (6b12~pre2-0ubuntu2) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081012). +++ * When building as cacao, build a cacao-oj6-plugin package. +++ * When building as cacao, run the testsuite on amd64, i386, sparc. +++ * Add finnish translations to the desktop files (Timo Jyrinki). +++ Closes: #494354. +++ * Fix font paths (Rob Gom). Closes: #495988. +++ * Reenable running the testsuite. +++ * Fix pulse-java build failure on amd64. +++ +++ -- Matthias Klose Sun, 12 Oct 2008 13:05:49 +0200 +++ +++openjdk-6 (6b12~pre2-0ubuntu1) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081011). +++ * debian/copyright: Add copyright notice for pulseaudio sound files. +++ * Add support to build with pulseaudio support. +++ +++ -- Matthias Klose Sat, 11 Oct 2008 15:44:50 +0200 +++ +++openjdk-6 (6b12~pre1-0ubuntu5) intrepid; urgency=low +++ +++ * Move the plugin from the -jre package into the -plugin package. +++ +++ -- Matthias Klose Fri, 10 Oct 2008 06:55:34 +0000 +++ +++openjdk-6 (6b12~pre1-0ubuntu4) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20081009). +++ * Configure with --enable-liveconnect, build an icedtea6-plugin package. +++ Thanks to Deepak Bhole. +++ LP: #207064, #195783, #199680, #202762, #220241, #242263, #242496, +++ #242496, #250292, #269885, #274356, #274360, #259313. +++ * Build an icedtea6-plugin package. +++ * Merge changes from 6b11-9 packaging. +++ * Build a openjdk-6-source-files packages (used as a build dependency +++ of cacao-oj6). +++ * Build depend on cacao-source for cacao-oj6 builds. +++ +++ -- Matthias Klose Thu, 09 Oct 2008 15:04:27 +0200 +++ +++openjdk-6 (6b12~pre1-0ubuntu3) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20080915). +++ * Reapply: openjdk-6-jre-headless: Make libnss-mdns a suggestion +++ instead of a recommendation. LP: #261847. +++ * Build-depend against fixed fastjar. LP: #267177. +++ +++ -- Matthias Klose Mon, 15 Sep 2008 20:16:51 +0200 +++ +++openjdk-6 (6b12~pre1-0ubuntu2) intrepid; urgency=low +++ +++ * Update the icedtea-hotspot patch to b12, fixing build failures +++ on zero archs (ia64, powerpc). +++ +++ -- Matthias Klose Sat, 13 Sep 2008 11:48:44 +0200 +++ +++openjdk-6 (6b12~pre1-0ubuntu1) intrepid; urgency=low +++ +++ * New code drop (b12). +++ * Update IcedTea build infrastructure (20080912). +++ +++ -- Matthias Klose Sat, 13 Sep 2008 00:41:42 +0200 +++ +++openjdk-6 (6b11-6) unstable; urgency=low +++ +++ * Set minimum heap size independent of available memory for cacao builds. +++ * Link the wrapper tools with -rdynamic for cacao builds. +++ * Update cacao based builds: +++ - Update cacao to 0.99.3, remove patches applied upstream. +++ - Fix build failures on mipsel-linux. +++ * Allow setting of the bootstrap compiler per architecture. +++ * Configure --with-alt-jar set to fastjar to speed up builds. +++ * Update IcedTea build infrastructure (20080815), remove local patches +++ integrated in IcedTea. +++ - Make use of unsigned/signed types explicit. +++ - Fix PR icedtea/184, adding support for returning floats and doubles +++ for zero builds. +++ - Fix Fix PR icedtea/181, class type checks. +++ +++ -- Matthias Klose Fri, 15 Aug 2008 16:59:48 +0000 +++ +++openjdk-6 (6b11-5) unstable; urgency=low +++ +++ * debian/rules (stamps/mauve-build): Configure with --host and --build. +++ * openjdk-6-jdk: Recommend libxt-dev (jawt_md.h header includes). +++ * Fix build issues on s390 (size_t is unsigned long). +++ +++ -- Matthias Klose Sun, 03 Aug 2008 20:05:44 +0200 +++ +++openjdk-6 (6b11-4) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20080801). +++ - Fix typo, causing build failure on mipsel. +++ +++ -- Matthias Klose Fri, 01 Aug 2008 01:25:51 +0200 +++ +++openjdk-6 (6b11-3) unstable; urgency=low +++ +++ * Include the name of the VM used in the package description. +++ * Update IcedTea build infrastructure (20080731). +++ * Build for alpha, arm, mips and mipsel. +++ * Switch from libcupsys2(-dev) to libcups2(-dev) for newer releases. +++ (Closes: #492384) +++ * Add symlinks for header files found in JAVA_HOME/include/linux in +++ JAVA_HOME/include. +++ * openjdk-6-jre: Don' recommend lesstif2 anymore. +++ +++ -- Matthias Klose Thu, 31 Jul 2008 17:16:59 +0200 +++ +++openjdk-6 (6b11-2ubuntu1) intrepid; urgency=low +++ +++ * xvfb seems to be broken when running with intrepid and an intrepid kernel. +++ Nevertheless, run xvfb-run -s "-extension GLX" on the buildds (hardy kernels). +++ * Stop the buildwatch process after the testsuite finishes. +++ +++ -- Matthias Klose Fri, 25 Jul 2008 12:33:44 +0200 +++ +++openjdk-6 (6b11-2) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20080724). +++ * debian/buildwatch.sh: Track long building files with no visible output. +++ * Fix build failure when not running the mauve testsuite. +++ * Disable running the testsuite for cacao builds (leaving processes around). +++ * Don't set a soversion for the cacao libjvm. +++ * Configure with --host and --build. +++ * Call xvfb-run with -s "-extension GLX". +++ +++ -- Matthias Klose Thu, 24 Jul 2008 22:25:30 +0200 +++ +++openjdk-6 (6b11-1ubuntu2) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20080724). +++ * debian/buildwatch.sh: Track long building files with no visible output. +++ * Fix build failure when not running the mauve testsuite. +++ * Disable running the testsuite for cacao builds (leaving processes around). +++ * Don't set a soversion for the cacao libjvm. +++ * Configure with --host and --build. +++ +++ -- Matthias Klose Thu, 24 Jul 2008 17:58:53 +0200 +++ +++openjdk-6 (6b11-1ubuntu1) intrepid; urgency=low +++ +++ * Regenerate the control file. +++ +++ -- Matthias Klose Wed, 23 Jul 2008 00:42:16 +0200 +++ +++openjdk-6 (6b11-1) unstable; urgency=low +++ +++ * New code drop (b11). +++ * Update IcedTea build infrastructure (20080721). +++ * debian/generate-dfsg.sh: Update for b11. +++ * debian/patches/const_strings.patch, debian/patches/issue-6659207.diff: +++ Remove, applied upstream. +++ * debian/generate-debian-orig.sh: Fix /proc check. +++ * debian/control.in: Loosen dependency of -jre-lib on -jre. +++ * Support `nodocs' in DEB_BUILD_OPTIONS. +++ * Remove build-dependency on lesstif2-dev. +++ * Bootstrap using gcj on all archs; the 6b10dfsg-2 packages are broken. +++ * Run the jtreg harness in a virtual X environment. +++ * Install javazic.jar in the jre-lib package. +++ * Don't run the testsuite on arm; the build already takes days; only +++ run the testsuite on hotspot archs and powerpc. +++ +++ -- Matthias Klose Wed, 23 Jul 2008 00:28:12 +0200 +++ +++openjdk-6 (6b10dfsg-2) unstable; urgency=low +++ +++ * Update IcedTea build infrastructure (20080714). +++ * On arm configure cacao builds with --enable-softfloat. +++ * Don't run the mauve testsuite for cacao builds (hangs the test runner +++ process). +++ * Don't configure cacao builds with --enable/-disable-zero. +++ * Don't remove alternatives on upgrade. +++ * debian/copyright: Add license for NanoXML. +++ * Do recommends ttf-indic-fonts instead of ttf-indic-fonts-core for +++ lenny and sid. Closes: #490619. +++ * Ignore errors when registering the jar binfmt. The alternative may +++ already be registered by another JVM. Closes: #490594. +++ * openjdk-6-jre-headless: Depend on ttf-dejavu-core instead of ttf-dejavu. +++ * On amd64, i386 and sparc, bootstrap using openjdk. +++ +++ -- Matthias Klose Mon, 14 Jul 2008 19:41:19 +0200 +++ +++openjdk-6 (6b10dfsg-1ubuntu2) intrepid; urgency=low +++ +++ * Update IcedTea build infrastructure (20080702). +++ - Do not configure --with-shark by default. +++ - Update license headers from jdk7. +++ * Start debian/buildwatch.sh for armel and sparc builds as well. +++ * Allow configuration with --with-cacao. +++ +++ -- Matthias Klose Mon, 30 Jun 2008 13:30:06 +0200 +++ +++openjdk-6 (6b10dfsg-1ubuntu1) intrepid; urgency=low +++ +++ * The rebuilt upstream tarball now has GPL-compatible free software licenses +++ and documented copyrights and licenses. LP: #238569. +++ * Fixed name of the xulrunner-1.9-javaplugin.so in the .jinfo file. +++ LP: #226911. +++ * Ignore errors during activation of class data sharing. Closes: #490617, +++ #490672. +++ +++ -- Matthias Klose Mon, 30 Jun 2008 13:30:06 +0200 +++ +++openjdk-6 (6b10dfsg-1) unstable; urgency=low +++ +++ * Rebuild the upstream tar ball: +++ - Remove the jscheme jar files. +++ - Apply the patch from Iris Clark (Sun) for the copyright headers +++ (http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=141#c4). +++ - Remove jdk/src/share/classes/java/lang/instrument/package.html. +++ - Upload to main. +++ * Update IcedTea build infrastructure (20080628). +++ * Build an openjdk-6-dbg package. +++ * patches/gcc-mtune-generic.diff: Fix typo. +++ * openjdk-6-jre: Depend on ttf-dejavu. +++ * debian/copyright: Add two more copyright holders, not directly +++ mentioned in the third party readme. +++ Replace Apache 2.0 license with pointer to common-licenses. +++ * Fix more lintian warnings. +++ * debian/sun_java_app.xpm: Downsize icon to 32x32 pixels. +++ * Build-depend/depend on rhino. +++ +++ -- Matthias Klose Sun, 29 Jun 2008 17:42:51 +0200 +++ +++openjdk-6 (6b10-1) unstable; urgency=low +++ +++ * New code drop (b10). +++ - Still some non-compliant license headers found in +++ openjdk/corba/src/share/classes/com/sun/tools/corba/se/idl. +++ - Upload to non-free. +++ * Update IcedTea build infrastructure (20080603). +++ * In fontconfig.properties, fix Korean font names and add paths to the Luxi +++ fonts for Motif. Add fonts for Indic languages. +++ * Install compilefontconfig.jar in openjdk-6-jre-lib package. +++ * Run the testsuites of hotspot, langtools and jdk. +++ * Include the jscheme-5.0 sources in the tarball, mention the jscheme +++ licenses in debian/copyright. +++ * Use the certificates provided by the ca-certificates-java package. +++ * More fontconfig updates (Arne Goetje). +++ * Fix some lintian warnings. +++ * Correct build-dependency for openjdk based bootstraps. +++ +++ -- Matthias Klose Wed, 04 Jun 2008 01:46:52 +0200 +++ +++openjdk-6 (6b09-1~pre1) unstable; urgency=low +++ +++ [ Matthias Klose ] +++ * New code drop (b09). +++ * Update IcedTea build infrastructure (20080528). +++ - Add missing color profiles. LP: #225174. +++ - Moved system properties defined in hotspot to TrustManagerFactoryImpl. +++ LP: #224455. +++ * 6636469_v4.diff: Remove, committed in IcedTea. +++ * debian/control: Update Vcs-* attributes. +++ * debian/JB-jre-headless.p*.in: Fix update-binfmts calls. +++ * Compress the man pages, fixing the slave symlinks of the alternatives. +++ * javaws.desktop: Add `%u' to the Exec key, remove -viewer option. +++ * openjdk-6-jre-headless: Recommends libnss-mdns. +++ * openjdk-6-jre-headless: Warn about unmounted /proc file system. +++ * debian/JB-jre.mime.in: Remove the -viewer option from command (Tan Rui +++ Boon). +++ * Add a `docs' symlink pointing to /usr/share/doc/openjdk-6. LP: #218405. +++ * Set maintainer to the team list. +++ * Add copyright notices for patches and generated files. +++ * Add helper scripts to modify upstream tarball and generate the debian +++ tarball. +++ * Fix names for browser alternatives in jinfo file, set browser_plugin_dirs +++ unconditionally. +++ * Recommend the ttf-wqy-zenhei font instead of ttf-arphic-uming, if the +++ latter is available in Truetype Collection (TTC) format only, add the +++ fontconfig changes as a patch. +++ * Make the cjk font packages configurable in the control file. +++ * Use GCC-4.3 on all platforms where available. +++ * Install a config file swing.properties, allowing a user to change +++ the default look and feel. LP: #229112. +++ * When trying to determine the executable name reading /proc/self/exe, +++ discard known prefixes used for unionfs mounts. LP: #224110. +++ * Explicitely configure with --disable-zero on hotspot architectures. +++ * Add fix for issue 6659207, access violation in CompilerThread0. +++ Addresses #478560. Needs checking: LP: #229207. +++ * Disable building the docs on ia64, powerpc and sparc, we don't build +++ architecture independent packages on these architectures. +++ * Explicitely configure --with-parallel-jobs, needed by the updated IcedTea. +++ * Backport the linux-sparc patches, enable building on sparc. LP: #154080. +++ * Don't use an absolute path calling the compiler. +++ * Replace the OpenJDK version in desktop and menu files. +++ * Install menu files. +++ * Install openjdk-6-java.desktop in -jre, instead of -jre-headless. +++ +++ -- Matthias Klose Wed, 14 May 2008 08:49:54 +0200 +++ +++openjdk-6 (6b08-1) unstable; urgency=low +++ +++ [ Torsten Werner ] +++ * first upload to Debian (Closes: #452750) +++ * Regenerate debian/control. +++ * Switch to bzip2 package compression in Debian but leave lzma compression +++ in Ubuntu. +++ * Temporarily downgrade Depends: tzdata-java to Recommends until the package +++ becomes available in Debian. +++ * Add myself to Uploaders. +++ * Do not install extras license file in openjdk-6-jre-lib. +++ * Add patch shebang.diff to fix a lintian warning. +++ * Install openjdk-6-java.desktop into the correct binary package. +++ * Improve some package descriptions. +++ * Remove some empty directories from binary packages. +++ * Install README.Debian in every binary package and give it some useful +++ content. +++ * Install java-rmi.cgi in package openjdk-6-jre-headless and mention it in +++ README.Debian. +++ * Install /usr/bin/jexec via update-alternatives. +++ * Downgrade Depends: java-common (>= 0.28). +++ * Add patch jexec.diff to make the jexec binary executable without +++ specifying an absolute path. +++ * Add Build-Depends: xauth and xfonts-base for mauve. +++ * Update and install the lintian override files. +++ * Replace all occurences of binary:Version and source:Version by +++ Source-Version to be compatible with Ubuntu release 6.06. +++ * Remove Conflicts: gcjwebplugin. +++ +++ [ Michael Koch ] +++ * Fixed Vcs-Bzr and Vcs-Browser fields. +++ * Removed Encoding entry from all debian/*.desktop.in files. +++ +++ [ Matthias Klose ] +++ * Make Java Full Screen Exclusive Mode work again with Xorg Server 1.3 +++ and above (Dan Munckton). LP: #154613 (Java bug 6636469). +++ * Configure with --enable-zero on all archs except amd64, i386, lpia. +++ * Update IcedTea build infrastructure. +++ * Handle binary files in updates of the build infrastructure. +++ * Enable bootstrap/normal builds per architecture. +++ * javaws-wrapper.sh: Use readlink --canonicalize. LP: #211515. +++ * binfmt-support: Handle /usr/share/binfmts/jar as a slave symlink of +++ the jexec alternative, install the binfmt file in the jre libdir. +++ Use the jexec alternative in the binfmt file. +++ * JB-jre-headless.postinst.in: Remove sun-java6 specific chunks. +++ * Differentiate between the openjdk version required as dependency and +++ as build dependency. +++ +++ -- Torsten Werner Wed, 09 Apr 2008 10:12:55 +0200 +++ +++openjdk-6 (6b08-0ubuntu1) hardy; urgency=low +++ +++ * New code drop (b08). +++ * Update IcedTea build infrastructure. +++ * Move binfmt-support references from -jre to -jre-headless package. +++ * Don't fail on purge, if /var/lib/binfmts/openjdk-6 is missing. LP: #206721. +++ * Only use the basename for icons in desktop files. LP: #207413. +++ * Install javaws(1). LP: #191297. +++ * Install a wrapper script for javaws, which calls `javaws -viewer' if no +++ arguments are given (or else starting javaws from the desktop menu +++ would not do anything). +++ * debian/JB-web-start.applications.in: Remove the -viewer option from command. +++ +++ -- Matthias Klose Fri, 28 Mar 2008 16:10:32 +0000 +++ +++openjdk-6 (6b07-0ubuntu1) hardy; urgency=low +++ +++ * New code drop (b07). +++ * Update IcedTea build infrastructure. +++ * debian/copyright: Update to OpenJDK Trademark Notice v1.1. +++ +++ -- Matthias Klose Sat, 22 Mar 2008 22:41:42 +0100 +++ +++openjdk-6 (6b06-0ubuntu12) hardy; urgency=low +++ +++ * Update icon locations in menu files. +++ * openjdk-6-jre-headless: Provide java-virtual-machine. LP: #189953. +++ * openjdk-6-jre-headless: Add a conflict to gcjwebplugin; for openjdk +++ use the icetea-gcjwebplugin, for gij the java-gcj-compat-plugin. +++ +++ -- Matthias Klose Sat, 22 Mar 2008 20:12:41 +0100 +++ +++openjdk-6 (6b06-0ubuntu11) hardy; urgency=low +++ +++ * Update IcedTea to 20080319. +++ * Move rt.jar into the openjdk-6-jre-headless package; sun/awt/X11 +++ class files differ between amd64 and i386. +++ * Install all desktop files in /usr/share/applications. +++ +++ -- Matthias Klose Wed, 19 Mar 2008 23:53:36 +0100 +++ +++openjdk-6 (6b06-0ubuntu10) hardy; urgency=low +++ +++ * Remove print-lsb-release.patch, forwarded to IcedTea. +++ * Fix IcedTea configure to detect libffi without pkg-config. +++ +++ -- Matthias Klose Wed, 12 Mar 2008 20:28:55 +0100 +++ +++openjdk-6 (6b06-0ubuntu9) hardy; urgency=low +++ +++ * Build-depend on libffi4-dev on architectures other than amd64, i386, lpia. +++ * Install icons in /usr/share/pixmaps, not /usr/share/icons. +++ * debian/rules: Call dh_icons. +++ +++ -- Matthias Klose Wed, 12 Mar 2008 11:34:44 +0100 +++ +++openjdk-6 (6b06-0ubuntu8) hardy; urgency=low +++ +++ * Tighten dependency on java-common. +++ * debian/copyright: Include trademark notice. +++ * debian/control: Mention IcedTea in the package descriptions. +++ * Update IcedTea to 20080311. +++ +++ -- Matthias Klose Tue, 11 Mar 2008 21:39:27 +0100 +++ +++openjdk-6 (6b06-0ubuntu7) hardy; urgency=low +++ +++ * Build-depend on unzip. +++ +++ -- Matthias Klose Fri, 07 Mar 2008 16:47:43 +0100 +++ +++openjdk-6 (6b06-0ubuntu6) hardy; urgency=low +++ +++ * Build-depend on zip. +++ +++ -- Matthias Klose Fri, 07 Mar 2008 16:16:52 +0100 +++ +++openjdk-6 (6b06-0ubuntu5) hardy; urgency=low +++ +++ * debian/mauve_tests: javax.swing.text.html.HTML.ElementTagAttributeTest, +++ removed, tries to access the network. +++ * debian/README.alternatives.in: Update for --jre-headless. +++ * debian/rules: Fix paths for OpenJDK based bootstrap. +++ * Compress packages using lzma. +++ * Drop build dependency on zip, unzip. +++ * Fix build infrastructure to bootstrap with OpenJDK instead of ecj. +++ * Do not build the gcjwebplugin from the OpenJDK source. +++ +++ -- Matthias Klose Fri, 07 Mar 2008 13:53:15 +0100 +++ +++openjdk-6 (6b06-0ubuntu4) hardy; urgency=low +++ +++ * Don't register a java-rmi.cgi alternative in /usr/bin. +++ +++ -- Matthias Klose Thu, 06 Mar 2008 17:59:35 +0100 +++ +++openjdk-6 (6b06-0ubuntu3) hardy; urgency=low +++ +++ * Split out a openjdk-6-jre-headless package, depend on java-common, +++ supporting update-java-alternatives --jre-headless. +++ * Make openjdk-6-jre-headless and openjdk-6-jre architecture any. +++ * New package openjdk-6-jre-lib (arch all). +++ * Remove openjdk-6-bin package. +++ * debian/patches/openjdk-ubuntu-branding.patch: New patch. +++ * Install images/cursors/cursors.properties as a config file. +++ * Do not compress demos and examples in the -demo package. +++ * openjdk-6-jre: Add dependency on libxinerama1. +++ * Update IcedTea to 20080305. +++ * Don't generate cacerts ourself, but depend on ca-certificates, +++ fix location of javax.net.ssl.trustStore property. +++ * Build-depend on mauve and xvfb; run some mauve tests (the list of +++ tests taken from the Fedora package). +++ * Keep a backup of the `generated' directory; some files are regenerated +++ differently, increasing the size of the diff. +++ +++ -- Matthias Klose Thu, 06 Mar 2008 10:05:39 +0100 +++ +++openjdk-6 (6b06-0ubuntu2) hardy; urgency=low +++ +++ * Re-add gawk and pkg-config as build dependencies. +++ +++ -- Matthias Klose Tue, 04 Mar 2008 12:20:21 +0100 +++ +++openjdk-6 (6b06-0ubuntu1) hardy; urgency=low +++ +++ * New code drop (b06). +++ * Remove java-access-bridge tarball, use an externally built package. +++ * Update IcedTea to 20080304. +++ * Don't use any compiler flags from the environment. +++ +++ -- Matthias Klose Tue, 04 Mar 2008 09:16:59 +0100 +++ +++openjdk-6 (6b05-0ubuntu1) hardy; urgency=low +++ +++ * First public OpenJDK upstream code drop (b05). +++ * Depend on tzdata-java. +++ +++ -- Matthias Klose Fri, 29 Feb 2008 19:05:42 +0100 +++ +++icedtea-java7 (7~b24-1.5+20080118-2) UNRELEASED; urgency=low +++ +++ * Fix removal of alternatives. +++ +++ -- Matthias Klose Sat, 26 Jan 2008 18:41:40 +0100 +++ +++icedtea-java7 (7~b24-1.5+20080118-1) hardy; urgency=low +++ +++ * Fix installation of the plugin for firefox-3.0. +++ +++ -- Matthias Klose Sat, 19 Jan 2008 15:10:18 +0100 +++ +++icedtea-java7 (7~b24-1.5+20080118-1~ppa1) hardy; urgency=low +++ +++ * Update IcedTea to 20080118. +++ * Fix another build failure when gcc version != gcj version. +++ * Use the versioned compiler to build the corba parts. +++ * Register plugin for firefox-3.0. +++ * Build using GCC-4.3. +++ +++ -- Matthias Klose Fri, 18 Jan 2008 21:15:08 +0100 +++ +++icedtea-java7 (7~b24-1.5-2) UNRELEASED; urgency=low +++ +++ * First upload to Debian. Closes: #452750. +++ * debian/control.in: +++ - Moved package from universe/devel section to devel. +++ - Put icedtea-java7-doc into doc section. +++ - Added Homepage field and removed Homepage pseudo field from +++ descriptions. +++ - Updated Standards-Version to 3.7.3. +++ * debian/rules: +++ - Check if Makefile exists before called clean in clean target. +++ * debian/copyright: Converted to UTF-8. +++ +++ -- Michael Koch Sat, 05 Jan 2008 13:34:46 -0100 +++ +++icedtea-java7 (7~b24-1.5-1) hardy; urgency=low +++ +++ * Update to IcedTea-1.5. +++ * debian/patches/ssp-interpreter.diff: Use bash to call the ssp script, +++ backslash handling differs betweend dash and bash. +++ +++ -- Matthias Klose Fri, 04 Jan 2008 09:58:27 +0100 +++ +++icedtea-java7 (7~b24-1.5~20071214-1) hardy; urgency=low +++ +++ * New upstream snapshot (b24). +++ * Update java-access-bridge to 1.21.1. +++ * On powerpc keep the build alive using buildwatch script. +++ * Do not install menu entries for javaws, ControlPanel. LP: #155553, #156673. +++ * README.alternatives: Fix example. LP: #157063. +++ +++ -- Matthias Klose Fri, 14 Dec 2007 11:09:22 +0100 +++ +++icedtea-java7 (7~b23-1.5~20071124-4) hardy; urgency=low +++ +++ * Allow libungif4-dev as alternative build dependency. +++ * On powerpc keep the build alive using buildwatch script. +++ * Always build the plugin using libxul-dev. +++ +++ -- Matthias Klose Mon, 10 Dec 2007 15:20:16 +0100 +++ +++icedtea-java7 (7~b23-1.5~20071124-3) hardy; urgency=low +++ +++ * Lower optimization to -O2 for building the jdk on amd64. +++ * Reenable parallel build. +++ * Link using -Bsymbolic-functions. +++ * debian/patches/arguments.patch, debian/patches/const_strings.patch: +++ New patches (Arnaud Vandyck). +++ +++ -- Matthias Klose Thu, 29 Nov 2007 18:50:41 +0100 +++ +++icedtea-java7 (7~b23-1.5~20071124-2) hardy; urgency=low +++ +++ * Bootstrap using ecj/gcj. +++ * Build using g++-4.1 on i386, lpia, powerpc. +++ +++ -- Matthias Klose Wed, 28 Nov 2007 14:46:48 +0000 +++ +++icedtea-java7 (7~b23-1.5~20071124-1) hardy; urgency=low +++ +++ * New upstream snapshot (b23). +++ +++ -- Matthias Klose Tue, 27 Nov 2007 15:48:08 +0100 +++ +++icedtea-java7 (7~b22-1.5~20071018-0ubuntu3) hardy; urgency=low +++ +++ * Revert the previous change, require 7~b22 versions again. +++ +++ -- Matthias Klose Sat, 20 Oct 2007 14:33:26 +0000 +++ +++icedtea-java7 (7~b22-1.5~20071018-0ubuntu2) hardy; urgency=low +++ +++ * Loosen dependencies to 7~b21, until package is built on all archs. +++ +++ -- Matthias Klose Sat, 20 Oct 2007 07:48:36 +0000 +++ +++icedtea-java7 (7~b22-1.5~20071018-0ubuntu1) hardy; urgency=low +++ +++ * New upstream snapshot (b22). +++ * Don't use parallel builds to make the build log better comparable. +++ +++ -- Matthias Klose Fri, 19 Oct 2007 19:49:51 +0200 +++ +++icedtea-java7 (7~b21-1.4+20071007-0ubuntu5) gutsy; urgency=low +++ +++ * Update icedtea to vcs 20071012 (1.4 release), checked that the plugin +++ works on amd64. +++ * debian/copyright: Update "License Headers" section. +++ +++ -- Matthias Klose Sun, 14 Oct 2007 19:55:12 +0200 +++ +++icedtea-java7 (7~b21-1.4+20071007-0ubuntu4) gutsy; urgency=low +++ +++ * Bootstrapping trigger upload for final step of bootstrapping i386, amd64, +++ lpia. +++ +++ -- LaMont Jones Wed, 10 Oct 2007 22:04:25 -0600 +++ +++icedtea-java7 (7~b21-1.4+20071007-0ubuntu3) gutsy; urgency=low +++ +++ * Add build dependency on bzip2. +++ +++ -- Matthias Klose Wed, 10 Oct 2007 09:00:40 +0000 +++ +++icedtea-java7 (7~b21-1.4+20071007-0ubuntu2) gutsy; urgency=low +++ +++ * Add build dependency on ant. +++ +++ -- Matthias Klose Wed, 10 Oct 2007 06:33:14 +0000 +++ +++icedtea-java7 (7~b21-1.4+20071007-0ubuntu1) gutsy; urgency=low +++ +++ * Update icedtea to vcs 20071007. +++ * Update java-access-bridge to 1.20.0. +++ * Add build-dependency on libxinerama-dev. +++ * Add Xb-Npp-xxx tags for the -plugin package. +++ * Name the plugin "GCJ Web Browser Plugin (using IcedTea)", GCJ now +++ "Great Cool Java" (according to Michael Koch). +++ * Compress binary-indep packages using bzip2. +++ +++ -- Matthias Klose Sun, 7 Oct 2007 23:43:28 +0200 +++ +++icedtea-java7 (7~b21-1.4+20071002-0ubuntu2) gutsy; urgency=low +++ +++ * Rebuild using icedtea 7~b21. +++ +++ -- Matthias Klose Tue, 02 Oct 2007 19:45:21 +0200 +++ +++icedtea-java7 (7~b21-1.4+20071002-0ubuntu1) gutsy; urgency=low +++ +++ * New upstream snapshot (b21). +++ * Correctly unregister the executable binary format in the -bin package. +++ * Assemble the debian/copyright file. +++ +++ -- Matthias Klose Tue, 2 Oct 2007 09:59:37 +0200 +++ +++icedtea-java7 (7~b19-1.3+20070905-0ubuntu1) gutsy; urgency=low +++ +++ * New upstream snapshot (b19). +++ * Build using g++-4.2 on amd64, using g++-4.1 on i386 and lpia. +++ * Build without -Werror, upstream source is not yet warning clean. +++ * Support DEB_BUILD_OPTIONS=parallel=. +++ * Add build dependency on wget. +++ * Add font suggestions. +++ * Changed font configuration to fix CJK font support (Arne Goetje). +++ * Fix location of the plugin, when registering the plugin alternatives. +++ +++ -- Matthias Klose Thu, 6 Sep 2007 00:46:40 +0200 +++ +++icedtea-java7 (7~b18-1.2+20070822-0ubuntu2) gutsy; urgency=low +++ +++ * Create browser plugin directories. +++ * Build-depend on liblcms1-dev. +++ * Recommend packages with dlopened libraries: liblcms1, lesstif2, libcupsys2, +++ libgtk2.0-0, libgnome2-0, libgnomevfs2-0, libgconf2-4, libxrandr2, +++ libgl1-mesa-glx. +++ +++ -- Matthias Klose Tue, 21 Aug 2007 17:21:00 +0200 +++ +++icedtea-java7 (7~b18-1.2+20070822-0ubuntu1) gutsy; urgency=low +++ +++ * New upstream version. +++ * Include java-access-bridge. +++ * Build -doc, -plugin packages. +++ * Register alternatives, priority 1060. +++ +++ -- Matthias Klose Tue, 21 Aug 2007 17:21:00 +0200 +++ +++icedtea-java7 (7~b17-1.2+20070808-1) gutsy; urgency=low +++ +++ * Initial release, discard the initial packaging based on cdbs. +++ * Base the packaging on the sun-javaX packages. +++ +++ -- Matthias Klose Wed, 08 Aug 2007 15:55:39 +0200 +++ +++icedtea (7~b16-20070724-1) UNRELEASED; urgency=low +++ +++ * Update upstream tarball to 7~b16, update icedtea to 20070724. +++ * debian/control: Build-depend on libfreetype6-dev. +++ * debian/rules: Configure --with-jar=/usr/bin/fastjar. +++ * Build using gcj-4.2. +++ +++ -- Matthias Klose Tue, 24 Jul 2007 11:24:55 +0200 +++ +++icedtea (7~b14-20070704-1) unstable; urgency=low +++ +++ * Initial version. +++ +++ -- Michael Koch Wed, 04 Jul 2007 08:25:31 -0100 diff --cc debian/compat index 000000000,000000000,000000000..b4de39476 new file mode 100644 --- /dev/null +++ b/debian/compat @@@@ -1,0 -1,0 -1,0 +1,1 @@@@ +++11 diff --cc debian/control index 000000000,000000000,000000000..c14a6d54b new file mode 100644 --- /dev/null +++ b/debian/control @@@@ -1,0 -1,0 -1,0 +1,204 @@@@ +++Source: openjdk-21 +++Section: java +++Priority: optional +++Maintainer: OpenJDK Team +++Uploaders: Matthias Klose +++Build-Depends: debhelper (>= 11), +++ m4, lsb-release, zip, unzip, +++ sharutils, gawk, cpio, procps, wdiff, pkgconf, fastjar (>= 2:0.96-0ubuntu2), +++ time, strip-nondeterminism, debugedit (>= 4.16), +++ jtreg7 (>= 7.3.1+1~) , libtestng7-java , xvfb , xauth , xfonts-base , libgl1-mesa-dri [!x32] , xfwm4 , x11-xkb-utils , dbus-x11 , libasmtools-java , xvfb , +++ autoconf, automake, ant, ant-optional, +++ g++-14 , +++ openjdk-21-jdk-headless:native | openjdk-20-jdk-headless:native, +++ libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, libasound2-dev, liblcms2-dev, libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libxrandr-dev, libelf-dev, libfontconfig-dev, libfreetype-dev, libharfbuzz-dev, +++ libffi-dev, libffi-dev:native, +++ zlib1g-dev:native, zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, systemtap-sdt-dev [!sh4], +++ libnss3-dev (>= 2:3.17.1), +++ openjdk-21-jdk-headless , +++Build-Depends-Indep: graphviz, pandoc, +++Rules-Requires-Root: no +++Standards-Version: 4.6.2 +++Homepage: https://openjdk.java.net/ +++Vcs-Browser: https://salsa.debian.org/openjdk-team/openjdk/tree/openjdk-21 +++Vcs-Git: https://salsa.debian.org/openjdk-team/openjdk.git -b openjdk-21 +++ +++Package: openjdk-21-jdk-headless +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre-headless (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Suggests: openjdk-21-demo, openjdk-21-source +++Provides: java-sdk-headless (= ${vm:Version}), java2-sdk-headless, +++ java5-sdk-headless, java6-sdk-headless, +++ java7-sdk-headless, java8-sdk-headless, +++ java9-sdk-headless, java10-sdk-headless, +++ java11-sdk-headless, java12-sdk-headless, +++ java13-sdk-headless, java14-sdk-headless, java15-sdk-headless, +++ java16-sdk-headless, java17-sdk-headless, +++ java18-sdk-headless, java19-sdk-headless, +++ java20-sdk-headless, java21-sdk-headless, +++ java-compiler +++Breaks: openjdk-17-jre-headless (<< 17~10), openjdk-21-jre-headless (<< 21~27ea), +++Replaces: openjdk-17-jre-headless (<< 17~10), openjdk-21-jre-headless (<< 21~27ea), +++Description: OpenJDK Development Kit (JDK) (headless) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ +++Package: openjdk-21-jre-headless +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: ${jredefault:Depends}, ${cacert:Depends}, +++ ${jcommon:Depends}, ${dlopenhl:Depends}, +++ ${mountpoint:Depends}, +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: ${dlopenhl:Recommends}, +++ ${fontmanager:Recommends}, ${jsound:Recommends} +++Suggests: libnss-mdns, +++ fonts-dejavu-extra, +++ fonts-ipafont-gothic, fonts-ipafont-mincho, fonts-wqy-microhei | fonts-wqy-zenhei, fonts-indic, +++Provides: java-runtime-headless (= ${vm:Version}), java2-runtime-headless, +++ java5-runtime-headless, java6-runtime-headless, +++ java7-runtime-headless, java8-runtime-headless, +++ java9-runtime-headless, java10-runtime-headless, +++ java11-runtime-headless, java12-runtime-headless, +++ java13-runtime-headless, java14-runtime-headless, java15-runtime-headless, +++ java16-runtime-headless, java17-runtime-headless, +++ java19-runtime-headless, java20-runtime-headless, +++ java21-runtime-headless, +++ ${defaultvm:Provides}, ${jvm:Provides} +++Breaks: ${jrehl:Breaks} +++Conflicts: oracle-java11-installer, openjdk-11-jdk-headless (<< 11~18-2) +++Replaces: openjdk-11-jdk-headless (<< 11~18-2) +++Description: OpenJDK Java runtime, using ${vm:Name} (headless) +++ Minimal Java runtime - needed for executing non GUI Java programs, +++ using ${vm:Name}. +++ +++Package: openjdk-21-jdk +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre (= ${binary:Version}), +++ openjdk-21-jdk-headless (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: libxt-dev +++Suggests: openjdk-21-demo, openjdk-21-source, visualvm +++Provides: java-sdk (= ${vm:Version}), java2-sdk, java5-sdk, java6-sdk, +++ java7-sdk, java8-sdk, java9-sdk, java10-sdk, java11-sdk, +++ java12-sdk, java13-sdk, java14-sdk, java15-sdk, java16-sdk, java17-sdk, +++ java18-sdk, java19-sdk, java20-sdk, java21-sdk, +++ java-compiler +++Description: OpenJDK Development Kit (JDK) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ +++Package: openjdk-21-jre +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre-headless (= ${binary:Version}), +++ ${dlopenjre:Depends}, ${fontmanager:Depends}, ${jsound:Depends}, +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: ${dlopenjre:Recommends}, ${bridge:Recommends}, fonts-dejavu-extra +++Provides: java-runtime (= ${vm:Version}), java2-runtime, +++ java5-runtime, java6-runtime, +++ java7-runtime, java8-runtime, +++ java9-runtime, java10-runtime, +++ java11-runtime, java12-runtime, +++ java13-runtime, java14-runtime, java15-runtime, +++ java16-runtime, java17-runtime, +++ java18-runtime, java19-runtime, +++ java20-runtime, java21-runtime, +++Breaks: openjdk-17-jre-headless (<< 17~10) +++Replaces: openjdk-17-jre-headless (<< 17~10) +++Description: OpenJDK Java runtime, using ${vm:Name} +++ Full Java runtime environment - needed for executing Java GUI and Webstart +++ programs, using ${vm:Name}. +++ +++Package: openjdk-21-demo +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Description: Java runtime based on OpenJDK (demos and examples) +++ OpenJDK Java runtime +++ +++Package: openjdk-21-source +++Architecture: all +++Multi-Arch: foreign +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jdk (>= ${source:Version}), +++ ${misc:Depends} +++Description: OpenJDK Development Kit (JDK) source files +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the Java programming language source files +++ (src.zip) for all classes that make up the Java core API. +++ +++Package: openjdk-21-doc +++Section: doc +++Pre-Depends: ${dpkg:Depends} +++Architecture: all +++Multi-Arch: foreign +++Priority: optional +++Depends: ${misc:Depends}, +++ libjs-jquery, +++ libjs-jquery-ui, +++ libjs-jquery-ui-theme-base, +++Suggests: openjdk-21-jdk +++Description: OpenJDK Development Kit (JDK) documentation +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the API documentation. +++ +++Package: openjdk-21-dbg +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Priority: optional +++Section: debug +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre-headless (= ${binary:Version}), +++ ${misc:Depends},${shlibs:Depends} +++Recommends: openjdk-21-jre (= ${binary:Version}) +++Suggests: openjdk-21-jdk (= ${binary:Version}) +++Conflicts: ${dbg:Conflicts} +++Description: Java runtime based on OpenJDK (debugging symbols) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the debugging symbols. +++ +++Package: openjdk-21-testsupport +++Architecture: alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++Multi-Arch: same +++Depends: openjdk-21-jdk (= ${binary:Version}), +++ build-essential, xfwm4, xvfb, dbus-x11, libatk-wrapper-java, +++ libatk-wrapper-java-jni, jtreg7 (>= 7.3.1+1~), libtestng7-java, +++ ${shlibs:Depends}, +++ ${misc:Depends} +++Description: Java runtime based on OpenJDK (regression test support) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains all the binary files needed to run the +++ OpenJDK autopkg tests. +++ +++Package: openjdk-21-jre-zero +++Architecture: amd64 i386 arm64 armhf ppc64 ppc64el riscv64 s390x +++Multi-Arch: same +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: openjdk-21-jre-headless (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +++Provides: ${zerovm:Provides} +++Description: Alternative JVM for OpenJDK, using Zero +++ The package provides an alternative runtime using the Zero VM. Built on +++ architectures in addition to the Hotspot VM as a debugging aid for those +++ architectures which don't have a Hotspot VM. +++ . +++ The VM is started with the option `-zero'. See the README.Debian for details. diff --cc debian/control.in index 000000000,000000000,000000000..7b94a3ecd new file mode 100644 --- /dev/null +++ b/debian/control.in @@@@ -1,0 -1,0 -1,0 +1,190 @@@@ +++Source: @basename@ +++Section: java +++Priority: optional +++Maintainer: OpenJDK Team <@basename@@packages.debian.org> +++Uploaders: Matthias Klose +++Build-Depends: @bd_debhelper@ +++ m4, lsb-release, zip, unzip, +++ sharutils, gawk, cpio, procps, wdiff, @bd_pkgconf@ @bd_fastjar@ +++ time, @bd_strip_ndt@ @bd_debugedit@ +++ @bd_check@ +++ @bd_autotools@ @bd_ant@ +++ @bd_gcc@ +++ @bd_bootstrap@ +++ @bd_openjdk@ +++ @bd_zero@ +++ @bd_syslibs@ @bd_systemtap@ +++ @bd_nss@ +++ @bd_cross@ +++Build-Depends-Indep: graphviz, pandoc, +++Rules-Requires-Root: no +++Standards-Version: 4.6.2 +++Homepage: https://openjdk.java.net/ +++Vcs-Browser: https://salsa.debian.org/openjdk-team/openjdk/tree/openjdk-21 +++Vcs-Git: https://salsa.debian.org/openjdk-team/openjdk.git -b openjdk-21 +++ +++Package: @basename@-jdk-headless +++Architecture: @any_archs@ +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre-headless (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Suggests: @basename@-demo, @basename@-source +++Provides: java-sdk-headless (= ${vm:Version}), java2-sdk-headless, +++ java5-sdk-headless, java6-sdk-headless, +++ java7-sdk-headless, java8-sdk-headless, +++ java9-sdk-headless, java10-sdk-headless, +++ java11-sdk-headless, java12-sdk-headless, +++ java13-sdk-headless, java14-sdk-headless, java15-sdk-headless, +++ java16-sdk-headless, java17-sdk-headless, +++ java18-sdk-headless, java19-sdk-headless, +++ java20-sdk-headless, java21-sdk-headless, +++ java-compiler +++Breaks: openjdk-17-jre-headless (<< 17~10), openjdk-21-jre-headless (<< 21~27ea), +++Replaces: openjdk-17-jre-headless (<< 17~10), openjdk-21-jre-headless (<< 21~27ea), +++Description: OpenJDK Development Kit (JDK) (headless) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ +++Package: @basename@-jre-headless +++Architecture: @any_archs@ +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: ${jredefault:Depends}, ${cacert:Depends}, +++ ${jcommon:Depends}, ${dlopenhl:Depends}, +++ ${mountpoint:Depends}, +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: ${dlopenhl:Recommends}, +++ ${fontmanager:Recommends}, ${jsound:Recommends} +++Suggests: libnss-mdns, +++ @core_fonts@, +++ @cjk_fonts@ +++Provides: java-runtime-headless (= ${vm:Version}), java2-runtime-headless, +++ java5-runtime-headless, java6-runtime-headless, +++ java7-runtime-headless, java8-runtime-headless, +++ java9-runtime-headless, java10-runtime-headless, +++ java11-runtime-headless, java12-runtime-headless, +++ java13-runtime-headless, java14-runtime-headless, java15-runtime-headless, +++ java16-runtime-headless, java17-runtime-headless, +++ java19-runtime-headless, java20-runtime-headless, +++ java21-runtime-headless, +++ ${defaultvm:Provides}, ${jvm:Provides} +++Breaks: ${jrehl:Breaks} +++Conflicts: oracle-java11-installer, openjdk-11-jdk-headless (<< 11~18-2) +++Replaces: openjdk-11-jdk-headless (<< 11~18-2) +++Description: OpenJDK Java runtime, using ${vm:Name} (headless) +++ Minimal Java runtime - needed for executing non GUI Java programs, +++ using ${vm:Name}. +++ +++Package: @basename@-jdk +++Architecture: @any_archs@ +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre (= ${binary:Version}), +++ @basename@-jdk-headless (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: libxt-dev +++Suggests: @basename@-demo, @basename@-source, visualvm +++Provides: java-sdk (= ${vm:Version}), java2-sdk, java5-sdk, java6-sdk, +++ java7-sdk, java8-sdk, java9-sdk, java10-sdk, java11-sdk, +++ java12-sdk, java13-sdk, java14-sdk, java15-sdk, java16-sdk, java17-sdk, +++ java18-sdk, java19-sdk, java20-sdk, java21-sdk, +++ java-compiler +++Description: OpenJDK Development Kit (JDK) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ +++Package: @basename@-jre +++Architecture: @any_archs@ +++Multi-Arch: same +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre-headless (= ${binary:Version}), +++ ${dlopenjre:Depends}, ${fontmanager:Depends}, ${jsound:Depends}, +++ ${shlibs:Depends}, ${misc:Depends} +++Recommends: ${dlopenjre:Recommends}, ${bridge:Recommends}, @core_fonts@ +++Provides: java-runtime (= ${vm:Version}), java2-runtime, +++ java5-runtime, java6-runtime, +++ java7-runtime, java8-runtime, +++ java9-runtime, java10-runtime, +++ java11-runtime, java12-runtime, +++ java13-runtime, java14-runtime, java15-runtime, +++ java16-runtime, java17-runtime, +++ java18-runtime, java19-runtime, +++ java20-runtime, java21-runtime, +++Breaks: openjdk-17-jre-headless (<< 17~10) +++Replaces: openjdk-17-jre-headless (<< 17~10) +++Description: OpenJDK Java runtime, using ${vm:Name} +++ Full Java runtime environment - needed for executing Java GUI and Webstart +++ programs, using ${vm:Name}. +++ +++Package: @basename@-demo +++Architecture: @any_archs@ +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre (= ${binary:Version}), +++ ${shlibs:Depends}, ${misc:Depends} +++Description: Java runtime based on OpenJDK (demos and examples) +++ OpenJDK Java runtime +++ +++Package: @basename@-source +++Architecture: all +++Multi-Arch: foreign +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jdk (>= ${source:Version}), +++ ${misc:Depends} +++Description: OpenJDK Development Kit (JDK) source files +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the Java programming language source files +++ (src.zip) for all classes that make up the Java core API. +++ +++Package: @basename@-doc +++Section: doc +++Pre-Depends: ${dpkg:Depends} +++Architecture: all +++Multi-Arch: foreign +++Priority: optional +++Depends: ${misc:Depends}, +++ libjs-jquery, +++ libjs-jquery-ui, +++ libjs-jquery-ui-theme-base, +++Suggests: @basename@-jdk +++Description: OpenJDK Development Kit (JDK) documentation +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the API documentation. +++ +++Package: @basename@-dbg +++Architecture: @any_archs@ +++Multi-Arch: same +++Priority: optional +++Section: debug +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre-headless (= ${binary:Version}), +++ ${misc:Depends},${shlibs:Depends} +++Recommends: @basename@-jre (= ${binary:Version}) +++Suggests: @basename@-jdk (= ${binary:Version}) +++Conflicts: ${dbg:Conflicts} +++Description: Java runtime based on OpenJDK (debugging symbols) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains the debugging symbols. +++ +++Package: @basename@-testsupport +++Architecture: @any_archs@ +++Multi-Arch: same +++Depends: @basename@-jdk (= ${binary:Version}), +++ build-essential, xfwm4, xvfb, dbus-x11, libatk-wrapper-java, +++ libatk-wrapper-java-jni, @jtreg_dep@, @testng_dep@, +++ ${shlibs:Depends}, +++ ${misc:Depends} +++Description: Java runtime based on OpenJDK (regression test support) +++ OpenJDK is a development environment for building applications, +++ applets, and components using the Java programming language. +++ . +++ This package contains all the binary files needed to run the +++ OpenJDK autopkg tests. diff --cc debian/control.zero-jre index 000000000,000000000,000000000..7a1ef31fc new file mode 100644 --- /dev/null +++ b/debian/control.zero-jre @@@@ -1,0 -1,0 -1,0 +1,14 @@@@ +++ +++Package: @basename@-jre-zero +++Architecture: @altzero_archs@ +++Multi-Arch: same +++Priority: optional +++Pre-Depends: ${dpkg:Depends} +++Depends: @basename@-jre-headless (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +++Provides: ${zerovm:Provides} +++Description: Alternative JVM for OpenJDK, using Zero +++ The package provides an alternative runtime using the Zero VM. Built on +++ architectures in addition to the Hotspot VM as a debugging aid for those +++ architectures which don't have a Hotspot VM. +++ . +++ The VM is started with the option `-zero'. See the README.Debian for details. diff --cc debian/copyright index 000000000,000000000,000000000..aa06bbaca new file mode 100644 --- /dev/null +++ b/debian/copyright @@@@ -1,0 -1,0 -1,0 +1,3501 @@@@ +++Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +++Files-Excluded: +++ .github/* +++ .gitattributes +++ src/java.base/share/native/libzip/zlib/* +++ src/java.desktop/share/native/libsplashscreen/giflib/* +++ src/java.desktop/share/native/libsplashscreen/libpng/* +++ src/java.smartcardio/unix/native/libj2pcsc/MUSCLE/* +++ src/java.desktop/share/native/libjavajpeg/jc* +++ src/java.desktop/share/native/libjavajpeg/jd* +++ src/java.desktop/share/native/libjavajpeg/je* +++ src/java.desktop/share/native/libjavajpeg/jf* +++ src/java.desktop/share/native/libjavajpeg/ji*.c +++ src/java.desktop/share/native/libjavajpeg/jm* +++ src/java.desktop/share/native/libjavajpeg/jpegi* +++ src/java.desktop/share/native/libjavajpeg/jpeglib.h +++ src/java.desktop/share/native/libjavajpeg/jq* +++ src/java.desktop/share/native/libjavajpeg/jv* +++ src/java.desktop/share/native/libjavajpeg/ju* +++ src/java.desktop/share/native/libjavajpeg/README +++Source: https://github.com/openjdk/jdk21u +++Comment: +++ Upstream Authors: +++ OpenJDK: +++ Oracle and/or its affiliates +++ Sun Microsystems, Inc +++ Red Hat, Inc +++ SAP SE +++ Azul Systems, Inc +++ Apache Software Foundation +++ Microsoft Corporation +++ Intel Corportation +++ IBM Corporation +++ Google LLC +++ Amazon.com, Inc +++ Other contributors +++ See the third party licenses below. +++ Packaged by: +++ Matthias Klose +++ +++Files: * +++Copyright: +++ Copyright (c) 1996-2023 Oracle and/or its affiliates. +++ Copyright (c) 1996-2003 Sun Microsystems, Inc. +++ Copyright (c) 2009-2012 Red Hat, Inc. +++ Copyright (c) 2012-2022 SAP SE. +++ Copyright (c) 2020-2021 Azul Systems, Inc. +++ Copyright (c) 1999-2022 The Apache Software Foundation. +++ Copyright (c) 2020-2021 Microsoft Corporation +++ Copyright (c) 2009-2022 Google LLC +++ Copyright (c) 2020-2021 Amazon.com, Inc +++ Copyright (c) 2021 Alibaba Group Holding Limited +++ Copyright (c) 2019-2021 Huawei Technologies Co. Ltd. +++ Copyright (c) 2021-2023 BELLSOFT +++ Copyright (c) 2022-23 THL A29 Limited, a Tencent company. +++ Copyright (c) 2021-2023, Arm Limited. +++ Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn. +++ Copyright (c) 2017 Instituto de Pesquisas Eldorado. +++ Copyright (c) 1999-2007 Brian Paul. +++ Copyright (c) 2018-2019 Adobe Inc. +++ Copyright 2006-2014 Adobe Systems Incorporated. +++ Copyright 1994-2011 Hewlett-Packard Co. +++ Portions Copyright (c) 2011-2014 IBM Corporation +++ Portions Copyright (c) 1995 Colin Plumb +++ Portions Copyright (c) 1997-2003 Eastman Kodak Company +++ See other third party notices under the License section +++License: GPL with Classpath exception +++ . +++ --- begin of LICENSE --- +++ . +++ The GNU General Public License (GPL) +++ . +++ Version 2, June 1991 +++ . +++ Copyright (C) 1989, 1991 Free Software Foundation, Inc. +++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +++ . +++ Everyone is permitted to copy and distribute verbatim copies of this license +++ document, but changing it is not allowed. +++ . +++ Preamble +++ . +++ The licenses for most software are designed to take away your freedom to share +++ and change it. By contrast, the GNU General Public License is intended to +++ guarantee your freedom to share and change free software--to make sure the +++ software is free for all its users. This General Public License applies to +++ most of the Free Software Foundation's software and to any other program whose +++ authors commit to using it. (Some other Free Software Foundation software is +++ covered by the GNU Library General Public License instead.) You can apply it to +++ your programs, too. +++ . +++ When we speak of free software, we are referring to freedom, not price. Our +++ General Public Licenses are designed to make sure that you have the freedom to +++ distribute copies of free software (and charge for this service if you wish), +++ that you receive source code or can get it if you want it, that you can change +++ the software or use pieces of it in new free programs; and that you know you +++ can do these things. +++ . +++ To protect your rights, we need to make restrictions that forbid anyone to deny +++ you these rights or to ask you to surrender the rights. These restrictions +++ translate to certain responsibilities for you if you distribute copies of the +++ software, or if you modify it. +++ . +++ For example, if you distribute copies of such a program, whether gratis or for +++ a fee, you must give the recipients all the rights that you have. You must +++ make sure that they, too, receive or can get the source code. And you must +++ show them these terms so they know their rights. +++ . +++ We protect your rights with two steps: (1) copyright the software, and (2) +++ offer you this license which gives you legal permission to copy, distribute +++ and/or modify the software. +++ . +++ Also, for each author's protection and ours, we want to make certain that +++ everyone understands that there is no warranty for this free software. If the +++ software is modified by someone else and passed on, we want its recipients to +++ know that what they have is not the original, so that any problems introduced +++ by others will not reflect on the original authors' reputations. +++ . +++ Finally, any free program is threatened constantly by software patents. We +++ wish to avoid the danger that redistributors of a free program will +++ individually obtain patent licenses, in effect making the program proprietary. +++ To prevent this, we have made it clear that any patent must be licensed for +++ everyone's free use or not licensed at all. +++ . +++ The precise terms and conditions for copying, distribution and modification +++ follow. +++ . +++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +++ . +++ 0. This License applies to any program or other work which contains a notice +++ placed by the copyright holder saying it may be distributed under the terms of +++ this General Public License. The "Program", below, refers to any such program +++ or work, and a "work based on the Program" means either the Program or any +++ derivative work under copyright law: that is to say, a work containing the +++ Program or a portion of it, either verbatim or with modifications and/or +++ translated into another language. (Hereinafter, translation is included +++ without limitation in the term "modification".) Each licensee is addressed as +++ "you". +++ . +++ Activities other than copying, distribution and modification are not covered by +++ this License; they are outside its scope. The act of running the Program is +++ not restricted, and the output from the Program is covered only if its contents +++ constitute a work based on the Program (independent of having been made by +++ running the Program). Whether that is true depends on what the Program does. +++ . +++ 1. You may copy and distribute verbatim copies of the Program's source code as +++ you receive it, in any medium, provided that you conspicuously and +++ appropriately publish on each copy an appropriate copyright notice and +++ disclaimer of warranty; keep intact all the notices that refer to this License +++ and to the absence of any warranty; and give any other recipients of the +++ Program a copy of this License along with the Program. +++ . +++ You may charge a fee for the physical act of transferring a copy, and you may +++ at your option offer warranty protection in exchange for a fee. +++ . +++ 2. You may modify your copy or copies of the Program or any portion of it, thus +++ forming a work based on the Program, and copy and distribute such modifications +++ or work under the terms of Section 1 above, provided that you also meet all of +++ these conditions: +++ . +++ a) You must cause the modified files to carry prominent notices stating +++ that you changed the files and the date of any change. +++ . +++ b) You must cause any work that you distribute or publish, that in whole or +++ in part contains or is derived from the Program or any part thereof, to be +++ licensed as a whole at no charge to all third parties under the terms of +++ this License. +++ . +++ c) If the modified program normally reads commands interactively when run, +++ you must cause it, when started running for such interactive use in the +++ most ordinary way, to print or display an announcement including an +++ appropriate copyright notice and a notice that there is no warranty (or +++ else, saying that you provide a warranty) and that users may redistribute +++ the program under these conditions, and telling the user how to view a copy +++ of this License. (Exception: if the Program itself is interactive but does +++ not normally print such an announcement, your work based on the Program is +++ not required to print an announcement.) +++ . +++ These requirements apply to the modified work as a whole. If identifiable +++ sections of that work are not derived from the Program, and can be reasonably +++ considered independent and separate works in themselves, then this License, and +++ its terms, do not apply to those sections when you distribute them as separate +++ works. But when you distribute the same sections as part of a whole which is a +++ work based on the Program, the distribution of the whole must be on the terms +++ of this License, whose permissions for other licensees extend to the entire +++ whole, and thus to each and every part regardless of who wrote it. +++ . +++ Thus, it is not the intent of this section to claim rights or contest your +++ rights to work written entirely by you; rather, the intent is to exercise the +++ right to control the distribution of derivative or collective works based on +++ the Program. +++ . +++ In addition, mere aggregation of another work not based on the Program with the +++ Program (or with a work based on the Program) on a volume of a storage or +++ distribution medium does not bring the other work under the scope of this +++ License. +++ . +++ 3. You may copy and distribute the Program (or a work based on it, under +++ Section 2) in object code or executable form under the terms of Sections 1 and +++ 2 above provided that you also do one of the following: +++ . +++ a) Accompany it with the complete corresponding machine-readable source +++ code, which must be distributed under the terms of Sections 1 and 2 above +++ on a medium customarily used for software interchange; or, +++ . +++ b) Accompany it with a written offer, valid for at least three years, to +++ give any third party, for a charge no more than your cost of physically +++ performing source distribution, a complete machine-readable copy of the +++ corresponding source code, to be distributed under the terms of Sections 1 +++ and 2 above on a medium customarily used for software interchange; or, +++ . +++ c) Accompany it with the information you received as to the offer to +++ distribute corresponding source code. (This alternative is allowed only +++ for noncommercial distribution and only if you received the program in +++ object code or executable form with such an offer, in accord with +++ Subsection b above.) +++ . +++ The source code for a work means the preferred form of the work for making +++ modifications to it. For an executable work, complete source code means all +++ the source code for all modules it contains, plus any associated interface +++ definition files, plus the scripts used to control compilation and installation +++ of the executable. However, as a special exception, the source code +++ distributed need not include anything that is normally distributed (in either +++ source or binary form) with the major components (compiler, kernel, and so on) +++ of the operating system on which the executable runs, unless that component +++ itself accompanies the executable. +++ . +++ If distribution of executable or object code is made by offering access to copy +++ from a designated place, then offering equivalent access to copy the source +++ code from the same place counts as distribution of the source code, even though +++ third parties are not compelled to copy the source along with the object code. +++ . +++ 4. You may not copy, modify, sublicense, or distribute the Program except as +++ expressly provided under this License. Any attempt otherwise to copy, modify, +++ sublicense or distribute the Program is void, and will automatically terminate +++ your rights under this License. However, parties who have received copies, or +++ rights, from you under this License will not have their licenses terminated so +++ long as such parties remain in full compliance. +++ . +++ 5. You are not required to accept this License, since you have not signed it. +++ However, nothing else grants you permission to modify or distribute the Program +++ or its derivative works. These actions are prohibited by law if you do not +++ accept this License. Therefore, by modifying or distributing the Program (or +++ any work based on the Program), you indicate your acceptance of this License to +++ do so, and all its terms and conditions for copying, distributing or modifying +++ the Program or works based on it. +++ . +++ 6. Each time you redistribute the Program (or any work based on the Program), +++ the recipient automatically receives a license from the original licensor to +++ copy, distribute or modify the Program subject to these terms and conditions. +++ You may not impose any further restrictions on the recipients' exercise of the +++ rights granted herein. You are not responsible for enforcing compliance by +++ third parties to this License. +++ . +++ 7. If, as a consequence of a court judgment or allegation of patent +++ infringement or for any other reason (not limited to patent issues), conditions +++ are imposed on you (whether by court order, agreement or otherwise) that +++ contradict the conditions of this License, they do not excuse you from the +++ conditions of this License. If you cannot distribute so as to satisfy +++ simultaneously your obligations under this License and any other pertinent +++ obligations, then as a consequence you may not distribute the Program at all. +++ For example, if a patent license would not permit royalty-free redistribution +++ of the Program by all those who receive copies directly or indirectly through +++ you, then the only way you could satisfy both it and this License would be to +++ refrain entirely from distribution of the Program. +++ . +++ If any portion of this section is held invalid or unenforceable under any +++ particular circumstance, the balance of the section is intended to apply and +++ the section as a whole is intended to apply in other circumstances. +++ . +++ It is not the purpose of this section to induce you to infringe any patents or +++ other property right claims or to contest validity of any such claims; this +++ section has the sole purpose of protecting the integrity of the free software +++ distribution system, which is implemented by public license practices. Many +++ people have made generous contributions to the wide range of software +++ distributed through that system in reliance on consistent application of that +++ system; it is up to the author/donor to decide if he or she is willing to +++ distribute software through any other system and a licensee cannot impose that +++ choice. +++ . +++ This section is intended to make thoroughly clear what is believed to be a +++ consequence of the rest of this License. +++ . +++ 8. If the distribution and/or use of the Program is restricted in certain +++ countries either by patents or by copyrighted interfaces, the original +++ copyright holder who places the Program under this License may add an explicit +++ geographical distribution limitation excluding those countries, so that +++ distribution is permitted only in or among countries not thus excluded. In +++ such case, this License incorporates the limitation as if written in the body +++ of this License. +++ . +++ 9. The Free Software Foundation may publish revised and/or new versions of the +++ General Public License from time to time. Such new versions will be similar in +++ spirit to the present version, but may differ in detail to address new problems +++ or concerns. +++ . +++ Each version is given a distinguishing version number. If the Program +++ specifies a version number of this License which applies to it and "any later +++ version", you have the option of following the terms and conditions either of +++ that version or of any later version published by the Free Software Foundation. +++ If the Program does not specify a version number of this License, you may +++ choose any version ever published by the Free Software Foundation. +++ . +++ 10. If you wish to incorporate parts of the Program into other free programs +++ whose distribution conditions are different, write to the author to ask for +++ permission. For software which is copyrighted by the Free Software Foundation, +++ write to the Free Software Foundation; we sometimes make exceptions for this. +++ Our decision will be guided by the two goals of preserving the free status of +++ all derivatives of our free software and of promoting the sharing and reuse of +++ software generally. +++ . +++ NO WARRANTY +++ . +++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +++ THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +++ STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +++ PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +++ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +++ FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +++ PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, +++ YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +++ . +++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +++ ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +++ PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +++ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR +++ INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA +++ BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +++ FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER +++ OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +++ . +++ END OF TERMS AND CONDITIONS +++ . +++ How to Apply These Terms to Your New Programs +++ . +++ If you develop a new program, and you want it to be of the greatest possible +++ use to the public, the best way to achieve this is to make it free software +++ which everyone can redistribute and change under these terms. +++ . +++ To do so, attach the following notices to the program. It is safest to attach +++ them to the start of each source file to most effectively convey the exclusion +++ of warranty; and each file should have at least the "copyright" line and a +++ pointer to where the full notice is found. +++ . +++ One line to give the program's name and a brief idea of what it does. +++ . +++ Copyright (C) +++ . +++ This program is free software; you can redistribute it and/or modify it +++ under the terms of the GNU General Public License as published by the Free +++ Software Foundation; either version 2 of the License, or (at your option) +++ any later version. +++ . +++ This program 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 for +++ more details. +++ . +++ You should have received a copy of the GNU General Public License along +++ with this program; if not, write to the Free Software Foundation, Inc., +++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +++ . +++ Also add information on how to contact you by electronic and paper mail. +++ . +++ If the program is interactive, make it output a short notice like this when it +++ starts in an interactive mode: +++ . +++ Gnomovision version 69, Copyright (C) year name of author Gnomovision comes +++ with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free +++ software, and you are welcome to redistribute it under certain conditions; +++ type 'show c' for details. +++ . +++ The hypothetical commands 'show w' and 'show c' should show the appropriate +++ parts of the General Public License. Of course, the commands you use may be +++ called something other than 'show w' and 'show c'; they could even be +++ mouse-clicks or menu items--whatever suits your program. +++ . +++ You should also get your employer (if you work as a programmer) or your school, +++ if any, to sign a "copyright disclaimer" for the program, if necessary. Here +++ is a sample; alter the names: +++ . +++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program +++ 'Gnomovision' (which makes passes at compilers) written by James Hacker. +++ . +++ signature of Ty Coon, 1 April 1989 +++ . +++ Ty Coon, President of Vice +++ . +++ This General Public License does not permit incorporating your program into +++ proprietary programs. If your program is a subroutine library, you may +++ consider it more useful to permit linking proprietary applications with the +++ library. If this is what you want to do, use the GNU Library General Public +++ License instead of this License. +++ . +++ . +++ "CLASSPATH" EXCEPTION TO THE GPL +++ . +++ Certain source files distributed by Oracle America and/or its affiliates are +++ subject to the following clarification and special exception to the GPL, but +++ only where Oracle has expressly included in the particular source file's header +++ the words "Oracle designates this particular file as subject to the "Classpath" +++ exception as provided by Oracle in the LICENSE file that accompanied this code." +++ . +++ Linking this library statically or dynamically with other modules is making +++ a combined work based on this library. Thus, the terms and conditions of +++ the GNU General Public License cover the whole combination. +++ . +++ As a special exception, the copyright holders of this library give you +++ permission to link this library with independent modules to produce an +++ executable, regardless of the license terms of these independent modules, +++ and to copy and distribute the resulting executable under terms of your +++ choice, provided that you also meet, for each linked independent module, +++ the terms and conditions of the license of that module. An independent +++ module is a module which is not derived from or based on this library. If +++ you modify this library, you may extend this exception to your version of +++ the library, but you are not obligated to do so. If you do not wish to do +++ so, delete this exception statement from your version. +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ The following licenses for third party code are taken from 'legal' +++ directories of modules under src/ +++ ------------------------------------------------------------------------------ +++ . +++ %% This notice is provided with respect to Cryptix AES v3.2.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Cryptix General License +++ . +++ . +++ Cryptix General License +++ . +++ Copyright (c) 1995-2005 The Cryptix Foundation Limited. +++ All rights reserved. +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are +++ met: +++ . +++ 1. Redistributions of source code must retain the copyright notice, +++ this list of conditions and the following disclaimer. +++ . +++ 2. Redistributions in binary form must reproduce the above copyright +++ notice, this list of conditions and the following disclaimer in +++ the documentation and/or other materials provided with the +++ distribution. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND +++ CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +++ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +++ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +++ IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE +++ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +++ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +++ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +++ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to ASM Bytecode Manipulation Framework v9.3, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ ASM License +++ . +++ . +++ Copyright (c) 2000-2011 France Télécom +++ All rights reserved. +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions +++ are met: +++ . +++ 1. Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ . +++ 2. Redistributions in binary form must reproduce the above copyright +++ notice, this list of conditions and the following disclaimer in the +++ documentation and/or other materials provided with the distribution. +++ . +++ 3. Neither the name of the copyright holders nor the names of its +++ contributors may be used to endorse or promote products derived from +++ this software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +++ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +++ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +++ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +++ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +++ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +++ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +++ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +++ THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to c-libutl 20160225, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ c-libutl License +++ . +++ . +++ This software is distributed under the terms of the BSD license. +++ . +++ == BSD LICENSE =============================================================== +++ . +++ (C) 2009 by Remo Dentato (rdentato@gmail.com) +++ . +++ . +++ Redistribution and use in source and binary forms, with or without modification, +++ are permitted provided that the following conditions are met: +++ . +++ * Redistributions of source code must retain the above copyright notice, +++ this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above copyright notice, +++ this list of conditions and the following disclaimer in the documentation +++ and/or other materials provided with the distribution. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +++ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +++ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +++ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +++ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +++ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +++ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +++ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ http://opensource.org/licenses/bsd-license.php +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Unicode Common Local Data Repository (CLDR) v43, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ CLDR License +++ . +++ . +++ . +++ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +++ . +++ See Terms of Use +++ for definitions of Unicode Inc.’s Data Files and Software. +++ . +++ NOTICE TO USER: Carefully read the following legal agreement. +++ BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +++ DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +++ YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +++ TERMS AND CONDITIONS OF THIS AGREEMENT. +++ IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +++ THE DATA FILES OR SOFTWARE. +++ . +++ COPYRIGHT AND PERMISSION NOTICE +++ . +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of the Unicode data files and any associated documentation +++ (the "Data Files") or Unicode software and any associated documentation +++ (the "Software") to deal in the Data Files or Software +++ without restriction, including without limitation the rights to use, +++ copy, modify, merge, publish, distribute, and/or sell copies of +++ the Data Files or Software, and to permit persons to whom the Data Files +++ or Software are furnished to do so, provided that either +++ (a) this copyright and permission notice appear with all copies +++ of the Data Files or Software, or +++ (b) this copyright and permission notice appear in associated +++ Documentation. +++ . +++ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +++ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +++ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT OF THIRD PARTY RIGHTS. +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +++ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +++ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +++ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +++ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +++ PERFORMANCE OF THE DATA FILES OR SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, +++ use or other dealings in these Data Files or Software without prior +++ written authorization of the copyright holder. +++ . +++ . +++ . +++ ------------------------------------------------------------ Terms of Use --------------------------------------------------------------- +++ . +++ . +++ Unicode® Copyright and Terms of Use +++ . +++ For the general privacy policy governing access to this site, see the Unicode Privacy Policy. +++ . +++ Unicode Copyright +++ Copyright © 1991-2023 Unicode, Inc. All rights reserved. +++ Definitions +++ . +++ Unicode Data Files ("DATA FILES") include all data files under the directories: +++ https://www.unicode.org/Public/ +++ https://www.unicode.org/reports/ +++ https://www.unicode.org/ivd/data/ +++ . +++ Unicode Data Files do not include PDF online code charts under the directory: +++ https://www.unicode.org/Public/ +++ . +++ Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard +++ or any source code or compiled code under the directories: +++ https://www.unicode.org/Public/PROGRAMS/ +++ https://www.unicode.org/Public/cldr/ +++ http://site.icu-project.org/download/ +++ . +++ Terms of Use +++ Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +++ Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. +++ Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. +++ Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. +++ The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. +++ All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +++ No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +++ Modification is not permitted with respect to this document. All copies of this document must be verbatim. +++ Restricted Rights Legend +++ Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +++ Warranties and Disclaimers +++ This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +++ If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +++ EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +++ Waiver of Damages +++ In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +++ Trademarks & Logos +++ The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +++ The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +++ All third party trademarks referenced herein are the property of their respective owners. +++ Miscellaneous +++ Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +++ Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. +++ Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +++ Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +++ Entire Agreement. This Agreement constitutes the entire agreement between the parties. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to International Components for Unicode (ICU4J) v72.1, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ ICU4J License +++ . +++ . +++ COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) +++ . +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of the Unicode data files and any associated documentation +++ (the "Data Files") or Unicode software and any associated documentation +++ (the "Software") to deal in the Data Files or Software +++ without restriction, including without limitation the rights to use, +++ copy, modify, merge, publish, distribute, and/or sell copies of +++ the Data Files or Software, and to permit persons to whom the Data Files +++ or Software are furnished to do so, provided that either +++ (a) this copyright and permission notice appear with all copies +++ of the Data Files or Software, or +++ (b) this copyright and permission notice appear in associated +++ Documentation. +++ . +++ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +++ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +++ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT OF THIRD PARTY RIGHTS. +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +++ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +++ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +++ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +++ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +++ PERFORMANCE OF THE DATA FILES OR SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, +++ use or other dealings in these Data Files or Software without prior +++ written authorization of the copyright holder. +++ . +++ --------------------- +++ . +++ Third-Party Software Licenses +++ . +++ This section contains third-party software notices and/or additional +++ terms for licensed third-party software components included within ICU +++ libraries. +++ . +++ 1. ICU License - ICU 1.8.1 to ICU 57.1 +++ . +++ COPYRIGHT AND PERMISSION NOTICE +++ . +++ Copyright (c) 1995-2016 International Business Machines Corporation and others +++ All rights reserved. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, and/or sell copies of the Software, and to permit persons +++ to whom the Software is furnished to do so, provided that the above +++ copyright notice(s) and this permission notice appear in all copies of +++ the Software and that both the above copyright notice(s) and this +++ permission notice appear in supporting documentation. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +++ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +++ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +++ SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +++ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +++ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +++ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, use +++ or other dealings in this Software without prior written authorization +++ of the copyright holder. +++ . +++ All trademarks and registered trademarks mentioned herein are the +++ property of their respective owners. +++ . +++ 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) +++ . +++ # The Google Chrome software developed by Google is licensed under +++ # the BSD license. Other software included in this distribution is +++ # provided under other licenses, as set forth below. +++ # +++ # The BSD License +++ # http://opensource.org/licenses/bsd-license.php +++ # Copyright (C) 2006-2008, Google Inc. +++ # +++ # All rights reserved. +++ # +++ # Redistribution and use in source and binary forms, with or without +++ # modification, are permitted provided that the following conditions are met: +++ # +++ # Redistributions of source code must retain the above copyright notice, +++ # this list of conditions and the following disclaimer. +++ # Redistributions in binary form must reproduce the above +++ # copyright notice, this list of conditions and the following +++ # disclaimer in the documentation and/or other materials provided with +++ # the distribution. +++ # Neither the name of Google Inc. nor the names of its +++ # contributors may be used to endorse or promote products derived from +++ # this software without specific prior written permission. +++ # +++ # +++ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +++ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +++ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +++ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +++ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +++ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +++ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +++ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +++ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +++ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +++ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +++ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ # +++ # +++ # The word list in cjdict.txt are generated by combining three word lists +++ # listed below with further processing for compound word breaking. The +++ # frequency is generated with an iterative training against Google web +++ # corpora. +++ # +++ # * Libtabe (Chinese) +++ # - https://sourceforge.net/project/?group_id=1519 +++ # - Its license terms and conditions are shown below. +++ # +++ # * IPADIC (Japanese) +++ # - http://chasen.aist-nara.ac.jp/chasen/distribution.html +++ # - Its license terms and conditions are shown below. +++ # +++ # ---------COPYING.libtabe ---- BEGIN-------------------- +++ # +++ # /* +++ # * Copyright (c) 1999 TaBE Project. +++ # * Copyright (c) 1999 Pai-Hsiang Hsiao. +++ # * All rights reserved. +++ # * +++ # * Redistribution and use in source and binary forms, with or without +++ # * modification, are permitted provided that the following conditions +++ # * are met: +++ # * +++ # * . Redistributions of source code must retain the above copyright +++ # * notice, this list of conditions and the following disclaimer. +++ # * . Redistributions in binary form must reproduce the above copyright +++ # * notice, this list of conditions and the following disclaimer in +++ # * the documentation and/or other materials provided with the +++ # * distribution. +++ # * . Neither the name of the TaBE Project nor the names of its +++ # * contributors may be used to endorse or promote products derived +++ # * from this software without specific prior written permission. +++ # * +++ # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +++ # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +++ # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +++ # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +++ # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +++ # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +++ # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +++ # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +++ # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +++ # * OF THE POSSIBILITY OF SUCH DAMAGE. +++ # */ +++ # +++ # /* +++ # * Copyright (c) 1999 Computer Systems and Communication Lab, +++ # * Institute of Information Science, Academia +++ # * Sinica. All rights reserved. +++ # * +++ # * Redistribution and use in source and binary forms, with or without +++ # * modification, are permitted provided that the following conditions +++ # * are met: +++ # * +++ # * . Redistributions of source code must retain the above copyright +++ # * notice, this list of conditions and the following disclaimer. +++ # * . Redistributions in binary form must reproduce the above copyright +++ # * notice, this list of conditions and the following disclaimer in +++ # * the documentation and/or other materials provided with the +++ # * distribution. +++ # * . Neither the name of the Computer Systems and Communication Lab +++ # * nor the names of its contributors may be used to endorse or +++ # * promote products derived from this software without specific +++ # * prior written permission. +++ # * +++ # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +++ # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +++ # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +++ # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +++ # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +++ # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +++ # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +++ # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +++ # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +++ # * OF THE POSSIBILITY OF SUCH DAMAGE. +++ # */ +++ # +++ # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, +++ # University of Illinois +++ # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 +++ # +++ # ---------------COPYING.libtabe-----END-------------------------------- +++ # +++ # +++ # ---------------COPYING.ipadic-----BEGIN------------------------------- +++ # +++ # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science +++ # and Technology. All Rights Reserved. +++ # +++ # Use, reproduction, and distribution of this software is permitted. +++ # Any copy of this software, whether in its original form or modified, +++ # must include both the above copyright notice and the following +++ # paragraphs. +++ # +++ # Nara Institute of Science and Technology (NAIST), +++ # the copyright holders, disclaims all warranties with regard to this +++ # software, including all implied warranties of merchantability and +++ # fitness, in no event shall NAIST be liable for +++ # any special, indirect or consequential damages or any damages +++ # whatsoever resulting from loss of use, data or profits, whether in an +++ # action of contract, negligence or other tortuous action, arising out +++ # of or in connection with the use or performance of this software. +++ # +++ # A large portion of the dictionary entries +++ # originate from ICOT Free Software. The following conditions for ICOT +++ # Free Software applies to the current dictionary as well. +++ # +++ # Each User may also freely distribute the Program, whether in its +++ # original form or modified, to any third party or parties, PROVIDED +++ # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +++ # on, or be attached to, the Program, which is distributed substantially +++ # in the same form as set out herein and that such intended +++ # distribution, if actually made, will neither violate or otherwise +++ # contravene any of the laws and regulations of the countries having +++ # jurisdiction over the User or the intended distribution itself. +++ # +++ # NO WARRANTY +++ # +++ # The program was produced on an experimental basis in the course of the +++ # research and development conducted during the project and is provided +++ # to users as so produced on an experimental basis. Accordingly, the +++ # program is provided without any warranty whatsoever, whether express, +++ # implied, statutory or otherwise. The term "warranty" used herein +++ # includes, but is not limited to, any warranty of the quality, +++ # performance, merchantability and fitness for a particular purpose of +++ # the program and the nonexistence of any infringement or violation of +++ # any right of any third party. +++ # +++ # Each user of the program will agree and understand, and be deemed to +++ # have agreed and understood, that there is no warranty whatsoever for +++ # the program and, accordingly, the entire risk arising from or +++ # otherwise connected with the program is assumed by the user. +++ # +++ # Therefore, neither ICOT, the copyright holder, or any other +++ # organization that participated in or was otherwise related to the +++ # development of the program and their respective officials, directors, +++ # officers and other employees shall be held liable for any and all +++ # damages, including, without limitation, general, special, incidental +++ # and consequential damages, arising out of or otherwise in connection +++ # with the use or inability to use the program or any product, material +++ # or result produced or otherwise obtained by using the program, +++ # regardless of whether they have been advised of, or otherwise had +++ # knowledge of, the possibility of such damages at any time during the +++ # project or thereafter. Each user will be deemed to have agreed to the +++ # foregoing by his or her commencement of use of the program. The term +++ # "use" as used herein includes, but is not limited to, the use, +++ # modification, copying and distribution of the program and the +++ # production of secondary products from the program. +++ # +++ # In the case where the program, whether in its original form or +++ # modified, was distributed or delivered to or received by a user from +++ # any person, organization or entity other than ICOT, unless it makes or +++ # grants independently of ICOT any specific warranty to the user in +++ # writing, such person, organization or entity, will also be exempted +++ # from and not be held liable to the user for any such damages as noted +++ # above as far as the program is concerned. +++ # +++ # ---------------COPYING.ipadic-----END---------------------------------- +++ . +++ 3. Lao Word Break Dictionary Data (laodict.txt) +++ . +++ # Copyright (C) 2016 and later: Unicode, Inc. and others. +++ # License & terms of use: http://www.unicode.org/copyright.html +++ # Copyright (c) 2015 International Business Machines Corporation +++ # and others. All Rights Reserved. +++ # +++ # Project: https://github.com/rober42539/lao-dictionary +++ # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt +++ # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt +++ # (copied below) +++ # +++ # This file is derived from the above dictionary version of Nov 22, 2020 +++ # ---------------------------------------------------------------------- +++ # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. +++ # All rights reserved. +++ # +++ # Redistribution and use in source and binary forms, with or without +++ # modification, are permitted provided that the following conditions are met: +++ # +++ # Redistributions of source code must retain the above copyright notice, this +++ # list of conditions and the following disclaimer. Redistributions in binary +++ # form must reproduce the above copyright notice, this list of conditions and +++ # the following disclaimer in the documentation and/or ther materials +++ # provided with the distribution. +++ # +++ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +++ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +++ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +++ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +++ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +++ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +++ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +++ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +++ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +++ # OF THE POSSIBILITY OF SUCH DAMAGE. +++ # -------------------------------------------------------------------------- +++ . +++ 4. Burmese Word Break Dictionary Data (burmesedict.txt) +++ . +++ # Copyright (c) 2014 International Business Machines Corporation +++ # and others. All Rights Reserved. +++ # +++ # This list is part of a project hosted at: +++ # github.com/kanyawtech/myanmar-karen-word-lists +++ # +++ # -------------------------------------------------------------------------- +++ # Copyright (c) 2013, LeRoy Benjamin Sharon +++ # All rights reserved. +++ # +++ # Redistribution and use in source and binary forms, with or without +++ # modification, are permitted provided that the following conditions +++ # are met: Redistributions of source code must retain the above +++ # copyright notice, this list of conditions and the following +++ # disclaimer. Redistributions in binary form must reproduce the +++ # above copyright notice, this list of conditions and the following +++ # disclaimer in the documentation and/or other materials provided +++ # with the distribution. +++ # +++ # Neither the name Myanmar Karen Word Lists, nor the names of its +++ # contributors may be used to endorse or promote products derived +++ # from this software without specific prior written permission. +++ # +++ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +++ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +++ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +++ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +++ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +++ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +++ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +++ # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +++ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +++ # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +++ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +++ # SUCH DAMAGE. +++ # -------------------------------------------------------------------------- +++ . +++ 5. Time Zone Database +++ . +++ ICU uses the public domain data and code derived from Time Zone +++ Database for its time zone support. The ownership of the TZ database +++ is explained in BCP 175: Procedure for Maintaining the Time Zone +++ Database section 7. +++ . +++ # 7. Database Ownership +++ # +++ # The TZ database itself is not an IETF Contribution or an IETF +++ # document. Rather it is a pre-existing and regularly updated work +++ # that is in the public domain, and is intended to remain in the +++ # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do +++ # not apply to the TZ Database or contributions that individuals make +++ # to it. Should any claims be made and substantiated against the TZ +++ # Database, the organization that is providing the IANA +++ # Considerations defined in this RFC, under the memorandum of +++ # understanding with the IETF, currently ICANN, may act in accordance +++ # with all competent court orders. No ownership claims will be made +++ # by ICANN or the IETF Trust on the database or the code. Any person +++ # making a contribution to the database or code waives all rights to +++ # future claims in that contribution or in the TZ Database. +++ . +++ 6. Google double-conversion +++ . +++ Copyright 2006-2011, the V8 project authors. All rights reserved. +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are +++ met: +++ . +++ * Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above +++ copyright notice, this list of conditions and the following +++ disclaimer in the documentation and/or other materials provided +++ with the distribution. +++ * Neither the name of Google Inc. nor the names of its +++ contributors may be used to endorse or promote products derived +++ from this software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ ==================================================== +++ . +++ Unicode® Copyright and Terms of Use +++ For the general privacy policy governing access to this site, see the Unicode Privacy Policy. +++ . +++ Unicode Copyright +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Definitions +++ Unicode Data Files ("DATA FILES") include all data files under the directories: +++ https://www.unicode.org/Public/ +++ https://www.unicode.org/reports/ +++ https://www.unicode.org/ivd/data/ +++ . +++ Unicode Data Files do not include PDF online code charts under the directory: +++ https://www.unicode.org/Public/ +++ . +++ Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard +++ or any source code or compiled code under the directories: +++ https://www.unicode.org/Public/PROGRAMS/ +++ https://www.unicode.org/Public/cldr/ +++ http://site.icu-project.org/download/ +++ Terms of Use +++ Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +++ Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. +++ Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. +++ Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. +++ The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. +++ All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +++ No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +++ Modification is not permitted with respect to this document. All copies of this document must be verbatim. +++ Restricted Rights Legend +++ Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +++ Warranties and Disclaimers +++ This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +++ If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +++ EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +++ Waiver of Damages +++ In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +++ Trademarks & Logos +++ The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +++ The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +++ All third party trademarks referenced herein are the property of their respective owners. +++ Miscellaneous +++ Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +++ Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. +++ Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +++ Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +++ Entire Agreement. This Agreement constitutes the entire agreement between the parties. +++ . +++ ======================================================= +++ . +++ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +++ . +++ See Terms of Use +++ for definitions of Unicode Inc.’s Data Files and Software. +++ . +++ NOTICE TO USER: Carefully read the following legal agreement. +++ BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +++ DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +++ YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +++ TERMS AND CONDITIONS OF THIS AGREEMENT. +++ IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +++ THE DATA FILES OR SOFTWARE. +++ . +++ COPYRIGHT AND PERMISSION NOTICE +++ . +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of the Unicode data files and any associated documentation +++ (the "Data Files") or Unicode software and any associated documentation +++ (the "Software") to deal in the Data Files or Software +++ without restriction, including without limitation the rights to use, +++ copy, modify, merge, publish, distribute, and/or sell copies of +++ the Data Files or Software, and to permit persons to whom the Data Files +++ or Software are furnished to do so, provided that either +++ (a) this copyright and permission notice appear with all copies +++ of the Data Files or Software, or +++ (b) this copyright and permission notice appear in associated +++ Documentation. +++ . +++ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +++ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +++ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT OF THIRD PARTY RIGHTS. +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +++ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +++ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +++ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +++ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +++ PERFORMANCE OF THE DATA FILES OR SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, +++ use or other dealings in these Data Files or Software without prior +++ written authorization of the copyright holder. +++ . +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Mozilla Public Suffix List, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Public Suffix Notice +++ . +++ You are receiving a copy of the Mozilla Public Suffix List in the following +++ file: /lib/security/public_suffix_list.dat. The terms of the +++ Oracle license do NOT apply to this file; it is licensed under the +++ Mozilla Public License 2.0, separately from the Oracle programs you receive. +++ If you do not wish to use the Public Suffix List, you may remove the +++ /lib/security/public_suffix_list.dat file. +++ . +++ The Source Code of this file is available under the +++ Mozilla Public License, v. 2.0 and is located at +++ https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat. +++ If a copy of the MPL was not distributed with this file, you can obtain one +++ at https://mozilla.org/MPL/2.0/. +++ . +++ Software distributed under the License is distributed on an "AS IS" basis, +++ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +++ for the specific language governing rights and limitations under the License. +++ . +++ . +++ MPL v2.0 +++ . +++ Mozilla Public License Version 2.0 +++ ================================== +++ . +++ 1. Definitions +++ -------------- +++ . +++ 1.1. "Contributor" +++ means each individual or legal entity that creates, contributes to +++ the creation of, or owns Covered Software. +++ . +++ 1.2. "Contributor Version" +++ means the combination of the Contributions of others (if any) used +++ by a Contributor and that particular Contributor's Contribution. +++ . +++ 1.3. "Contribution" +++ means Covered Software of a particular Contributor. +++ . +++ 1.4. "Covered Software" +++ means Source Code Form to which the initial Contributor has attached +++ the notice in Exhibit A, the Executable Form of such Source Code +++ Form, and Modifications of such Source Code Form, in each case +++ including portions thereof. +++ . +++ 1.5. "Incompatible With Secondary Licenses" +++ means +++ . +++ (a) that the initial Contributor has attached the notice described +++ in Exhibit B to the Covered Software; or +++ . +++ (b) that the Covered Software was made available under the terms of +++ version 1.1 or earlier of the License, but not also under the +++ terms of a Secondary License. +++ . +++ 1.6. "Executable Form" +++ means any form of the work other than Source Code Form. +++ . +++ 1.7. "Larger Work" +++ means a work that combines Covered Software with other material, in +++ a separate file or files, that is not Covered Software. +++ . +++ 1.8. "License" +++ means this document. +++ . +++ 1.9. "Licensable" +++ means having the right to grant, to the maximum extent possible, +++ whether at the time of the initial grant or subsequently, any and +++ all of the rights conveyed by this License. +++ . +++ 1.10. "Modifications" +++ means any of the following: +++ . +++ (a) any file in Source Code Form that results from an addition to, +++ deletion from, or modification of the contents of Covered +++ Software; or +++ . +++ (b) any new file in Source Code Form that contains any Covered +++ Software. +++ . +++ 1.11. "Patent Claims" of a Contributor +++ means any patent claim(s), including without limitation, method, +++ process, and apparatus claims, in any patent Licensable by such +++ Contributor that would be infringed, but for the grant of the +++ License, by the making, using, selling, offering for sale, having +++ made, import, or transfer of either its Contributions or its +++ Contributor Version. +++ . +++ 1.12. "Secondary License" +++ means either the GNU General Public License, Version 2.0, the GNU +++ Lesser General Public License, Version 2.1, the GNU Affero General +++ Public License, Version 3.0, or any later versions of those +++ licenses. +++ . +++ 1.13. "Source Code Form" +++ means the form of the work preferred for making modifications. +++ . +++ 1.14. "You" (or "Your") +++ means an individual or a legal entity exercising rights under this +++ License. For legal entities, "You" includes any entity that +++ controls, is controlled by, or is under common control with You. For +++ purposes of this definition, "control" means (a) the power, direct +++ or indirect, to cause the direction or management of such entity, +++ whether by contract or otherwise, or (b) ownership of more than +++ fifty percent (50%) of the outstanding shares or beneficial +++ ownership of such entity. +++ . +++ 2. License Grants and Conditions +++ -------------------------------- +++ . +++ 2.1. Grants +++ . +++ Each Contributor hereby grants You a world-wide, royalty-free, +++ non-exclusive license: +++ . +++ (a) under intellectual property rights (other than patent or trademark) +++ Licensable by such Contributor to use, reproduce, make available, +++ modify, display, perform, distribute, and otherwise exploit its +++ Contributions, either on an unmodified basis, with Modifications, or +++ as part of a Larger Work; and +++ . +++ (b) under Patent Claims of such Contributor to make, use, sell, offer +++ for sale, have made, import, and otherwise transfer either its +++ Contributions or its Contributor Version. +++ . +++ 2.2. Effective Date +++ . +++ The licenses granted in Section 2.1 with respect to any Contribution +++ become effective for each Contribution on the date the Contributor first +++ distributes such Contribution. +++ . +++ 2.3. Limitations on Grant Scope +++ . +++ The licenses granted in this Section 2 are the only rights granted under +++ this License. No additional rights or licenses will be implied from the +++ distribution or licensing of Covered Software under this License. +++ Notwithstanding Section 2.1(b) above, no patent license is granted by a +++ Contributor: +++ . +++ (a) for any code that a Contributor has removed from Covered Software; +++ or +++ . +++ (b) for infringements caused by: (i) Your and any other third party's +++ modifications of Covered Software, or (ii) the combination of its +++ Contributions with other software (except as part of its Contributor +++ Version); or +++ . +++ (c) under Patent Claims infringed by Covered Software in the absence of +++ its Contributions. +++ . +++ This License does not grant any rights in the trademarks, service marks, +++ or logos of any Contributor (except as may be necessary to comply with +++ the notice requirements in Section 3.4). +++ . +++ 2.4. Subsequent Licenses +++ . +++ No Contributor makes additional grants as a result of Your choice to +++ distribute the Covered Software under a subsequent version of this +++ License (see Section 10.2) or under the terms of a Secondary License (if +++ permitted under the terms of Section 3.3). +++ . +++ 2.5. Representation +++ . +++ Each Contributor represents that the Contributor believes its +++ Contributions are its original creation(s) or it has sufficient rights +++ to grant the rights to its Contributions conveyed by this License. +++ . +++ 2.6. Fair Use +++ . +++ This License is not intended to limit any rights You have under +++ applicable copyright doctrines of fair use, fair dealing, or other +++ equivalents. +++ . +++ 2.7. Conditions +++ . +++ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +++ in Section 2.1. +++ . +++ 3. Responsibilities +++ ------------------- +++ . +++ 3.1. Distribution of Source Form +++ . +++ All distribution of Covered Software in Source Code Form, including any +++ Modifications that You create or to which You contribute, must be under +++ the terms of this License. You must inform recipients that the Source +++ Code Form of the Covered Software is governed by the terms of this +++ License, and how they can obtain a copy of this License. You may not +++ attempt to alter or restrict the recipients' rights in the Source Code +++ Form. +++ . +++ 3.2. Distribution of Executable Form +++ . +++ If You distribute Covered Software in Executable Form then: +++ . +++ (a) such Covered Software must also be made available in Source Code +++ Form, as described in Section 3.1, and You must inform recipients of +++ the Executable Form how they can obtain a copy of such Source Code +++ Form by reasonable means in a timely manner, at a charge no more +++ than the cost of distribution to the recipient; and +++ . +++ (b) You may distribute such Executable Form under the terms of this +++ License, or sublicense it under different terms, provided that the +++ license for the Executable Form does not attempt to limit or alter +++ the recipients' rights in the Source Code Form under this License. +++ . +++ 3.3. Distribution of a Larger Work +++ . +++ You may create and distribute a Larger Work under terms of Your choice, +++ provided that You also comply with the requirements of this License for +++ the Covered Software. If the Larger Work is a combination of Covered +++ Software with a work governed by one or more Secondary Licenses, and the +++ Covered Software is not Incompatible With Secondary Licenses, this +++ License permits You to additionally distribute such Covered Software +++ under the terms of such Secondary License(s), so that the recipient of +++ the Larger Work may, at their option, further distribute the Covered +++ Software under the terms of either this License or such Secondary +++ License(s). +++ . +++ 3.4. Notices +++ . +++ You may not remove or alter the substance of any license notices +++ (including copyright notices, patent notices, disclaimers of warranty, +++ or limitations of liability) contained within the Source Code Form of +++ the Covered Software, except that You may alter any license notices to +++ the extent required to remedy known factual inaccuracies. +++ . +++ 3.5. Application of Additional Terms +++ . +++ You may choose to offer, and to charge a fee for, warranty, support, +++ indemnity or liability obligations to one or more recipients of Covered +++ Software. However, You may do so only on Your own behalf, and not on +++ behalf of any Contributor. You must make it absolutely clear that any +++ such warranty, support, indemnity, or liability obligation is offered by +++ You alone, and You hereby agree to indemnify every Contributor for any +++ liability incurred by such Contributor as a result of warranty, support, +++ indemnity or liability terms You offer. You may include additional +++ disclaimers of warranty and limitations of liability specific to any +++ jurisdiction. +++ . +++ 4. Inability to Comply Due to Statute or Regulation +++ --------------------------------------------------- +++ . +++ If it is impossible for You to comply with any of the terms of this +++ License with respect to some or all of the Covered Software due to +++ statute, judicial order, or regulation then You must: (a) comply with +++ the terms of this License to the maximum extent possible; and (b) +++ describe the limitations and the code they affect. Such description must +++ be placed in a text file included with all distributions of the Covered +++ Software under this License. Except to the extent prohibited by statute +++ or regulation, such description must be sufficiently detailed for a +++ recipient of ordinary skill to be able to understand it. +++ . +++ 5. Termination +++ -------------- +++ . +++ 5.1. The rights granted under this License will terminate automatically +++ if You fail to comply with any of its terms. However, if You become +++ compliant, then the rights granted under this License from a particular +++ Contributor are reinstated (a) provisionally, unless and until such +++ Contributor explicitly and finally terminates Your grants, and (b) on an +++ ongoing basis, if such Contributor fails to notify You of the +++ non-compliance by some reasonable means prior to 60 days after You have +++ come back into compliance. Moreover, Your grants from a particular +++ Contributor are reinstated on an ongoing basis if such Contributor +++ notifies You of the non-compliance by some reasonable means, this is the +++ first time You have received notice of non-compliance with this License +++ from such Contributor, and You become compliant prior to 30 days after +++ Your receipt of the notice. +++ . +++ 5.2. If You initiate litigation against any entity by asserting a patent +++ infringement claim (excluding declaratory judgment actions, +++ counter-claims, and cross-claims) alleging that a Contributor Version +++ directly or indirectly infringes any patent, then the rights granted to +++ You by any and all Contributors for the Covered Software under Section +++ 2.1 of this License shall terminate. +++ . +++ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all +++ end user license agreements (excluding distributors and resellers) which +++ have been validly granted by You or Your distributors under this License +++ prior to termination shall survive termination. +++ . +++ ************************************************************************ +++ * * +++ * 6. Disclaimer of Warranty * +++ * ------------------------- * +++ * * +++ * Covered Software is provided under this License on an "as is" * +++ * basis, without warranty of any kind, either expressed, implied, or * +++ * statutory, including, without limitation, warranties that the * +++ * Covered Software is free of defects, merchantable, fit for a * +++ * particular purpose or non-infringing. The entire risk as to the * +++ * quality and performance of the Covered Software is with You. * +++ * Should any Covered Software prove defective in any respect, You * +++ * (not any Contributor) assume the cost of any necessary servicing, * +++ * repair, or correction. This disclaimer of warranty constitutes an * +++ * essential part of this License. No use of any Covered Software is * +++ * authorized under this License except under this disclaimer. * +++ * * +++ ************************************************************************ +++ . +++ ************************************************************************ +++ * * +++ * 7. Limitation of Liability * +++ * -------------------------- * +++ * * +++ * Under no circumstances and under no legal theory, whether tort * +++ * (including negligence), contract, or otherwise, shall any * +++ * Contributor, or anyone who distributes Covered Software as * +++ * permitted above, be liable to You for any direct, indirect, * +++ * special, incidental, or consequential damages of any character * +++ * including, without limitation, damages for lost profits, loss of * +++ * goodwill, work stoppage, computer failure or malfunction, or any * +++ * and all other commercial damages or losses, even if such party * +++ * shall have been informed of the possibility of such damages. This * +++ * limitation of liability shall not apply to liability for death or * +++ * personal injury resulting from such party's negligence to the * +++ * extent applicable law prohibits such limitation. Some * +++ * jurisdictions do not allow the exclusion or limitation of * +++ * incidental or consequential damages, so this exclusion and * +++ * limitation may not apply to You. * +++ * * +++ ************************************************************************ +++ . +++ 8. Litigation +++ ------------- +++ . +++ Any litigation relating to this License may be brought only in the +++ courts of a jurisdiction where the defendant maintains its principal +++ place of business and such litigation shall be governed by laws of that +++ jurisdiction, without reference to its conflict-of-law provisions. +++ Nothing in this Section shall prevent a party's ability to bring +++ cross-claims or counter-claims. +++ . +++ 9. Miscellaneous +++ ---------------- +++ . +++ This License represents the complete agreement concerning the subject +++ matter hereof. If any provision of this License is held to be +++ unenforceable, such provision shall be reformed only to the extent +++ necessary to make it enforceable. Any law or regulation which provides +++ that the language of a contract shall be construed against the drafter +++ shall not be used to construe this License against a Contributor. +++ . +++ 10. Versions of the License +++ --------------------------- +++ . +++ 10.1. New Versions +++ . +++ Mozilla Foundation is the license steward. Except as provided in Section +++ 10.3, no one other than the license steward has the right to modify or +++ publish new versions of this License. Each version will be given a +++ distinguishing version number. +++ . +++ 10.2. Effect of New Versions +++ . +++ You may distribute the Covered Software under the terms of the version +++ of the License under which You originally received the Covered Software, +++ or under the terms of any subsequent version published by the license +++ steward. +++ . +++ 10.3. Modified Versions +++ . +++ If you create software not governed by this License, and you want to +++ create a new license for such software, you may create and use a +++ modified version of this License if you rename the license and remove +++ any references to the name of the license steward (except to note that +++ such modified license differs from this License). +++ . +++ 10.4. Distributing Source Code Form that is Incompatible With Secondary +++ Licenses +++ . +++ If You choose to distribute Source Code Form that is Incompatible With +++ Secondary Licenses under the terms of this version of the License, the +++ notice described in Exhibit B of this License must be attached. +++ . +++ Exhibit A - Source Code Form License Notice +++ ------------------------------------------- +++ . +++ 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 https://mozilla.org/MPL/2.0/. +++ . +++ If it is not possible or desirable to put the notice in a particular +++ file, then You may include the notice in a location (such as a LICENSE +++ file in a relevant directory) where a recipient would be likely to look +++ for such a notice. +++ . +++ You may add additional accurate notices of copyright ownership. +++ . +++ Exhibit B - "Incompatible With Secondary Licenses" Notice +++ --------------------------------------------------------- +++ . +++ This Source Code Form is "Incompatible With Secondary Licenses", as +++ defined by the Mozilla Public License, v. 2.0. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to SipHash v1.0-68c8a7c, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Notice +++ SipHash reference C implementation +++ . +++ . +++ Copyright (c) 2016 Jean-Philippe Aumasson +++ . +++ To the extent possible under law, the author(s) have dedicated all copyright +++ and related and neighboring rights to this software to the public domain +++ worldwide. This software is distributed without any warranty. +++ . +++ You should have received a copy of the CC0 Public Domain Dedication along +++ with +++ this software. If not, see +++ . +++ . +++ . +++ Licenses +++ The code is dual-licensed CCO and MIT +++ . +++ #MIT License +++ . +++ Copyright 2012-2024 JP Aumasson +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ . +++ #CC0 1.0 Universal +++ . +++ Statement of Purpose +++ . +++ The laws of most jurisdictions throughout the world automatically confer +++ exclusive Copyright and Related Rights (defined below) upon the creator and +++ subsequent owner(s) (each and all, an "owner") of an original work of +++ authorship and/or a database (each, a "Work"). +++ . +++ Certain owners wish to permanently relinquish those rights to a Work for the +++ purpose of contributing to a commons of creative, cultural and scientific +++ works ("Commons") that the public can reliably and without fear of later +++ claims of infringement build upon, modify, incorporate in other works, reuse +++ and redistribute as freely as possible in any form whatsoever and for any +++ purposes, including without limitation commercial purposes. These owners may +++ contribute to the Commons to promote the ideal of a free culture and the +++ further production of creative, cultural and scientific works, or to gain +++ reputation or greater distribution for their Work in part through the use and +++ efforts of others. +++ . +++ For these and/or other purposes and motivations, and without any expectation +++ of additional consideration or compensation, the person associating CC0 with a +++ Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +++ and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +++ and publicly distribute the Work under its terms, with knowledge of his or her +++ Copyright and Related Rights in the Work and the meaning and intended legal +++ effect of CC0 on those rights. +++ . +++ 1. Copyright and Related Rights. A Work made available under CC0 may be +++ protected by copyright and related or neighboring rights ("Copyright and +++ Related Rights"). Copyright and Related Rights include, but are not limited +++ to, the following: +++ . +++ i. the right to reproduce, adapt, distribute, perform, display, communicate, +++ and translate a Work; +++ . +++ ii. moral rights retained by the original author(s) and/or performer(s); +++ . +++ iii. publicity and privacy rights pertaining to a person's image or likeness +++ depicted in a Work; +++ . +++ iv. rights protecting against unfair competition in regards to a Work, +++ subject to the limitations in paragraph 4(a), below; +++ . +++ v. rights protecting the extraction, dissemination, use and reuse of data in +++ a Work; +++ . +++ vi. database rights (such as those arising under Directive 96/9/EC of the +++ European Parliament and of the Council of 11 March 1996 on the legal +++ protection of databases, and under any national implementation thereof, +++ including any amended or successor version of such directive); and +++ . +++ vii. other similar, equivalent or corresponding rights throughout the world +++ based on applicable law or treaty, and any national implementations thereof. +++ . +++ 2. Waiver. To the greatest extent permitted by, but not in contravention of, +++ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +++ unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +++ and Related Rights and associated claims and causes of action, whether now +++ known or unknown (including existing as well as future claims and causes of +++ action), in the Work (i) in all territories worldwide, (ii) for the maximum +++ duration provided by applicable law or treaty (including future time +++ extensions), (iii) in any current or future medium and for any number of +++ copies, and (iv) for any purpose whatsoever, including without limitation +++ commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes +++ the Waiver for the benefit of each member of the public at large and to the +++ detriment of Affirmer's heirs and successors, fully intending that such Waiver +++ shall not be subject to revocation, rescission, cancellation, termination, or +++ any other legal or equitable action to disrupt the quiet enjoyment of the Work +++ by the public as contemplated by Affirmer's express Statement of Purpose. +++ . +++ 3. Public License Fallback. Should any part of the Waiver for any reason be +++ judged legally invalid or ineffective under applicable law, then the Waiver +++ shall be preserved to the maximum extent permitted taking into account +++ Affirmer's express Statement of Purpose. In addition, to the extent the Waiver +++ is so judged Affirmer hereby grants to each affected person a royalty-free, +++ non transferable, non sublicensable, non exclusive, irrevocable and +++ unconditional license to exercise Affirmer's Copyright and Related Rights in +++ the Work (i) in all territories worldwide, (ii) for the maximum duration +++ provided by applicable law or treaty (including future time extensions), (iii) +++ in any current or future medium and for any number of copies, and (iv) for any +++ purpose whatsoever, including without limitation commercial, advertising or +++ promotional purposes (the "License"). The License shall be deemed effective as +++ of the date CC0 was applied by Affirmer to the Work. Should any part of the +++ License for any reason be judged legally invalid or ineffective under +++ applicable law, such partial invalidity or ineffectiveness shall not +++ invalidate the remainder of the License, and in such case Affirmer hereby +++ affirms that he or she will not (i) exercise any of his or her remaining +++ Copyright and Related Rights in the Work or (ii) assert any associated claims +++ and causes of action with respect to the Work, in either case contrary to +++ Affirmer's express Statement of Purpose. +++ . +++ 4. Limitations and Disclaimers. +++ . +++ a. No trademark or patent rights held by Affirmer are waived, abandoned, +++ surrendered, licensed or otherwise affected by this document. +++ . +++ b. Affirmer offers the Work as-is and makes no representations or warranties +++ of any kind concerning the Work, express, implied, statutory or otherwise, +++ including without limitation warranties of title, merchantability, fitness +++ for a particular purpose, non infringement, or the absence of latent or +++ other defects, accuracy, or the present or absence of errors, whether or not +++ discoverable, all to the greatest extent permissible under applicable law. +++ . +++ c. Affirmer disclaims responsibility for clearing rights of other persons +++ that may apply to the Work or any use thereof, including without limitation +++ any person's Copyright and Related Rights in the Work. Further, Affirmer +++ disclaims responsibility for obtaining any necessary consents, permissions +++ or other rights required for any use of the Work. +++ . +++ d. Affirmer understands and acknowledges that Creative Commons is not a +++ party to this document and has no duty or obligation with respect to this +++ CC0 or use of the Work. +++ . +++ For more information, please see +++ +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to The Unicode Standard, Unicode Character Database, Version 15.0.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Unicode Character Database +++ . +++ . +++ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +++ . +++ See Terms of Use for definitions of Unicode Inc.'s +++ Data Files and Software. +++ . +++ NOTICE TO USER: Carefully read the following legal agreement. +++ BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +++ DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +++ YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +++ TERMS AND CONDITIONS OF THIS AGREEMENT. +++ IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +++ THE DATA FILES OR SOFTWARE. +++ . +++ COPYRIGHT AND PERMISSION NOTICE +++ . +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of the Unicode data files and any associated documentation +++ (the "Data Files") or Unicode software and any associated documentation +++ (the "Software") to deal in the Data Files or Software +++ without restriction, including without limitation the rights to use, +++ copy, modify, merge, publish, distribute, and/or sell copies of +++ the Data Files or Software, and to permit persons to whom the Data Files +++ or Software are furnished to do so, provided that either +++ (a) this copyright and permission notice appear with all copies +++ of the Data Files or Software, or +++ (b) this copyright and permission notice appear in associated +++ Documentation. +++ . +++ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +++ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +++ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT OF THIRD PARTY RIGHTS. +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +++ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +++ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +++ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +++ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +++ PERFORMANCE OF THE DATA FILES OR SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, +++ use or other dealings in these Data Files or Software without prior +++ written authorization of the copyright holder. +++ . +++ === http://www.unicode.org/copyright.html content === +++ Unicode (R) Copyright and Terms of Use +++ For the general privacy policy governing access to this site, see the Unicode Privacy Policy. +++ . +++ Unicode Copyright +++ Copyright (C) 1991-2022 Unicode, Inc. All rights reserved. +++ Definitions +++ Unicode Data Files ("DATA FILES") include all data files under the directories: +++ https://www.unicode.org/Public/ +++ https://www.unicode.org/reports/ +++ https://www.unicode.org/ivd/data/ +++ . +++ Unicode Data Files do not include PDF online code charts under the directory: +++ https://www.unicode.org/Public/ +++ . +++ Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard +++ or any source code or compiled code under the directories: +++ https://www.unicode.org/Public/PROGRAMS/ +++ https://www.unicode.org/Public/cldr/ +++ http://site.icu-project.org/download/ +++ Terms of Use +++ Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +++ Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. +++ Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. +++ Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. +++ The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. +++ All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +++ No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +++ Modification is not permitted with respect to this document. All copies of this document must be verbatim. +++ Restricted Rights Legend +++ Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +++ Warranties and Disclaimers +++ This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +++ If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +++ EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +++ Waiver of Damages +++ In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +++ Trademarks & Logos +++ The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +++ The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +++ All third party trademarks referenced herein are the property of their respective owners. +++ Miscellaneous +++ Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +++ Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. +++ Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +++ Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +++ Entire Agreement. This Agreement constitutes the entire agreement between the parties. +++ . +++ . +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Eastman Kodak Company: Portions of color management and imaging software, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Eastman Kodak Notice +++ . +++ Portions Copyright Eastman Kodak Company 1991-2003 +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to The FreeType Project: Freetype v2.13.2, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ . +++ FreeType Notice +++ . +++ . +++ FreeType comes with two licenses from which you can choose the one +++ which fits your needs best. +++ . +++ The FreeType License (FTL) is the most commonly used one. It is +++ a BSD-style license with a credit clause and thus compatible with +++ the GNU Public License (GPL) version 3, but not with the +++ GPL version 2. +++ . +++ The GNU General Public License (GPL), version 2. Use it for all +++ projects which use the GPLv2 also, or which need a license +++ compatible to the GPLv2. +++ . +++ . +++ . +++ FreeType License +++ . +++ . +++ Copyright (C) 1996-2023 by David Turner, Robert Wilhelm, and Werner Lemberg. +++ Copyright (C) 2007-2023 by Dereg Clegg and Michael Toftdal. +++ Copyright (C) 1996-2023 by Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. +++ Copyright (C) 2022-2023 by David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and +++ Copyright (C) 2004-2023 by Masatake YAMATO and Redhat K.K. +++ Copyright (C) 2007-2023 by Derek Clegg and Michael Toftdal. +++ Copyright (C) 2003-2023 by Masatake YAMATO, Red Hat K.K., +++ Copyright (C) 1996-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches. +++ Copyright (C) 2007-2023 by David Turner. +++ Copyright (C) 2022-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. +++ Copyright (C) 2007-2023 by Rahul Bhalerao , . +++ Copyright (C) 2008-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. +++ Copyright (C) 2013-2023 by Google, Inc. +++ Copyright (C) 2019-2023 by Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. +++ Copyright (C) 2009-2023 by Oran Agra and Mickey Gabel. +++ Copyright (C) 2018-2023 by David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg. +++ Copyright (C) 2004-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. +++ . +++ . +++ The FreeType Project LICENSE +++ ---------------------------- +++ . +++ 2006-Jan-27 +++ . +++ Copyright 1996-2002, 2006 by +++ David Turner, Robert Wilhelm, and Werner Lemberg +++ . +++ . +++ . +++ Introduction +++ ============ +++ . +++ The FreeType Project is distributed in several archive packages; +++ some of them may contain, in addition to the FreeType font engine, +++ various tools and contributions which rely on, or relate to, the +++ FreeType Project. +++ . +++ This license applies to all files found in such packages, and +++ which do not fall under their own explicit license. The license +++ affects thus the FreeType font engine, the test programs, +++ documentation and makefiles, at the very least. +++ . +++ This license was inspired by the BSD, Artistic, and IJG +++ (Independent JPEG Group) licenses, which all encourage inclusion +++ and use of free software in commercial and freeware products +++ alike. As a consequence, its main points are that: +++ . +++ o We don't promise that this software works. However, we will be +++ interested in any kind of bug reports. (`as is' distribution) +++ . +++ o You can use this software for whatever you want, in parts or +++ full form, without having to pay us. (`royalty-free' usage) +++ . +++ o You may not pretend that you wrote this software. If you use +++ it, or only parts of it, in a program, you must acknowledge +++ somewhere in your documentation that you have used the +++ FreeType code. (`credits') +++ . +++ We specifically permit and encourage the inclusion of this +++ software, with or without modifications, in commercial products. +++ We disclaim all warranties covering The FreeType Project and +++ assume no liability related to The FreeType Project. +++ . +++ . +++ Finally, many people asked us for a preferred form for a +++ credit/disclaimer to use in compliance with this license. We thus +++ encourage you to use the following text: +++ . +++ """ +++ Portions of this software are copyright © The FreeType +++ Project (www.freetype.org). All rights reserved. +++ """ +++ . +++ Please replace with the value from the FreeType version you +++ actually use. +++ . +++ . +++ Legal Terms +++ =========== +++ . +++ 0. Definitions +++ -------------- +++ . +++ Throughout this license, the terms `package', `FreeType Project', +++ and `FreeType archive' refer to the set of files originally +++ distributed by the authors (David Turner, Robert Wilhelm, and +++ Werner Lemberg) as the `FreeType Project', be they named as alpha, +++ beta or final release. +++ . +++ `You' refers to the licensee, or person using the project, where +++ `using' is a generic term including compiling the project's source +++ code as well as linking it to form a `program' or `executable'. +++ This program is referred to as `a program using the FreeType +++ engine'. +++ . +++ This license applies to all files distributed in the original +++ FreeType Project, including all source code, binaries and +++ documentation, unless otherwise stated in the file in its +++ original, unmodified form as distributed in the original archive. +++ If you are unsure whether or not a particular file is covered by +++ this license, you must contact us to verify this. +++ . +++ The FreeType Project is copyright (C) 1996-2000 by David Turner, +++ Robert Wilhelm, and Werner Lemberg. All rights reserved except as +++ specified below. +++ . +++ 1. No Warranty +++ -------------- +++ . +++ THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY +++ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +++ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +++ PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS +++ BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO +++ USE, OF THE FREETYPE PROJECT. +++ . +++ 2. Redistribution +++ ----------------- +++ . +++ This license grants a worldwide, royalty-free, perpetual and +++ irrevocable right and license to use, execute, perform, compile, +++ display, copy, create derivative works of, distribute and +++ sublicense the FreeType Project (in both source and object code +++ forms) and derivative works thereof for any purpose; and to +++ authorize others to exercise some or all of the rights granted +++ herein, subject to the following conditions: +++ . +++ o Redistribution of source code must retain this license file +++ (`FTL.TXT') unaltered; any additions, deletions or changes to +++ the original files must be clearly indicated in accompanying +++ documentation. The copyright notices of the unaltered, +++ original files must be preserved in all copies of source +++ files. +++ . +++ o Redistribution in binary form must provide a disclaimer that +++ states that the software is based in part of the work of the +++ FreeType Team, in the distribution documentation. We also +++ encourage you to put an URL to the FreeType web page in your +++ documentation, though this isn't mandatory. +++ . +++ These conditions apply to any software derived from or based on +++ the FreeType Project, not just the unmodified files. If you use +++ our work, you must acknowledge us. However, no fee need be paid +++ to us. +++ . +++ 3. Advertising +++ -------------- +++ . +++ Neither the FreeType authors and contributors nor you shall use +++ the name of the other for commercial, advertising, or promotional +++ purposes without specific prior written permission. +++ . +++ We suggest, but do not require, that you use one or more of the +++ following phrases to refer to this software in your documentation +++ or advertising materials: `FreeType Project', `FreeType Engine', +++ `FreeType library', or `FreeType Distribution'. +++ . +++ As you have not signed this license, you are not required to +++ accept it. However, as the FreeType Project is copyrighted +++ material, only this license, or another one contracted with the +++ authors, grants you the right to use, distribute, and modify it. +++ Therefore, by using, distributing, or modifying the FreeType +++ Project, you indicate that you understand and accept all the terms +++ of this license. +++ . +++ 4. Contacts +++ ----------- +++ . +++ There are two mailing lists related to FreeType: +++ . +++ o freetype@nongnu.org +++ . +++ Discusses general use and applications of FreeType, as well as +++ future and wanted additions to the library and distribution. +++ If you are looking for support, start in this list if you +++ haven't found anything to help you in the documentation. +++ . +++ o freetype-devel@nongnu.org +++ . +++ Discusses bugs, as well as engine internals, design issues, +++ specific licenses, porting, etc. +++ . +++ Our home page can be found at +++ . +++ https://www.freetype.org +++ . +++ . +++ . +++ GPL v2: Refer to the copy under /usr/share/common-licenses +++ . +++ Additional Freetype Attributions +++ . +++ . +++ --------------------------------- +++ The below license applies to the following files: +++ libfreetype/src/psaux/psarrst.c +++ libfreetype/src/psaux/psarrst.h +++ libfreetype/src/psaux/psblues.c +++ libfreetype/src/psaux/psblues.h +++ libfreetype/src/psaux/pserror.c +++ libfreetype/src/psaux/pserror.h +++ libfreetype/src/psaux/psfixed.h +++ libfreetype/src/psaux/psfont.c +++ libfreetype/src/psaux/psfont.h +++ libfreetype/src/psaux/psft.c +++ libfreetype/src/psaux/psft.h +++ libfreetype/src/psaux/psglue.h +++ libfreetype/src/psaux/pshints.c +++ libfreetype/src/psaux/pshints.h +++ libfreetype/src/psaux/psintrp.c +++ libfreetype/src/psaux/psintrp.h +++ libfreetype/src/psaux/psread.c +++ libfreetype/src/psaux/psread.h +++ libfreetype/src/psaux/psstack.c +++ libfreetype/src/psaux/psstack.h +++ libfreetype/src/psaux/pstypes.h +++ . +++ Copyright 2006-2014 Adobe Systems Incorporated. +++ . +++ This software, and all works of authorship, whether in source or +++ object code form as indicated by the copyright notice(s) included +++ herein (collectively, the "Work") is made available, and may only be +++ used, modified, and distributed under the FreeType Project License, +++ LICENSE.TXT. Additionally, subject to the terms and conditions of the +++ FreeType Project License, each contributor to the Work hereby grants +++ to any individual or legal entity exercising permissions granted by +++ the FreeType Project License and this section (hereafter, "You" or +++ "Your") a perpetual, worldwide, non-exclusive, no-charge, +++ royalty-free, irrevocable (except as stated in this section) patent +++ license to make, have made, use, offer to sell, sell, import, and +++ otherwise transfer the Work, where such license applies only to those +++ patent claims licensable by such contributor that are necessarily +++ infringed by their contribution(s) alone or by combination of their +++ contribution(s) with the Work to which such contribution(s) was +++ submitted. If You institute patent litigation against any entity +++ (including a cross-claim or counterclaim in a lawsuit) alleging that +++ the Work or a contribution incorporated within the Work constitutes +++ direct or contributory patent infringement, then any patent licenses +++ granted to You under this License for that Work shall terminate as of +++ the date such litigation is filed. +++ . +++ By using, modifying, or distributing the Work you indicate that you +++ have read and understood the terms and conditions of the +++ FreeType Project License as well as those provided in this section, +++ and you accept them fully. +++ . +++ . +++ . +++ . +++ MIT License +++ . +++ . +++ --------------------------------- +++ The below license applies to the following files: +++ libfreetype/include/freetype/internal/fthash.h +++ libfreetype/src/base/fthash.c +++ . +++ Copyright 2000 Computing Research Labs, New Mexico State University +++ Copyright 2001-2015 +++ . +++ Francesco Zappa Nardelli +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and associated documentation files (the "Software"), +++ to deal in the Software without restriction, including without limitation +++ the rights to use, copy, modify, merge, publish, distribute, sublicense, +++ and/or sell copies of the Software, and to permit persons to whom the +++ Software is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included in +++ all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +++ THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +++ OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +++ THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Harfbuzz v8.2.2, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Harfbuzz License +++ . +++ . +++ . +++ HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +++ For parts of HarfBuzz that are licensed under different licenses see individual +++ files names COPYING in subdirectories where applicable. +++ . +++ Copyright © 2010-2023 Google, Inc. +++ Copyright © 2018-2020 Ebrahim Byagowi +++ Copyright © 2004-2013 Red Hat, Inc. +++ Copyright © 2019 Facebook, Inc. +++ Copyright (C) 2012 Zilong Tan (eric.zltan@gmail.com) +++ Copyright © 2007 Chris Wilson +++ Copyright © 2018-2019 Adobe Inc. +++ Copyright © 2006-2023 Behdad Esfahbod +++ Copyright © 1998-2004 David Turner and Werner Lemberg +++ Copyright © 2009 Keith Stribley +++ Copyright © 2018 Khaled Hosny +++ Copyright © 2016 Elie Roux +++ Copyright © 2016 Igalia S.L. +++ Copyright © 2015 Mozilla Foundation. +++ Copyright © 1999 David Turner +++ Copyright © 2005 Werner Lemberg +++ Copyright © 2013-2015 Alexei Podtelezhnikov +++ Copyright © 2022 Matthias Clasen +++ Copyright © 2011 Codethink Limited +++ . +++ For full copyright notices consult the individual files in the package. +++ . +++ . +++ Permission is hereby granted, without written agreement and without +++ license or royalty fees, to use, copy, modify, and distribute this +++ software and its documentation for any purpose, provided that the +++ above copyright notice and the following two paragraphs appear in +++ all copies of this software. +++ . +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +++ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +++ ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +++ IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +++ DAMAGE. +++ . +++ THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +++ BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +++ FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +++ ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +++ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +++ . +++ All source code, except for one section, is licensed as above. The one +++ exception is licensed with a slightly different MIT variant: +++ The contents of this directory are licensed under the following terms: +++ . +++ --------------------------------- +++ The below license applies to the following files: +++ libharfbuzz/hb-ucd.cc +++ . +++ Copyright (C) 2012 Grigori Goronzy +++ . +++ Permission to use, copy, modify, and/or distribute this software for any +++ purpose with or without fee is hereby granted, provided that the above +++ copyright notice and this permission notice appear in all copies. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +++ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +++ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +++ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +++ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +++ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +++ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +++ . +++ --------------------------------- +++ The below license applies to the following files: +++ libharfbuzz/hb-unicode-emoji-table.hh +++ . +++ © 2023 Unicode®, Inc. +++ Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. +++ in the U.S. and other countries. +++ For terms of use, see https://www.unicode.org/terms_of_use.html +++ . +++ . +++ . +++ AUTHORS File Information +++ . +++ . +++ Behdad Esfahbod +++ David Corbett +++ David Turner +++ Ebrahim Byagowi +++ Garret Rieger +++ Jonathan Kew +++ Khaled Hosny +++ Lars Knoll +++ Martin Hosken +++ Owen Taylor +++ Roderick Sheeter +++ Roozbeh Pournader +++ Simon Hausmann +++ Werner Lemberg +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Little Color Management System (LCMS) v2.16, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ LCMS License +++ . +++ . +++ MIT License +++ . +++ Copyright (C) 1998-2023 Marti Maria Saguer +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the "Software"), +++ to deal in the Software without restriction, including without limitation +++ the rights to use, copy, modify, merge, publish, distribute, sublicense, +++ and/or sell copies of the Software, and to permit persons to whom the Software +++ is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included in +++ all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +++ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ --------------------------------- +++ The below license applies to the following files: +++ liblcms/cmssm.c +++ . +++ Copyright 2001, softSurfer (www.softsurfer.com) +++ . +++ This code may be freely used and modified for any purpose +++ providing that this copyright notice is included with it. +++ SoftSurfer makes no warranty for this code, and cannot be held +++ liable for any real or imagined damage resulting from its use. +++ Users of this code must verify correctness for their application. +++ . +++ . +++ . +++ AUTHORS File Information +++ . +++ . +++ Main Author +++ ------------ +++ Marti Maria +++ . +++ . +++ Contributors +++ ------------ +++ Bob Friesenhahn +++ Kai-Uwe Behrmann +++ Stuart Nixon +++ Jordi Vilar +++ Richard Hughes +++ Auke Nauta +++ Chris Evans (Google) +++ Lorenzo Ridolfi +++ Robin Watts (Artifex) +++ Shawn Pedersen +++ Andrew Brygin +++ Samuli Suominen +++ Florian Hˆch +++ Aurelien Jarno +++ Claudiu Cebuc +++ Michael Vhrel (Artifex) +++ Michal Cihar +++ Daniel Kaneider +++ Mateusz Jurczyk (Google) +++ Paul Miller +++ SÈbastien LÈon +++ Christian Schmitz +++ XhmikosR +++ Stanislav Brabec (SuSe) +++ Leonhard Gruenschloss (Google) +++ Patrick Noffke +++ Christopher James Halse Rogers +++ John Hein +++ Thomas Weber (Debian) +++ Mark Allen +++ Noel Carboni +++ Sergei Trofimovic +++ Philipp Knechtges +++ Amyspark +++ Lovell Fuller +++ Eli Schwartz +++ Diogo Teles Sant'Anna +++ . +++ Special Thanks +++ -------------- +++ Artifex software +++ AlienSkin software +++ libVIPS +++ Jan Morovic +++ Jos Vernon (WebSupergoo) +++ Harald Schneider (Maxon) +++ Christian Albrecht +++ Dimitrios Anastassakis +++ Lemke Software +++ Tim Zaman +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Mesa 3-D Graphics Library v21.0.3, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Mesa License +++ . +++ . +++ Copyright (C) 1999-2007 Brian Paul All Rights Reserved. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and associated documentation files (the "Software"), +++ to deal in the Software without restriction, including without limitation +++ the rights to use, copy, modify, merge, publish, distribute, sublicense, +++ and/or sell copies of the Software, and to permit persons to whom the +++ Software is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included +++ in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +++ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +++ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +++ SOFTWARE. +++ . +++ Attention, Contributors +++ . +++ When contributing to the Mesa project you must agree to the licensing terms +++ of the component to which you're contributing. +++ The following section lists the primary components of the Mesa distribution +++ and their respective licenses. +++ Mesa Component Licenses +++ . +++ . +++ . +++ Component Location License +++ ------------------------------------------------------------------ +++ Main Mesa code src/mesa/ MIT +++ Device drivers src/mesa/drivers/* MIT, generally +++ . +++ Gallium code src/gallium/ MIT +++ . +++ Ext headers GL/glext.h Khronos +++ GL/glxext.h Khronos +++ GL/wglext.h Khronos +++ KHR/khrplatform.h Khronos +++ . +++ ***************************************************************************** +++ . +++ ---- +++ include/GL/gl.h : +++ . +++ . +++ Mesa 3-D graphics library +++ . +++ Copyright (C) 1999-2006 Brian Paul All Rights Reserved. +++ Copyright (C) 2009 VMware, Inc. All Rights Reserved. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and associated documentation files (the "Software"), +++ to deal in the Software without restriction, including without limitation +++ the rights to use, copy, modify, merge, publish, distribute, sublicense, +++ and/or sell copies of the Software, and to permit persons to whom the +++ Software is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included +++ in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +++ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +++ OTHER DEALINGS IN THE SOFTWARE. +++ . +++ ***************************************************************************** +++ . +++ ---- +++ include/GL/glext.h +++ include/GL/glxext.h +++ include/GL/wglxext.h : +++ . +++ . +++ Copyright (c) 2013 - 2018 The Khronos Group Inc. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and/or associated documentation files (the +++ "Materials"), to deal in the Materials without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Materials, and to +++ permit persons to whom the Materials are furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included +++ in all copies or substantial portions of the Materials. +++ . +++ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +++ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +++ . +++ ***************************************************************************** +++ . +++ ---- +++ include/KHR/khrplatform.h : +++ . +++ Copyright (c) 2008 - 2018 The Khronos Group Inc. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and/or associated documentation files (the +++ "Materials"), to deal in the Materials without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Materials, and to +++ permit persons to whom the Materials are furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included +++ in all copies or substantial portions of the Materials. +++ . +++ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +++ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +++ . +++ ***************************************************************************** +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to PipeWire 0.3.68, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ PipeWire license: +++ . +++ All PipeWire header files are licensed under the MIT License: +++ . +++ . +++ . +++ Copyright © 2018-2023 Wim Taymans +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a +++ copy of this software and associated documentation files (the "Software"), +++ to deal in the Software without restriction, including without limitation +++ the rights to use, copy, modify, merge, publish, distribute, sublicense, +++ and/or sell copies of the Software, and to permit persons to whom the +++ Software is furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice (including the next +++ paragraph) shall be included in all copies or substantial portions of the +++ Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +++ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +++ DEALINGS IN THE SOFTWARE. +++ . +++ . +++ The below copyright applies to the following files: +++ . +++ spa/include/spa/monitor/type-info.h +++ . +++ Copyright © 2021 Collabora Ltd. +++ . +++ . +++ spa/include/spa/utils/string.h +++ . +++ Copyright © 2021 Red Hat, Inc. +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to xwd v1.0.7, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ xwd utility +++ . +++ . +++ This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt: +++ list.h, multiVis.h, wsutils.h, list.c, multiVis.c +++ . +++ Copyright 1994 Hewlett-Packard Co. +++ Copyright 1996, 1998 The Open Group +++ . +++ Permission to use, copy, modify, distribute, and sell this software and its +++ documentation for any purpose is hereby granted without fee, provided that +++ the above copyright notice appear in all copies and that both that +++ copyright notice and this permission notice appear in supporting +++ documentation. +++ . +++ The above copyright notice and this permission notice shall be included +++ in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +++ IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +++ OTHER DEALINGS IN THE SOFTWARE. +++ . +++ Except as contained in this notice, the name of The Open Group shall +++ not be used in advertising or otherwise to promote the sale, use or +++ other dealings in this Software without prior written authorization +++ from The Open Group. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Apache Commons Byte Code Engineering Library (BCEL) Version 6.7.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Apache Commons BCEL Notice +++ . +++ . +++ Apache Commons BCEL +++ Copyright 2004-2022 The Apache Software Foundation +++ . +++ This product includes software developed at +++ The Apache Software Foundation (https://www.apache.org/). +++ . +++ . +++ . +++ Apache 2.0 License: Refer to the copy under /usr/share/common-licenses +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to DOM Level 3 Core Specification v1.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ W3C Software Notice +++ . +++ Copyright © 2004 World Wide Web Consortium, (Massachusetts Institute of Technology, +++ European Research Consortium for Informatics and Mathematics, Keio University). +++ All Rights Reserved. +++ . +++ The DOM bindings are published under the W3C Software Copyright Notice and License. +++ The software license requires "Notice of any changes or modifications to the W3C +++ files, including the date changes were made." Consequently, modified versions of +++ the DOM bindings must document that they do not conform to the W3C standard; in the +++ case of the IDL definitions, the pragma prefix can no longer be 'w3c.org'; in the +++ case of the Java language binding, the package names can no longer be in the +++ 'org.w3c' package. +++ . +++ . +++ W3C License +++ . +++ . +++ W3C SOFTWARE NOTICE AND LICENSE +++ . +++ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +++ . +++ This work (and included software, documentation such as READMEs, or other +++ related items) is being provided by the copyright holders under the following +++ license. By obtaining, using and/or copying this work, you (the licensee) +++ agree that you have read, understood, and will comply with the following terms +++ and conditions. +++ . +++ Permission to copy, modify, and distribute this software and its +++ documentation, with or without modification, for any purpose and without fee +++ or royalty is hereby granted, provided that you include the following on ALL +++ copies of the software and documentation or portions thereof, including +++ modifications: +++ . +++ 1.The full text of this NOTICE in a location viewable to users of the +++ redistributed or derivative work. +++ . +++ 2.Any pre-existing intellectual property disclaimers, notices, or terms and +++ conditions. If none exist, the W3C Software Short Notice should be included +++ (hypertext is preferred, text is permitted) within the body of any +++ redistributed or derivative code. +++ . +++ 3.Notice of any changes or modifications to the files, including the date +++ changes were made. (We recommend you provide URIs to the location from +++ which the code is derived.) +++ . +++ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS +++ MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT +++ LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR +++ PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY +++ THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +++ . +++ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL +++ OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR +++ DOCUMENTATION. The name and trademarks of copyright holders may NOT be used +++ in advertising or publicity pertaining to the software without specific, +++ written prior permission. Title to copyright in this software and any +++ associated documentation will at all times remain with copyright holders. +++ . +++ ____________________________________ +++ . +++ This formulation of W3C's notice and license became active on December 31 +++ 2002. This version removes the copyright ownership notice such that this +++ license can be used with materials other than those owned by the W3C, reflects +++ that ERCIM is now a host of the W3C, includes references to this specific +++ dated version of the license, and removes the ambiguous grant of "use". +++ Otherwise, this version is the same as the previous version and is written so +++ as to preserve the Free Software Foundation's assessment of GPL compatibility +++ and OSI's certification under the Open Source Definition. Please see our +++ Copyright FAQ for common questions about using materials from our site, +++ including specific terms and conditions for packages like libwww, Amaya, and +++ Jigsaw. Other questions about this notice can be directed to +++ site-policy@w3.org. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to CUP Parser Generator for Java v 0.11b, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ CUP Parser Generator License +++ . +++ . +++ Copyright 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter +++ . +++ Permission to use, copy, modify, and distribute this software and its +++ documentation for any purpose and without fee is hereby granted, provided +++ that the above copyright notice appear in all copies and that both +++ the copyright notice and this permission notice and warranty disclaimer +++ appear in supporting documentation, and that the names of the authors or +++ their employers not be used in advertising or publicity pertaining to +++ distribution of the software without specific, written prior permission. +++ . +++ The authors and their employers disclaim all warranties with regard to +++ this software, including all implied warranties of merchantability and +++ fitness. In no event shall the authors or their employers be liable for +++ any special, indirect or consequential damages or any damages whatsoever +++ resulting from loss of use, data or profits, whether in an action of +++ contract, negligence or other tortious action, arising out of or in +++ connection with the use or performance of this software. +++ . +++ --- +++ . +++ This is an open source license. It is also GPL-Compatible (see entry for +++ "Standard ML of New Jersey"). The portions of CUP output which are hard-coded +++ into the CUP source code are (naturally) covered by this same license, as is +++ the CUP runtime code linked with the generated parser. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Apache Xalan v2.7.2, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Apache Xalan Notice +++ . +++ . +++ ====================================================================================== +++ == NOTICE file corresponding to the section 4d of the Apache License, Version 2.0, == +++ == in this case for the Apache Xalan distribution. == +++ ====================================================================================== +++ . +++ This product includes software developed by +++ The Apache Software Foundation (http://www.apache.org/). +++ . +++ Specifically, we only include the XSLTC portion of the source from the Xalan distribution. +++ The Xalan project has two processors: an interpretive one (Xalan Interpretive) and a +++ compiled one (The XSLT Compiler (XSLTC)). We *only* use the XSLTC part of Xalan; We use +++ the source from the packages that are part of the XSLTC sources. +++ . +++ Portions of this software was originally based on the following: +++ . +++ - software copyright (c) 1999-2002, Lotus Development Corporation., http://www.lotus.com. +++ - software copyright (c) 2001-2002, Sun Microsystems., http://www.sun.com. +++ - software copyright (c) 2003, IBM Corporation., http://www.ibm.com. +++ - voluntary contributions made by Ovidiu Predescu (ovidiu@cup.hp.com) on behalf of the +++ Apache Software Foundation and was originally developed at Hewlett Packard Company. +++ . +++ . +++ . +++ Apache 2.0 License: Refer to the copy under /usr/share/common-licenses +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Apache Xerces v2.12.2, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Apache Xerces Notice +++ . +++ ========================================================================= +++ == NOTICE file corresponding to section 4(d) of the Apache License, == +++ == Version 2.0, in this case for the Apache Xerces Java distribution. == +++ ========================================================================= +++ . +++ Apache Xerces Java +++ Copyright 1999-2022 The Apache Software Foundation +++ . +++ This product includes software developed at +++ The Apache Software Foundation (http://www.apache.org/). +++ . +++ Portions of this software were originally based on the following: +++ - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. +++ - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. +++ - voluntary contributions made by Paul Eng on behalf of the +++ Apache Software Foundation that were originally developed at iClick, Inc., +++ software copyright (c) 1999. +++ . +++ . +++ Apache 2.0 License: Refer to the copy under /usr/share/common-licenses +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Apache Santuario v3.0.3, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Apache 2.0 License: Refer to the copy under /usr/share/common-licenses +++ . +++ Apache Santuario Notice +++ . +++ . +++ Apache Santuario - XML Security for Java +++ Copyright 1999-2023 The Apache Software Foundation +++ . +++ This product includes software developed at +++ The Apache Software Foundation (http://www.apache.org/). +++ . +++ It was originally based on software copyright (c) 2001, Institute for +++ Data Communications Systems, . +++ . +++ The development of this software was partly funded by the European +++ Commission in the project in the ISIS Programme. +++ . +++ This product contains software that is +++ copyright (c) 2021, Oracle and/or its affiliates. +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to OASIS PKCS #11 Cryptographic Token Interface v3.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ OASIS PKCS #11 Cryptographic Token Interface License +++ . +++ . +++ Copyright © OASIS Open 2020. All Rights Reserved. +++ . +++ All capitalized terms in the following text have the meanings +++ assigned to them in the OASIS Intellectual Property Rights Policy (the +++ "OASIS IPR Policy"). The full Policy may be found at the OASIS website: +++ [http://www.oasis-open.org/policies-guidelines/ipr] +++ . +++ This document and translations of it may be copied and furnished to +++ others, and derivative works that comment on or otherwise explain it or +++ assist in its implementation may be prepared, copied, published, and +++ distributed, in whole or in part, without restriction of any kind, +++ provided that the above copyright notice and this section are included +++ on all such copies and derivative works. However, this document itself +++ may not be modified in any way, including by removing the copyright +++ notice or references to OASIS, except as needed for the purpose of +++ developing any document or deliverable produced by an OASIS Technical +++ Committee (in which case the rules applicable to copyrights, as set +++ forth in the OASIS IPR Policy, must be followed) or as required to +++ translate it into languages other than English. +++ . +++ The limited permissions granted above are perpetual and will not be +++ revoked by OASIS or its successors or assigns. +++ . +++ This document and the information contained herein is provided on an +++ "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, +++ INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE +++ INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED +++ WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS +++ AND ITS MEMBERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +++ CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR ANY +++ PART THEREOF. +++ . +++ [OASIS requests that any OASIS Party or any other party that +++ believes it has patent claims that would necessarily be infringed by +++ implementations of this OASIS Standards Final Deliverable, to notify +++ OASIS TC Administrator and provide an indication of its willingness to +++ grant patent licenses to such patent claims in a manner consistent with +++ the IPR Mode of the OASIS Technical Committee that produced this +++ deliverable.] +++ . +++ [OASIS invites any party to contact the OASIS TC Administrator if it +++ is aware of a claim of ownership of any patent claims that would +++ necessarily be infringed by implementations of this OASIS Standards +++ Final Deliverable by a patent holder that is not willing to provide a +++ license to such patent claims in a manner consistent with the IPR Mode +++ of the OASIS Technical Committee that produced this OASIS Standards +++ Final Deliverable. OASIS may include such claims on its website, but +++ disclaims any obligation to do so.] +++ . +++ [OASIS takes no position regarding the validity or scope of any +++ intellectual property or other rights that might be claimed to pertain +++ to the implementation or use of the technology described in this OASIS +++ Standards Final Deliverable or the extent to which any license under +++ such rights might or might not be available; neither does it represent +++ that it has made any effort to identify any such rights. Information on +++ OASIS' procedures with respect to rights in any document or deliverable +++ produced by an OASIS Technical Committee can be found on the OASIS +++ website. Copies of claims of rights made available for publication and +++ any assurances of licenses to be made available, or the result of an +++ attempt made to obtain a general license or permission for the use of +++ such proprietary rights by implementers or users of this OASIS Standards +++ Final Deliverable, can be obtained from the OASIS TC Administrator. +++ OASIS makes no representation that any information or list of +++ intellectual property rights will at any time be complete, or that any +++ claims in such list are, in fact, Essential Claims.] +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to IAIK (Institute for Applied Information Processing and Communication) PKCS#11 wrapper files v1, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ IAIK License +++ . +++ . +++ Copyright (c) 2002 Graz University of Technology. All rights reserved. +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are met: +++ . +++ 1. Redistributions of source code must retain the above copyright notice, this +++ list of conditions and the following disclaimer. +++ . +++ 2. Redistributions in binary form must reproduce the above copyright notice, +++ this list of conditions and the following disclaimer in the documentation +++ and/or other materials provided with the distribution. +++ . +++ 3. The end-user documentation included with the redistribution, if any, must +++ include the following acknowledgment: +++ . +++ "This product includes software developed by IAIK of Graz University of +++ Technology." +++ . +++ Alternately, this acknowledgment may appear in the software itself, if and +++ wherever such third-party acknowledgments normally appear. +++ . +++ 4. The names "Graz University of Technology" and "IAIK of Graz University of +++ Technology" must not be used to endorse or promote products derived from this +++ software without prior written permission. +++ . +++ 5. Products derived from this software may not be called "IAIK PKCS Wrapper", +++ nor may "IAIK" appear in their name, without prior written permission of +++ Graz University of Technology. +++ . +++ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +++ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +++ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +++ LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +++ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +++ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +++ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +++ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +++ POSSIBILITY OF SUCH DAMAGE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Dynalink v.5, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Dynalink License +++ . +++ . +++ Copyright (c) 2009-2013, Attila Szegedi +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are +++ met: +++ * Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above copyright +++ notice, this list of conditions and the following disclaimer in the +++ documentation and/or other materials provided with the distribution. +++ * Neither the name of the copyright holder nor the names of +++ contributors may be used to endorse or promote products derived from +++ this software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +++ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +++ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +++ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER +++ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +++ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +++ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +++ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to JLine v3.22.0, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ JLine License +++ . +++ . +++ Copyright (c) 2002-2018, the original author or authors. +++ All rights reserved. +++ . +++ https://opensource.org/licenses/BSD-3-Clause +++ . +++ Redistribution and use in source and binary forms, with or +++ without modification, are permitted provided that the following +++ conditions are met: +++ . +++ Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ . +++ Redistributions in binary form must reproduce the above copyright +++ notice, this list of conditions and the following disclaimer +++ in the documentation and/or other materials provided with +++ the distribution. +++ . +++ Neither the name of JLine nor the names of its contributors +++ may be used to endorse or promote products derived from this +++ software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +++ BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +++ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +++ EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +++ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +++ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +++ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +++ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +++ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +++ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +++ OF THE POSSIBILITY OF SUCH DAMAGE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to jopt-simple v5.0.4, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ MIT License +++ . +++ . +++ Copyright (c) 2004-2015 Paul R. Holser, Jr. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +++ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +++ OTHER DEALINGS IN THE SOFTWARE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to jQuery v3.6.1, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ jQuery License +++ . +++ jQuery v 3.6.1 +++ Copyright OpenJS Foundation and other contributors, https://openjsf.org/ +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ ****************************************** +++ . +++ The jQuery JavaScript Library v3.6.1 also includes Sizzle.js +++ . +++ Sizzle.js includes the following license: +++ . +++ Copyright JS Foundation and other contributors, https://js.foundation/ +++ . +++ This software consists of voluntary contributions made by many +++ individuals. For exact contribution history, see the revision history +++ available at https://github.com/jquery/sizzle +++ . +++ The following license applies to all parts of this software except as +++ documented below: +++ . +++ ==== +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ ==== +++ . +++ All files located in the node_modules and external directories are +++ externally maintained libraries used by this software which have their +++ own licenses; we recommend you read them, as their terms may differ from +++ the terms above. +++ . +++ ********************* +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to jQuery UI v1.13.2, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ jQuery UI License +++ . +++ Copyright jQuery Foundation and other contributors, https://jquery.org/ +++ . +++ This software consists of voluntary contributions made by many +++ individuals. For exact contribution history, see the revision history +++ available at https://github.com/jquery/jquery-ui +++ . +++ The following license applies to all parts of this software except as +++ documented below: +++ . +++ ==== +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ . +++ ==== +++ . +++ Copyright and related rights for sample code are waived via CC0. Sample +++ code is defined as all source code contained within the demos directory. +++ . +++ CC0: http://creativecommons.org/publicdomain/zero/1.0/ +++ . +++ ==== +++ . +++ All files located in the node_modules and external directories are +++ externally maintained libraries used by this software which have their +++ own licenses; we recommend you read them, as their terms may differ from +++ the terms above. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Unicode Common Local Data Repository (CLDR) v43, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ CLDR License +++ . +++ . +++ . +++ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +++ . +++ See Terms of Use +++ for definitions of Unicode Inc.’s Data Files and Software. +++ . +++ NOTICE TO USER: Carefully read the following legal agreement. +++ BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +++ DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +++ YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +++ TERMS AND CONDITIONS OF THIS AGREEMENT. +++ IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +++ THE DATA FILES OR SOFTWARE. +++ . +++ COPYRIGHT AND PERMISSION NOTICE +++ . +++ Copyright © 1991-2022 Unicode, Inc. All rights reserved. +++ Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of the Unicode data files and any associated documentation +++ (the "Data Files") or Unicode software and any associated documentation +++ (the "Software") to deal in the Data Files or Software +++ without restriction, including without limitation the rights to use, +++ copy, modify, merge, publish, distribute, and/or sell copies of +++ the Data Files or Software, and to permit persons to whom the Data Files +++ or Software are furnished to do so, provided that either +++ (a) this copyright and permission notice appear with all copies +++ of the Data Files or Software, or +++ (b) this copyright and permission notice appear in associated +++ Documentation. +++ . +++ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +++ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +++ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT OF THIRD PARTY RIGHTS. +++ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +++ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +++ DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +++ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +++ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +++ PERFORMANCE OF THE DATA FILES OR SOFTWARE. +++ . +++ Except as contained in this notice, the name of a copyright holder +++ shall not be used in advertising or otherwise to promote the sale, +++ use or other dealings in these Data Files or Software without prior +++ written authorization of the copyright holder. +++ . +++ . +++ . +++ ------------------------------------------------------------ Terms of Use --------------------------------------------------------------- +++ . +++ . +++ Unicode® Copyright and Terms of Use +++ . +++ For the general privacy policy governing access to this site, see the Unicode Privacy Policy. +++ . +++ Unicode Copyright +++ Copyright © 1991-2023 Unicode, Inc. All rights reserved. +++ Definitions +++ . +++ Unicode Data Files ("DATA FILES") include all data files under the directories: +++ https://www.unicode.org/Public/ +++ https://www.unicode.org/reports/ +++ https://www.unicode.org/ivd/data/ +++ . +++ Unicode Data Files do not include PDF online code charts under the directory: +++ https://www.unicode.org/Public/ +++ . +++ Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard +++ or any source code or compiled code under the directories: +++ https://www.unicode.org/Public/PROGRAMS/ +++ https://www.unicode.org/Public/cldr/ +++ http://site.icu-project.org/download/ +++ . +++ Terms of Use +++ Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +++ Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. +++ Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. +++ Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. +++ The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. +++ All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +++ No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +++ Modification is not permitted with respect to this document. All copies of this document must be verbatim. +++ Restricted Rights Legend +++ Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +++ Warranties and Disclaimers +++ This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +++ If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +++ EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +++ Waiver of Damages +++ In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +++ Trademarks & Logos +++ The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +++ The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +++ All third party trademarks referenced herein are the property of their respective owners. +++ Miscellaneous +++ Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +++ Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. +++ Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +++ Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +++ Entire Agreement. This Agreement constitutes the entire agreement between the parties. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ %% This notice is provided with respect to Thai Dictionary, +++ which may be included with JRE 21, JDK 21 and OpenJDK 21 +++ . +++ --- begin of LICENSE --- +++ . +++ Thai Dictionary License +++ . +++ . +++ Copyright (C) 1982 The Royal Institute, Thai Royal Government. +++ . +++ Copyright (C) 1998 National Electronics and Computer Technology Center, +++ National Science and Technology Development Agency, +++ Ministry of Science Technology and Environment, +++ Thai Royal Government. +++ . +++ Permission is hereby granted, free of charge, to any person obtaining a copy +++ of this software and associated documentation files (the "Software"), to deal +++ in the Software without restriction, including without limitation the rights +++ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +++ copies of the Software, and to permit persons to whom the Software is +++ furnished to do so, subject to the following conditions: +++ . +++ The above copyright notice and this permission notice shall be included in all +++ copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +++ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +++ SOFTWARE. +++ . +++ . +++ . +++ --- end of LICENSE --- +++ . +++ ------------------------------------------------------------------------------ +++ +++Files: googletest/* +++Copyright: Copyright 2008, Google Inc. +++License: BSD-C3 +++ Copyright 2008, Google Inc. +++ All rights reserved. +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are +++ met: +++ . +++ * Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above +++ copyright notice, this list of conditions and the following disclaimer +++ in the documentation and/or other materials provided with the +++ distribution. +++ * Neither the name of Google Inc. nor the names of its +++ contributors may be used to endorse or promote products derived from +++ this software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++Files: debian/* +++Copyright: Copyright © 2007-2023 Canonical Ltd. +++License: MIT +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ +++Files: debian/dbg.py +++Copyright: Copyright 2016, Red Hat and individual contributors +++License: LGPL +++ # Copyright 2016, Red Hat and individual contributors +++ # by the @authors tag. +++ # +++ # This is free software; you can redistribute it and/or modify it +++ # under the terms of the GNU Lesser General Public License as +++ # published by the Free Software Foundation; either version 2.1 of +++ # the License, or (at your option) any later version. +++ # +++ # This software 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 +++ # Lesser General Public License for more details. +++ . +++ On Debian systems a full copy of the GNU General Public License, GPL, can be +++ found in the file /usr/share/common-licenses/GPL-2. +++ diff --cc debian/copyright-generator/bundled-stanzas index 000000000,000000000,000000000..a45a35bb1 new file mode 100644 --- /dev/null +++ b/debian/copyright-generator/bundled-stanzas @@@@ -1,0 -1,0 -1,0 +1,31 @@@@ +++Files: googletest/* +++Copyright: Copyright 2008, Google Inc. +++License: BSD-C3 +++ Copyright 2008, Google Inc. +++ All rights reserved. +++ . +++ Redistribution and use in source and binary forms, with or without +++ modification, are permitted provided that the following conditions are +++ met: +++ . +++ * Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above +++ copyright notice, this list of conditions and the following disclaimer +++ in the documentation and/or other materials provided with the +++ distribution. +++ * Neither the name of Google Inc. nor the names of its +++ contributors may be used to endorse or promote products derived from +++ this software without specific prior written permission. +++ . +++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --cc debian/copyright-generator/copyright-gen.py index 000000000,000000000,000000000..bbcf99102 new file mode 100755 --- /dev/null +++ b/debian/copyright-generator/copyright-gen.py @@@@ -1,0 -1,0 -1,0 +1,296 @@@@ +++#!/usr/bin/python3 +++ +++# This script needs to be run from the `debian/copyright-generator` directory. +++ +++# This is an initial version of a script that generates the copyrights file +++# for the openjdk-XX packages. A lot of information is still hard-coded, +++# which means the script needs to be improved. +++# +++# For instance, it must be possible to parse all the copyright headers from +++# all the source files and deduce a list of "Upstream Authors". It must +++# also be possible to deduce the smallest yet complete list of copyrights. +++# For now, we have these hard-coded in the "copyright-gen/upstream-authors" +++# and "copyright-gen/copyrights" file. +++# +++# Licenses from the legal directories of different modules are gathered and +++# dumped under the License field of the first File stanza. +++# The debian build does not build native libraries like zlib, pcsclite, giflib +++# libpng and libjpeg. These are excluded. There's scope for improvement here too. +++# The script must be able to look into "debian/rules" and deduce these exclusions. +++ +++import os +++import re +++import sys +++import textwrap +++ +++version = ""; +++needs_cleanup = False +++packaged_by = "Matthias Klose "; +++common_licenses = {}; +++ +++## TODO: Can the script deduce this list? +++excluded_files = [ +++ ".github/*", +++ ".gitattributes", +++ "src/java.base/share/native/libzip/zlib/*", +++ "src/java.desktop/share/native/libsplashscreen/giflib/*", +++ "src/java.desktop/share/native/libsplashscreen/libpng/*", +++ "src/java.smartcardio/unix/native/libj2pcsc/MUSCLE/*", +++ "src/java.desktop/share/native/libjavajpeg/jc*", +++ "src/java.desktop/share/native/libjavajpeg/jd*", +++ "src/java.desktop/share/native/libjavajpeg/je*", +++ "src/java.desktop/share/native/libjavajpeg/jf*", +++ "src/java.desktop/share/native/libjavajpeg/ji*.c", +++ "src/java.desktop/share/native/libjavajpeg/jm*", +++ "src/java.desktop/share/native/libjavajpeg/jpegi*", +++ "src/java.desktop/share/native/libjavajpeg/jpeglib.h", +++ "src/java.desktop/share/native/libjavajpeg/jq*", +++ "src/java.desktop/share/native/libjavajpeg/jv*", +++ "src/java.desktop/share/native/libjavajpeg/ju*", +++ "src/java.desktop/share/native/libjavajpeg/README" +++] +++ +++## TODO: Can the script deduce this list? +++openjdk_copyrights = [ +++ "Copyright (c) 1996-2023 Oracle and/or its affiliates.", +++ "Copyright (c) 1996-2003 Sun Microsystems, Inc.", +++ "Copyright (c) 2009-2012 Red Hat, Inc.", +++ "Copyright (c) 2012-2022 SAP SE.", +++ "Copyright (c) 2020-2021 Azul Systems, Inc.", +++ "Copyright (c) 1999-2022 The Apache Software Foundation.", +++ "Copyright (c) 2020-2021 Microsoft Corporation", +++ "Copyright (c) 2009-2022 Google LLC", +++ "Copyright (c) 2020-2021 Amazon.com, Inc", +++ "Copyright (c) 2021 Alibaba Group Holding Limited", +++ "Copyright (c) 2019-2021 Huawei Technologies Co. Ltd.", +++ "Copyright (c) 2021-2023 BELLSOFT", +++ "Copyright (c) 2022-23 THL A29 Limited, a Tencent company.", +++ "Copyright (c) 2021-2023, Arm Limited.", +++ "Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn.", +++ "Copyright (c) 2017 Instituto de Pesquisas Eldorado.", +++ "Copyright (c) 1999-2007 Brian Paul.", +++ "Copyright (c) 2018-2019 Adobe Inc.", +++ "Copyright 2006-2014 Adobe Systems Incorporated.", +++ "Copyright 1994-2011 Hewlett-Packard Co.", +++ "Portions Copyright (c) 2011-2014 IBM Corporation", +++ "Portions Copyright (c) 1995 Colin Plumb", +++ "Portions Copyright (c) 1997-2003 Eastman Kodak Company", +++ "See other third party notices under the License section" +++] +++ +++## TODO: Can the script deduce this list? +++upstream_authors = [ +++ "Oracle and/or its affiliates", +++ "Sun Microsystems, Inc", +++ "Red Hat, Inc", +++ "SAP SE", +++ "Azul Systems, Inc", +++ "Apache Software Foundation", +++ "Microsoft Corporation", +++ "Intel Corportation", +++ "IBM Corporation", +++ "Google LLC", +++ "Amazon.com, Inc", +++ "Other contributors", +++ "See the third party licenses below." +++] +++ +++exclude_licenses = ["zlib.md", "pcsclite.md", "giflib.md", "libpng.md", "jpeg.md"] +++ +++def print_field(name, single_line, value): +++ print(name + ":", end="") +++ if (single_line): +++ print(" " + value) +++ else: +++ print("\n" + value) +++ +++def print_header_stanza(format, files_excluded, source, comment): +++ print_field("Format", True, format) +++ print_field("Files-Excluded", False, files_excluded) +++ print_field("Source", True, source) +++ print_field("Comment", False, comment) +++ print() # an empty line +++ +++def print_file_stanza(files, copyrights, license, comments): +++ print_field("Files", True, files) +++ print_field("Copyright", False, copyrights) +++ print_field("License", True, license) +++ if (comments is not None and len(comments) != 0): +++ print_field("Comments", True, comments) +++ print() # an empty line +++ +++def generate_excluded_files_str(): +++ return " " + "\n ".join(excluded_files) +++ +++def generate_comment_str(): +++ upstream_authors_str = "\n ".join(upstream_authors) +++ return f""" Upstream Authors: +++ OpenJDK: +++ {upstream_authors_str} +++ Packaged by: +++ {packaged_by}""" +++ +++def generate_header_stanza(): +++ format = "https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/" +++ excluded = generate_excluded_files_str() +++ source = "https://github.com/openjdk/jdk21u" +++ comment = generate_comment_str() +++ print_header_stanza(format, excluded, source, comment) +++ +++def get_content(path): +++ lines = [] +++ with open(path, 'r') as file: +++ for line in file: +++ lines.append(line +++ .replace("### ","") +++ .replace("```", "") +++ .replace("
", "")
+++        .replace("
", "")) +++ +++ return lines[0], "".join(lines[1:]) +++ +++ +++def fill_with_dots_and_indent(text): +++ indentation = " " * 2 +++ # Setting a large arbitrary width because we don't want to wrap lines +++ wrapper = textwrap.TextWrapper(initial_indent=indentation, width=2000, subsequent_indent=indentation, drop_whitespace=False) +++ lines = text.split("\n") +++ out = [] +++ for line in lines: +++ if line.strip() == "": +++ line = "." +++ out.append(wrapper.fill(line)) +++ return "\n".join(out) +++ +++def gen_comment(component): +++ return f"""%% This notice is provided with respect to {component}, +++which may be included with JRE {version}, JDK {version} and OpenJDK {version}""" +++ +++def gen_license_text(license): +++ print("Gathering license content for " + license, file=sys.stderr) +++ component, content = get_content(license) +++ component = component.split("## ")[1].rstrip("\n"); +++ return f""" +++{gen_comment(component)} +++ +++--- begin of LICENSE --- +++{content} +++--- end of LICENSE --- +++ +++------------------------------------------------------------------------------""" +++ +++ +++def gather_legal_dirs(path): +++ legal_dirs = [] +++ for root, dirs, files in os.walk(path): +++ if "legal" in dirs and (root.endswith("share") or root.endswith("unix")): +++ legal_dirs.append(os.path.join(root, "legal")) +++ return legal_dirs +++ +++def gather_licenses(module): +++ legal_dirs = gather_legal_dirs(module) +++ licenses_text = "" +++ for dir in sorted(legal_dirs): +++ licenses = os.listdir(dir) +++ for license in sorted(licenses): +++ if not license in exclude_licenses: +++ licenses_text += gen_license_text(dir + "/" + license) +++ return licenses_text +++ +++def gather_modules_licenses(srcdir): +++ licenses = "" +++ modules = os.listdir(srcdir) +++ for module in sorted(modules): +++ licenses += gather_licenses(srcdir + "/" + module) +++ return licenses +++ +++def find_directory(prefix, path = '.'): +++ for file in os.scandir(path): +++ if file.is_dir() and file.name.startswith(prefix): +++ return file.path +++ +++def search_source_rootdir(level, path = '.'): +++ # The user might have already pulled the source package. +++ # Search for a downloaded package at three levels +++ # - openjdk +++ # - openjdk/debian +++ # - openjdk/debian/copyright-generator +++ # if one none found, download the source package +++ rootdir = find_directory(f"openjdk-{version}", path) +++ if rootdir is not None: +++ return rootdir +++ +++ match level: +++ case 0: +++ path = "./debian" +++ level= level + 1 +++ case 1: +++ path = "./debian/copyright-generator" +++ level = level + 1 +++ case 2: +++ print("No source package found. Downloading...", file = sys.stderr) +++ os.system(f"pull-debian-source openjdk-{version} > /dev/null 2>&1") +++ needs_cleanup = True +++ return find_directory(f"openjdk-{version}") +++ case _: +++ print("Irrecoverable error while searching for source package") +++ exit(1) +++ +++ return search_source_rootdir(level, path) +++ +++def generate_copyright(): +++ rootdir = search_source_rootdir(0) +++ if rootdir is None: +++ print("No source package found. Download also failed. Aborting.") +++ exit(2) +++ print(f"Using the source package at {rootdir}", file = sys.stderr) +++ srcdir = f"{rootdir}/src"; +++ +++ os.system(f"/bin/sh ./debian/copyright-generator/strip-common-licenses.sh {rootdir} {version}") +++ generate_header_stanza(); +++ +++ licenses = f"""GPL with Classpath exception +++ +++--- begin of LICENSE --- +++ +++{open(rootdir + "/LICENSE").read()} +++--- end of LICENSE --- +++ +++------------------------------------------------------------------------------ +++The following licenses for third party code are taken from 'legal' \ndirectories of modules under src/ +++------------------------------------------------------------------------------ +++{gather_modules_licenses(srcdir)}""" +++ +++ print_file_stanza("*", " " + "\n ".join(openjdk_copyrights), fill_with_dots_and_indent(licenses), "") +++ if (version != "11"): +++ print(open("./debian/copyright-generator/bundled-stanzas").read()) +++ print(open("./debian/copyright-generator/debian-stanzas").read()) +++ +++ # clean-up +++ if needs_cleanup: +++ os.system(f"rm -rf *.debian.tar.xz *.orig.tar.xz *.dsc *googletest.tar.xz"); +++ +++ +++ +++def detect_version(): +++ with open("debian/rules", 'r') as file: +++ content = file.read() +++ match = re.search(r'shortver\t=\s+(\d{2})', content) +++ if match: +++ return match.group(1) +++ +++def main(): +++ global version +++ +++ version = detect_version() +++ +++ sys.stdout = open('./debian/copyright', 'w') +++ supported_versions = ["11", "17", "21", "22", "23"] +++ +++ if version in supported_versions: +++ generate_copyright() +++ else: +++ print("Version not supported.") +++ +++if __name__ == "__main__": +++ main() diff --cc debian/copyright-generator/debian-stanzas index 000000000,000000000,000000000..e8ae199c5 new file mode 100644 --- /dev/null +++ b/debian/copyright-generator/debian-stanzas @@@@ -1,0 -1,0 -1,0 +1,40 @@@@ +++Files: debian/* +++Copyright: Copyright © 2007-2023 Canonical Ltd. +++License: MIT +++ Permission is hereby granted, free of charge, to any person obtaining +++ a copy of this software and associated documentation files (the +++ "Software"), to deal in the Software without restriction, including +++ without limitation the rights to use, copy, modify, merge, publish, +++ distribute, sublicense, and/or sell copies of the Software, and to +++ permit persons to whom the Software is furnished to do so, subject to +++ the following conditions: +++ . +++ The above copyright notice and this permission notice shall be +++ included in all copies or substantial portions of the Software. +++ . +++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +++ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +++ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +++ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +++ +++Files: debian/dbg.py +++Copyright: Copyright 2016, Red Hat and individual contributors +++License: LGPL +++ # Copyright 2016, Red Hat and individual contributors +++ # by the @authors tag. +++ # +++ # This is free software; you can redistribute it and/or modify it +++ # under the terms of the GNU Lesser General Public License as +++ # published by the Free Software Foundation; either version 2.1 of +++ # the License, or (at your option) any later version. +++ # +++ # This software 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 +++ # Lesser General Public License for more details. +++ . +++ On Debian systems a full copy of the GNU General Public License, GPL, can be +++ found in the file /usr/share/common-licenses/GPL-2. diff --cc debian/copyright-generator/strip-common-licenses.sh index 000000000,000000000,000000000..e53f69670 new file mode 100755 --- /dev/null +++ b/debian/copyright-generator/strip-common-licenses.sh @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++SOURCE_DIR=$1 +++VERSION=$2 +++for LEGAL_DIR in `find $SOURCE_DIR/src -name legal`; do +++ for COMMON_LICENSE in "### Apache 2.0 License" "### GPL v2" "### GPL version 3"; do +++ for FILE in `grep -Rl "${COMMON_LICENSE}" $LEGAL_DIR`; do +++ sed -i "/^${COMMON_LICENSE}/,/^###/{/^###/!{d}}" $FILE +++ sed -i "s/${COMMON_LICENSE}/${COMMON_LICENSE}: Refer to the copy under \/usr\/share\/common-licenses\n/g" $FILE +++ done +++ done +++ # special cases +++ if [ $VERSION = "21" ] || [ $VERSION = "17" ] || [ $VERSION = "11" ]; then +++ FILE=$SOURCE_DIR/src/jdk.internal.le/share/legal/jline.md +++ sed -i "/^Apache License/,/^=====/{/^Apache License/!{/^=====/!{d}}}" $FILE +++ sed -i "s/^Apache License/Apache 2.0 License: Refer to the copy under \/usr\/share\/common-licenses\n\n/g" $FILE +++ fi +++done +++ +++ diff --cc debian/dbg.py index 000000000,000000000,000000000..47db8589f new file mode 100644 --- /dev/null +++ b/debian/dbg.py @@@@ -1,0 -1,0 -1,0 +1,1232 @@@@ +++# Copyright 2016, Red Hat and individual contributors +++# by the @authors tag. +++# +++# This is free software; you can redistribute it and/or modify it +++# under the terms of the GNU Lesser General Public License as +++# published by the Free Software Foundation; either version 2.1 of +++# the License, or (at your option) any later version. +++# +++# This software 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 +++# Lesser General Public License for more details. +++# +++# You should have received a copy of the GNU Lesser General Public +++# License along with this software; if not, write to the Free +++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +++# 02110-1301 USA, or see the FSF site: http://www.fsf.org. +++# +++# @authors Andrew Dinn +++ +++import gdb +++ +++import re +++from gdb.FrameDecorator import FrameDecorator +++ +++# we rely on the unwinder API provided by gdb.7.10 +++ +++_dump_frame = False +++_have_unwinder = True +++try: +++ from gdb.unwinder import Unwinder +++ gdb.write("Installing openjdk unwinder\n") +++except ImportError: +++ _have_unwinder = False +++ # We need something here; it doesn't matter what as no unwinder +++ # will ever be instantiated. +++ Unwinder = object +++ +++ +++def debug_write(msg): +++ gdb.write(msg) +++ # pass +++ +++def t(msg): +++ gdb.write("%s\n" % msg) +++ # pass +++ +++# debug_write("dbg.py\n") +++ +++# class providing various type conversions for gdb Value instances +++ +++class Types(object): +++ # cache some basic primitive and pointer types +++ byte_t = gdb.lookup_type('unsigned char') +++ char_t = gdb.lookup_type('char') +++ int_t = gdb.lookup_type('int') +++ long_t = gdb.lookup_type('long') +++ void_t = gdb.lookup_type('void') +++ +++ bytep_t = byte_t.pointer() +++ charp_t = char_t.pointer() +++ intp_t = int_t.pointer() +++ longp_t = long_t.pointer() +++ voidp_t = void_t.pointer() +++ +++ codeblobp_t = gdb.lookup_type('CodeBlob').pointer() +++ cmethodp_t = gdb.lookup_type('CompiledMethod').pointer() +++ nmethodp_t = gdb.lookup_type('nmethod').pointer() +++ +++ ptrp_t = voidp_t.pointer() +++ +++ # convert Values to primitive Values +++ @classmethod +++ def cast_byte(cls, value): +++ return value.cast(cls.byte_t) +++ +++ @classmethod +++ def cast_int(cls, value): +++ return value.cast(cls.int_t) +++ +++ @classmethod +++ def cast_long(cls, value): +++ return value.cast(cls.long_t) +++ +++ # convert Values to pointer Values +++ @classmethod +++ def cast_bytep(cls, value): +++ return value.cast(cls.bytep_t) +++ +++ @classmethod +++ def cast_intp(cls, value): +++ return value.cast(cls.intp_t) +++ +++ @classmethod +++ def cast_longp(cls, value): +++ return value.cast(cls.longp_t) +++ +++ @classmethod +++ def cast_voidp(cls, value): +++ return value.cast(cls.voidp_t) +++ +++ @classmethod +++ def cast_ptrp(cls, value): +++ return value.cast(cls.ptrp_t) +++ +++ # cast Value to pointer type then load and return contents as Value +++ @classmethod +++ def load_ptr(cls, value): +++ return cls.cast_ptrp(cls.cast_ptrp(value).dereference()) +++ +++ @classmethod +++ def load_byte(cls, value): +++ return cls.cast_bytep(value).dereference() +++ +++ @classmethod +++ def load_int(cls, value): +++ return cls.cast_intp(value).dereference() +++ +++ @classmethod +++ def load_long(cls, value): +++ return cls.cast_longp(value).dereference() +++ +++ # cast Value to int and return as python integer +++ @classmethod +++ def as_int(cls, value): +++ return int(cls.cast_int(value)) +++ +++ # cast Value to long and return as python integer +++ @classmethod +++ def as_long(cls, value): +++ return int(cls.cast_long(value)) +++ +++ # construct Value from integer x and cast to type t +++ @classmethod +++ def to_type(cls, x, t): +++ return gdb.Value(x).cast(t) +++ +++ # construct voidp Value from integer x +++ @classmethod +++ def to_voidp(cls, x): +++ return cls.to_type(x, cls.voidp_t) +++ +++ # construct void ** Value from integer x +++ @classmethod +++ def to_ptrp(cls, x): +++ return cls.to_type(x, cls.ptrp_t) +++ +++# OpenJDK specific classes which understand the layout of the code +++# heap and know how to translate a PC to an associated code blob and, +++# from there to a method object. n.b. in some cases the latter step +++# requires a frame base pointer bu tthat can be calculated using the +++# code blob and stack pointer +++ +++# class encapsulating details of a specific heap +++ +++class CodeHeap: +++ +++ # track whether we have static initialized yet +++ class_inited = False +++ heap_block_type = None +++ code_blob_type = None +++ +++ @classmethod +++ def class_init(cls): +++ # t("CodeHeap.class_init") +++ if cls.class_inited: +++ return +++ # we can only proceed if we have the necessary heap symbols +++ # if this excepts then we don't care +++ cls.heap_block_type = gdb.lookup_type("HeapBlock").pointer() +++ cls.code_blob_type = gdb.lookup_type("CodeBlob").pointer() +++ cls.class_inited = True +++ +++ def __init__(self, heap): +++ # t("CodeHeap.__init__") +++ # make sure we have static inited successfuly +++ self.class_init() +++ # if we got here we are ok to create a new instance +++ self.heap = heap +++ self.name = str(heap['_name']) +++ self.lo = Types.as_long(heap['_memory']['_low_boundary']) +++ self.hi = Types.as_long(heap['_memory']['_high_boundary']) +++ self.segmap = heap['_segmap'] +++ self.segmap_lo = self.segmap['_low'] +++ self.segment_size = int(heap['_segment_size']) +++ self.log2_segment_size = int(heap['_log2_segment_size']) +++ # debug_write("@@ heap.name = %s\n" % self.name) +++ # debug_write("@@ heap.lo = 0x%x\n" % self.lo) +++ # debug_write("@@ heap.hi = 0x%x\n" % self.hi) +++ +++ def inrange(self, x): +++ # t("CodeHeap.inrange") +++ return self.lo <= x and self.hi > x +++ def findblob(self, pc): +++ # t("CodeHeap.findblob") +++ x = Types.as_long(pc) +++ # debug_write("@@ findblob(%s, 0x%x)\n" % (self.name, pc)) +++ # debug_write("@@ pc (%s) = 0x%x \n" % (str(pc.type), pc)) +++ # debug_write("@@ self.lo = 0x%x\n" % self.lo) +++ # debug_write("@@ self.hi = 0x%x\n" % self.hi) +++ # check pc is in this heap's range +++ # t("if not self.inrange(x):") +++ if not self.inrange(x): +++ return None +++ # debug_write("@@ pc in range\n") +++ # t("segments = 0") +++ segments = 0 +++ # debug_write("@@ segmap_lo (%s) = 0x%x\n" % (str(self.segmap_lo.type), self.segmap_lo)) +++ # debug_write("@@ self.lo = 0x%x \n" % self.lo) +++ # debug_write("@@ self.log2_segment_size = 0x%x \n" % self.log2_segment_size) +++ # t("offset = Types.as_long(pc - self.lo)") +++ offset = Types.as_long(pc - self.lo) +++ # debug_write("@@ offset = 0x%x\n" % offset) +++ # t("shift = self.log2_segment_size") +++ shift = self.log2_segment_size +++ # debug_write("@@ shift = 0x%x\n" % shift) +++ # t("segment = offset >> shift") +++ segment = offset >> shift +++ # segment = (offset >> self.log2_segment_size) +++ #segment = offset >> (self.log2_segment_size & 0x31) +++ # debug_write("@@ segment = 0x%x\n" % segment) +++ # t("tag = (self.segmap_lo + segment).dereference() & 0xff") +++ tag = (self.segmap_lo + segment).dereference() & 0xff +++ # tag = Types.load_byte(self.segmap_lo + segment) & 0xff +++ # debug_write("@@ tag (%s) = 0x%x\n" % (str(tag.type), tag)) +++ # t("while tag > 0 and segments < 64:") +++ while tag > 0 and segments < 64: +++ # t("segment = segment - tag") +++ segment = segment - tag +++ # debug_write("@@ segment = 0x%x\n" % segment) +++ # t("tag = (self.segmap_lo + segment).dereference() & 0xff") +++ tag = (self.segmap_lo + segment).dereference() & 0xff +++ # debug_write("@@ tag (%s) = 0x%x\n" % (str(tag.type), tag)) +++ # t("segments += 1") +++ segments += 1 +++ # t("if tag != 0:") +++ if tag != 0: +++ # t("return None") +++ return None +++ # debug_write("@@ lo = 0x%x\n" % self.lo) +++ # debug_write("@@ segment << self.log2_segment_size = 0x%x\n" % (segment << self.log2_segment_size)) +++ # t("block_addr = self.lo + (segment << self.log2_segment_size)") +++ block_addr = self.lo + (segment << self.log2_segment_size) +++ # debug_write("@@ block_addr (%s) = 0x%x\n" % (str(block_addr.type), block_addr)) +++ # t("heap_block = gdb.Value(block_addr).cast(CodeHeap.heap_block_type)") +++ heap_block = gdb.Value(block_addr).cast(CodeHeap.heap_block_type) +++ # debug_write("@@ heap_block (%s) = 0x%x\n" % (str(heap_block.type), heap_block)) +++ # t("if heap_block['_header']['_used'] != 1:") +++ if heap_block['_header']['_used'] != 1: +++ # hmm, this is not meant to happen +++ # t("return None") +++ return None +++ # t("blob = (heap_block + 1).cast(CodeHeap.code_blob_type)") +++ blob = (heap_block + 1).cast(CodeHeap.code_blob_type) +++ return blob +++ +++# class encapsulating access to code cache memory +++# this is essentially all static as per the JVM class +++ +++class CodeCache: +++ # track whether we have successfully intiialized +++ class_inited = False +++ # static heap start, lo and hi bounds for code addresses +++ lo = 0 +++ hi = 0 +++ heap_count = 0 +++ heap_list = [] +++ +++ @classmethod +++ def class_init(cls): +++ # t("CodeCache.class_init") +++ if cls.class_inited: +++ return +++ # t("if cls.lo == 0 or cls.hi == 0:") +++ if cls.lo == 0 or cls.hi == 0: +++ try: +++ # t("cls.lo = gdb.parse_and_eval(\"CodeCache::_low_bound\")") +++ lo = gdb.parse_and_eval("CodeCache::_low_bound") +++ cls.lo = Types.as_long(lo) +++ # debug_write("@@ CodeCache::_low_bound = 0x%x\n" % cls.lo) +++ if cls.lo == 0: +++ return +++ # t("cls.hi = gdb.parse_and_eval(\"CodeCache::_high_bound\")") +++ hi = gdb.parse_and_eval("CodeCache::_high_bound") +++ cls.hi = Types.as_long(hi) +++ # debug_write("@@ CodeCache::_high_bound = 0x%x\n" % cls.hi) +++ if cls.hi == 0: +++ return +++ except Exception as arg: +++ # debug_write("@@ %s\n" % arg) +++ cls.lo = 0 +++ cls.hi = 0 +++ cls.class_inited = False +++ raise +++ +++ # t("f cls.heap_list == []:") +++ if cls.heap_list == []: +++ try: +++ # t("heaps = gdb.parse_and_eval(\"CodeCache::_heaps\")") +++ heaps = gdb.parse_and_eval("CodeCache::_heaps") +++ # debug_write("@@ CodeCache::_heaps (%s) = 0x%x\n" % (heaps.type, heaps)) +++ # t("len = int(heaps['_len'])") +++ len = int(heaps['_len']) +++ # debug_write("@@ CodeCache::_heaps->_len = %d\n" % len) +++ # t("data = heaps['_data']") +++ data = heaps['_data'] +++ # debug_write("@@ CodeCache::_heaps->_data = 0x%x\n" % data) +++ # t("for i in range(0, len):") +++ for i in range(0, len): +++ # t("heap = CodeHeap((data + i).dereference())") +++ heap = CodeHeap((data + i).dereference()) +++ # t("cls.heap_list.append(heap)") +++ cls.heap_list.append(heap) +++ # t("cls.heap_count += 1") +++ cls.heap_count += 1 +++ except Exception as arg: +++ # debug_write("@@ %s\n" % arg) +++ cls.heap_list = [] +++ cls.heap_count = 0 +++ cls.class_inited = False +++ raise +++ cls.class_inited = True +++ +++ @classmethod +++ def inrange(cls, pc): +++ # t("CodeCache.inrange") +++ # make sure we are initialized +++ cls.class_init() +++ # if we got here we can use the heaps +++ x = Types.as_long(pc) +++ # t("return cls.lo <= x and cls.hi > x") +++ return cls.lo <= x and cls.hi > x +++ +++ @classmethod +++ def makestr(cls, charcnt, charptr): +++ # t("CodeCache.makestr") +++ #res = "" +++ #for i in range(0, charcnt): +++ # c = (charptr + i).dereference() +++ # res = ("%s%c" % (res, c)) +++ #return res +++ # debug_write("charcnt = %d charptr = %s\n" % (charcnt, str(charptr))) +++ return charptr.string("ascii", "ignore", charcnt) +++ +++ # given a PC find the associated OpenJDK code blob instance +++ @classmethod +++ def findblob(cls, pc): +++ # t("CodeCache.findblob") +++ # make sure we are initialized +++ cls.class_init() +++ # if we got here we can use the heaps +++ if not cls.inrange(pc): +++ raise gdb.GdbError("dbg.findblob : address 0x%x is not in range!" % pc) +++ for heap in cls.heap_list: +++ try: +++ # t("blob = heap.findblob(pc)") +++ blob = heap.findblob(pc) +++ except Exception as arg: +++ # debug_write("@@ findblob excepted %s\n" % str(arg)) +++ # t("blob = None") +++ blob = None +++ # t("if blob != None:") +++ if blob != None: +++ # t("name=str(blob['_name'])") +++ name=str(blob['_name']) +++ # debug_write("@@ blob(0x%x) -> %s\n" % (pc, name)) +++ # t("return blob") +++ return blob +++ # t("raise gdb.GdbError") +++ raise gdb.GdbError("dbg.findblob : no blob for inrange address 0x%x!" % pc) +++ +++# abstract over some constants for stack frame layout +++ +++class FrameConstants(object): +++ class_inited = False +++ _sender_sp_offset = 0 +++ _interpreter_frame_sender_sp_offset = 0 +++ _interpreter_frame_method_offset = 0 +++ _interpreter_frame_bcp_offset = 0 +++ @classmethod +++ def class_init(cls): +++ if cls.class_inited: +++ return +++ cls._interpreter_frame_sender_sp_offset = int(gdb.parse_and_eval("frame::interpreter_frame_sender_sp_offset")) +++ cls._sender_sp_offset = int(gdb.parse_and_eval("frame::sender_sp_offset")) +++ cls._interpreter_frame_method_offset = int(gdb.parse_and_eval("frame::interpreter_frame_method_offset")) +++ cls._interpreter_frame_bcp_offset = int(gdb.parse_and_eval("frame::interpreter_frame_bcp_offset")) +++ # only set if we got here with no errors +++ cls.class_inited = True +++ @classmethod +++ def sender_sp_offset(cls): +++ cls.class_init() +++ return cls._sender_sp_offset +++ @classmethod +++ def interpreter_frame_sender_sp_offset(cls): +++ cls.class_init() +++ return cls._interpreter_frame_sender_sp_offset +++ @classmethod +++ def interpreter_frame_method_offset(cls): +++ cls.class_init() +++ return cls._interpreter_frame_method_offset +++ @classmethod +++ def interpreter_frame_bcp_offset(cls): +++ cls.class_init() +++ return cls._interpreter_frame_bcp_offset +++ +++# class which knows how to read a compressed stream of bytes n.b. at +++# the moment we only need to know how to read bytes and ints +++ +++class CompressedStream: +++ # important constants for compressed stream read +++ BitsPerByte = 8 +++ lg_H = 6 +++ H = 1 << lg_H +++ L = (1 << BitsPerByte) - H +++ MAX_i = 4 +++ +++ def __init__(self, data): +++ # data is a gdb.Value of type 'byte *' +++ self.data = data +++ self.pos = 0 +++ # retrieve the byte at offset pos +++ def at(self, pos): +++ return int(Types.load_byte(self.data + pos)) +++ # read and return the next byte +++ def read(self): +++ # t("CompressedStream.read()") +++ pos = self.pos +++ b = self.at(pos) +++ self.pos = pos+1 +++ return b +++ def read_int(self): +++ # t("CompressedStream.read_int()") +++ b0 = self.read() +++ # debug_write("b0 = 0x%x\n" % b0) +++ if b0 < CompressedStream.L: +++ return b0 +++ return self.read_int_mb(b0) +++ def read_signed_int(self): +++ # t("CompressedStream.read_signed_int()") +++ return self.decode_sign(self.read_int()) +++ def decode_sign(self, x): +++ # t("CompressedStream.decode_sign()") +++ return (x >> 1) ^ (0 - (x & 1)) +++ def read_int_mb(self, b): +++ t# ("CompressedStream.read_int_mb()") +++ sum = b +++ pos = self.pos +++ # debug_write("pos = %d\n" % pos) +++ # debug_write("sum = 0x%x\n" % sum) +++ lg_H_i = CompressedStream.lg_H +++ i = 0 +++ while (True): +++ b_i = self.at(pos + i) +++ # debug_write("b_%d = %d\n" % (i, b_i)) +++ sum += (b_i << lg_H_i) +++ # debug_write("sum = 0x%x\n" % sum) +++ i += 1 +++ if b_i < CompressedStream.L or i == CompressedStream.MAX_i: +++ self.pos = pos + i +++ # debug_write("self.pos = %d\n" % self.pos) +++ return sum +++ lg_H_i += CompressedStream.lg_H +++ +++ +++# class which knows how to find method and bytecode +++# index pairs from a pc associated with a given compiled +++# method. n.b. there may be more than one such pair +++# because of inlining. +++ +++class MethodBCIReader: +++ pcdescstar_t = None +++ class_inited = False +++ @classmethod +++ def class_init(cls): +++ # t("MethodBCIReader.class_init") +++ if cls.class_inited: +++ return +++ # cache some useful types +++ cls.pcdesc_p = gdb.lookup_type("PcDesc").pointer() +++ cls.metadata_p = gdb.lookup_type("Metadata").pointer() +++ cls.metadata_pp = cls.metadata_p.pointer() +++ cls.method_p = gdb.lookup_type("Method").pointer() +++ cls.class_inited = True +++ +++ @classmethod +++ def as_pcdesc_p(cls, val): +++ return Types.to_type(val, cls.pcdesc_p) +++ +++ def __init__(self, nmethod, method): +++ # t("MethodBCIReader.__init__") +++ # ensure we have cached the necessary types +++ self.class_init() +++ # need to unpack pc scopes +++ self.nmethod = nmethod +++ self.method = method +++ # debug_write("nmethod (%s) = 0x%x\n" % (str(nmethod.type), Types.as_long(nmethod))) +++ blob = Types.to_type(nmethod, Types.codeblobp_t); +++ self.code_begin = Types.as_long(blob['_code_begin']) +++ self.code_end = Types.as_long(blob['_code_end']) +++ scopes_pcs_begin_offset = Types.as_int(nmethod['_scopes_pcs_offset']) +++ # debug_write("scopes_pcs_begin_offset = 0x%x\n" % scopes_pcs_begin_offset) +++ scopes_pcs_end_offset = Types.as_int(nmethod['_dependencies_offset']) +++ # debug_write("scopes_pcs_end_offset = 0x%x\n" % scopes_pcs_end_offset) +++ header_begin = Types.cast_bytep(nmethod) +++ self.scopes_pcs_begin = self.as_pcdesc_p(header_begin + scopes_pcs_begin_offset) +++ # debug_write("scopes_pcs_begin (%s) = 0x%x\n" % (str(self.scopes_pcs_begin.type), Types.as_long(self.scopes_pcs_begin))) +++ self.scopes_pcs_end = self.as_pcdesc_p(header_begin + scopes_pcs_end_offset) +++ # debug_write("scopes_pcs_end (%s) = 0x%x\n" % (str(self.scopes_pcs_end.type), Types.as_long(self.scopes_pcs_end))) +++ +++ def find_pc_desc(self, pc_off): +++ lower = self.scopes_pcs_begin +++ upper = self.scopes_pcs_end - 1 +++ if lower == upper: +++ return None +++ # non-empty table always starts with lower as a sentinel with +++ # offset -1 and will have at least one real offset beyond that +++ next = lower + 1 +++ while next < upper and next['_pc_offset'] <= pc_off: +++ next = next + 1 +++ # use the last known bci below this pc +++ return next - 1 +++ +++ def pc_desc_to_method_bci_stack(self, pc_desc): +++ scope_decode_offset = Types.as_int(pc_desc['_scope_decode_offset']) +++ if scope_decode_offset == 0: +++ return [ { 'method': self.method, 'bci': 0 } ] +++ nmethod = self.nmethod +++ # debug_write("nmethod = 0x%x\n" % nmethod) +++ # debug_write("pc_desc = 0x%x\n" % Types.as_long(pc_desc)) +++ base = Types.cast_bytep(nmethod) +++ # scopes_data_offset = Types.as_int(nmethod['_scopes_data_offset']) +++ # scopes_base = base + scopes_data_offset +++ scopes_base = nmethod['_scopes_data_begin'] +++ # debug_write("scopes_base = 0x%x\n" % Types.as_long(scopes_base)) +++ metadata_offset = Types.as_int(nmethod['_metadata_offset']) +++ metadata_base = Types.to_type(base + metadata_offset, self.metadata_pp) +++ # debug_write("metadata_base = 0x%x\n" % Types.as_long(metadata_base)) +++ scope = scopes_base + scope_decode_offset +++ # debug_write("scope = 0x%x\n" % Types.as_long(scope)) +++ stream = CompressedStream(scope) +++ # debug_write("stream = %s\n" % stream) +++ sender = stream.read_int() +++ # debug_write("sender = %s\n" % sender) +++ # method name is actually in metadata +++ method_idx = stream.read_int() +++ method_md = (metadata_base + (method_idx - 1)).dereference() +++ methodptr = Types.to_type(method_md, self.method_p) +++ method = Method(methodptr) +++ # bci is offset by -1 to allow range [-1, ..., MAX_UINT) +++ bci = stream.read_int() - 1 +++ # debug_write("method,bci = %s,0x%x\n" % (method.get_name(), bci)) +++ result = [ { 'method': method, 'bci': bci } ] +++ while sender > 0: +++ # debug_write("\nsender = 0x%x\n" % sender) +++ stream = CompressedStream(scopes_base + sender) +++ sender = stream.read_int() +++ method_idx = stream.read_int() +++ method_md = (metadata_base + (method_idx - 1)).dereference() +++ methodptr = Types.to_type(method_md, self.method_p) +++ method = Method(methodptr) +++ # bci is offset by -1 to allow range [-1, ..., MAX_UINT) +++ bci = stream.read_int() - 1 +++ # debug_write("method,bci = %s,0x%x\n" % (method.get_name(), bci)) +++ result.append( { 'method': method, 'bci': bci } ) +++ return result +++ +++ def pc_to_method_bci_stack(self, pc): +++ # need to search unpacked pc scopes +++ if pc < self.code_begin or pc >= self.code_end: +++ return None +++ pc_off = pc - self.code_begin +++ # debug_write("\npc_off = 0x%x\n" % pc_off) +++ pc_desc = self.find_pc_desc(pc_off) +++ if pc_desc is None: +++ return None +++ return self.pc_desc_to_method_bci_stack(pc_desc) +++ +++# class which knows how to read a method's line +++# number table, translating bytecode indices to line numbers +++class LineReader: +++ # table is a gdb.Value of type 'byte *' (strictly 'u_char *' in JVM code) +++ def __init__(self, table): +++ # t("LineReader.init") +++ self.table = table +++ self.translations = {} +++ def bc_to_line(self, bci): +++ # t("LineReader.bc_to_line()") +++ try: +++ return self.translations[bci] +++ except Exception as arg: +++ line = self.compute_line(bci) +++ if line >= 0: +++ self.translations[bci] = line +++ return line +++ def compute_line(self, bci): +++ # t("LineReader.compute_line()") +++ # debug_write("table = 0x%x\n" % self.table) +++ bestline = -1 +++ self.stream = CompressedStream(self.table) +++ self._bci = 0 +++ self._line = 0 +++ while self.read_pair(): +++ nextbci = self._bci +++ nextline = self._line +++ if nextbci >= bci: +++ return nextline +++ else: +++ bestline = nextline +++ return bestline +++ def read_pair(self): +++ # t("LineReader.read_pair()") +++ next = self.stream.read() +++ # debug_write("next = 0x%x\n" % next) +++ if next == 0: +++ return False +++ if next == 0xff: +++ self._bci = self._bci + self.stream.read_signed_int() +++ self._line = self._line + self.stream.read_signed_int() +++ else: +++ self._bci = self._bci + (next >> 3) +++ self._line = self._line + (next & 0x7) +++ # debug_write("_bci = %d\n" % self._bci) +++ # debug_write("_line = %d\n" % self._line) +++ return True +++ +++# class to provide access to data relating to a Method object +++class Method(object): +++ def __init__(self, methodptr): +++ self.methodptr = methodptr; +++ self.name = None +++ const_method = self.methodptr['_constMethod'] +++ bcbase = Types.cast_bytep(const_method + 1) +++ bytecode_size = Types.as_int(const_method['_code_size']) +++ lnbase = Types.cast_bytep(bcbase + bytecode_size) +++ self.line_number_reader = LineReader(lnbase) +++ +++ def get_name(self): +++ if self.name == None: +++ self.make_name(self.methodptr) +++ return self.name +++ +++ def get_klass_path(self): +++ if self.name == None: +++ self.make_name(self.methodptr) +++ return self.klass_path +++ +++ def get_line(self, bci): +++ if bci < 0: +++ bci = 0 +++ return self.line_number_reader.bc_to_line(bci) +++ +++ def make_name(self, methodptr): +++ const_method = methodptr['_constMethod'] +++ constant_pool = const_method['_constants'] +++ constant_pool_base = Types.cast_voidp((constant_pool + 1)) +++ klass_sym = constant_pool['_pool_holder']['_name'] +++ klass_name = klass_sym['_body'].cast(gdb.lookup_type("char").pointer()) +++ klass_name_length = int(klass_sym['_length']) +++ klass_path = CodeCache.makestr(klass_name_length, klass_name) +++ self.klass_str = klass_path.replace("/", ".") +++ dollaridx = klass_path.find('$') +++ if dollaridx >= 0: +++ klass_path = klass_path[0:dollaridx] +++ self.klass_path = klass_path + ".java" +++ method_idx = const_method['_name_index'] +++ method_sym = (constant_pool_base + (8 * method_idx)).cast(gdb.lookup_type("Symbol").pointer().pointer()).dereference() +++ method_name = method_sym['_body'].cast(gdb.lookup_type("char").pointer()) +++ method_name_length = int(method_sym['_length']) +++ self.method_str = CodeCache.makestr(method_name_length, method_name) +++ +++ sig_idx = const_method['_signature_index'] +++ sig_sym = (constant_pool_base + (8 * sig_idx)).cast(gdb.lookup_type("Symbol").pointer().pointer()).dereference() +++ sig_name = sig_sym['_body'].cast(gdb.lookup_type("char").pointer()) +++ sig_name_length = int(sig_sym['_length']) +++ sig_str = CodeCache.makestr(sig_name_length, sig_name) +++ self.sig_str = self.make_sig_str(sig_str) +++ self.name = self.klass_str + "." + self.method_str + self.sig_str +++ +++ def make_sig_str(self, sig): +++ in_sym_name = False +++ sig_str = "" +++ prefix="" +++ for i, c in enumerate(sig): +++ if c == "(": +++ sig_str = sig_str + c +++ elif c == ")": +++ # ignore return type +++ return sig_str + c +++ elif in_sym_name == True: +++ if c == ";": +++ in_sym_name = False +++ elif c == "/": +++ sig_str = sig_str + "." +++ else: +++ sig_str = sig_str + c +++ elif c == "L": +++ sig_str = sig_str + prefix +++ prefix = "," +++ in_sym_name = True +++ elif c == "B": +++ sig_str = sig_str + prefix + "byte" +++ prefix = "," +++ elif c == "S": +++ sig_str = sig_str + prefix + "short" +++ prefix = "," +++ elif c == "C": +++ sig_str = sig_str + prefix + "char" +++ prefix = "," +++ elif c == "I": +++ sig_str = sig_str + prefix + "int" +++ prefix = "," +++ elif c == "J": +++ sig_str = sig_str + prefix + "long" +++ prefix = "," +++ elif c == "F": +++ sig_str = sig_str + prefix + "float" +++ prefix = "," +++ elif c == "D": +++ sig_str = sig_str + prefix + "double" +++ prefix = "," +++ elif c == "Z": +++ sig_str = sig_str + prefix + "boolean" +++ prefix = "," +++ return sig_str +++ +++# This represents a method in a JIT frame for the purposes of +++# display. There may be more than one method associated with +++# a (compiled) frame because of inlining. The MethodInfo object +++# associated with a JIT frame creates a list of decorators. +++# Interpreted and stub MethodInfo objects insert only one +++# decorator. Compiled MethodInfo objects insert one for the +++# base method and one for each inlined method found at the +++# frame PC address. +++class OpenJDKFrameDecorator(FrameDecorator): +++ def __init__(self, base, methodname, filename, line): +++ super(FrameDecorator, self).__init__() +++ self._base = base +++ self._methodname = methodname +++ self._filename = filename +++ self._line = line +++ +++ def function(self): +++ try: +++ # t("OpenJDKFrameDecorator.function") +++ return self._methodname +++ except Exception as arg: +++ gdb.write("!!! function oops !!! %s\n" % arg) +++ return None +++ +++ def method_name(self): +++ return _methodname +++ +++ def filename(self): +++ try: +++ return self._filename +++ except Exception as arg: +++ gdb.write("!!! filename oops !!! %s\n" % arg) +++ return None +++ +++ def line(self): +++ try: +++ return self._line +++ except Exception as arg: +++ gdb.write("!!! line oops !!! %s\n" % arg) +++ return None +++ +++# A frame filter for OpenJDK. +++class OpenJDKFrameFilter(object): +++ def __init__(self, unwinder): +++ self.name="OpenJDK" +++ self.enabled = True +++ self.priority = 100 +++ self.unwinder = unwinder +++ +++ def maybe_wrap_frame(self, frame): +++ # t("OpenJDKFrameFilter.maybe_wrap_frame") +++ if self.unwinder is None: +++ return [ frame ] +++ # t("unwindercache = self.unwinder.unwindercache") +++ unwindercache = self.unwinder.unwindercache +++ if unwindercache is None: +++ return [ frame ] +++ # t("base = frame.inferior_frame()") +++ base = frame.inferior_frame() +++ # t("sp = Types.as_long(base.read_register('rsp'))") +++ sp = base.read_register('rsp') +++ x = Types.as_long(sp) +++ # debug_write("@@ get info at unwindercache[0x%x]\n" % x) +++ try: +++ cache_entry = unwindercache[x] +++ except Exception as arg: +++ # n.b. no such entry throws an exception +++ # just ignore and use existing frame +++ return [ frame ] +++ try: +++ if cache_entry is None: +++ # debug_write("@@ lookup found no cache_entry\n") +++ return [ frame ] +++ elif cache_entry.codetype == "unknown": +++ # debug_write("@@ lookup found unknown cache_entry\n") +++ return [ frame ] +++ else: +++ # debug_write("@@ got cache_entry for blob 0x%x at unwindercache[0x%x]\n" % (cache_entry.blob, x)) +++ method_info = cache_entry.method_info +++ if method_info == None: +++ return [ frame ] +++ else: +++ return method_info.decorate(frame) +++ except Exception as arg: +++ gdb.write("!!! maybe_wrap_frame oops !!! %s\n" % arg) +++ return [ frame ] +++ +++ def flatten(self, list_of_lists): +++ return [x for y in list_of_lists for x in y ] +++ +++ def filter(self, frame_iter): +++ # return map(self.maybe_wrap_frame, frame_iter) +++ return self.flatten( map(self.maybe_wrap_frame, frame_iter) ) +++ +++ +++# A frame id class, as specified by the gdb unwinder API. +++class OpenJDKFrameId(object): +++ def __init__(self, sp, pc): +++ # t("OpenJDKFrameId.__init__") +++ self.sp = sp +++ self.pc = pc +++ +++# class hierarchy to record details of different code blobs +++# the class implements functionality required by the frame decorator +++ +++class MethodInfo(object): +++ def __init__(self, entry): +++ self.blob = entry.blob +++ self.pc = Types.as_long(entry.pc) +++ self.sp = Types.as_long(entry.sp) +++ if entry.bp is None: +++ self.bp = 0 +++ else: +++ self.bp = Types.as_long(entry.bp) +++ +++ def decorate(self, frame): +++ return [ frame ] +++ +++# info for stub frame +++ +++class StubMethodInfo(MethodInfo): +++ def __init__(self, entry, name): +++ super(StubMethodInfo, self).__init__(entry) +++ self.name = name +++ +++ def decorate(self, frame): +++ return [ OpenJDKFrameDecorator(frame, self.name, None, None) ] +++ +++# common info for compiled, native or interpreted frame +++class JavaMethodInfo(MethodInfo): +++ +++ def __init__(self, entry): +++ super(JavaMethodInfo, self).__init__(entry) +++ +++ def cache_method_info(self): +++ methodptr = self.get_methodptr() +++ self.method = Method(methodptr) +++ +++ +++ def get_method(self): +++ return self.method +++ +++ def method_name(self): +++ return self.get_method().get_name() +++ +++ def filename(self): +++ return self.get_method().get_klass_path() +++ +++ def decorate(self, frame): +++ return [ OpenJDKFrameDecorator(frame, self.method_name(), self.filename(), None) ] +++ +++# info for compiled frame +++ +++class CompiledMethodInfo(JavaMethodInfo): +++ +++ def __init__(self, entry): +++ # t("CompiledMethodInfo.__init__") +++ super(CompiledMethodInfo,self).__init__(entry) +++ blob = self.blob +++ cmethod = Types.to_type(blob, Types.cmethodp_t) +++ nmethod = Types.to_type(blob, Types.nmethodp_t) +++ self.methodptr = cmethod['_method'] +++ const_method = self.methodptr['_constMethod'] +++ bcbase = Types.cast_bytep(const_method + 1) +++ self.code_begin = Types.as_long(blob['_code_begin']) +++ # get bc and line number info from method +++ self.cache_method_info() +++ # get PC to BCI translator from the nmethod +++ self.bytecode_index_reader = MethodBCIReader(nmethod, self.method) +++ # t("self.method_bci_stack = self.bytecode_index_reader.pc_to_method_bci_stack(self.pc)") +++ self.method_bci_stack = self.bytecode_index_reader.pc_to_method_bci_stack(self.pc) +++ +++ # subclasses need to compute their method pointer +++ +++ def get_methodptr(self): +++ return self.methodptr +++ +++ def format_method_name(self, method, is_outer): +++ name = method.get_name() +++ if is_outer: +++ return ("[compiled offset=0x%x] %s" % (self.pc - self.code_begin, name)) +++ else: +++ return ("[inlined] %s" % name) +++ +++ def make_decorator(self, frame, pair, is_outer): +++ # t("make_decorator") +++ method = pair['method'] +++ bci = pair['bci'] +++ methodname = self.format_method_name(method, is_outer) +++ filename = method.get_klass_path() +++ line = method.get_line(bci) +++ if line < 0: +++ line = None +++ decorator = OpenJDKFrameDecorator(frame, methodname, filename, line) +++ return decorator +++ +++ def decorate(self, frame): +++ if self.method_bci_stack == None: +++ return [ frame ] +++ else: +++ try: +++ decorators = [] +++ pairs = self.method_bci_stack +++ # debug_write("converting method_bci_stack = %s\n" % self.method_bci_stack) +++ l = len(pairs) +++ for i in range(l): +++ pair = pairs[i] +++ # debug_write("decorating pair %s\n" % pair) +++ decorator = self.make_decorator(frame, pair, i == (l - 1)) +++ decorators.append(decorator) +++ return decorators +++ except Exception as arg: +++ gdb.write("!!! decorate oops %s !!!\n" % arg) +++ return [ frame ] +++ +++# info for native frame +++ +++class NativeMethodInfo(JavaMethodInfo): +++ +++ def __init__(self, entry): +++ # t("NativeMethodInfo.__init__") +++ super(NativeMethodInfo,self).__init__(entry) +++ blob = self.blob +++ cmethod = Types.to_type(blob, Types.cmethodp_t) +++ nmethod = Types.to_type(blob, Types.nmethodp_t) +++ self.methodptr = cmethod['_method'] +++ const_method = self.methodptr['_constMethod'] +++ bcbase = Types.cast_bytep(const_method + 1) +++ self.code_begin = Types.as_long(blob['_code_begin']) +++ # get bc and line number info from method +++ self.cache_method_info() +++ +++ # subclasses need to compute their method pointer +++ +++ def get_methodptr(self): +++ return self.methodptr +++ +++ def format_method_name(self, method): +++ name = method.get_name() +++ return ("[native offset=0x%x] %s" % (self.pc - self.code_begin, name)) +++ +++ def method_name(self): +++ return self.format_method_name(self.method) +++ +++# info for interpreted frame +++ +++class InterpretedMethodInfo(JavaMethodInfo): +++ +++ def __init__(self, entry, bcp): +++ super(InterpretedMethodInfo,self).__init__(entry) +++ # interpreter frames store methodptr in slot 3 +++ methodptr_offset = FrameConstants.interpreter_frame_method_offset() * 8 +++ methodptr_addr = gdb.Value((self.bp + methodptr_offset) & 0xffffffffffffffff) +++ methodptr_slot = methodptr_addr.cast(gdb.lookup_type("Method").pointer().pointer()) +++ self.methodptr = methodptr_slot.dereference() +++ # bytecode immediately follows const method +++ const_method = self.methodptr['_constMethod'] +++ bcbase = Types.cast_bytep(const_method + 1) +++ # debug_write("@@ bcbase = 0x%x\n" % Types.as_long(bcbase)) +++ bcp_offset = FrameConstants.interpreter_frame_bcp_offset() * 8 +++ if bcp is None: +++ # interpreter frames store bytecodeptr in slot 8 +++ bcp_addr = gdb.Value((self.bp + bcp_offset) & 0xffffffffffffffff) +++ bcp_val = Types.cast_bytep(Types.load_ptr(bcp_addr)) +++ else: +++ bcp_val = Types.cast_bytep(bcp) +++ # sanity check the register value -- it is sometimes off +++ # when returning from a call out +++ bcoff = Types.as_long(bcp_val - bcbase) +++ if bcoff < 0 or bcoff >= 0x10000: +++ # use the value in the frame slot +++ bcp_addr = gdb.Value((self.bp + bcp_offset) & 0xffffffffffffffff) +++ bcp_val = Types.cast_bytep(Types.load_ptr(bcp_addr)) +++ self.bcoff = Types.as_long(bcp_val - bcbase) +++ # debug_write("@@ bcoff = 0x%x\n" % self.bcoff) +++ # line number table immediately following bytecode +++ bytecode_size = Types.as_int(const_method['_code_size']) +++ self.is_native = (bytecode_size == 0) +++ # n.b. data in compressed line_number_table block is u_char +++ # debug_write("bytecode_size = 0x%x\n" % bytecode_size) +++ lnbase = Types.cast_bytep(bcbase + bytecode_size) +++ # debug_write("lnbase = 0x%x\n" % Types.as_long(lnbase)) +++ self.line_number_reader = LineReader(lnbase) +++ self.cache_method_info() +++ +++ def get_methodptr(self): +++ return self.methodptr +++ +++ def format_method_name(self, method): +++ name = method.get_name() +++ if self.is_native: +++ return "[native] " + name +++ else: +++ return ("[interpreted: bc = %d] " % self.bcoff) + name +++ +++ def line(self): +++ line = self.line_number_reader.bc_to_line(self.bcoff) +++ # debug_write("bc_to_line(%d) = %d\n" % (self.bcoff, line)) +++ if line < 0: +++ line = None +++ return line +++ +++ def decorate(self, frame): +++ method = self.get_method() +++ return [ OpenJDKFrameDecorator(frame, self.format_method_name(method), method.get_klass_path(), self.line()) ] +++ +++ +++class OpenJDKUnwinderCacheEntry(object): +++ def __init__(self, blob, sp, pc, bp, bcp, name, codetype): +++ # t("OpenJDKUnwinderCacheEntry.__init__") +++ self.blob = blob +++ self.sp = sp +++ self.pc = pc +++ self.bp = bp +++ self.codetype = codetype +++ try: +++ if codetype == "compiled": +++ self.method_info = CompiledMethodInfo(self) +++ elif codetype == "native": +++ self.method_info = NativeMethodInfo(self) +++ elif codetype == "interpreted": +++ self.method_info = InterpretedMethodInfo(self, bcp) +++ elif codetype == "stub": +++ self.method_info = StubMethodInfo(self, name) +++ else: +++ self.method_info = None +++ except Exception as arg: +++ gdb.write("!!! failed to cache info for %s frame [pc: 0x%x sp:0x%x bp 0x%x] !!!\n!!! %s !!!\n" % (codetype, pc, sp, bp, arg)) +++ self.method_info = None +++ +++# an unwinder class, an instance of which can be registered with gdb +++# to handle unwinding of frames. +++ +++class OpenJDKUnwinder(Unwinder): +++ def __init__(self): +++ # t("OpenJDKUnwinder.__init__") +++ super(OpenJDKUnwinder, self).__init__("OpenJDKUnwinder") +++ # blob name will be in format '0xHexDigits "AlphaNumSpaces"' +++ self.matcher=re.compile('^0x[a-fA-F0-9]+ "(.*)"$') +++ self.unwindercache = {} +++ self.invocations = {} +++ +++ # the method that gets called by the pyuw_sniffer +++ def __call__(self, pending_frame): +++ # sometimes when we call into python gdb routines +++ # the call tries to re-establish the frame and ends +++ # up calling the frame sniffer recursively +++ # +++ # so use a list keyed by thread to avoid recursive calls +++ # t("OpenJDKUnwinder.__call__") +++ thread = gdb.selected_thread() +++ if self.invocations.get(thread) != None: +++ # debug_write("!!! blocked %s !!!\n" % str(thread)) +++ return None +++ try: +++ # debug_write("!!! blocking %s !!!\n" % str(thread)) +++ self.invocations[thread] = thread +++ result = self.call_sub(pending_frame) +++ # debug_write("!!! unblocking %s !!!\n" % str(thread)) +++ self.invocations[thread] = None +++ return result +++ except Exception as arg: +++ gdb.write("!!! __call__ oops %s !!!\n" % arg) +++ # debug_write("!!! unblocking %s !!!\n" % str(thread)) +++ self.invocations[thread] = None +++ return None +++ +++ def call_sub(self, pending_frame): +++ # t("OpenJDKUnwinder.__call_sub__") +++ # debug_write("@@ reading pending frame registers\n") +++ pc = pending_frame.read_register('rip') +++ # debug_write("@@ pc = 0x%x\n" % Types.as_long(pc)) +++ sp = pending_frame.read_register('rsp') +++ # debug_write("@@ sp = 0x%x\n" % Types.as_long(sp)) +++ bp = pending_frame.read_register('rbp') +++ # debug_write("@@ bp = 0x%x\n" % Types.as_long(bp)) +++ try: +++ if not CodeCache.inrange(pc): +++ # t("not CodeCache.inrange(0x%x)\n" % pc) +++ return None +++ except Exception as arg: +++ # debug_write("@@ %s\n" % arg) +++ return None +++ if _dump_frame: +++ debug_write(" pc = 0x%x\n" % Types.as_long(pc)) +++ debug_write(" sp = 0x%x\n" % Types.as_long(sp)) +++ debug_write(" bp = 0x%x\n" % Types.as_long(bp)) +++ # this is a Java frame so we need to return unwind info +++ # +++ # the interpreter keeps the bytecode pointer (bcp) in a +++ # register and saves it to the stack when it makes a call to +++ # another Java method or to C++. if the current frame has a +++ # bcp register value then we pass it in case the pending frame +++ # is an intrepreter frame. that ensures we use the most up to +++ # date bcp when the inferior has stopped at the top level in a +++ # Java interpreted frame. it also saves us doing a redundant +++ # stack read when the pending frame sits below a non-JITted +++ # (C++) frame. n.b. if the current frame is a JITted frame +++ # (i.e. one that we have already unwound) then rbp will not be +++ # present. that's ok because the frame decorator can still +++ # find the latest bcp value on the stack. +++ bcp = pending_frame.read_register('r13') +++ try: +++ # convert returned value to a python int to force a check that +++ # the register is defined. if not this will except +++ bcp = gdb.Value(int(bcp)) +++ # debug_write("@@ bcp = 0x%x\n" % Types.as_long(bcp)) +++ except Exception as arg: +++ # debug_write("@@ !!! call_sub oops %s !!! \n" % arg) +++ bcp = None +++ # debug_write("@@ bcp = None\n") +++ # t("blob = CodeCache.findblob(pc)") +++ blob = CodeCache.findblob(pc) +++ # t("if blob is None:") +++ if blob is None: +++ # t("return None") +++ return None +++ # if the blob is an nmethod then we use the frame +++ # size to identify the frame base otherwise we +++ # use the value in rbp +++ # t("name = str(blob['_name'])") +++ name = str(blob['_name']) +++ # blob name will be in format '0xHexDigits "AlphaNumSpaces"' +++ # and we just want the bit between the quotes +++ m = self.matcher.match(name) +++ if not m is None: +++ # debug_write("@@ m.group(1) == %s\n" % m.group(1)) +++ name = m.group(1) +++ if name == "nmethod": +++ # debug_write("@@ compiled %s\n" % name) +++ codetype = 'compiled' +++ # TODO -- need to check if frame is complete +++ # i.e. if ((char *)pc - (char *)blob) > blob['_code_begin'] + blob['_frame_complete_offset'] +++ # if not then we have not pushed a frame. +++ # what do we do then? use SP as BP??? +++ frame_size = blob['_frame_size'] +++ # debug_write("@@ frame_size = 0x%x\n" % int(frame_size)) +++ # n.b. frame_size includes stacked rbp and rip hence the -2 +++ bp = sp + ((frame_size - 2) * 8) +++ # debug_write("@@ revised bp = 0x%x\n" % Types.as_long(bp)) +++ elif name == "native nmethod": +++ # debug_write("@@ native %s \n" % name) +++ codetype = "native" +++ elif name == "Interpreter": +++ # debug_write("@@ interpreted %s\n" %name) +++ codetype = "interpreted" +++ elif name[:4] == "Stub": +++ # debug_write("@@ stub %s\n" % name) +++ codetype = "stub" +++ else: +++ # debug_write("@@ unknown %s\n" % name) +++ codetype = "unknown" +++ # cache details of the current frame +++ x = Types.as_long(sp) +++ # debug_write("@@ add %s cache entry for blob 0x%x at unwindercache[0x%x]\n" % (codetype, blob, x)) +++ self.unwindercache[x] = OpenJDKUnwinderCacheEntry(blob, sp, pc, bp, bcp, name, codetype) +++ # t("next_bp = Types.load_long(bp)") +++ next_bp = Types.load_long(bp) +++ # t("next_pc = Types.load_long(bp + 8)") +++ next_pc = Types.load_long(bp + 8) +++ # next_sp is normally just 2 words below current bp +++ # but for interpreted frames we need to skip locals +++ # so we pull caller_sp from the frame +++ if codetype == "interpreted": +++ interpreter_frame_sender_sp_offset = FrameConstants.interpreter_frame_sender_sp_offset() * 8 +++ # interpreter frames store sender sp in slot 1 +++ next_sp = Types.load_long(bp + interpreter_frame_sender_sp_offset) +++ else: +++ sender_sp_offset = FrameConstants.sender_sp_offset() * 8 +++ next_sp = bp + sender_sp_offset +++ # create unwind info for this frame +++ # t("frameid = OpenJDKFrameId(...)") +++ frameid = OpenJDKFrameId(Types.to_voidp(next_sp), +++ Types.to_type(next_pc, pc.type)) +++ # debug_write("@@ created frame id\n") +++ # t("unwind_info = pending_frame.create_unwind_info(frameid)") +++ unwind_info = pending_frame.create_unwind_info(frameid) +++ # debug_write("@@ created unwind info\n") +++ # debug_write("@@ next_bp = 0x%x\n" % next_bp) +++ # debug_write("@@ next_pc = 0x%x\n" % next_pc) +++ # debug_write("@@ next_sp = 0x%x\n" % next_sp) +++ # we must calculate pc, sp and bp. +++ # +++ # for now we only add the minimum of registers that we know +++ # are valid. +++ unwind_info.add_saved_register('rip', next_pc) +++ unwind_info.add_saved_register('rsp', next_sp) +++ unwind_info.add_saved_register('rbp', next_bp) +++ if _dump_frame: +++ debug_write("next pc = 0x%x\n" % Types.as_long(next_pc)) +++ debug_write("next sp = 0x%x\n" % Types.as_long(next_sp)) +++ debug_write("next bp = 0x%x\n" % Types.as_long(next_bp)) +++ # t("return unwind_info") +++ return unwind_info +++ +++# register the unwinder globally [probably really needs to be +++# registered solely with libjvm.so] +++def register_unwinder(): +++ unwinder = None +++ if _have_unwinder: +++ unwinder = OpenJDKUnwinder() +++ gdb.unwinder.register_unwinder(None, unwinder, replace=True) +++ filt = OpenJDKFrameFilter(unwinder) +++ gdb.frame_filters[filt.name] = filt +++ +++register_unwinder() diff --cc debian/font.properties.ja index 000000000,000000000,000000000..91916715f new file mode 100644 --- /dev/null +++ b/debian/font.properties.ja @@@@ -1,0 -1,0 -1,0 +1,197 @@@@ +++# @(#)font.properties.ja.linux 1.7 02/03/07 +++# +++# Copyright 2002 Sun Microsystems, Inc. All rights reserved. +++# +++ +++# Component Font Mappings +++# +++serif.0=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1 +++serif.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.italic.0=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1 +++serif.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.bold.0=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1 +++serif.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.bolditalic.0=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1 +++serif.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.0=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.italic.0=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.italic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.bold.0=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.bold.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.bolditalic.0=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.bolditalic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.italic.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.bold.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.bolditalic.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.0=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.italic.0=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.italic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.bold.0=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.bold.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.bolditalic.0=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.bolditalic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.italic.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.bold.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.bolditalic.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++# Missing Glyph Character +++# +++default.char=274f +++ +++# Component Font Character Encodings +++# +++fontcharset.serif.0=sun.io.CharToByteISO8859_1 +++fontcharset.serif.1=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.sansserif.0=sun.io.CharToByteISO8859_1 +++fontcharset.sansserif.1=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.monospaced.0=sun.io.CharToByteISO8859_1 +++fontcharset.monospaced.1=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.dialog.0=sun.io.CharToByteISO8859_1 +++fontcharset.dialog.1=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.dialoginput.0=sun.io.CharToByteISO8859_1 +++fontcharset.dialoginput.1=sun.awt.motif.CharToByteX11JIS0208 +++ +++# Exclusion Ranges +++# +++ +++# XFontSet Information +++# +++fontset.serif.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.default=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 diff --cc debian/font.properties.ja.wqy_zenhai index 000000000,000000000,000000000..119822d83 new file mode 100644 --- /dev/null +++ b/debian/font.properties.ja.wqy_zenhai @@@@ -1,0 -1,0 -1,0 +1,244 @@@@ +++# @(#)font.properties.ja.linux 1.7 02/03/07 +++# +++# Copyright 2002 Sun Microsystems, Inc. All rights reserved. +++# +++ +++# Component Font Mappings +++# +++serif.0=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1 +++serif.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++serif.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.italic.0=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1 +++serif.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++serif.italic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.bold.0=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1 +++serif.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++serif.bold.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++serif.bolditalic.0=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1 +++serif.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++serif.bolditalic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.0=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++sansserif.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.italic.0=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.italic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++sansserif.italic.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.bold.0=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.bold.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++sansserif.bold.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++sansserif.bolditalic.0=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++sansserif.bolditalic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++sansserif.bolditalic.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++monospaced.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.italic.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++monospaced.italic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.bold.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++monospaced.bold.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++monospaced.bolditalic.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++monospaced.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++monospaced.bolditalic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.0=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialog.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.italic.0=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.italic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialog.italic.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.bold.0=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.bold.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialog.bold.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialog.bolditalic.0=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +++dialog.bolditalic.1=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialog.bolditalic.2=-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialoginput.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.italic.0=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.italic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialoginput.italic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.bold.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.bold.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialoginput.bold.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++dialoginput.bolditalic.0=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +++dialoginput.bolditalic.1=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++dialoginput.bolditalic.2=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++# Missing Glyph Character +++# +++default.char=274f +++ +++# Component Font Character Encodings +++# +++fontcharset.serif.0=sun.io.CharToByteISO8859_1 +++fontcharset.serif.1=sun.awt.motif.CharToByteX11JIS0208 +++fontcharset.serif.2=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.sansserif.0=sun.io.CharToByteISO8859_1 +++fontcharset.sansserif.1=sun.awt.motif.CharToByteX11JIS0208 +++fontcharset.sansserif.2=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.monospaced.0=sun.io.CharToByteISO8859_1 +++fontcharset.monospaced.1=sun.awt.motif.CharToByteX11JIS0208 +++fontcharset.monospaced.2=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.dialog.0=sun.io.CharToByteISO8859_1 +++fontcharset.dialog.1=sun.awt.motif.CharToByteX11JIS0208 +++fontcharset.dialog.2=sun.awt.motif.CharToByteX11JIS0208 +++ +++fontcharset.dialoginput.0=sun.io.CharToByteISO8859_1 +++fontcharset.dialoginput.1=sun.awt.motif.CharToByteX11JIS0208 +++fontcharset.dialoginput.2=sun.awt.motif.CharToByteX11JIS0208 +++ +++# Exclusion Ranges +++# +++ +++# XFontSet Information +++# +++fontset.serif.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.serif.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.sansserif.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.monospaced.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialog.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.italic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.bold=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.bolditalic=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.dialoginput.plain=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ +++fontset.default=\ +++-sony-fixed-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\ +++-b&h-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1,\ +++-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0,\ +++-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +++ diff --cc debian/generate-debian-orig.sh index 000000000,000000000,000000000..9ee8ac31d new file mode 100644 --- /dev/null +++ b/debian/generate-debian-orig.sh @@@@ -1,0 -1,0 -1,0 +1,68 @@@@ +++#!/bin/sh +++ +++tarballs="corba.tar.gz hotspot.tar.gz jaxp.tar.gz jaxws.tar.gz jdk.tar.gz langtools.tar.gz openjdk.tar.gz" +++# AArch64 hotspot +++aarch64_hsname=f50993b6c38d +++tarballs="$tarballs $aarch64_hsname.tar.gz" +++jamvmtb=jamvm-ac22c9948434e528ece451642b4ebde40953ee7e.tar.gz +++tarballdir=7u55 +++version=7u55-2.4.7 +++base=openjdk-7 +++pkgdir=$base-$version +++origtar=${base}_${version}.orig.tar.gz +++ +++icedtea_checkout=icedtea7-2.4.7 +++debian_checkout=openjdk7 +++ +++if [ -d $pkgdir ]; then +++ echo directory $pkgdir already exists +++ exit 1 +++fi +++ +++if [ -d $pkgdir.orig ]; then +++ echo directory $pkgdir.orig already exists +++ exit 1 +++fi +++ +++if [ -f $origtar ]; then +++ echo "Using existing $origtar" +++ tar xf $origtar +++ if [ -d $pkgdir.orig ]; then +++ mv $pkgdir.orig $pkgdir +++ fi +++ tar -c -f - -C $icedtea_checkout . | tar -x -f - -C $pkgdir +++ rm -rf $pkgdir/.hg +++else +++ echo "Creating new $pkgdir.orig/" +++ rm -rf $pkgdir.orig +++ mkdir -p $pkgdir.orig +++ case "$base" in +++ openjdk*) +++ for i in $tarballs; do +++ cp -p $tarballdir/$i $pkgdir.orig/ +++ done +++ cp -p $tarballdir/$jamvmtb $pkgdir.orig/ +++ ;; +++ esac +++ tar -c -f - -C $icedtea_checkout . | tar -x -f - -C $pkgdir.orig +++ ( +++ cd $pkgdir.orig +++ sh autogen.sh +++ rm -rf autom4te.cache +++ ) +++ cp -a $pkgdir.orig $pkgdir +++ rm -rf $pkgdir.orig/.hg +++fi +++ +++echo "Build debian diff in $pkgdir/" +++cp -a $debian_checkout $pkgdir/debian +++( +++ cd $pkgdir +++ #bash debian/update-shasum.sh +++ #bash debian/update-hgrev.sh +++ ls +++ patch -p1 < debian/patches/icedtea-patch.diff +++ sh autogen.sh +++ rm -rf autom4te.cache +++ echo "aarch64 http://openjdk.linaro.org/hotspot $aarch64_hsname $(sha256sum $aarch64_hsname.tar.gz) $aarch64_hsname.tar.gz" >> hotspot.map +++) diff --cc debian/generate-dfsg-zip.sh index 000000000,000000000,000000000..200be9485 new file mode 100644 --- /dev/null +++ b/debian/generate-dfsg-zip.sh @@@@ -1,0 -1,0 -1,0 +1,60 @@@@ +++#!/bin/sh +++ +++if [ ! -f "$1" ]; then +++ echo "does not exist: $1" +++ exit 1 +++fi +++ +++jdkdir=$(tar tf $1 | head -1 | sed 's,/.*,,') +++echo $jdkdir +++ +++dist=$(lsb_release -is) +++ +++echo "not needed anymore. 2.4.4 has both jdk and langtools cleaned up" +++exit 1 +++ +++# Untar openjdk source zip. +++rm -rf openjdk +++case "$1" in +++ *.zip) unzip -q -x $1 ;; +++ *.tar*) tar xf $1;; +++esac +++ +++case "$1" in +++ *jdk*) +++ echo "Cleanup jdk tarball..." +++ # Remove J2DBench sources, some of which have questionable license +++ # headers. +++ rm -rf \ +++ $jdkdir/src/share/demo/java2d/J2DBench +++ +++ # binary files +++ rm -f \ +++ $jdkdir/test/sun/net/idn/*.spp +++ +++ rm -rf \ +++ $jdkdir/test/sun/security/pkcs11/nss/lib/* +++ +++ rm -f \ +++ $jdkdir/test/java/util/Locale/data/deflocale.sh \ +++ $jdkdir/test/java/util/Locale/data/deflocale.rhel5 \ +++ $jdkdir/test/java/util/Locale/data/deflocale.rhel5.fmtasdefault \ +++ $jdkdir/test/java/util/Locale/data/deflocale.sol10.fmtasdefault \ +++ $jdkdir/test/java/util/Locale/data/deflocale.win7 \ +++ $jdkdir/test/java/util/Locale/data/deflocale.win7.fmtasdefault +++;; +++ +++ *langtools*) +++ echo "Cleanup langtools tarball..." +++ rm -rf $jdkdir/test/tools/javac/T5090006/broken.jar +++;; +++ +++esac +++ +++# Create new zip with new name. +++ +++NEW_ZIP=$(echo $1 | sed -e 's/\.tar.gz/-dfsg.tar.gz/;s/\.zip/-dfsg.tar.gz/') +++GZIP=-9v tar -cz -f $NEW_ZIP $jdkdir +++ +++# Remove old unzipped openjdk dir. +++rm -rf $jdkdir diff --cc debian/jvm.cfg-default index 000000000,000000000,000000000..d886ba82a new file mode 100644 --- /dev/null +++ b/debian/jvm.cfg-default @@@@ -1,0 -1,0 -1,0 +1,5 @@@@ +++# jvm.cfg-default - default jvm configuration which is used if no jvm.cfg +++# is found. After unpacking the file jvm.cfg doesn't exist yet (config file), +++# in this case use this file instead, so that the VM can be used before +++# configuration of the runtime package. +++-server KNOWN diff --cc debian/mauve_tests index 000000000,000000000,000000000..edba589aa new file mode 100644 --- /dev/null +++ b/debian/mauve_tests @@@@ -1,0 -1,0 -1,0 +1,2570 @@@@ +++javax.xml.xpath.XPath +++javax.xml.parsers.DocumentBuilder.PR27864 +++javax.xml.parsers.DocumentBuilder.parseSimpleXML +++javax.crypto.spec.TestOfPBEKeySpec +++javax.crypto.spec.TestOfSecretKeySpec +++javax.accessibility.AccessibleContext.getAccessibleRelationSet +++javax.imageio.plugins.jpeg.TestJPEGImageReadParam +++javax.imageio.plugins.jpeg.TestJPEGHuffmanTable +++javax.imageio.plugins.jpeg.TestJPEGQTable +++javax.imageio.stream.IIOByteBuffer.setOffset +++javax.imageio.stream.IIOByteBuffer.setLength +++javax.imageio.stream.IIOByteBuffer.setData +++javax.imageio.spi.ServiceRegistry.getServiceProviderByClass +++javax.imageio.spi.ServiceRegistry.deregisterAll +++javax.imageio.spi.ServiceRegistry.getCategories +++javax.imageio.spi.ServiceRegistry.lookupProviders +++javax.imageio.spi.ServiceRegistry.registerServiceProvider +++javax.imageio.spi.IIOServiceProvider.getVersion +++javax.imageio.spi.IIOServiceProvider.getVendorName +++javax.imageio.spi.ImageOutputStreamSpi.ImageOutputStreamSpi +++javax.imageio.spi.ImageOutputStreamSpi.needsCacheFile +++javax.imageio.spi.ImageOutputStreamSpi.canUseCacheFile +++javax.imageio.spi.ImageReaderWriterSpi.getNativeImageMetadataFormatName +++javax.imageio.spi.ImageReaderWriterSpi.getFileSuffixes +++javax.imageio.spi.ImageReaderWriterSpi.getExtraImageMetadataFormatNames +++javax.imageio.spi.ImageReaderWriterSpi.getPluginClassName +++javax.imageio.spi.ImageReaderWriterSpi.getNativeStreamMetadataFormatName +++javax.imageio.spi.ImageReaderWriterSpi.getExtraStreamMetadataFormatNames +++javax.imageio.spi.ImageReaderWriterSpi.getMIMETypes +++javax.imageio.spi.ImageReaderWriterSpi.isStandardImageMetadataFormatSupported +++javax.imageio.spi.ImageReaderWriterSpi.getFormatNames +++javax.imageio.spi.ImageReaderWriterSpi.isStandardStreamMetadataFormatSupported +++javax.imageio.spi.ImageInputStreamSpi.ImageInputStreamSpi +++javax.imageio.spi.ImageInputStreamSpi.needsCacheFile +++javax.imageio.spi.ImageInputStreamSpi.canUseCacheFile +++javax.imageio.spi.ImageTranscoderSpi.ImageTranscoderSpi +++javax.imageio.spi.IIORegistry.getDefaultInstance +++javax.naming.CompoundName.simple +++javax.naming.directory.BasicAttribute.Enumerate +++javax.naming.CompositeName.composite +++javax.management.ObjectName.apply +++javax.management.ObjectName.Parsing +++javax.management.ObjectName.ParsingJDK6 +++javax.management.ObjectName.applyJDK6 +++javax.management.openmbean.ArrayType.IsValue +++javax.management.openmbean.ArrayType.Constructor2 +++javax.management.openmbean.ArrayType.Equals +++javax.management.openmbean.ArrayType.IsPrimitiveArray +++javax.management.openmbean.ArrayType.GetArrayType +++javax.management.openmbean.ArrayType.HashCode +++javax.management.openmbean.ArrayType.GetPrimitiveArrayType +++javax.management.openmbean.ArrayType.Constructor1 +++javax.management.openmbean.CompositeDataInvocationHandler.Test +++javax.management.MBeanServerPermission.Constructor +++javax.security.auth.login.TestOfPR25202 +++javax.print.SimpleDoc.constructor +++javax.print.SimpleDoc.getStreamForBytes +++javax.print.SimpleDoc.getAttributes +++javax.print.SimpleDoc.getReaderForText +++javax.print.DocFlavor.parseMimeType +++javax.print.attribute.TextSyntax.constructors +++javax.print.attribute.ResolutionSyntax.simple +++javax.print.attribute.EnumSyntax.serialize +++javax.print.attribute.EnumSyntax.equals +++javax.print.attribute.AttributeSetUtilities.simple +++javax.print.attribute.Size2DSyntax.simple +++javax.print.attribute.SetOfIntegerSyntax.Simple +++javax.print.attribute.HashAttributeSet.populatedSet +++javax.print.attribute.HashAttributeSet.nullTests +++javax.print.attribute.HashAttributeSet.emptySet +++javax.print.attribute.standard.MediaSize.userClass +++javax.swing.JWindow.isRootPaneCheckingEnabled +++javax.swing.JSplitPane.setComponent +++javax.swing.JSplitPane.setResizeWeight +++javax.swing.JSplitPane.getDividerLocation +++javax.swing.JSplitPane.getInputMap +++javax.swing.JSplitPane.getActionMap +++javax.swing.JSplitPane.paramString +++javax.swing.JSplitPane.Constructor +++javax.swing.JOptionPane.getInputMap +++javax.swing.JTabbedPane.getInputMap +++javax.swing.JTabbedPane.Mnemonic +++javax.swing.JTabbedPane.remove +++javax.swing.JToggleButton.constructor +++javax.swing.JToggleButton.actionEvent +++javax.swing.JToggleButton.isFocusable +++javax.swing.JToggleButton.uidelegate +++javax.swing.JToggleButton.getActionCommand +++javax.swing.JToggleButton.model +++javax.swing.JToggleButton.click +++javax.swing.text.View.getResizeWeight +++javax.swing.text.View.getMaximumSpan +++javax.swing.text.View.getMinimumSpan +++javax.swing.text.View.getAlignment +++javax.swing.text.GapContent.getString +++javax.swing.text.GapContent.GapContentTest +++javax.swing.text.GapContent.length +++javax.swing.text.GapContent.constructors +++javax.swing.text.GapContent.insertString +++javax.swing.text.GapContent.getChars +++javax.swing.text.GapContent.PositionTest +++javax.swing.text.GapContent.remove +++javax.swing.text.ElementIterator.ElementIteratorTest +++javax.swing.text.AbstractDocument.BranchElement.getStartOffset +++javax.swing.text.AbstractDocument.BranchElement.getElementIndexNullPointer +++javax.swing.text.AbstractDocument.BranchElement.BranchElementTest +++javax.swing.text.AbstractDocument.BranchElement.getElementIndex +++javax.swing.text.AbstractDocument.LeafElement.getStartOffset +++javax.swing.text.AbstractDocument.getDocumentProperties +++javax.swing.text.AbstractDocument.ElementChange2 +++javax.swing.text.AbstractDocument.AbstractDocumentTest +++javax.swing.text.AbstractDocument.ElementChange +++javax.swing.text.AbstractDocument.filterTest +++javax.swing.text.MaskFormatter.MaskFormatterTest +++javax.swing.text.DefaultFormatter.getValueClass +++javax.swing.text.PlainDocument.getRootElements +++javax.swing.text.PlainDocument.getDocumentProperties +++javax.swing.text.PlainDocument.removeJoinesLines +++javax.swing.text.PlainDocument.multipleLeafs +++javax.swing.text.PlainDocument.getText +++javax.swing.text.PlainDocument.getLength +++javax.swing.text.PlainDocument.createPosition +++javax.swing.text.PlainDocument.insertUpdate +++javax.swing.text.PlainDocument.insertString +++javax.swing.text.PlainDocument.PlainDocumentTest +++javax.swing.text.AttributeSet.isEqual +++javax.swing.text.Segment.clone +++javax.swing.text.Segment.first +++javax.swing.text.Segment.setIndex +++javax.swing.text.Segment.last +++javax.swing.text.Segment.getIndex +++javax.swing.text.Segment.current +++javax.swing.text.Segment.next +++javax.swing.text.Segment.isPartialReturn +++javax.swing.text.Segment.getEndIndex +++javax.swing.text.Segment.setPartialReturn +++javax.swing.text.Segment.getBeginIndex +++javax.swing.text.Segment.constructors +++javax.swing.text.Segment.toString +++javax.swing.text.Segment.previous +++javax.swing.text.TextAction.augmentList +++javax.swing.text.TabSet.getTab +++javax.swing.text.TabSet.constructor +++javax.swing.text.TabSet.getTabCount +++javax.swing.text.TabSet.getTabIndex +++javax.swing.text.TabSet.getTabIndexAfter +++javax.swing.text.TabSet.equals +++javax.swing.text.TabSet.toString +++javax.swing.text.html.HTML.HTML_Test +++javax.swing.text.html.HTMLDocument.FindById +++javax.swing.text.html.parser.Entity.Entity_Test +++javax.swing.text.html.parser.TagElement.TagElement_Test +++javax.swing.text.html.parser.AttributeList.AttributeList_test +++javax.swing.text.html.parser.Element.Element_Test +++javax.swing.text.html.parser.ParserDelegator.Entities +++javax.swing.text.html.parser.ParserDelegator.Text4 +++javax.swing.text.html.parser.ParserDelegator.randomTables +++javax.swing.text.html.parser.ParserDelegator.SimpleParsing +++javax.swing.text.html.parser.ParserDelegator.Text3 +++javax.swing.text.html.parser.ParserDelegator.Text +++javax.swing.text.html.parser.ParserDelegator.eolnNorification +++javax.swing.text.html.parser.ParserDelegator.tokenLocations +++javax.swing.text.html.parser.DTD.DTD_test +++javax.swing.text.BoxView.spans +++javax.swing.text.StyleConstants.setTabSet +++javax.swing.text.StyleConstants.setUnderline +++javax.swing.text.StyleConstants.getLeftIndent +++javax.swing.text.StyleConstants.getIcon +++javax.swing.text.StyleConstants.setFontFamily +++javax.swing.text.StyleConstants.isBold +++javax.swing.text.StyleConstants.setLineSpacing +++javax.swing.text.StyleConstants.isSubscript +++javax.swing.text.StyleConstants.setItalic +++javax.swing.text.StyleConstants.getFontSize +++javax.swing.text.StyleConstants.setComponent +++javax.swing.text.StyleConstants.setBidiLevel +++javax.swing.text.StyleConstants.getForeground +++javax.swing.text.StyleConstants.setSuperscript +++javax.swing.text.StyleConstants.getSpaceAbove +++javax.swing.text.StyleConstants.getLineSpacing +++javax.swing.text.StyleConstants.setSpaceBelow +++javax.swing.text.StyleConstants.setBackground +++javax.swing.text.StyleConstants.getRightIndent +++javax.swing.text.StyleConstants.getFirstLineIndent +++javax.swing.text.StyleConstants.isItalic +++javax.swing.text.StyleConstants.getTabSet +++javax.swing.text.StyleConstants.setIcon +++javax.swing.text.StyleConstants.isUnderline +++javax.swing.text.StyleConstants.setBold +++javax.swing.text.StyleConstants.setAlignment +++javax.swing.text.StyleConstants.setSubscript +++javax.swing.text.StyleConstants.setRightIndent +++javax.swing.text.StyleConstants.isSuperscript +++javax.swing.text.StyleConstants.getSpaceBelow +++javax.swing.text.StyleConstants.setFontSize +++javax.swing.text.StyleConstants.getFontFamily +++javax.swing.text.StyleConstants.constants +++javax.swing.text.StyleConstants.setStrikeThrough +++javax.swing.text.StyleConstants.setForeground +++javax.swing.text.StyleConstants.getAlignment +++javax.swing.text.StyleConstants.setLeftIndent +++javax.swing.text.StyleConstants.getBackground +++javax.swing.text.StyleConstants.getComponent +++javax.swing.text.StyleConstants.getBidiLevel +++javax.swing.text.StyleConstants.setFirstLineIndent +++javax.swing.text.StyleConstants.setSpaceAbove +++javax.swing.text.StyleConstants.isStrikeThrough +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure3 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure1 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument6 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure7 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure2 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument1 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure4 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure6 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument3 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure5 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.insert +++javax.swing.text.DefaultStyledDocument.ElementBuffer.ElementStructure8 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument2 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument5 +++javax.swing.text.DefaultStyledDocument.ElementBuffer.StyledDocument4 +++javax.swing.text.DefaultStyledDocument.Insert +++javax.swing.text.DefaultStyledDocument.insertString +++javax.swing.text.DefaultStyledDocument.Create +++javax.swing.text.SimpleAttributeSet.removeAttributesOnlyIfMatch +++javax.swing.text.SimpleAttributeSet.clone +++javax.swing.text.SimpleAttributeSet.EMPTY +++javax.swing.text.SimpleAttributeSet.containsAttributes +++javax.swing.text.SimpleAttributeSet.containsChecksParent +++javax.swing.text.SimpleAttributeSet.containsAttribute +++javax.swing.text.SimpleAttributeSet.getResolveParent +++javax.swing.text.SimpleAttributeSet.removeAttribute +++javax.swing.text.SimpleAttributeSet.copyAttributes +++javax.swing.text.SimpleAttributeSet.equals +++javax.swing.text.SimpleAttributeSet.removeAttributes +++javax.swing.text.SimpleAttributeSet.getAttribute +++javax.swing.text.SimpleAttributeSet.isEqual +++javax.swing.text.SimpleAttributeSet.getAttributeCount +++javax.swing.text.SimpleAttributeSet.constructors +++javax.swing.text.SimpleAttributeSet.isDefined +++javax.swing.text.SimpleAttributeSet.addAttribute +++javax.swing.text.SimpleAttributeSet.getAttributeNames +++javax.swing.text.SimpleAttributeSet.setResolveParent +++javax.swing.text.SimpleAttributeSet.isEmpty +++javax.swing.text.SimpleAttributeSet.addAttributes +++javax.swing.text.SimpleAttributeSet.nullValue +++javax.swing.text.ZoneView.getMaximumZoneSize +++javax.swing.text.ZoneView.createZone +++javax.swing.text.ZoneView.constructor +++javax.swing.text.ZoneView.zoneWasLoaded +++javax.swing.text.ZoneView.isZoneLoaded +++javax.swing.text.ZoneView.loadChildren +++javax.swing.text.ZoneView.setMaxZonesLoaded +++javax.swing.text.ZoneView.unloadZone +++javax.swing.text.ZoneView.setMaximumZoneSize +++javax.swing.text.FlowView.FlowStrategy.adjustRow +++javax.swing.text.FlowView.getFlowAxis +++javax.swing.text.InternationalFormatter.InternationalFormatterTest +++javax.swing.text.Utilities.getNextWord +++javax.swing.text.Utilities.getBreakLocation +++javax.swing.text.Utilities.getPreviousWord +++javax.swing.text.Utilities.getWordStart +++javax.swing.text.Utilities.getTabbedTextOffset +++javax.swing.text.TabStop.constructors +++javax.swing.text.TabStop.toString +++javax.swing.text.StringContent.insertUndo +++javax.swing.text.StringContent.BadLocationExceptionTest +++javax.swing.text.StringContent.stickyPosition +++javax.swing.text.StringContent.length +++javax.swing.text.StringContent.removeUndo +++javax.swing.text.StringContent.constructors +++javax.swing.text.StringContent.insertString +++javax.swing.text.StringContent.StringContentTest +++javax.swing.text.StyledEditorKit.createInputAttributesTest +++javax.swing.text.StyleContext.NamedStyleInit +++javax.swing.text.StyleContext.NamedStyleSetResolveParent +++javax.swing.text.StyleContext.addStyle +++javax.swing.text.StyleContext.addAttribute +++javax.swing.JScrollBar.getAccessibleContext +++javax.swing.JScrollBar.getInputMap +++javax.swing.JScrollBar.constructors +++javax.swing.JScrollBar.getActionMap +++javax.swing.JScrollBar.paramString +++javax.swing.plaf.basic.BasicButtonUI.getTextShiftOffset +++javax.swing.plaf.basic.BasicButtonUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicButtonUI.defaultTextIconGap +++javax.swing.plaf.basic.BasicButtonUI.setTextShiftOffset +++javax.swing.plaf.basic.BasicButtonUI.defaultTextShiftOffset +++javax.swing.plaf.basic.BasicButtonUI.clearTextShiftOffset +++javax.swing.plaf.basic.BasicRadioButtonMenuItemUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicToggleButtonUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicSeparatorUI.getPreferredSize +++javax.swing.plaf.basic.BasicSeparatorUI.getMinimumSize +++javax.swing.plaf.basic.BasicSeparatorUI.getMaximumSize +++javax.swing.plaf.basic.BasicLookAndFeel.initSystemColorDefaults +++javax.swing.plaf.basic.BasicCheckBoxMenuItemUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicHTML.isHTMLString +++javax.swing.plaf.basic.BasicScrollBarUI.layoutContainer +++javax.swing.plaf.basic.BasicScrollBarUI.getPreferredSize +++javax.swing.plaf.basic.BasicScrollBarUI.constructor +++javax.swing.plaf.basic.BasicScrollBarUI.getMinimumSize +++javax.swing.plaf.basic.BasicScrollBarUI.createDecreaseButton +++javax.swing.plaf.basic.BasicScrollBarUI.getMaximumSize +++javax.swing.plaf.basic.BasicScrollBarUI.getMaximumThumbSize +++javax.swing.plaf.basic.BasicScrollBarUI.installDefaults +++javax.swing.plaf.basic.BasicScrollBarUI.createIncreaseButton +++javax.swing.plaf.basic.BasicScrollBarUI.installComponents +++javax.swing.plaf.basic.BasicScrollBarUI.getMinimumThumbSize +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.MaximizeAction.constructor +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.IconifyAction.constructor +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.CloseAction.constructor +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.RestoreAction.constructor +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.MoveAction.constructor +++javax.swing.plaf.basic.BasicInternalFrameTitlePane.SizeAction.constructor +++javax.swing.plaf.basic.BasicPasswordFieldUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager.layoutContainer +++javax.swing.plaf.basic.BasicSplitPaneUI.getDividerLocation +++javax.swing.plaf.basic.BasicArrowButton.getPreferredSize +++javax.swing.plaf.basic.BasicArrowButton.isFocusTraversable +++javax.swing.plaf.basic.BasicArrowButton.getMinimumSize +++javax.swing.plaf.basic.BasicArrowButton.isFocusable +++javax.swing.plaf.basic.BasicArrowButton.getMaximumSize +++javax.swing.plaf.basic.BasicSliderUI.xPositionForValue +++javax.swing.plaf.basic.BasicSliderUI.getPreferredSize +++javax.swing.plaf.basic.BasicSliderUI.getMinimumSize +++javax.swing.plaf.basic.BasicSliderUI.valueForYPosition +++javax.swing.plaf.basic.BasicSliderUI.getMaximumSize +++javax.swing.plaf.basic.BasicSliderUI.getThumbSize +++javax.swing.plaf.basic.BasicSliderUI.valueForXPosition +++javax.swing.plaf.basic.BasicSliderUI.constructors +++javax.swing.plaf.basic.BasicSliderUI.yPositionForValue +++javax.swing.plaf.basic.BasicTextFieldUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicTextPaneUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicMenuItemUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicFormattedTextFieldUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicTextAreaUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicComboBoxUI.getDefaultSize +++javax.swing.plaf.basic.BasicComboBoxUI.createEditor +++javax.swing.plaf.basic.BasicComboBoxUI.getMaximumSize +++javax.swing.plaf.basic.BasicListUI.updateLayoutStateNeeded +++javax.swing.plaf.basic.BasicMenuUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicIconFactory.getCheckBoxMenuItemIcon +++javax.swing.plaf.basic.BasicIconFactory.getMenuArrowIcon +++javax.swing.plaf.basic.BasicIconFactory.getCheckBoxIcon +++javax.swing.plaf.basic.BasicFileChooserUI.getFileName +++javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonText +++javax.swing.plaf.basic.BasicFileChooserUI.constructor +++javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonMnemonic +++javax.swing.plaf.basic.BasicFileChooserUI.uninstallStrings +++javax.swing.plaf.basic.BasicFileChooserUI.getApproveButton +++javax.swing.plaf.basic.BasicFileChooserUI.getGoHomeAction +++javax.swing.plaf.basic.BasicFileChooserUI.getUpdateAction +++javax.swing.plaf.basic.BasicFileChooserUI.getDirectoryName +++javax.swing.plaf.basic.BasicFileChooserUI.getApproveSelectionAction +++javax.swing.plaf.basic.BasicFileChooserUI.installStrings +++javax.swing.plaf.basic.BasicFileChooserUI.getChangeToParentDirectoryAction +++javax.swing.plaf.basic.BasicFileChooserUI.getCancelSelectionAction +++javax.swing.plaf.basic.BasicFileChooserUI.getFileView +++javax.swing.plaf.basic.BasicFileChooserUI.installIcons +++javax.swing.plaf.basic.BasicFileChooserUI.getNewFolderAction +++javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonToolTipText +++javax.swing.plaf.basic.BasicFileChooserUI.getDialogTitle +++javax.swing.plaf.basic.BasicCheckBoxUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicComboBoxEditor.removeActionListener +++javax.swing.plaf.basic.BasicComboBoxEditor.addActionListener +++javax.swing.plaf.basic.BasicComboBoxEditor.constructor +++javax.swing.plaf.basic.BasicEditorPaneUI.getPropertyPrefix +++javax.swing.plaf.basic.BasicRootPaneUI.installDefaults +++javax.swing.plaf.basic.BasicRadioButtonUI.getPropertyPrefix +++javax.swing.plaf.ColorUIResource.serialization +++javax.swing.plaf.ColorUIResource.equals +++javax.swing.plaf.ColorUIResource.constructors +++javax.swing.plaf.metal.MetalTheme.MetalThemeTest +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuTextFont +++javax.swing.plaf.metal.MetalLookAndFeel.getDescription +++javax.swing.plaf.metal.MetalLookAndFeel.isNativeLookAndFeel +++javax.swing.plaf.metal.MetalLookAndFeel.getSeparatorBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControl +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowTitleInactiveForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlShadow +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowTitleForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getControlTextFont +++javax.swing.plaf.metal.MetalLookAndFeel.getControlHighlight +++javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlHighlight +++javax.swing.plaf.metal.MetalLookAndFeel.getControlTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlDarkShadow +++javax.swing.plaf.metal.MetalLookAndFeel.getSeparatorForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getSubTextFont +++javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme +++javax.swing.plaf.metal.MetalLookAndFeel.getControlShadow +++javax.swing.plaf.metal.MetalLookAndFeel.isSupportedLookAndFeel +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuSelectedBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getInactiveControlTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getWhite +++javax.swing.plaf.metal.MetalLookAndFeel.getUserTextFont +++javax.swing.plaf.metal.MetalLookAndFeel.getAcceleratorForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getControlDisabled +++javax.swing.plaf.metal.MetalLookAndFeel.getID +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowTitleBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getName +++javax.swing.plaf.metal.MetalLookAndFeel.getSystemTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowTitleFont +++javax.swing.plaf.metal.MetalLookAndFeel.getInactiveSystemTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getUserTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getBlack +++javax.swing.plaf.metal.MetalLookAndFeel.getAcceleratorSelectedForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getDesktopColor +++javax.swing.plaf.metal.MetalLookAndFeel.getSystemTextFont +++javax.swing.plaf.metal.MetalLookAndFeel.getControlDarkShadow +++javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuDisabledForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getFocusColor +++javax.swing.plaf.metal.MetalLookAndFeel.getMenuSelectedForeground +++javax.swing.plaf.metal.MetalLookAndFeel.getHighlightedTextColor +++javax.swing.plaf.metal.MetalLookAndFeel.getControl +++javax.swing.plaf.metal.MetalLookAndFeel.getWindowTitleInactiveBackground +++javax.swing.plaf.metal.MetalLookAndFeel.getTextHighlightColor +++javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlInfo +++javax.swing.plaf.metal.MetalComboBoxIcon.getIconWidth +++javax.swing.plaf.metal.MetalComboBoxIcon.getIconHeight +++javax.swing.plaf.metal.MetalComboBoxUI.getPreferredSize +++javax.swing.plaf.metal.MetalComboBoxUI.createArrowButton +++javax.swing.plaf.metal.MetalFileChooserUI.getFileName +++javax.swing.plaf.metal.MetalFileChooserUI.createFilterComboBoxModel +++javax.swing.plaf.metal.MetalFileChooserUI.getButtonPanel +++javax.swing.plaf.metal.MetalFileChooserUI.getPreferredSize +++javax.swing.plaf.metal.MetalFileChooserUI.getMinimumSize +++javax.swing.plaf.metal.MetalFileChooserUI.getMaximumSize +++javax.swing.plaf.metal.MetalFileChooserUI.getApproveButton +++javax.swing.plaf.metal.MetalFileChooserUI.setFileName +++javax.swing.plaf.metal.MetalFileChooserUI.getBottomPanel +++javax.swing.plaf.metal.MetalCheckBoxUI.getPropertyPrefix +++javax.swing.plaf.metal.MetalIconFactory.TreeFolderIcon.getAdditionalHeight +++javax.swing.plaf.metal.MetalIconFactory.TreeFolderIcon.getShift +++javax.swing.plaf.metal.MetalIconFactory.PaletteCloseIcon.getIconWidth +++javax.swing.plaf.metal.MetalIconFactory.PaletteCloseIcon.getIconHeight +++javax.swing.plaf.metal.MetalIconFactory.TreeLeafIcon.getAdditionalHeight +++javax.swing.plaf.metal.MetalIconFactory.TreeLeafIcon.getShift +++javax.swing.plaf.metal.MetalIconFactory.getInternalFrameCloseIcon +++javax.swing.plaf.metal.MetalIconFactory.getInternalFrameMaximizeIcon +++javax.swing.plaf.metal.MetalIconFactory.getMenuItemCheckIcon +++javax.swing.plaf.metal.MetalIconFactory.getRadioButtonMenuItemIcon +++javax.swing.plaf.metal.MetalIconFactory.getCheckBoxMenuItemIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeHardDriveIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeLeafIcon +++javax.swing.plaf.metal.MetalIconFactory.getMenuArrowIcon +++javax.swing.plaf.metal.MetalIconFactory.getFileChooserNewFolderIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeControlIcon +++javax.swing.plaf.metal.MetalIconFactory.getFileChooserDetailViewIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeFloppyDriveIcon +++javax.swing.plaf.metal.MetalIconFactory.getMenuItemArrowIcon +++javax.swing.plaf.metal.MetalIconFactory.getFileChooserListViewIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeComputerIcon +++javax.swing.plaf.metal.MetalIconFactory.getFileChooserHomeFolderIcon +++javax.swing.plaf.metal.MetalIconFactory.getInternalFrameAltMaximizeIcon +++javax.swing.plaf.metal.MetalIconFactory.getRadioButtonIcon +++javax.swing.plaf.metal.MetalIconFactory.getFileChooserUpFolderIcon +++javax.swing.plaf.metal.MetalIconFactory.getInternalFrameDefaultMenuIcon +++javax.swing.plaf.metal.MetalIconFactory.getInternalFrameMinimizeIcon +++javax.swing.plaf.metal.MetalIconFactory.getCheckBoxIcon +++javax.swing.plaf.metal.MetalIconFactory.getTreeFolderIcon +++javax.swing.plaf.metal.MetalRadioButtonUI.getSelectColor +++javax.swing.plaf.metal.MetalRadioButtonUI.getFocusColor +++javax.swing.plaf.metal.MetalRadioButtonUI.getDisabledTextColor +++javax.swing.plaf.metal.MetalComboBoxButton.setIconOnly +++javax.swing.plaf.metal.MetalComboBoxButton.isFocusTraversable +++javax.swing.plaf.metal.MetalComboBoxButton.setEnabled +++javax.swing.plaf.metal.MetalComboBoxButton.isIconOnly +++javax.swing.plaf.metal.MetalComboBoxButton.getComboBox +++javax.swing.plaf.metal.MetalComboBoxButton.getComboIcon +++javax.swing.plaf.metal.MetalComboBoxButton.setComboBox +++javax.swing.plaf.metal.MetalComboBoxButton.constructors +++javax.swing.plaf.metal.MetalComboBoxButton.setComboIcon +++javax.swing.plaf.metal.DefaultMetalTheme.getMenuTextFont +++javax.swing.plaf.metal.DefaultMetalTheme.DefaultMetalThemeTest +++javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont +++javax.swing.plaf.metal.DefaultMetalTheme.getSubTextFont +++javax.swing.plaf.metal.DefaultMetalTheme.getUserTextFont +++javax.swing.plaf.metal.DefaultMetalTheme.getName +++javax.swing.plaf.metal.DefaultMetalTheme.getWindowTitleFont +++javax.swing.plaf.metal.DefaultMetalTheme.getSystemTextFont +++javax.swing.plaf.metal.MetalComboBoxEditor.constructor +++javax.swing.plaf.metal.MetalComboBoxEditor.editorBorderInsets +++javax.swing.plaf.metal.MetalToolTipUI.constructor +++javax.swing.plaf.metal.MetalToolTipUI.createUI +++javax.swing.plaf.metal.OceanTheme.OceanThemeTest +++javax.swing.plaf.metal.OceanTheme.addCustomEntriesToTable +++javax.swing.plaf.metal.MetalToggleButtonUI.getSelectColor +++javax.swing.plaf.metal.MetalToggleButtonUI.getFocusColor +++javax.swing.plaf.metal.MetalToggleButtonUI.getDisabledTextColor +++javax.swing.plaf.metal.MetalBorders.ToolBarBorder.getBorderInsets +++javax.swing.plaf.metal.MetalBorders.MenuItemBorder.borderInsets +++javax.swing.plaf.metal.MetalBorders.MenuBarBorder.getBorderInsets +++javax.swing.plaf.metal.MetalBorders.MenuBarBorder.borderInsets +++javax.swing.plaf.metal.MetalBorders.getToggleButtonBorder +++javax.swing.plaf.metal.MetalBorders.getDesktopIconBorder +++javax.swing.plaf.metal.MetalBorders.getButtonBorder +++javax.swing.plaf.metal.MetalBorders.getTextFieldBorder +++javax.swing.plaf.metal.MetalBorders.getTextBorder +++javax.swing.plaf.metal.MetalScrollButton.getButtonWidth +++javax.swing.plaf.metal.MetalScrollButton.getPreferredSize +++javax.swing.plaf.metal.MetalScrollButton.constructor +++javax.swing.plaf.metal.MetalScrollButton.getMinimumSize +++javax.swing.plaf.metal.MetalScrollButton.isFocusable +++javax.swing.plaf.metal.MetalScrollButton.getMaximumSize +++javax.swing.plaf.metal.MetalScrollBarUI.layoutContainer +++javax.swing.plaf.metal.MetalScrollBarUI.getPreferredSize +++javax.swing.plaf.metal.MetalScrollBarUI.constructor +++javax.swing.plaf.metal.MetalScrollBarUI.installDefaults +++javax.swing.plaf.metal.MetalScrollBarUI.getMinimumThumbSize +++javax.swing.plaf.metal.MetalButtonUI.getSelectColor +++javax.swing.plaf.metal.MetalButtonUI.getFocusColor +++javax.swing.plaf.metal.MetalButtonUI.getDisabledTextColor +++javax.swing.plaf.IconUIResource.constructor +++javax.swing.JFrame.isRootPaneCheckingEnabled +++javax.swing.JFrame.glassPaneLayout +++javax.swing.JFrame.constructors +++javax.swing.border.TitledBorder.getTitleFont +++javax.swing.border.TitledBorder.getTitle +++javax.swing.border.TitledBorder.setTitleJustification +++javax.swing.border.TitledBorder.getBorder +++javax.swing.border.TitledBorder.getBorderInsets +++javax.swing.border.TitledBorder.setTitleColor +++javax.swing.border.TitledBorder.setTitle +++javax.swing.border.TitledBorder.setTitlePosition +++javax.swing.border.TitledBorder.getTitleJustification +++javax.swing.border.TitledBorder.setBorder +++javax.swing.border.TitledBorder.getTitleColor +++javax.swing.border.TitledBorder.isBorderOpaque +++javax.swing.border.TitledBorder.constructors +++javax.swing.border.TitledBorder.setTitleFont +++javax.swing.border.TitledBorder.getTitlePosition +++javax.swing.border.CompoundBorder.isBorderOpaque +++javax.swing.JTable.AccessibleJTable.AccessibleJTableHeaderCell.getAccessibleRole +++javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleRole +++javax.swing.JTable.AccessibleJTable.getAccessibleColumnHeader +++javax.swing.JTable.setRowSelectionAllowed +++javax.swing.JTable.getColumn +++javax.swing.JTable.getRowHeight +++javax.swing.JTable.convertColumnIndexToModel +++javax.swing.JTable.createDefaultDataModel +++javax.swing.JTable.getCellEditor +++javax.swing.JTable.setColumnSelectionAllowed +++javax.swing.JTable.setAutoCreateColumnsFromModel +++javax.swing.JTable.setRowHeight +++javax.swing.JTable.createDefaultSelectionModel +++javax.swing.JTable.getAccessibleContext +++javax.swing.JTable.convertColumnIndexToView +++javax.swing.JTable.isCellEditable +++javax.swing.JTable.getInputMap +++javax.swing.JTable.getCellRect +++javax.swing.JTable.isRowSelected +++javax.swing.JTable.getModel +++javax.swing.JTable.initializeLocalVars +++javax.swing.JTable.createDefaultColumnsFromModel +++javax.swing.JTable.getAutoCreateColumnsFromModel +++javax.swing.JTable.isColumnSelected +++javax.swing.JTable.addColumn +++javax.swing.table.AbstractTableModel.getColumnName +++javax.swing.table.AbstractTableModel.fireTableDataChanged +++javax.swing.table.AbstractTableModel.fireTableStructureChanged +++javax.swing.table.AbstractTableModel.fireTableRowsUpdated +++javax.swing.table.AbstractTableModel.fireTableRowsDeleted +++javax.swing.table.AbstractTableModel.getColumnClass +++javax.swing.table.AbstractTableModel.isCellEditable +++javax.swing.table.AbstractTableModel.fireTableChanged +++javax.swing.table.AbstractTableModel.findColumn +++javax.swing.table.AbstractTableModel.fireTableRowsInserted +++javax.swing.table.AbstractTableModel.fireTableCellUpdated +++javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent +++javax.swing.table.DefaultTableColumnModel.getListeners +++javax.swing.table.DefaultTableColumnModel.getColumn +++javax.swing.table.DefaultTableColumnModel.getColumnModelListeners +++javax.swing.table.DefaultTableColumnModel.getSelectedColumnCount +++javax.swing.table.DefaultTableColumnModel.getSelectionModel +++javax.swing.table.DefaultTableColumnModel.getTotalColumnWidth +++javax.swing.table.DefaultTableColumnModel.constructor +++javax.swing.table.DefaultTableColumnModel.getColumns +++javax.swing.table.DefaultTableColumnModel.setColumnSelectionAllowed +++javax.swing.table.DefaultTableColumnModel.getColumnSelectionAllowed +++javax.swing.table.DefaultTableColumnModel.getColumnCount +++javax.swing.table.DefaultTableColumnModel.setSelectionModel +++javax.swing.table.DefaultTableColumnModel.setColumnMargin +++javax.swing.table.DefaultTableColumnModel.getColumnIndexAtX +++javax.swing.table.DefaultTableColumnModel.addColumnModelListener +++javax.swing.table.DefaultTableColumnModel.removeColumn +++javax.swing.table.DefaultTableColumnModel.moveColumn +++javax.swing.table.DefaultTableColumnModel.addColumn +++javax.swing.table.DefaultTableColumnModel.getColumnIndex +++javax.swing.table.DefaultTableColumnModel.getColumnMargin +++javax.swing.table.DefaultTableModel.removeRow +++javax.swing.table.DefaultTableModel.getRowCount +++javax.swing.table.DefaultTableModel.setColumnCount +++javax.swing.table.DefaultTableModel.insertRow +++javax.swing.table.DefaultTableModel.getColumnCount +++javax.swing.table.DefaultTableModel.convertToVector +++javax.swing.table.DefaultTableModel.setColumnIdentifiers +++javax.swing.table.DefaultTableModel.isCellEditable +++javax.swing.table.DefaultTableModel.setDataVector +++javax.swing.table.DefaultTableModel.setValueAt +++javax.swing.table.DefaultTableModel.moveRow +++javax.swing.table.DefaultTableModel.newDataAvailable +++javax.swing.table.DefaultTableModel.addRow +++javax.swing.table.DefaultTableModel.constructors +++javax.swing.table.DefaultTableModel.getDataVector +++javax.swing.table.DefaultTableModel.rowsRemoved +++javax.swing.table.DefaultTableModel.addColumn +++javax.swing.table.DefaultTableModel.setRowCount +++javax.swing.table.DefaultTableModel.getValueAt +++javax.swing.table.TableColumn.setCellEditor +++javax.swing.table.TableColumn.getHeaderRenderer +++javax.swing.table.TableColumn.getIdentifier +++javax.swing.table.TableColumn.setPreferredWidth +++javax.swing.table.TableColumn.setHeaderValue +++javax.swing.table.TableColumn.getCellRenderer +++javax.swing.table.TableColumn.sizeWidthToFit +++javax.swing.table.TableColumn.setResizable +++javax.swing.table.TableColumn.properties +++javax.swing.table.TableColumn.removePropertyChangeListener +++javax.swing.table.TableColumn.setIdentifier +++javax.swing.table.TableColumn.addPropertyChangeListener +++javax.swing.table.TableColumn.setMinWidth +++javax.swing.table.TableColumn.setModelIndex +++javax.swing.table.TableColumn.setCellRenderer +++javax.swing.table.TableColumn.getModelIndex +++javax.swing.table.TableColumn.setMaxWidth +++javax.swing.table.TableColumn.setWidth +++javax.swing.table.TableColumn.constants +++javax.swing.table.TableColumn.setHeaderRenderer +++javax.swing.table.TableColumn.getHeaderValue +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getLocale +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.isFocusTraversable +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.setAccessibleName +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleName +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleDescription +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleIndexInParent +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleContext +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.isVisible +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleChild +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleRole +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleComponent +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleChildrenCount +++javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleValue +++javax.swing.table.JTableHeader.AccessibleJTableHeader.getAccessibleChild +++javax.swing.table.JTableHeader.AccessibleJTableHeader.getAccessibleRole +++javax.swing.table.JTableHeader.AccessibleJTableHeader.getAccessibleChildrenCount +++javax.swing.table.JTableHeader.getAccessibleContext +++javax.swing.event.InternalFrameEvent.constructor +++javax.swing.event.InternalFrameEvent.getInternalFrame +++javax.swing.event.InternalFrameEvent.paramString +++javax.swing.event.ListDataEvent.getIndex0 +++javax.swing.event.ListDataEvent.constructor +++javax.swing.event.ListDataEvent.getType +++javax.swing.event.ListDataEvent.getSource +++javax.swing.event.ListDataEvent.getIndex1 +++javax.swing.event.ListDataEvent.toString +++javax.swing.event.TableModelEvent.constructors +++javax.swing.event.SwingPropertyChangeSupport.firePropertyChange +++javax.swing.event.SwingPropertyChangeSupport.getPropertyChangeListeners +++javax.swing.event.SwingPropertyChangeSupport.constructor +++javax.swing.event.SwingPropertyChangeSupport.hasListeners +++javax.swing.event.SwingPropertyChangeSupport.removePropertyChangeListener +++javax.swing.event.SwingPropertyChangeSupport.addPropertyChangeListener +++javax.swing.event.EventListenerList.getListeners +++javax.swing.event.EventListenerList.add +++javax.swing.event.EventListenerList.getListenerList +++javax.swing.event.EventListenerList.getListenerCount +++javax.swing.event.EventListenerList.toString +++javax.swing.event.EventListenerList.remove +++javax.swing.event.TreeSelectionEvent.isAddedPath +++javax.swing.event.TreeSelectionEvent.cloneWithSource +++javax.swing.event.TreeSelectionEvent.constructors +++javax.swing.JDesktopPane.constructor +++javax.swing.JRadioButton.isFocusable +++javax.swing.JRadioButton.uidelegate +++javax.swing.JRadioButton.getActionCommand +++javax.swing.JRadioButton.model +++javax.swing.JMenuBar.getComponentIndex +++javax.swing.JMenuBar.getHelpMenu +++javax.swing.JMenuBar.getSubElements +++javax.swing.JMenuBar.setMargin +++javax.swing.JMenuBar.getInputMap +++javax.swing.JMenuBar.setHelpMenu +++javax.swing.JMenuBar.getActionMap +++javax.swing.JMenuBar.getMenu +++javax.swing.JCheckBoxMenuItem.uidelegate +++javax.swing.JCheckBoxMenuItem.getActionCommand +++javax.swing.JCheckBoxMenuItem.model +++javax.swing.JCheckBoxMenuItem.constructors +++javax.swing.JComboBox.getPrototypeDisplayValue +++javax.swing.JComboBox.MutableTest2 +++javax.swing.JComboBox.setEditor +++javax.swing.JComboBox.getEditor +++javax.swing.JComboBox.addItem +++javax.swing.JComboBox.MutableTest1 +++javax.swing.JComboBox.removeItem +++javax.swing.JComboBox.setModel +++javax.swing.JComboBox.setSelectedIndex +++javax.swing.JComboBox.model +++javax.swing.JComboBox.listenerList +++javax.swing.JComboBox.setPrototypeDisplayValue +++javax.swing.JComboBox.setEditable +++javax.swing.JComboBox.SimpleSelectionTest +++javax.swing.OverlayLayout.layoutContainer +++javax.swing.OverlayLayout.getLayoutAlignmentY +++javax.swing.OverlayLayout.getLayoutAlignmentX +++javax.swing.OverlayLayout.preferredLayoutSize +++javax.swing.OverlayLayout.minimumLayoutSize +++javax.swing.OverlayLayout.maximumLayoutSize +++javax.swing.JScrollPane.AccessibleJScrollPane.resetViewport +++javax.swing.JScrollPane.createHorizontalScrollBar +++javax.swing.JScrollPane.getInputMap +++javax.swing.JScrollPane.createVerticalScrollBar +++javax.swing.JScrollPane.getActionMap +++javax.swing.DefaultListCellRenderer.getListCellRendererComponent +++javax.swing.JFileChooser.setFileHidingEnabled +++javax.swing.JFileChooser.getControlButtonsAreShown +++javax.swing.JFileChooser.setApproveButtonMnemonic +++javax.swing.JFileChooser.setFileSystemView +++javax.swing.JFileChooser.getApproveButtonText +++javax.swing.JFileChooser.setDialogTitle +++javax.swing.JFileChooser.setDialogType +++javax.swing.JFileChooser.setSelectedFile +++javax.swing.JFileChooser.getChoosableFileFilters +++javax.swing.JFileChooser.getApproveButtonMnemonic +++javax.swing.JFileChooser.setApproveButtonText +++javax.swing.JFileChooser.getDialogType +++javax.swing.JFileChooser.getFileFilter +++javax.swing.JFileChooser.setAccessory +++javax.swing.JFileChooser.isAcceptAllFileFilterUsed +++javax.swing.JFileChooser.accept +++javax.swing.JFileChooser.setControlButtonsAreShown +++javax.swing.JFileChooser.setFileView +++javax.swing.JFileChooser.setCurrentDirectory +++javax.swing.JFileChooser.isFileHidingEnabled +++javax.swing.JFileChooser.constructors +++javax.swing.JFileChooser.changeToParentDirectory +++javax.swing.JFileChooser.getFileView +++javax.swing.JFileChooser.getFileSystemView +++javax.swing.JFileChooser.setSelectedFiles +++javax.swing.JFileChooser.setFileFilter +++javax.swing.JFileChooser.getFileSelectionMode +++javax.swing.JFileChooser.setFileSelectionMode +++javax.swing.JFileChooser.getSelectedFiles +++javax.swing.JFileChooser.getAccessory +++javax.swing.JFileChooser.setApproveButtonToolTipText +++javax.swing.JFileChooser.getApproveButtonToolTipText +++javax.swing.JFileChooser.getDialogTitle +++javax.swing.SpinnerDateModel.getPreviousValue +++javax.swing.SpinnerDateModel.setStart +++javax.swing.SpinnerDateModel.setEnd +++javax.swing.SpinnerDateModel.setValue +++javax.swing.SpinnerDateModel.getNextValue +++javax.swing.SpinnerDateModel.constructors +++javax.swing.JDialog.isRootPaneCheckingEnabled +++javax.swing.JPopupMenu.getInputMap +++javax.swing.JSlider.getPaintTrack +++javax.swing.JSlider.addChangeListener +++javax.swing.JSlider.setMinimum +++javax.swing.JSlider.setSnapToTicks +++javax.swing.JSlider.setOrientation +++javax.swing.JSlider.getMinorTickSpacing +++javax.swing.JSlider.setValue +++javax.swing.JSlider.setMaximum +++javax.swing.JSlider.setExtent +++javax.swing.JSlider.setPaintLabels +++javax.swing.JSlider.getSnapToTicks +++javax.swing.JSlider.setMinorTickSpacing +++javax.swing.JSlider.getUIClassID +++javax.swing.JSlider.setLabelTable +++javax.swing.JSlider.getPaintTicks +++javax.swing.JSlider.setModel +++javax.swing.JSlider.getMaximum +++javax.swing.JSlider.setPaintTicks +++javax.swing.JSlider.getPaintLabels +++javax.swing.JSlider.getMinimum +++javax.swing.JSlider.getModel +++javax.swing.JSlider.getInverted +++javax.swing.JSlider.setInverted +++javax.swing.JSlider.constructors +++javax.swing.JSlider.getMajorTickSpacing +++javax.swing.JSlider.createStandardLabels +++javax.swing.JSlider.setMajorTickSpacing +++javax.swing.JSlider.getExtent +++javax.swing.JSlider.setPaintTrack +++javax.swing.JSlider.getLabelTable +++javax.swing.DefaultButtonModel.addActionListener +++javax.swing.DefaultButtonModel.setPressed +++javax.swing.DefaultButtonModel.setEnabled +++javax.swing.DefaultButtonModel.constructor +++javax.swing.DefaultButtonModel.setActionCommand +++javax.swing.DefaultButtonModel.getSelectedObjects +++javax.swing.DefaultButtonModel.setArmed +++javax.swing.DefaultButtonModel.setSelected +++javax.swing.DefaultButtonModel.constants +++javax.swing.DefaultButtonModel.setRollover +++javax.swing.DefaultButtonModel.setGroup +++javax.swing.JComponent.getListeners +++javax.swing.JComponent.setVerifyInputWhenFocusTarget +++javax.swing.JComponent.getVetoableChangeListeners +++javax.swing.JComponent.setInheritsPopupMenu +++javax.swing.JComponent.getPreferredSize +++javax.swing.JComponent.setEnabled +++javax.swing.JComponent.constructor +++javax.swing.JComponent.registerKeyboardAction +++javax.swing.JComponent.setUI +++javax.swing.JComponent.getActionForKeyStroke +++javax.swing.JComponent.setMinimumSize +++javax.swing.JComponent.setPreferredSize +++javax.swing.JComponent.setDefaultLocale +++javax.swing.JComponent.setBackground +++javax.swing.JComponent.setBorder +++javax.swing.JComponent.getInputMap +++javax.swing.JComponent.setVisible +++javax.swing.JComponent.setAlignmentX +++javax.swing.JComponent.setComponentPopupMenu +++javax.swing.JComponent.getFont +++javax.swing.JComponent.setAlignmentY +++javax.swing.JComponent.setMaximumSize +++javax.swing.JComponent.setFont +++javax.swing.JComponent.getVerifyInputWhenFocusTarget +++javax.swing.JComponent.putClientProperty +++javax.swing.JComponent.getAlignmentY +++javax.swing.JComponent.getComponentPopupMenu +++javax.swing.JComponent.getAlignmentX +++javax.swing.JComponent.removeVetoableChangeListener +++javax.swing.JComponent.getRegisteredKeyStrokes +++javax.swing.JComponent.setForeground +++javax.swing.JComponent.paint +++javax.swing.JComponent.setOpaque +++javax.swing.JComponent.addVetoableChangeListener +++javax.swing.JProgressBar.isStringPainted +++javax.swing.JProgressBar.setOrientation +++javax.swing.JProgressBar.setValue +++javax.swing.JProgressBar.setBorderPainted +++javax.swing.JProgressBar.setStringPainted +++javax.swing.JProgressBar.getAccessibleContext +++javax.swing.JProgressBar.getPercentComplete +++javax.swing.JProgressBar.paramString +++javax.swing.JMenu.uidelegate +++javax.swing.JMenu.getInputMap +++javax.swing.JMenu.getActionCommand +++javax.swing.JMenu.model +++javax.swing.JMenu.getPopUpMenu +++javax.swing.JMenu.remove +++javax.swing.UIManager.LookAndFeelInfo.constructor +++javax.swing.UIManager.getPropertyChangeListeners +++javax.swing.UIManager.getBoolean +++javax.swing.UIManager.addAuxiliaryLookAndFeel +++javax.swing.UIManager.getString +++javax.swing.UIManager.getBorder +++javax.swing.UIManager.getIcon +++javax.swing.UIManager.getInsets +++javax.swing.UIManager.removeAuxiliaryLookAndFeel +++javax.swing.UIManager.setLookAndFeel +++javax.swing.UIManager.getFont +++javax.swing.UIManager.getDefaults +++javax.swing.UIManager.getInt +++javax.swing.UIManager.addPropertyChangeListener +++javax.swing.UIManager.getUI +++javax.swing.UIManager.getDimension +++javax.swing.UIManager.getLookAndFeelDefaults +++javax.swing.UIManager.getCrossPlatformLookAndFeelClassName +++javax.swing.UIManager.getColor +++javax.swing.UIManager.getAuxiliaryLookAndFeels +++javax.swing.JPanel.setBorder +++javax.swing.JPanel.Layouter +++javax.swing.JTree.getCellRenderer +++javax.swing.JTree.isRowSelected +++javax.swing.JTree.setModel +++javax.swing.TransferHandler.exportToClipboard +++javax.swing.TransferHandler.TransferActionConstructor +++javax.swing.TransferHandler.canImport +++javax.swing.TransferHandler.importData +++javax.swing.TransferHandler.createTransferable +++javax.swing.JToolTip.setComponent +++javax.swing.JToolTip.setTipText +++javax.swing.JToolTip.getAccessibleContext +++javax.swing.JToolTip.getUIClassID +++javax.swing.JToolTip.getTipText +++javax.swing.JToolTip.paramString +++javax.swing.JToolTip.getComponent +++javax.swing.JToolBar.buttonInsets +++javax.swing.JToolBar.getInputMap +++javax.swing.JRootPane.RootLayout.layoutContainer +++javax.swing.JRootPane.RootLayout.getLayoutAlignmentY +++javax.swing.JRootPane.RootLayout.getLayoutAlignmentX +++javax.swing.JRootPane.RootLayout.preferredLayoutSize +++javax.swing.JRootPane.setLayeredPane +++javax.swing.ScrollPaneLayout.minimumLayoutSize +++javax.swing.Timer.preparatory +++javax.swing.Timer.setDelay +++javax.swing.Timer.basic +++javax.swing.Timer.test_23918 +++javax.swing.Timer.setInitialDelay +++javax.swing.ActionMap.newMapKeysNull +++javax.swing.InputMap.put +++javax.swing.InputMap.constructor +++javax.swing.InputMap.keys +++javax.swing.InputMap.setParent +++javax.swing.InputMap.size +++javax.swing.InputMap.newMapKeysNull +++javax.swing.InputMap.get +++javax.swing.InputMap.getParent +++javax.swing.InputMap.remove +++javax.swing.InputMap.clear +++javax.swing.InputMap.allKeys +++javax.swing.filechooser.FileView.getDescription +++javax.swing.filechooser.FileView.getIcon +++javax.swing.filechooser.FileView.getName +++javax.swing.filechooser.FileView.isTraversable +++javax.swing.filechooser.FileView.getTypeDescription +++javax.swing.filechooser.FileSystemView.getFileSystemView +++javax.swing.ViewportLayout.layoutContainer +++javax.swing.ViewportLayout.minimumLayoutSize +++javax.swing.JList.AccessibleJList.AccessibleJListChild.isFocusTraversable +++javax.swing.JList.AccessibleJList.AccessibleJListChild.isEnabled +++javax.swing.JList.AccessibleJList.AccessibleJListChild.setEnabled +++javax.swing.JList.AccessibleJList.AccessibleJListChild.setCursor +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getForeground +++javax.swing.JList.AccessibleJList.AccessibleJListChild.setBackground +++javax.swing.JList.AccessibleJList.AccessibleJListChild.isVisible +++javax.swing.JList.AccessibleJList.AccessibleJListChild.isShowing +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getFont +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getCursor +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleRole +++javax.swing.JList.AccessibleJList.AccessibleJListChild.setFont +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleStateSet +++javax.swing.JList.AccessibleJList.AccessibleJListChild.setForeground +++javax.swing.JList.AccessibleJList.AccessibleJListChild.getBackground +++javax.swing.JList.AccessibleJList.valueChanged +++javax.swing.JList.AccessibleJList.getAccessibleChild +++javax.swing.JList.AccessibleJList.getAccessibleRole +++javax.swing.JList.AccessibleJList.intervalAdded +++javax.swing.JList.AccessibleJList.intervalRemoved +++javax.swing.JList.AccessibleJList.contentsChanged +++javax.swing.JList.AccessibleJList.getAccessibleStateSet +++javax.swing.JList.setValueIsAdjusting +++javax.swing.JList.setVisibleRowCount +++javax.swing.JList.setSelectionBackground +++javax.swing.JList.setBackground +++javax.swing.JList.getSelectionBackground +++javax.swing.JList.getInputMap +++javax.swing.JList.setModel +++javax.swing.JList.getNextMatch +++javax.swing.JList.setLayoutOrientation +++javax.swing.JList.constructors +++javax.swing.JList.getBackground +++javax.swing.ToolTipManager.setReshowDelay +++javax.swing.ToolTipManager.setInitialDelay +++javax.swing.ToolTipManager.setDismissDelay +++javax.swing.AbstractButton.constructor +++javax.swing.AbstractButton.setRolloverEnabled +++javax.swing.AbstractButton.setRolloverSelectedIcon +++javax.swing.AbstractButton.init +++javax.swing.AbstractButton.setVerticalTextPosition +++javax.swing.AbstractButton.setHorizontalAlignment +++javax.swing.AbstractButton.setHorizontalTextPosition +++javax.swing.AbstractButton.setRolloverIcon +++javax.swing.AbstractButton.setVerticalAlignment +++javax.swing.AbstractButton.createChangeListener +++javax.swing.JLayeredPane.defaultLayoutManager +++javax.swing.JLayeredPane.getComponentsInLayer +++javax.swing.JLayeredPane.setPosition +++javax.swing.JLayeredPane.moveToFront +++javax.swing.JLayeredPane.addImpl +++javax.swing.DefaultListModel.toArray +++javax.swing.DefaultListModel.trimToSize +++javax.swing.DefaultListModel.removeAllElements +++javax.swing.DefaultListModel.constructor +++javax.swing.DefaultListModel.add +++javax.swing.DefaultListModel.lastElement +++javax.swing.DefaultListModel.copyInto +++javax.swing.DefaultListModel.firstElement +++javax.swing.DefaultListModel.setElementAt +++javax.swing.DefaultListModel.set +++javax.swing.DefaultListModel.elementAt +++javax.swing.DefaultListModel.ensureCapacity +++javax.swing.DefaultListModel.indexOf +++javax.swing.DefaultListModel.insertElementAt +++javax.swing.DefaultListModel.setSize +++javax.swing.DefaultListModel.lastIndexOf +++javax.swing.DefaultListModel.elements +++javax.swing.DefaultListModel.size +++javax.swing.DefaultListModel.getSize +++javax.swing.DefaultListModel.capacity +++javax.swing.DefaultListModel.removeElementAt +++javax.swing.DefaultListModel.get +++javax.swing.DefaultListModel.contains +++javax.swing.DefaultListModel.getElementAt +++javax.swing.DefaultListModel.removeRange +++javax.swing.DefaultListModel.addElement +++javax.swing.DefaultListModel.removeElement +++javax.swing.DefaultListModel.isEmpty +++javax.swing.DefaultListModel.remove +++javax.swing.DefaultListModel.clear +++javax.swing.JFormattedTextField.JFormattedTextFieldTests +++javax.swing.AbstractAction.clone +++javax.swing.AbstractAction.setEnabled +++javax.swing.AbstractAction.getValue +++javax.swing.AbstractAction.constructors +++javax.swing.AbstractAction.putValue +++javax.swing.JTextArea.preferredSize +++javax.swing.JTextArea.isValidChecks +++javax.swing.JTextArea.text +++javax.swing.JTextArea.gettingText +++javax.swing.JCheckBox.constructor +++javax.swing.JCheckBox.isFocusable +++javax.swing.JCheckBox.uidelegate +++javax.swing.JCheckBox.getActionCommand +++javax.swing.JCheckBox.model +++javax.swing.JButton.uidelegate +++javax.swing.JButton.getActionCommand +++javax.swing.JButton.model +++javax.swing.SizeRequirements.calculateAlignedPositions +++javax.swing.tree.TreePath.getParentPath +++javax.swing.tree.TreePath.serialization +++javax.swing.tree.TreePath.getPath +++javax.swing.tree.TreePath.getLastPathComponent +++javax.swing.tree.TreePath.PR27651 +++javax.swing.tree.TreePath.isDescendant +++javax.swing.tree.TreePath.equals +++javax.swing.tree.TreePath.getPathCount +++javax.swing.tree.TreePath.constructors +++javax.swing.tree.TreePath.getPathComponent +++javax.swing.tree.TreePath.pathByAddingChild +++javax.swing.tree.DefaultMutableTreeNode.clone +++javax.swing.tree.DefaultMutableTreeNode.getChildAt +++javax.swing.tree.DefaultMutableTreeNode.getChildBefore +++javax.swing.tree.DefaultMutableTreeNode.getSiblingCount +++javax.swing.tree.DefaultMutableTreeNode.isNodeSibling +++javax.swing.tree.DefaultMutableTreeNode.getIndex +++javax.swing.tree.DefaultMutableTreeNode.isNodeChild +++javax.swing.tree.DefaultMutableTreeNode.add +++javax.swing.tree.DefaultMutableTreeNode.getFirstChild +++javax.swing.tree.DefaultMutableTreeNode.getPath +++javax.swing.tree.DefaultMutableTreeNode.removeAllChildren +++javax.swing.tree.DefaultMutableTreeNode.getChildCount +++javax.swing.tree.DefaultMutableTreeNode.isNodeRelated +++javax.swing.tree.DefaultMutableTreeNode.getNextSibling +++javax.swing.tree.DefaultMutableTreeNode.getPreviousSibling +++javax.swing.tree.DefaultMutableTreeNode.setAllowsChildren +++javax.swing.tree.DefaultMutableTreeNode.getPreviousLeaf +++javax.swing.tree.DefaultMutableTreeNode.isNodeAncestor +++javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode +++javax.swing.tree.DefaultMutableTreeNode.isNodeDescendant +++javax.swing.tree.DefaultMutableTreeNode.breadthFirstEnumeration +++javax.swing.tree.DefaultMutableTreeNode.getLastLeaf +++javax.swing.tree.DefaultMutableTreeNode.children +++javax.swing.tree.DefaultMutableTreeNode.getAllowsChildren +++javax.swing.tree.DefaultMutableTreeNode.getFirstLeaf +++javax.swing.tree.DefaultMutableTreeNode.constructors +++javax.swing.tree.DefaultMutableTreeNode.isLeaf +++javax.swing.tree.DefaultMutableTreeNode.insert +++javax.swing.tree.DefaultMutableTreeNode.DefaultMutableTreeNodeTest +++javax.swing.tree.DefaultMutableTreeNode.getParent +++javax.swing.tree.DefaultMutableTreeNode.getLastChild +++javax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration +++javax.swing.tree.DefaultMutableTreeNode.remove +++javax.swing.tree.DefaultMutableTreeNode.getNextLeaf +++javax.swing.tree.DefaultMutableTreeNode.getChildAfter +++javax.swing.tree.DefaultTreeCellRenderer.getBackgroundSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.getOpenIcon +++javax.swing.tree.DefaultTreeCellRenderer.getClosedIcon +++javax.swing.tree.DefaultTreeCellRenderer.setOpenIcon +++javax.swing.tree.DefaultTreeCellRenderer.constructor +++javax.swing.tree.DefaultTreeCellRenderer.getLeafIcon +++javax.swing.tree.DefaultTreeCellRenderer.getBorderSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.setLeafIcon +++javax.swing.tree.DefaultTreeCellRenderer.getDefaultLeafIcon +++javax.swing.tree.DefaultTreeCellRenderer.setBackgroundSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.getDefaultOpenIcon +++javax.swing.tree.DefaultTreeCellRenderer.getDefaultClosedIcon +++javax.swing.tree.DefaultTreeCellRenderer.setBackgroundNonSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.setBorderSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.getBackgroundNonSelectionColor +++javax.swing.tree.DefaultTreeCellRenderer.setClosedIcon +++javax.swing.tree.VariableHeightLayoutCache.getBounds +++javax.swing.BoxLayout.layoutContainer +++javax.swing.BoxLayout.invalidateLayout +++javax.swing.BoxLayout.constructor +++javax.swing.BoxLayout.simplevertical +++javax.swing.BoxLayout.maximumLayoutSize2 +++javax.swing.BoxLayout.getLayoutAlignmentY +++javax.swing.BoxLayout.horizontal2 +++javax.swing.BoxLayout.getLayoutAlignmentX +++javax.swing.BoxLayout.simplehorizontal +++javax.swing.BoxLayout.constants +++javax.swing.BoxLayout.preferredLayoutSize +++javax.swing.BoxLayout.minimumLayoutSize +++javax.swing.BoxLayout.maximumLayoutSize +++javax.swing.JApplet.isRootPaneCheckingEnabled +++javax.swing.DefaultBoundedRangeModel.setValueIsAdjusting +++javax.swing.DefaultBoundedRangeModel.setMinimum +++javax.swing.DefaultBoundedRangeModel.serialization +++javax.swing.DefaultBoundedRangeModel.setValue +++javax.swing.DefaultBoundedRangeModel.setMaximum +++javax.swing.DefaultBoundedRangeModel.setExtent +++javax.swing.DefaultBoundedRangeModel.getChangeListeners +++javax.swing.DefaultBoundedRangeModel.getValue +++javax.swing.DefaultBoundedRangeModel.setRangeProperties +++javax.swing.DefaultBoundedRangeModel.getMaximum +++javax.swing.DefaultBoundedRangeModel.getValueIsAdjusting +++javax.swing.DefaultBoundedRangeModel.getMinimum +++javax.swing.DefaultBoundedRangeModel.general +++javax.swing.DefaultBoundedRangeModel.toString +++javax.swing.DefaultBoundedRangeModel.getExtent +++javax.swing.undo.UndoableEditSupport.getUndoableEditListeners +++javax.swing.undo.UndoableEditSupport.createCompoundEdit +++javax.swing.undo.UndoableEditSupport.toString +++javax.swing.undo.UndoableEditSupport.beginUpdate +++javax.swing.undo.UndoableEditSupport.UndoableEditSupport +++javax.swing.undo.UndoableEditSupport.getUpdateLevel +++javax.swing.undo.CompoundEdit.lastEdit +++javax.swing.undo.CompoundEdit.addEdit +++javax.swing.undo.CompoundEdit.canRedo +++javax.swing.undo.CompoundEdit.canUndo +++javax.swing.undo.CompoundEdit.isInProgress +++javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName +++javax.swing.undo.AbstractUndoableEdit.addEdit +++javax.swing.undo.AbstractUndoableEdit.canRedo +++javax.swing.undo.AbstractUndoableEdit.redo +++javax.swing.undo.AbstractUndoableEdit.undo +++javax.swing.undo.AbstractUndoableEdit.canUndo +++javax.swing.undo.AbstractUndoableEdit.getPresentationName +++javax.swing.undo.AbstractUndoableEdit.replaceEdit +++javax.swing.undo.AbstractUndoableEdit.isSignificant +++javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName +++javax.swing.undo.StateEdit.undo +++javax.swing.undo.StateEdit.getPresentationName +++javax.swing.undo.UndoManager.getRedoPresentationName +++javax.swing.undo.UndoManager.getUndoOrRedoPresentationName +++javax.swing.undo.UndoManager.addEdit +++javax.swing.undo.UndoManager.canRedo +++javax.swing.undo.UndoManager.trimEdits +++javax.swing.undo.UndoManager.undoTo +++javax.swing.undo.UndoManager.editToBeUndone +++javax.swing.undo.UndoManager.canUndo +++javax.swing.undo.UndoManager.undoableEditHappened +++javax.swing.undo.UndoManager.setLimit +++javax.swing.undo.UndoManager.discardAllEdits +++javax.swing.undo.UndoManager.redoTo +++javax.swing.undo.UndoManager.end +++javax.swing.undo.UndoManager.toString +++javax.swing.undo.UndoManager.getUndoPresentationName +++javax.swing.undo.UndoManager.getLimit +++javax.swing.undo.UndoManager.editToBeRedone +++javax.swing.undo.UndoManager.canUndoOrRedo +++javax.swing.JMenuItem.getActionCommand +++javax.swing.JMenuItem.constructors +++javax.swing.DefaultComboBoxModel.removeAllElements +++javax.swing.DefaultComboBoxModel.insertElementAt +++javax.swing.DefaultComboBoxModel.getIndexOf +++javax.swing.DefaultComboBoxModel.getSize +++javax.swing.DefaultComboBoxModel.constructors +++javax.swing.DefaultComboBoxModel.removeElementAt +++javax.swing.DefaultComboBoxModel.getSelectedItem +++javax.swing.DefaultComboBoxModel.getElementAt +++javax.swing.DefaultComboBoxModel.addElement +++javax.swing.DefaultComboBoxModel.removeElement +++javax.swing.SizeSequence.getIndex +++javax.swing.SizeSequence.getSizes +++javax.swing.SizeSequence.removeEntries +++javax.swing.SizeSequence.setSizes +++javax.swing.SizeSequence.setSize +++javax.swing.SizeSequence.getSize +++javax.swing.SizeSequence.constructors +++javax.swing.SizeSequence.insertEntries +++javax.swing.JTextField.CopyPaste +++javax.swing.JTextField.createDefaultModel +++javax.swing.JTextField.setDocument +++javax.swing.JTextField.fireActionPerformed +++javax.swing.UIDefaults.putDefaults +++javax.swing.UIDefaults.getBoolean +++javax.swing.UIDefaults.remove +++javax.swing.RepaintManager.addDirtyRegion +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getAccessibleName +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getCurrentAccessibleValue +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getMaximumAccessibleValue +++javax.swing.JInternalFrame.AccessibleJInternalFrame.setCurrentAccessibleValue +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getAccessibleRole +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getAccessibleValue +++javax.swing.JInternalFrame.AccessibleJInternalFrame.getMinimumAccessibleValue +++javax.swing.JInternalFrame.getDesktopIcon +++javax.swing.JInternalFrame.isRootPaneCheckingEnabled +++javax.swing.JInternalFrame.setDefaultCloseOperation +++javax.swing.JInternalFrame.isIconifiable +++javax.swing.JInternalFrame.setTitle +++javax.swing.JInternalFrame.setClosable +++javax.swing.JInternalFrame.setResizable +++javax.swing.JInternalFrame.setIconifiable +++javax.swing.JInternalFrame.setFrameIcon +++javax.swing.JInternalFrame.setMaximizable +++javax.swing.JInternalFrame.getInputMap +++javax.swing.JInternalFrame.setClosed +++javax.swing.JInternalFrame.setNormalBounds +++javax.swing.JInternalFrame.setSelected2 +++javax.swing.JInternalFrame.dispose +++javax.swing.JInternalFrame.isResizable +++javax.swing.JInternalFrame.constructors +++javax.swing.JInternalFrame.paramString +++javax.swing.JInternalFrame.setDesktopIcon +++javax.swing.JInternalFrame.getNormalBounds +++javax.swing.SpinnerListModel.Constructors +++javax.swing.SpinnerListModel.Ordering +++javax.swing.SpinnerListModel.SetList +++javax.swing.SpinnerListModel.ArrayModel +++javax.swing.SpinnerListModel.ListModel +++javax.swing.JRadioButtonMenuItem.isFocusable +++javax.swing.JRadioButtonMenuItem.uidelegate +++javax.swing.JRadioButtonMenuItem.getActionCommand +++javax.swing.JRadioButtonMenuItem.model +++javax.swing.KeyStroke.getKeyStroke +++javax.swing.SpinnerNumberModel.getPreviousValue +++javax.swing.SpinnerNumberModel.setMinimum +++javax.swing.SpinnerNumberModel.setValue +++javax.swing.SpinnerNumberModel.setMaximum +++javax.swing.SpinnerNumberModel.getNextValue +++javax.swing.SpinnerNumberModel.setStepSize +++javax.swing.SpinnerNumberModel.constructors +++javax.swing.JLabel.AccessibleJLabel.getAccessibleName +++javax.swing.JLabel.setDisplayedMnemonicIndex +++javax.swing.JLabel.constructor +++javax.swing.JLabel.getAccessibleContext +++javax.swing.JLabel.Icon +++javax.swing.JLabel.getInputMap +++javax.swing.JLabel.setHorizontalAlignment +++javax.swing.JLabel.setFont +++javax.swing.JLabel.setDisplayedMnemonic +++javax.swing.JLabel.getActionMap +++javax.swing.JLabel.Mnemonic +++javax.swing.JLabel.paramString +++javax.swing.JLabel.setVerticalAlignment +++javax.swing.JEditorPane.ContentType +++javax.swing.JEditorPane.ViewType +++javax.swing.JEditorPane.setText +++javax.swing.JEditorPane.getScrollableTracks +++javax.swing.DefaultListSelectionModel.clone +++javax.swing.DefaultListSelectionModel.getListeners +++javax.swing.DefaultListSelectionModel.setValueIsAdjusting +++javax.swing.DefaultListSelectionModel.setAnchorSelectionIndex +++javax.swing.DefaultListSelectionModel.removeListSelectionListener +++javax.swing.DefaultListSelectionModel.constructor +++javax.swing.DefaultListSelectionModel.removeIndexInterval +++javax.swing.DefaultListSelectionModel.removeSelectionInterval +++javax.swing.DefaultListSelectionModel.getAnchorSelectionIndex +++javax.swing.DefaultListSelectionModel.getLeadSelectionIndex +++javax.swing.DefaultListSelectionModel.isLeadAnchorNotificationEnabled +++javax.swing.DefaultListSelectionModel.setSelectionInterval +++javax.swing.DefaultListSelectionModel.getSelectionMode +++javax.swing.DefaultListSelectionModel.isSelectedIndex +++javax.swing.DefaultListSelectionModel.moveLeadSelectionIndex +++javax.swing.DefaultListSelectionModel.leadSelectionIndex +++javax.swing.DefaultListSelectionModel.getMaxSelectionIndex +++javax.swing.DefaultListSelectionModel.getMinSelectionIndex +++javax.swing.DefaultListSelectionModel.getListSelectionListeners +++javax.swing.DefaultListSelectionModel.getValueIsAdjusting +++javax.swing.DefaultListSelectionModel.isSelectionEmpty +++javax.swing.DefaultListSelectionModel.addSelectionInterval +++javax.swing.DefaultListSelectionModel.setLeadSelectionIndex +++javax.swing.DefaultListSelectionModel.toString +++javax.swing.DefaultListSelectionModel.setSelectionMode +++javax.swing.DefaultListSelectionModel.clearSelection +++javax.swing.DefaultListSelectionModel.insertIndexInterval +++javax.swing.DefaultListSelectionModel.addListSelectionListener +++javax.swing.SwingUtilities.calculateInnerArea +++javax.swing.SwingUtilities.isRectangleContainingRectangle +++javax.swing.SwingUtilities.computeIntersection +++javax.swing.SwingUtilities.replaceUIActionMap +++javax.swing.SwingUtilities.computeUnion +++javax.swing.JSpinner.ListEditor.constructor +++javax.swing.JSpinner.ListEditor.getModel +++javax.swing.JSpinner.NumberEditor.getModel +++javax.swing.JSpinner.NumberEditor.constructors +++javax.swing.JSpinner.NumberEditor.getFormat +++javax.swing.JSpinner.DefaultEditor.constructor +++javax.swing.JSpinner.DefaultEditor.stateChanged +++javax.swing.JSpinner.DefaultEditor.propertyChange +++javax.swing.JSpinner.DefaultEditor.preferredLayoutSize +++javax.swing.JSpinner.DefaultEditor.minimumLayoutSize +++javax.swing.JSpinner.DateEditor.getModel +++javax.swing.JSpinner.getPreviousValue +++javax.swing.JSpinner.addChangeListener +++javax.swing.JSpinner.createEditor +++javax.swing.JSpinner.getChangeListeners +++javax.swing.JSpinner.setEditor +++javax.swing.JSpinner.getUIClassID +++javax.swing.JSpinner.getEditor +++javax.swing.JSpinner.setModel +++javax.swing.JSpinner.getNextValue +++javax.swing.JSpinner.getModel +++javax.swing.JSpinner.constructors +++javax.swing.JSpinner.removeChangeListener +++javax.swing.ButtonGroup.constructor +++javax.swing.ButtonGroup.add +++javax.swing.ButtonGroup.isSelected +++javax.swing.ButtonGroup.getSelection +++javax.swing.ButtonGroup.getElements +++javax.swing.ButtonGroup.getButtonCount +++javax.swing.ButtonGroup.setSelected +++javax.swing.ButtonGroup.remove +++javax.swing.JViewport.setView +++gnu.javax.crypto.jce.TestOfDHKeyAgreement2 +++gnu.javax.crypto.jce.TestOfPR27849 +++gnu.javax.crypto.jce.TestOfPR27228 +++java.rmi.server.Uniqueness +++java.lang.Integer.compareTo +++java.lang.Integer.decode +++java.lang.Integer.new_Integer +++java.lang.Integer.IntegerTest +++java.lang.Integer.getInteger +++java.lang.Integer.parseInt +++java.lang.ClassLoader.redefine +++java.lang.ClassLoader.security +++java.lang.ClassLoader.loadClass +++java.lang.ClassLoader.initialize +++java.lang.ClassLoader.Resources +++java.lang.ClassLoader.BootDefinedPackages +++java.lang.Number.NumberTest +++java.lang.ProcessBuilder.simple +++java.lang.System.getProperty +++java.lang.System.arraycopy +++java.lang.System.identityHashCode +++java.lang.ThreadGroup.enumerate +++java.lang.ThreadGroup.insecurity +++java.lang.ThreadGroup.security +++java.lang.String.substring +++java.lang.String.compareTo +++java.lang.String.getBytes13 +++java.lang.String.hash +++java.lang.String.split +++java.lang.String.getBytes14 +++java.lang.String.startsWith +++java.lang.String.equals +++java.lang.String.indexOf +++java.lang.String.to +++java.lang.String.StringTest +++java.lang.String.surrogate +++java.lang.String.charAt +++java.lang.String.new_String +++java.lang.String.getBytes +++java.lang.String.CASE_INSENSITIVE_ORDER +++java.lang.Class.ClassTest +++java.lang.Class.serialization +++java.lang.Class.reflect +++java.lang.Class.security +++java.lang.Class.init +++java.lang.Class.newInstance +++java.lang.Class.reflect2 +++java.lang.Cloneable.CloneableTest +++java.lang.ref.WeakReference.weakref +++java.lang.ref.PhantomReference.phantom +++java.lang.Double.compareTo +++java.lang.Double.DoubleSetterTest +++java.lang.Double.DoubleTest +++java.lang.Double.toHexString +++java.lang.Double.parseDouble +++java.lang.Double.compare +++java.lang.Double.valueOf +++java.lang.StrictMath.cbrt +++java.lang.StrictMath.expm1 +++java.lang.StrictMath.cosh +++java.lang.StrictMath.sinh +++java.lang.StrictMath.tanh +++java.lang.Short.hash +++java.lang.Short.ShortTest +++java.lang.InheritableThreadLocal.simple +++java.lang.Math.max +++java.lang.Math.ulp +++java.lang.Math.sin +++java.lang.Math.min +++java.lang.Math.cos +++java.lang.Math.MathTest +++java.lang.Math.rint +++java.lang.Boolean.BooleanTest +++java.lang.Boolean.equals_Boolean +++java.lang.Boolean.new_Boolean +++java.lang.Boolean.hashcode_Boolean +++java.lang.Boolean.get +++java.lang.Boolean.value +++java.lang.Float.compareTo +++java.lang.Float.toHexString +++java.lang.Float.compare +++java.lang.Float.parseFloat +++java.lang.Float.valueOf +++java.lang.Float.FloatTest +++java.lang.Float.new_Float +++java.lang.reflect.Array.set +++java.lang.reflect.Array.newInstance +++java.lang.reflect.AccessibleObject.accessible +++java.lang.reflect.Field.promotion +++java.lang.reflect.Field.access +++java.lang.reflect.Field.toString +++java.lang.reflect.Modifier.toString12 +++java.lang.reflect.Modifier.toString +++java.lang.reflect.Constructor.newInstance +++java.lang.reflect.Constructor.toString +++java.lang.reflect.Proxy.DeclaringClass +++java.lang.reflect.Proxy.check13 +++java.lang.reflect.Proxy.ExceptionRaising +++java.lang.reflect.Proxy.ToString +++java.lang.reflect.InvocationTargetException.Chain +++java.lang.reflect.Method.equals +++java.lang.reflect.Method.toString +++java.lang.reflect.Method.invoke +++java.lang.reflect.ReflectAccess +++java.lang.ThreadLocal.simple +++java.lang.Object.clone +++java.lang.Object.wait +++java.lang.Object.ObjectTest +++java.lang.Object.oom +++java.lang.Byte.ByteTest +++java.lang.Byte.new_Byte +++java.lang.StringBuffer.StringBufferTest +++java.lang.StringBuffer.plus +++java.lang.Long.Tests15 +++java.lang.Long.getLong +++java.lang.Long.LongTest +++java.lang.Long.new_Long +++java.lang.Thread.join +++java.lang.Thread.isAlive +++java.lang.Thread.name +++java.lang.Thread.interrupt +++java.lang.Thread.contextClassLoader +++java.lang.Thread.getThreadGroup +++java.lang.Thread.priority +++java.lang.Thread.stop +++java.lang.Thread.daemon +++java.lang.Package.getPackage +++java.lang.Character.digit +++java.lang.Character.Blocks +++java.lang.Character.unicode +++java.lang.Character.getNumericValue +++java.lang.Character.getType +++java.lang.Character.hash +++java.lang.Character.classify +++java.lang.Character.classify12 +++java.lang.Character.to +++java.lang.Character.consts +++java.lang.Character.forDigit +++java.lang.Character.getType12 +++java.lang.Character.equals_Character +++java.lang.Character.CharacterTest +++java.lang.Character.Blocks15 +++java.lang.SecurityManager.thread +++java.text.StringCharacterIterator.constructor +++java.text.StringCharacterIterator.iter +++java.text.CollationElementIterator.offset +++java.text.CollationElementIterator.jdk11 +++java.text.AttributedString.constructors +++java.text.AttributedString.addAttribute +++java.text.AttributedString.getIterator +++java.text.AttributedString.addAttributes +++java.text.AttributedString.Test +++java.text.DecimalFormat.setCurrency +++java.text.DecimalFormat.clone +++java.text.DecimalFormat.setDecimalFormatSymbols +++java.text.DecimalFormat.getNegativePrefix +++java.text.DecimalFormat.applyPattern +++java.text.DecimalFormat.formatToCharacterIterator +++java.text.DecimalFormat.getNegativeSuffix +++java.text.DecimalFormat.setNegativePrefix +++java.text.DecimalFormat.applyLocalizedPattern +++java.text.DecimalFormat.getDecimalFormatSymbols +++java.text.DecimalFormat.toLocalizedPattern +++java.text.DecimalFormat.isDecimalSeparatorAlwaysShown +++java.text.DecimalFormat.setNegativeSuffix +++java.text.DecimalFormat.PR27311 +++java.text.DecimalFormat.getPositivePrefix +++java.text.DecimalFormat.getCurrency +++java.text.DecimalFormat.equals +++java.text.DecimalFormat.digits +++java.text.DecimalFormat.setDecimalSeparatorAlwaysShown +++java.text.DecimalFormat.setPositiveSuffix +++java.text.DecimalFormat.parse +++java.text.DecimalFormat.setPositivePrefix +++java.text.DecimalFormat.toPattern14 +++java.text.DecimalFormat.setMultiplier +++java.text.DecimalFormat.format +++java.text.DecimalFormat.getPositiveSuffix +++java.text.DecimalFormat.setGroupingSize +++java.text.DecimalFormat.PR23996 +++java.text.DecimalFormat.toPattern +++java.text.DecimalFormat.constructors +++java.text.DecimalFormat.MaximumAndMinimumDigits +++java.text.DecimalFormat.formatExp +++java.text.DecimalFormat.getGroupingSize +++java.text.DecimalFormat.hashCode +++java.text.DecimalFormat.position +++java.text.DecimalFormat.getMultiplier +++java.text.NumberFormat.UK +++java.text.CharacterIterator.implement +++java.text.ParsePosition.Test +++java.text.BreakIterator.chariter +++java.text.BreakIterator.patho +++java.text.BreakIterator.lineiter +++java.text.BreakIterator.sentiter +++java.text.BreakIterator.worditer +++java.text.Collator.Constants +++java.text.Collator.GetSet +++java.text.ParseException.Test +++java.text.Annotation.Test +++java.text.RuleBasedCollator.CollatorTests +++java.text.RuleBasedCollator.VeryBasic +++java.text.MessageFormat.format14 +++java.text.MessageFormat.attribute +++java.text.MessageFormat.parse +++java.text.MessageFormat.format +++java.text.ChoiceFormat.next +++java.text.ChoiceFormat.parse +++java.text.ChoiceFormat.format +++java.text.DateFormatSymbols.setMonths +++java.text.DateFormatSymbols.setShortMonths +++java.text.DateFormatSymbols.setEras +++java.text.DateFormatSymbols.setAmPmStrings +++java.text.DateFormatSymbols.setWeekdays +++java.text.DateFormatSymbols.setZoneStrings +++java.text.DateFormatSymbols.setShortWeekdays +++java.text.DateFormatSymbols.Test +++java.text.AttributedCharacterIterator.Attribute.toString +++java.text.AttributedCharacterIterator.getRunLimit +++java.text.AttributedCharacterIterator.implement +++java.text.AttributedCharacterIterator.getRunStart +++java.text.AttributedCharacterIterator.getAttribute +++java.text.DateFormat.equals +++java.text.DateFormat.hashCode +++java.text.DateFormat.Test +++java.text.ACIAttribute.Test +++java.text.DecimalFormatSymbols.serial +++java.text.DecimalFormatSymbols.GetSet12 +++java.text.DecimalFormatSymbols.getCurrency +++java.text.DecimalFormatSymbols.DumpDefault11 +++java.text.DecimalFormatSymbols.GetSet11 +++java.text.DecimalFormatSymbols.DumpDefault12 +++java.text.FieldPosition.Test +++java.text.SimpleDateFormat.applyPattern +++java.text.SimpleDateFormat.Localization +++java.text.SimpleDateFormat.applyLocalizedPattern +++java.text.SimpleDateFormat.toLocalizedPattern +++java.text.SimpleDateFormat.attribute +++java.text.SimpleDateFormat.Cloning +++java.text.SimpleDateFormat.getDateFormatSymbols +++java.text.SimpleDateFormat.parse +++java.text.SimpleDateFormat.toPattern +++java.text.SimpleDateFormat.constructors +++java.text.SimpleDateFormat.setDateFormatSymbols +++java.text.SimpleDateFormat.getAndSet2DigitYearStart +++java.text.SimpleDateFormat.Test +++java.text.Bidi.Basic +++java.text.Bidi.reorderVisually +++java.math.BigInteger.compareTo +++java.math.BigInteger.modInverse +++java.math.BigInteger.shift +++java.math.BigInteger.serialization +++java.math.BigInteger.add +++java.math.BigInteger.TestOfPR27372 +++java.math.BigInteger.signum +++java.math.BigInteger.modPow +++java.math.BigInteger.equals +++java.math.BigInteger.divide +++java.math.BigInteger.setBit +++java.math.BigInteger.multiply +++java.math.BigInteger.TestOfToByteArray +++java.math.BigInteger.toString +++java.math.BigInteger.ctor +++java.math.BigInteger.abs +++java.math.BigInteger.valueOf +++java.math.BigDecimal.compareTo +++java.math.BigDecimal.divide +++java.math.BigDecimal.DiagBigDecimal +++java.math.BigDecimal.construct +++java.math.BigDecimal.setScale +++java.security.MessageDigest.Instance +++java.security.AccessController.doPrivileged +++java.security.AccessController.contexts +++java.security.Security.getAlgorithms +++java.security.Security.provider +++java.security.Provider.NameVersionInfo +++java.security.SecureRandom.SHA1PRNG +++java.security.SecureRandom.TestOfPR23899 +++java.security.SecureRandom.Instance +++java.security.KeyPairGenerator.getInstance14 +++java.security.AlgorithmParameters.getInstance14 +++java.security.AlgorithmParameterGenerator.getInstance14 +++java.security.DigestInputStream.readMD5 +++java.security.KeyFactory.getInstance14 +++java.security.Signature.getInstance14 +++java.security.Signature.Instance +++java.security.BasicPermission.newPermission +++java.sql.Clob.ClobTest +++java.sql.Types.TestJdbc10 +++java.sql.Types.TestJdbc20 +++java.sql.Array.ArrayTest +++java.sql.Blob.BlobTest +++java.sql.Connection.TestJdbc +++java.sql.Time.TimeTest +++java.sql.DriverManager.DriverManagerTest +++java.sql.Date.DateTest +++java.sql.DatabaseMetaData.TestJdbc +++java.sql.Timestamp.TimestampTest +++java.io.RandomAccessFile.setLength +++java.io.RandomAccessFile.security +++java.io.RandomAccessFile.jdk11 +++java.io.RandomAccessFile.randomaccessfile +++java.io.BufferedWriter.Test +++java.io.PipedReaderWriter.Test +++java.io.PushbackInputStream.ProtectedVars +++java.io.PushbackInputStream.BufferOverflow +++java.io.PushbackInputStream.Unread +++java.io.FileOutputStream.append +++java.io.FileOutputStream.fileoutputstream +++java.io.FileOutputStream.security +++java.io.FileOutputStream.write +++java.io.FileOutputStream.jdk12 +++java.io.StringWriter.Test +++java.io.FilterOutputStream.write +++java.io.ObjectInputStream.security +++java.io.ObjectInputStream.readResolve +++java.io.ObjectInputStream.ClassLoaderTest +++java.io.ObjectOutputStream.security +++java.io.ObjectOutputStream.StreamDataTest +++java.io.ObjectOutputStream.useProtocolVersion +++java.io.InputStream.Test +++java.io.Utf8Encoding.ReadReference +++java.io.Utf8Encoding.WriteRead +++java.io.FilePermission.traversal2 +++java.io.FilePermission.simple +++java.io.FilePermission.traversal +++java.io.FileWriter.jdk11 +++java.io.OutputStreamWriter.jdk11 +++java.io.Serializable.BreakMe +++java.io.Serializable.BreakMeTestSer +++java.io.Serializable.ParentReadResolve +++java.io.Serializable.readResolve +++java.io.Serializable.ParentWriteReplace +++java.io.ObjectInputOutput.LoopSerializationTest +++java.io.ObjectInputOutput.ExtTest +++java.io.ObjectInputOutput.Deserializable +++java.io.ObjectInputOutput.ProxySerializationTest +++java.io.ObjectInputOutput.Compat1 +++java.io.ObjectInputOutput.SerTest +++java.io.ObjectInputOutput.HierarchyTest +++java.io.ObjectInputOutput.OutputTest +++java.io.ObjectInputOutput.InputTest +++java.io.PrintWriter.jdk11 +++java.io.PrintWriter.checkError +++java.io.SequenceInputStream.Test +++java.io.StringBufferInputStream.ProtectedVars +++java.io.StringBufferInputStream.SimpleRead +++java.io.StringBufferInputStream.MarkReset +++java.io.LineNumberReader.Test2 +++java.io.LineNumberReader.mark +++java.io.LineNumberReader.Test +++java.io.InputStreamReader.hang +++java.io.InputStreamReader.utf8 +++java.io.InputStreamReader.jdk11 +++java.io.InputStreamReader.except +++java.io.InputStreamReader.getEncoding +++java.io.DataInputStream.readLine +++java.io.DataInputStream.ReadReference +++java.io.DataInputStream.ReadReference2 +++java.io.FilterWriter.write +++java.io.CharArrayWriter.ProtectedVars +++java.io.CharArrayWriter.BasicTests +++java.io.FileDescriptor.jdk11 +++java.io.Reader.Test +++java.io.PushbackReader.BufferOverflow +++java.io.PushbackReader.Unread +++java.io.ByteArrayOutputStream.subclass +++java.io.ByteArrayOutputStream.write +++java.io.PrintStream.subclass +++java.io.PrintStream.encodings +++java.io.ObjectStreamClass.ProxyTest +++java.io.ObjectStreamClass.Test +++java.io.FilterReader.SimpleRead +++java.io.FilterReader.MarkReset +++java.io.BufferedOutputStream.interrupt +++java.io.BufferedOutputStream.Test +++java.io.BufferedInputStream.Skip +++java.io.BufferedInputStream.BigMark +++java.io.BufferedInputStream.ProtectedVars +++java.io.BufferedInputStream.ZeroRead +++java.io.BufferedInputStream.SimpleRead +++java.io.BufferedInputStream.MarkReset +++java.io.BufferedReader.mark +++java.io.BufferedReader.SimpleRead +++java.io.BufferedReader.MarkReset +++java.io.BufferedReader.boundary +++java.io.DataOutputStream.WriteRead2 +++java.io.DataOutputStream.writeUTF +++java.io.DataOutputStream.WriteRead +++java.io.PipedStream.close +++java.io.PipedStream.receive +++java.io.PipedStream.Test +++java.io.FileInputStream.fileinputstream +++java.io.FileInputStream.read +++java.io.FileInputStream.security +++java.io.Writer.Test +++java.io.FilterInputStream.SimpleRead +++java.io.FilterInputStream.MarkReset +++java.io.FileReader.jdk11 +++java.io.StringReader.Test +++java.io.ByteArrayInputStream.ProtectedVars +++java.io.ByteArrayInputStream.SimpleRead +++java.io.ByteArrayInputStream.MarkReset +++java.io.File.newFileURI +++java.io.File.URI +++java.io.File.createFile +++java.io.File.security +++java.io.File.ReadMethods +++java.io.File.ExecuteMethods +++java.io.File.list +++java.io.File.jdk11 +++java.io.File.newFile +++java.io.File.WriteMethods +++java.io.File.canWrite +++java.io.File.listFiles +++java.io.File.emptyFile +++java.io.File.UnicodeURI +++java.io.OutputStream.Test +++java.io.StreamTokenizer.WordWhiteChars +++java.io.StreamTokenizer.slashstar +++java.io.StreamTokenizer.commentchar +++java.io.StreamTokenizer.slashslash +++java.io.StreamTokenizer.newline +++java.io.StreamTokenizer.misc +++java.io.StreamTokenizer.Test +++java.io.LineNumberInputStream.Test +++java.io.CharArrayReader.ProtectedVars +++java.io.CharArrayReader.OutOfBounds +++java.io.CharArrayReader.SimpleRead +++java.io.CharArrayReader.MarkReset +++java.util.Stack.AcuniaStackTest +++java.util.Arrays.asList +++java.util.Arrays.fill +++java.util.Arrays.equals +++java.util.Arrays.sort +++java.util.Arrays.binarySearch +++java.util.Properties.getProperty +++java.util.Properties.AcuniaPropertiesTest +++java.util.Properties.load +++java.util.TreeSet.basic +++java.util.Observable.observable +++java.util.StringTokenizer.hasMoreElements +++java.util.StringTokenizer.hasMoreTokens +++java.util.StringTokenizer.countTokens +++java.util.StringTokenizer.nextToken +++java.util.StringTokenizer.constructors +++java.util.StringTokenizer.nextElement +++java.util.IdentityHashMap.simple +++java.util.prefs.PreferenceTest +++java.util.Hashtable.HashContains +++java.util.Hashtable.AcuniaHashtableTest +++java.util.Hashtable.EnumerateAndModify +++java.util.Hashtable.basic +++java.util.Hashtable.ContainsHash +++java.util.Hashtable.NullValue +++java.util.TreeMap.serialization +++java.util.TimeZone.setDefault +++java.util.TimeZone.zdump +++java.util.TimeZone.setID +++java.util.UUID.TestAll +++java.util.Currency.Constructors +++java.util.Currency.Germany +++java.util.Currency.ReferenceEquality +++java.util.Currency.France +++java.util.Currency.getInstance +++java.util.Currency.Japan +++java.util.Currency.UK +++java.util.Currency.Korea +++java.util.Currency.PRC +++java.util.Currency.Canada +++java.util.Currency.CanadaFrench +++java.util.Currency.China +++java.util.Currency.Taiwan +++java.util.Currency.Italy +++java.util.AbstractCollection.AcuniaAbstractCollectionTest +++java.util.AbstractCollection.AcuniaAddCollectionTest +++java.util.AbstractCollection.toString +++java.util.SimpleTimeZone.clone +++java.util.SimpleTimeZone.hasSameRules +++java.util.SimpleTimeZone.getRawOffset +++java.util.SimpleTimeZone.setRawOffset +++java.util.SimpleTimeZone.check14 +++java.util.SimpleTimeZone.equals +++java.util.SimpleTimeZone.inDaylightTime +++java.util.SimpleTimeZone.setStartYear +++java.util.SimpleTimeZone.constructors +++java.util.SimpleTimeZone.getOffset +++java.util.SimpleTimeZone.setDSTSavings +++java.util.SimpleTimeZone.hashCode +++java.util.SimpleTimeZone.constants +++java.util.SimpleTimeZone.getDSTSavings +++java.util.AbstractList.AcuniaAbstractListTest +++java.util.Collections.nCopies +++java.util.Collections.fill +++java.util.Collections.max +++java.util.Collections.copy +++java.util.Collections.rotate +++java.util.Collections.unmodifiableList +++java.util.Collections.min +++java.util.Collections.unmodifiableMap +++java.util.Collections.reverse +++java.util.Collections.reverseOrder +++java.util.Collections.sort +++java.util.Collections.binarySearch +++java.util.logging.SocketHandler.SocketHandler +++java.util.logging.XMLFormatter.getTail +++java.util.logging.Handler.isLoggable +++java.util.logging.Handler.setEncoding +++java.util.logging.Handler.setFilter +++java.util.logging.Handler.getErrorManager +++java.util.logging.Handler.reportError +++java.util.logging.Handler.setLevel +++java.util.logging.Handler.setErrorManager +++java.util.logging.LogRecord.getThreadID +++java.util.logging.LogRecord.setLoggerName +++java.util.logging.LogRecord.getMillis +++java.util.logging.LogRecord.setThrown +++java.util.logging.LogRecord.setThreadID +++java.util.logging.LogRecord.setSequenceNumber +++java.util.logging.LogRecord.setSourceMethodName +++java.util.logging.LogRecord.setResourceBundle +++java.util.logging.LogRecord.setMillis +++java.util.logging.LogRecord.setMessage +++java.util.logging.LogRecord.setParameters +++java.util.logging.LogRecord.setSourceClassName +++java.util.logging.LogRecord.setLevel +++java.util.logging.Level.intValue +++java.util.logging.Level.equals +++java.util.logging.Level.getName +++java.util.logging.Level.parse +++java.util.logging.Level.toString +++java.util.logging.Level.hashCode +++java.util.logging.LogManager.readConfiguration +++java.util.logging.LoggingMXBean.Test +++java.util.logging.Logger.hierarchyChecks +++java.util.logging.Logger.getName +++java.util.logging.Logger.getAnonymousLogger +++java.util.logging.Logger.securityChecks +++java.util.logging.Logger.getParent +++java.util.logging.Logger.global +++java.util.Iterator.ConcurrentModification +++java.util.BitSet.AcuniaBitSetTest +++java.util.BitSet.flip +++java.util.BitSet.jdk10 +++java.util.BitSet.get +++java.util.BitSet.clear +++java.util.Timer.taskException +++java.util.GregorianCalendar.first +++java.util.GregorianCalendar.setFirstDayOfWeek +++java.util.GregorianCalendar.dayOfWeekInMonth +++java.util.GregorianCalendar.setWeekOfMonth +++java.util.GregorianCalendar.internal +++java.util.GregorianCalendar.equals +++java.util.GregorianCalendar.getMinimum +++java.util.GregorianCalendar.getMinimalDaysInFirstWeek +++java.util.GregorianCalendar.conversion +++java.util.GregorianCalendar.weekOfYear +++java.util.Random.basic +++java.util.AbstractSet.AcuniaAbstractSetTest +++java.util.Calendar.TimeZone +++java.util.Calendar.ampm +++java.util.Calendar.add +++java.util.Calendar.minmax +++java.util.Calendar.setTime +++java.util.Calendar.setTimeZone +++java.util.Calendar.getInstance +++java.util.Calendar.set +++java.util.Calendar.simple +++java.util.Calendar.roll +++java.util.Calendar.dstOffset +++java.util.regex.Matcher.hitEnd +++java.util.regex.Pattern.UnicodeSimpleCategory +++java.util.regex.Pattern.pcrematches +++java.util.regex.Pattern.matches +++java.util.regex.PatternSplit +++java.util.regex.CharacterClasses +++java.util.AbstractSequentialList.AcuniaAbstractSequentialListTest +++java.util.LinkedList.subList +++java.util.LinkedList.AcuniaLinkedListTest +++java.util.LinkedList.SubListTest +++java.util.HashMap.AcuniaHashMapTest +++java.util.jar.JarInputStream.getNextEntry +++java.util.jar.JarFile.TestOfManifest +++java.util.jar.JarFile.basic +++java.util.Vector.subList +++java.util.Vector.copyInto +++java.util.Vector.removeAll +++java.util.Vector.retainAll +++java.util.Vector.VectorSerialization +++java.util.zip.ZipEntry.time +++java.util.zip.ZipEntry.Size +++java.util.zip.ZipEntry.newZipEntry +++java.util.zip.ZipEntry.setComment +++java.util.zip.ZipInputStream.close +++java.util.zip.ZipInputStream.basic +++java.util.zip.Deflater.PR27435 +++java.util.zip.Adler32.checksum +++java.util.zip.GZIPInputStream.PR24461 +++java.util.zip.GZIPInputStream.basic +++java.util.zip.InflaterInputStream.basic +++java.util.zip.ZipFile.DirEntryTest +++java.util.zip.ZipFile.NoEntryTest +++java.util.zip.ZipFile.newZipFile +++java.util.Date.compareTo +++java.util.Date.clone +++java.util.Date.before +++java.util.Date.serialization +++java.util.Date.range +++java.util.Date.equals +++java.util.Date.parse +++java.util.Date.after +++java.util.Date.getTimezoneOffset +++java.util.LinkedHashMap.LinkedHashMapTest +++java.util.LinkedHashMap.Regress +++java.util.ArrayList.subList +++java.util.ArrayList.serial +++java.util.ResourceBundle.getBundle +++java.util.AbstractMap.AcuniaAbstractMapTest +++java.beans.XMLDecoder.jdk14 +++java.beans.Expression.check +++java.beans.Introspector.getBeanInfo2 +++java.beans.Introspector.getBeanInfo4 +++java.beans.Introspector.getBeanInfo +++java.beans.Introspector.jdk11 +++java.beans.Introspector.jdk12 +++java.beans.Introspector.getBeanInfo2_2 +++java.beans.DesignMode.constants +++java.beans.PropertyEditorSupport.setValue +++java.beans.PropertyEditorSupport.getSource +++java.beans.SimpleBeanInfo.getIcon +++java.beans.SimpleBeanInfo.getDefaultPropertyIndex +++java.beans.SimpleBeanInfo.getEventSetDescriptors +++java.beans.SimpleBeanInfo.getDefaultEventIndex +++java.beans.SimpleBeanInfo.getBeanDescriptor +++java.beans.SimpleBeanInfo.getAdditionalBeanInfo +++java.beans.SimpleBeanInfo.loadImage +++java.beans.EventSetDescriptor.constructorTest1 +++java.beans.FeatureDescriptor.check +++java.beans.beancontext.BeanContextSupport.toArray +++java.beans.beancontext.BeanContextSupport.getChildPropertyChangeListener +++java.beans.beancontext.BeanContextSupport.serialize +++java.beans.beancontext.BeanContextSupport.getChildBeanContextChild +++java.beans.beancontext.BeanContextSupport.getChildBeanContextMembershipListener +++java.beans.beancontext.BeanContextSupport.setDesignTime +++java.beans.beancontext.BeanContextSupport.getChildVisibility +++java.beans.beancontext.BeanContextSupport.constructors +++java.beans.beancontext.BeanContextSupport.getChildVetoableChangeListener +++java.beans.beancontext.BeanContextSupport.getChildSerializable +++java.beans.beancontext.BeanContextSupport.getBeanContextPeer +++java.beans.beancontext.BeanContextServicesSupport.getChildBeanContextServicesListener +++java.beans.beancontext.InstantiateChild +++java.beans.beancontext.Remove +++java.beans.beancontext.Array +++java.beans.beancontext.Add +++java.beans.PropertyChangeSupport.firePropertyChange +++java.beans.VetoableChangeSupport.addVetoableChangeListener +++java.beans.Statement.check +++java.beans.Beans.instantiate_1 +++java.beans.EventHandler.check +++java.beans.EventHandler.check14b +++java.beans.PropertyDescriptor.constructorTest2 +++java.beans.PropertyDescriptor.constructorTest1 +++java.beans.MethodDescriptor.constructorTest1 +++java.awt.AWTEvent.constants +++java.awt.CardLayout.show +++java.awt.CardLayout.first +++java.awt.CardLayout.testMaximumLayoutSize +++java.awt.CardLayout.testMinimumLayoutSize +++java.awt.Graphics.clearRect +++java.awt.Polygon.contains +++java.awt.Polygon.getPathIterator +++java.awt.BasicStroke.equals +++java.awt.BasicStroke.constructors +++java.awt.BasicStroke.hashCode +++java.awt.BasicStroke.constants +++java.awt.Graphics2D.setClip +++java.awt.Graphics2D.getClip +++java.awt.Graphics2D.getClipBounds +++java.awt.Graphics2D.setTransform +++java.awt.Graphics2D.clip +++java.awt.Graphics2D.transform +++java.awt.Point.move +++java.awt.Point.clone +++java.awt.Point.equals +++java.awt.Point.constructors +++java.awt.Point.setLocation +++java.awt.Point.translate +++java.awt.Point.getLocation +++java.awt.event.ComponentEvent.paramString +++java.awt.image.ShortLookupTable.getTable +++java.awt.image.ShortLookupTable.lookupPixel +++java.awt.image.ShortLookupTable.constructors +++java.awt.image.PixelGrabber.SimpleGrabber +++java.awt.image.PixelGrabber.testNullProducer +++java.awt.image.ConvolveOp.getEdgeCondition +++java.awt.image.ConvolveOp.getKernel +++java.awt.image.ConvolveOp.filterRaster +++java.awt.image.ConvolveOp.getRenderingHints +++java.awt.image.ConvolveOp.getPoint2D +++java.awt.image.ConvolveOp.createCompatibleDestRaster +++java.awt.image.ConvolveOp.constructors +++java.awt.image.ConvolveOp.getBounds2D +++java.awt.image.ConvolveOp.constants +++java.awt.image.IndexColorModel.getGreens +++java.awt.image.IndexColorModel.getComponentSize +++java.awt.image.IndexColorModel.getTransparentPixel +++java.awt.image.IndexColorModel.getColorSpace +++java.awt.image.IndexColorModel.getAlphas +++java.awt.image.IndexColorModel.getPixelSize +++java.awt.image.IndexColorModel.isValid +++java.awt.image.IndexColorModel.constructors +++java.awt.image.IndexColorModel.getBlues +++java.awt.image.IndexColorModel.getReds +++java.awt.image.IndexColorModel.getTransparency +++java.awt.image.DataBuffer.getDataTypeSize +++java.awt.image.DataBuffer.getOffset +++java.awt.image.DataBuffer.constants +++java.awt.image.DataBuffer.getOffsets +++java.awt.image.DataBufferUShort.getData +++java.awt.image.DataBufferUShort.getBankData +++java.awt.image.DataBufferUShort.setElem +++java.awt.image.DataBufferUShort.getElem +++java.awt.image.DataBufferUShort.getDataType +++java.awt.image.DataBufferUShort.constructors +++java.awt.image.ComponentSampleModel.setPixels +++java.awt.image.ComponentSampleModel.getPixelStride +++java.awt.image.ComponentSampleModel.getDataElements +++java.awt.image.ComponentSampleModel.getSample +++java.awt.image.ComponentSampleModel.getBandOffsets +++java.awt.image.ComponentSampleModel.equals +++java.awt.image.ComponentSampleModel.getPixel +++java.awt.image.ComponentSampleModel.getNumDataElements +++java.awt.image.ComponentSampleModel.getSamples +++java.awt.image.ComponentSampleModel.getSampleSize +++java.awt.image.ComponentSampleModel.getSampleFloat +++java.awt.image.ComponentSampleModel.setDataElements +++java.awt.image.ComponentSampleModel.constructors +++java.awt.image.ComponentSampleModel.setPixel +++java.awt.image.ComponentSampleModel.createDataBuffer +++java.awt.image.ComponentSampleModel.getOffset +++java.awt.image.ComponentSampleModel.getSampleDouble +++java.awt.image.ComponentSampleModel.createCompatibleSampleModel +++java.awt.image.ComponentSampleModel.setSamples +++java.awt.image.ComponentSampleModel.hashCode +++java.awt.image.ComponentSampleModel.getPixels +++java.awt.image.ComponentSampleModel.getScanlineStride +++java.awt.image.ComponentSampleModel.createSubsetSampleModel +++1 problem (1 error)java.awt.image.ColorModel.getComponentSize +++java.awt.image.ColorModel.getRGBdefault +++java.awt.image.ColorModel.constructors +++java.awt.image.LookupTable.constructor +++java.awt.image.LookupTable.getNumComponents +++java.awt.image.RescaleOp.getScaleFactors +++java.awt.image.RescaleOp.getRenderingHints +++java.awt.image.RescaleOp.getPoint2D +++java.awt.image.RescaleOp.constructors +++java.awt.image.RescaleOp.getNumFactors +++java.awt.image.RescaleOp.getOffsets +++java.awt.image.DirectColorModel.coerceData +++java.awt.image.WritableRaster.createChild +++java.awt.image.WritableRaster.createWritableChild +++java.awt.image.ComponentColorModel.coerceData +++java.awt.image.SampleModel.setPixels +++java.awt.image.SampleModel.getSample +++java.awt.image.SampleModel.getPixel +++java.awt.image.SampleModel.getSamples +++java.awt.image.SampleModel.getSampleSize +++java.awt.image.SampleModel.getSampleFloat +++java.awt.image.SampleModel.setPixel +++java.awt.image.SampleModel.setSample +++java.awt.image.SampleModel.createDataBuffer +++java.awt.image.SampleModel.getSampleDouble +++java.awt.image.SampleModel.setSamples +++java.awt.image.SampleModel.getPixels +++java.awt.image.BandCombineOp.getPoint2D +++java.awt.image.BandCombineOp.createCompatibleDestRaster +++java.awt.image.BandCombineOp.getBounds2D +++java.awt.image.BandCombineOp.filter +++java.awt.image.LookupOp.constructor +++java.awt.image.LookupOp.filterRaster +++java.awt.image.LookupOp.getRenderingHints +++java.awt.image.LookupOp.getTable +++java.awt.image.LookupOp.getPoint2D +++java.awt.image.Kernel.getYOrigin +++java.awt.image.Kernel.constructor +++java.awt.image.Kernel.getXOrigin +++java.awt.image.Kernel.getHeight +++java.awt.image.Kernel.check +++java.awt.image.Kernel.getKernelData +++java.awt.image.Kernel.getWidth +++java.awt.image.BufferedImage.getSubimage +++java.awt.image.BufferedImage.getSetRgb1Pixel +++java.awt.image.DataBufferByte.getData +++java.awt.image.DataBufferByte.getBankData +++java.awt.image.DataBufferByte.setElem +++java.awt.image.DataBufferByte.getElem +++java.awt.image.DataBufferByte.getDataType +++java.awt.image.DataBufferByte.constructors +++java.awt.image.DataBufferShort.getData +++java.awt.image.DataBufferShort.getBankData +++java.awt.image.DataBufferShort.setElem +++java.awt.image.DataBufferShort.getElem +++java.awt.image.DataBufferShort.getDataType +++java.awt.image.DataBufferShort.constructors +++java.awt.image.Raster.createChild +++java.awt.image.DataBufferInt.getData +++java.awt.image.DataBufferInt.getBankData +++java.awt.image.DataBufferInt.setElem +++java.awt.image.DataBufferInt.getElem +++java.awt.image.DataBufferInt.getDataType +++java.awt.image.DataBufferInt.constructors +++java.awt.image.SinglePixelPackedSampleModel.getBitOffsets +++java.awt.image.SinglePixelPackedSampleModel.getDataElements +++java.awt.image.SinglePixelPackedSampleModel.getSample +++java.awt.image.SinglePixelPackedSampleModel.equals +++java.awt.image.SinglePixelPackedSampleModel.getPixel +++java.awt.image.SinglePixelPackedSampleModel.getNumDataElements +++java.awt.image.SinglePixelPackedSampleModel.getSamples +++java.awt.image.SinglePixelPackedSampleModel.getSampleSize +++java.awt.image.SinglePixelPackedSampleModel.setDataElements +++java.awt.image.SinglePixelPackedSampleModel.constructors +++java.awt.image.SinglePixelPackedSampleModel.getBitMasks +++java.awt.image.SinglePixelPackedSampleModel.setPixel +++java.awt.image.SinglePixelPackedSampleModel.setSample +++java.awt.image.SinglePixelPackedSampleModel.createDataBuffer +++java.awt.image.SinglePixelPackedSampleModel.getOffset +++java.awt.image.SinglePixelPackedSampleModel.createCompatibleSampleModel +++java.awt.image.SinglePixelPackedSampleModel.hashCode +++java.awt.image.SinglePixelPackedSampleModel.getPixels +++java.awt.image.SinglePixelPackedSampleModel.getScanlineStride +++java.awt.image.SinglePixelPackedSampleModel.createSubsetSampleModel +++java.awt.image.ByteLookupTable.getTable +++java.awt.image.ByteLookupTable.lookupPixel +++java.awt.image.ByteLookupTable.constructors +++java.awt.image.MultiPixelPackedSampleModel.getBitOffset +++java.awt.image.MultiPixelPackedSampleModel.getTransferType +++java.awt.image.MultiPixelPackedSampleModel.getDataElements +++java.awt.image.MultiPixelPackedSampleModel.getSample +++java.awt.image.MultiPixelPackedSampleModel.equals +++java.awt.image.MultiPixelPackedSampleModel.getPixel +++java.awt.image.MultiPixelPackedSampleModel.getSampleSize +++java.awt.image.MultiPixelPackedSampleModel.setDataElements +++java.awt.image.MultiPixelPackedSampleModel.constructors +++java.awt.image.MultiPixelPackedSampleModel.setPixel +++java.awt.image.MultiPixelPackedSampleModel.setSample +++java.awt.image.MultiPixelPackedSampleModel.createDataBuffer +++java.awt.image.MultiPixelPackedSampleModel.getPixelBitStride +++java.awt.image.MultiPixelPackedSampleModel.getOffset +++java.awt.image.MultiPixelPackedSampleModel.createCompatibleSampleModel +++java.awt.image.MultiPixelPackedSampleModel.hashCode +++java.awt.image.MultiPixelPackedSampleModel.getScanlineStride +++java.awt.image.MultiPixelPackedSampleModel.createSubsetSampleModel +++java.awt.image.AffineTransformOp.getPoint2D +++java.awt.image.AffineTransformOp.createCompatibleDestRaster +++java.awt.image.AffineTransformOp.constructors +++java.awt.image.AffineTransformOp.getBounds2D +++java.awt.image.PixelInterleavedSampleModel.createSubsetSampleModel +++java.awt.image.BandedSampleModel.setPixels +++java.awt.image.BandedSampleModel.getDataElements +++java.awt.image.BandedSampleModel.getSample +++java.awt.image.BandedSampleModel.getPixel +++java.awt.image.BandedSampleModel.getSamples +++java.awt.image.BandedSampleModel.getSampleFloat +++java.awt.image.BandedSampleModel.setDataElements +++java.awt.image.BandedSampleModel.constructors +++java.awt.image.BandedSampleModel.setPixel +++java.awt.image.BandedSampleModel.setSample +++java.awt.image.BandedSampleModel.createDataBuffer +++java.awt.image.BandedSampleModel.getSampleDouble +++java.awt.image.BandedSampleModel.createCompatibleSampleModel +++java.awt.image.BandedSampleModel.setSamples +++java.awt.image.BandedSampleModel.hashCode +++java.awt.image.BandedSampleModel.getPixels +++java.awt.image.BandedSampleModel.createSubsetSampleModel +++java.awt.image.ColorConvertOp.filterRaster +++java.awt.image.ColorConvertOp.getPoint2D +++java.awt.image.ColorConvertOp.createCompatibleDestRaster +++java.awt.image.ColorConvertOp.constructors +++java.awt.image.ColorConvertOp.getBounds2D +++java.awt.ScrollPaneAdjustable.paramString +++java.awt.GridBagLayout.AdjustForGravity +++java.awt.GridBagLayout.toString +++java.awt.Dimension.clone +++java.awt.Dimension.equals +++java.awt.Dimension.setSize +++java.awt.Dimension.getSize +++java.awt.Dimension.constructors +++java.awt.TextField.getPreferredSize +++java.awt.TextField.getMinimumSize +++java.awt.TextField.constructors +++java.awt.BorderLayout.layoutContainer +++java.awt.BorderLayout.getHgap +++java.awt.BorderLayout.maxLayoutSize +++java.awt.BorderLayout.setVgap +++java.awt.BorderLayout.getVgap +++java.awt.BorderLayout.getLayoutAlignmentY +++java.awt.BorderLayout.Test15 +++java.awt.BorderLayout.getLayoutAlignmentX +++java.awt.BorderLayout.setHgap +++java.awt.BorderLayout.constructors +++java.awt.BorderLayout.constants +++java.awt.BorderLayout.preferredLayoutSize +++java.awt.BorderLayout.addLayoutComponent +++java.awt.Scrollbar.testSetBlockIncrement +++java.awt.Scrollbar.testSetUnitIncrement +++java.awt.Scrollbar.testSetValues +++java.awt.List.testSelected +++java.awt.ScrollPane.add +++java.awt.ScrollPane.getScrollPosition +++java.awt.ScrollPane.testSetLayout +++java.awt.ScrollPane.setScrollPosition +++java.awt.ScrollPane.doLayout +++java.awt.Choice.getSelected +++java.awt.Choice.remove +++java.awt.KeyboardFocusManager.getFocusOwner +++java.awt.KeyboardFocusManager.getGlobalPermanentFocusOwner +++java.awt.KeyboardFocusManager.getGlobalFocusOwner +++java.awt.AWTPermission.constructor +++java.awt.ColorClass.decode +++java.awt.ColorClass.serialization +++java.awt.ColorClass.equals +++java.awt.ColorClass.getGreen +++java.awt.ColorClass.constructors +++java.awt.ColorClass.brighter +++java.awt.ColorClass.hashCode +++java.awt.ColorClass.constants +++java.awt.ColorClass.getBlue +++java.awt.ColorClass.getRed +++java.awt.RenderingHints.Key.isCompatibleValue +++java.awt.RenderingHints.clone +++java.awt.RenderingHints.keySet +++java.awt.RenderingHints.put +++java.awt.RenderingHints.add +++java.awt.RenderingHints.putAll +++java.awt.RenderingHints.entrySet +++java.awt.RenderingHints.equals +++java.awt.RenderingHints.size +++java.awt.RenderingHints.get +++java.awt.RenderingHints.values +++java.awt.RenderingHints.containsValue +++java.awt.RenderingHints.isEmpty +++java.awt.RenderingHints.remove +++java.awt.RenderingHints.clear +++java.awt.Panel.TestPanelRepaint +++java.awt.AWTKeyStroke.serialization +++java.awt.AWTKeyStroke.equals +++java.awt.AWTKeyStroke.getAWTKeyStroke +++java.awt.Rectangle.clone +++java.awt.Rectangle.add +++java.awt.Rectangle.setRect +++java.awt.Rectangle.setBounds +++java.awt.Rectangle.equals +++java.awt.Rectangle.intersects +++java.awt.Rectangle.setSize +++java.awt.Rectangle.grow +++java.awt.Rectangle.outcode +++java.awt.Rectangle.union +++java.awt.Rectangle.constructors +++java.awt.Rectangle.intersection +++java.awt.Rectangle.setLocation +++java.awt.Rectangle.translate +++java.awt.Rectangle.contains +++java.awt.Rectangle.isEmpty +++java.awt.Menu.insert +++java.awt.AlphaComposite.getInstance +++java.awt.AlphaComposite.equals +++java.awt.AlphaComposite.getInstance14 +++java.awt.AlphaComposite.getRule +++java.awt.Window.security +++java.awt.Window.focusCycleRootTest +++java.awt.EventClass.constants +++java.awt.Frame.isDisplayable1 +++java.awt.Frame.isDisplayable5 +++java.awt.Frame.isDisplayable4 +++java.awt.Frame.isDisplayable3 +++java.awt.Frame.isDisplayable6 +++java.awt.Frame.menubar +++java.awt.Frame.isDisplayable2 +++java.awt.Frame.isDisplayable7 +++java.awt.Container.getListeners +++java.awt.Container.setLayout +++java.awt.Container.getPreferredSize +++java.awt.Container.applyComponentOrientation +++java.awt.Container.getComponentAt +++java.awt.Container.getAlignmentY +++java.awt.Container.getAlignmentX +++java.awt.Container.addImpl +++java.awt.FontClass.serialization +++java.awt.MenuItem.label1 +++java.awt.font.TextHitInfo.isLeadingEdge +++java.awt.font.TextHitInfo.getOtherHit +++java.awt.font.TextHitInfo.leading +++java.awt.font.TextHitInfo.getOffsetHit +++java.awt.font.TextHitInfo.equals +++java.awt.font.TextHitInfo.getCharIndex +++java.awt.font.TextHitInfo.afterOffset +++java.awt.font.TextHitInfo.getInsertionIndex +++java.awt.font.TextHitInfo.toString +++java.awt.font.TextHitInfo.beforeOffset +++java.awt.font.TextHitInfo.hashCode +++java.awt.font.TextHitInfo.trailing +++java.awt.font.TransformAttribute.serialization +++java.awt.font.TransformAttribute.getTransform +++java.awt.font.TransformAttribute.isIdentity +++java.awt.font.ShapeGraphicAttribute.ShapeGraphicAttributeTest +++java.awt.font.ImageGraphicAttribute.ImageGraphicAttributeTest +++java.awt.font.TextAttribute.toString13 +++java.awt.font.TextAttribute.serialization +++java.awt.font.TextAttribute.toString +++java.awt.font.TextAttribute.constants13 +++java.awt.font.TextAttribute.constants +++java.awt.GradientPaint.getPoint2 +++java.awt.GradientPaint.equals +++java.awt.GradientPaint.getColor1 +++java.awt.GradientPaint.constructors +++java.awt.GradientPaint.getColor2 +++java.awt.GradientPaint.isCyclic +++java.awt.GradientPaint.getTransparency +++java.awt.GradientPaint.getPoint1 +++java.awt.TextComponent.setSelectionStart +++java.awt.Component.repaint +++java.awt.Component.getListeners +++java.awt.Component.setName +++java.awt.Component.properties14 +++java.awt.Component.getMaximumSize +++java.awt.Component.setMinimumSize +++java.awt.Component.getForeground +++java.awt.Component.setPreferredSize +++java.awt.Component.properties +++java.awt.Component.requestFocus +++java.awt.Component.isValid +++java.awt.Component.getFont +++java.awt.Component.setMaximumSize +++java.awt.Component.setComponentOrientation +++java.awt.datatransfer.DataFlavor.writeExternal +++java.awt.datatransfer.StringSelection.selection +++java.awt.TextArea.getPreferredSize +++java.awt.TextArea.getMinimumSize +++java.awt.TextArea.testReplaceText +++java.awt.TextArea.constructors +++java.awt.TextArea.testAppendText +++java.awt.TextArea.testInsertText +++java.awt.TextArea.testInvalidConstructorValues +++java.awt.color.ColorSpace.isCS_sRGB +++java.awt.color.ColorSpace.getInstance +++java.awt.FlowLayout.minimumLayoutSize +++java.awt.geom.Ellipse2D.Double.clone +++java.awt.geom.Ellipse2D.Double.getY +++java.awt.geom.Ellipse2D.Double.setFrame +++java.awt.geom.Ellipse2D.Double.getHeight +++java.awt.geom.Ellipse2D.Double.getX +++java.awt.geom.Ellipse2D.Double.constructors +++java.awt.geom.Ellipse2D.Double.getBounds2D +++java.awt.geom.Ellipse2D.Double.isEmpty +++java.awt.geom.Ellipse2D.Double.getWidth +++java.awt.geom.Ellipse2D.Float.clone +++java.awt.geom.Ellipse2D.Float.getY +++java.awt.geom.Ellipse2D.Float.setFrame +++java.awt.geom.Ellipse2D.Float.getHeight +++java.awt.geom.Ellipse2D.Float.getX +++java.awt.geom.Ellipse2D.Float.constructors +++java.awt.geom.Ellipse2D.Float.getBounds2D +++java.awt.geom.Ellipse2D.Float.isEmpty +++java.awt.geom.Ellipse2D.Float.getWidth +++java.awt.geom.Ellipse2D.intersects +++java.awt.geom.Ellipse2D.contains +++java.awt.geom.GeneralPath.getCurrentPoint +++java.awt.geom.GeneralPath.GeneralPath +++java.awt.geom.GeneralPath.append_PathIterator +++java.awt.geom.GeneralPath.contains +++java.awt.geom.GeneralPath.getPathIterator +++java.awt.geom.RectangularShape.getFrame +++java.awt.geom.RectangularShape.setFrame +++java.awt.geom.RectangularShape.getMinY +++java.awt.geom.RectangularShape.intersects +++java.awt.geom.RectangularShape.getMaxY +++java.awt.geom.RectangularShape.getMaxX +++java.awt.geom.RectangularShape.setFrameFromCenter +++java.awt.geom.RectangularShape.setFrameFromDiagonal +++java.awt.geom.RectangularShape.getMinX +++java.awt.geom.RectangularShape.getCenterX +++java.awt.geom.RectangularShape.getCenterY +++java.awt.geom.RectangularShape.contains +++java.awt.geom.RectangularShape.isEmpty +++java.awt.geom.RectangularShape.getBounds +++java.awt.geom.Line2D.clone +++java.awt.geom.Line2D.getP1 +++java.awt.geom.Line2D.linesIntersect +++java.awt.geom.Line2D.ptSegDistSq +++java.awt.geom.Line2D.relativeCCW +++java.awt.geom.Line2D.getP2 +++java.awt.geom.Line2D.setLine +++java.awt.geom.Line2D.equals +++java.awt.geom.Line2D.intersects +++java.awt.geom.Line2D.ptLineDistSq +++java.awt.geom.Line2D.ptSegDist +++java.awt.geom.Line2D.intersectsLine +++java.awt.geom.Line2D.contains +++java.awt.geom.Line2D.ptLineDist +++java.awt.geom.Line2D.getPathIterator +++java.awt.geom.Line2D.getBounds +++java.awt.geom.Area.clone +++java.awt.geom.Area.add +++java.awt.geom.Area.isRectangular +++java.awt.geom.Area.createTransformedArea +++java.awt.geom.Area.isPolygonal +++java.awt.geom.Area.intersect +++java.awt.geom.Area.equals +++java.awt.geom.Area.exclusiveOr +++java.awt.geom.Area.intersects +++java.awt.geom.Area.reset +++java.awt.geom.Area.isSingular +++java.awt.geom.Area.constructors +++java.awt.geom.Area.getBounds2D +++java.awt.geom.Area.contains +++java.awt.geom.Area.subtract +++java.awt.geom.Area.isEmpty +++java.awt.geom.Area.transform +++java.awt.geom.Area.getBounds +++java.awt.geom.Rectangle2D.Double.clone +++java.awt.geom.Rectangle2D.Double.createIntersection +++java.awt.geom.Rectangle2D.Double.setRect +++java.awt.geom.Rectangle2D.Double.outcode +++java.awt.geom.Rectangle2D.Double.createUnion +++java.awt.geom.Rectangle2D.Double.isEmpty +++java.awt.geom.Rectangle2D.Float.clone +++java.awt.geom.Rectangle2D.Float.createIntersection +++java.awt.geom.Rectangle2D.Float.setRect +++java.awt.geom.Rectangle2D.Float.outcode +++java.awt.geom.Rectangle2D.Float.createUnion +++java.awt.geom.Rectangle2D.Float.isEmpty +++java.awt.geom.Rectangle2D.add +++java.awt.geom.Rectangle2D.setFrame +++java.awt.geom.Rectangle2D.intersect +++java.awt.geom.Rectangle2D.equals +++java.awt.geom.Rectangle2D.intersects +++java.awt.geom.Rectangle2D.union +++java.awt.geom.Rectangle2D.intersectsLine +++java.awt.geom.Rectangle2D.getBounds2D +++java.awt.geom.Rectangle2D.contains +++java.awt.geom.Rectangle2D.constants +++java.awt.geom.Rectangle2D.getPathIterator +++java.awt.geom.Rectangle2D.getBounds +++java.awt.geom.Arc2D.Double.clone +++java.awt.geom.Arc2D.Float.clone +++java.awt.geom.Arc2D.setFrame +++java.awt.geom.Arc2D.setAngleStart +++java.awt.geom.Arc2D.setArc +++java.awt.geom.Arc2D.setArcByTangent +++java.awt.geom.Arc2D.containsAngle +++java.awt.geom.Arc2D.setArcByCenter +++java.awt.geom.Arc2D.intersects +++java.awt.geom.Arc2D.getEndPoint +++java.awt.geom.Arc2D.setAngleExtent +++java.awt.geom.Arc2D.constructors +++java.awt.geom.Arc2D.getBounds2D +++java.awt.geom.Arc2D.contains +++java.awt.geom.Arc2D.getStartPoint +++java.awt.geom.Arc2D.constants +++java.awt.geom.Arc2D.isEmpty +++java.awt.geom.Arc2D.getPathIterator +++java.awt.geom.Arc2D.setAngles +++java.awt.geom.Arc2D.setArcType +++java.awt.geom.QuadCurve2D.Double.getP1 +++java.awt.geom.QuadCurve2D.Double.getP2 +++java.awt.geom.QuadCurve2D.Double.getCtrlPt +++java.awt.geom.QuadCurve2D.Double.getBounds2D +++java.awt.geom.QuadCurve2D.Double.Double +++java.awt.geom.QuadCurve2D.Double.setCurve +++java.awt.geom.QuadCurve2D.Float.getP1 +++java.awt.geom.QuadCurve2D.Float.Float +++java.awt.geom.QuadCurve2D.Float.getP2 +++java.awt.geom.QuadCurve2D.Float.getCtrlPt +++java.awt.geom.QuadCurve2D.Float.getBounds2D +++java.awt.geom.QuadCurve2D.Float.setCurve +++java.awt.geom.QuadCurve2D.clone +++java.awt.geom.QuadCurve2D.getFlatness +++java.awt.geom.QuadCurve2D.subdivide +++java.awt.geom.QuadCurve2D.getFlatnessSq +++java.awt.geom.QuadCurve2D.setCurve +++java.awt.geom.QuadCurve2D.getPathIterator +++java.awt.geom.CubicCurve2D.Double.getP1 +++java.awt.geom.CubicCurve2D.Double.getCtrlP2 +++java.awt.geom.CubicCurve2D.Double.getP2 +++java.awt.geom.CubicCurve2D.Double.getBounds2D +++java.awt.geom.CubicCurve2D.Double.Double +++java.awt.geom.CubicCurve2D.Double.setCurve +++java.awt.geom.CubicCurve2D.Double.getCtrlP1 +++java.awt.geom.CubicCurve2D.Float.getP1 +++java.awt.geom.CubicCurve2D.Float.getCtrlP2 +++java.awt.geom.CubicCurve2D.Float.Float +++java.awt.geom.CubicCurve2D.Float.getP2 +++java.awt.geom.CubicCurve2D.Float.getBounds2D +++java.awt.geom.CubicCurve2D.Float.setCurve +++java.awt.geom.CubicCurve2D.Float.getCtrlP1 +++java.awt.geom.CubicCurve2D.clone +++java.awt.geom.CubicCurve2D.getFlatness +++java.awt.geom.CubicCurve2D.subdivide +++java.awt.geom.CubicCurve2D.getFlatnessSq +++java.awt.geom.CubicCurve2D.setCurve +++java.awt.geom.CubicCurve2D.getPathIterator +++java.awt.geom.FlatteningPathIterator.FlatteningPathIterator +++java.awt.geom.FlatteningPathIterator.getWindingRule +++java.awt.geom.FlatteningPathIterator.getFlatness +++java.awt.geom.FlatteningPathIterator.getRecursionLimit +++java.awt.geom.FlatteningPathIterator.currentSegment +++java.awt.geom.AffineTransform.clone +++java.awt.geom.AffineTransform.preConcatenate +++java.awt.geom.AffineTransform.getRotateInstance +++java.awt.geom.AffineTransform.getMatrix +++java.awt.geom.AffineTransform.inverseTransform +++java.awt.geom.AffineTransform.getScaleInstance +++java.awt.geom.AffineTransform.createInverse +++java.awt.geom.AffineTransform.deltaTransform +++java.awt.geom.AffineTransform.equals +++java.awt.geom.AffineTransform.setTransform +++java.awt.geom.AffineTransform.constructors +++java.awt.geom.AffineTransform.getTranslateInstance +++java.awt.geom.AffineTransform.constants +++java.awt.geom.AffineTransform.concatenate +++java.awt.geom.AffineTransform.getShearInstance +++java.awt.geom.AffineTransform.transform +++java.awt.geom.AffineTransform.getDeterminant +++java.awt.geom.AffineTransform.isIdentity +++java.awt.geom.RoundRectangle2D.intersects +++java.awt.geom.RoundRectangle2D.contains +++java.awt.testName +++java.nio.Buffer.IntBufferTest +++java.nio.Buffer.ShortBufferTest +++java.nio.Buffer.FloatBufferTest +++java.nio.Buffer.LongBufferTest +++java.nio.Buffer.ByteBufferTest +++java.nio.Buffer.DoubleBufferTest +++java.nio.Buffer.CharBufferTest +++java.nio.LongBuffer.compact +++java.nio.ShortBuffer.compact +++java.nio.IntBuffer.compareTo +++java.nio.IntBuffer.compact +++java.nio.channels.Channels.ChannelsTest +++java.nio.channels.Selector.testEmptySelect +++java.nio.channels.FileChannel.copyIO +++java.nio.channels.FileChannel.multibufferIO +++java.nio.channels.FileChannel.truncate +++java.nio.channels.FileChannel.map +++java.nio.channels.FileChannel.offsetSingleBuffer +++java.nio.channels.FileChannel.singlebufferIO +++java.nio.channels.FileChannel.multidirectbufferIO +++java.nio.channels.FileChannel.offsetSingleDirectBuffer +++java.nio.DoubleBuffer.compareTo +++java.nio.DoubleBuffer.compact +++java.nio.ByteBuffer.direct +++java.nio.ByteBuffer.compact +++java.nio.ByteBuffer.TestAllocateDirect +++java.nio.ByteBuffer.GetPut +++java.nio.ByteBuffer.putDouble +++java.nio.ByteBuffer.Order +++java.nio.ByteBuffer.Allocating +++java.nio.CharBuffer.compact +++java.nio.FloatBuffer.compareTo +++java.nio.FloatBuffer.compact +++java.nio.charset.Charset.UTF8Charset +++java.nio.charset.Charset.utf16 +++java.nio.charset.Charset.canEncode +++java.nio.charset.Charset.forName diff --cc debian/nss.cfg index 000000000,000000000,000000000..3535a4001 new file mode 100644 --- /dev/null +++ b/debian/nss.cfg @@@@ -1,0 -1,0 -1,0 +1,4 @@@@ +++name = NSS +++nssDbMode = noDb +++attributes = compatibility +++handleStartupErrors = ignoreMultipleInitialisation diff --cc debian/patches/Don-t-optimize-fdlibm-fork-for-Zero-on-linux-sparc-Z.patch index 000000000,000000000,000000000..ef728ee5b new file mode 100644 --- /dev/null +++ b/debian/patches/Don-t-optimize-fdlibm-fork-for-Zero-on-linux-sparc-Z.patch @@@@ -1,0 -1,0 -1,0 +1,27 @@@@ +++From 7ce2609d6ff5299f2ed3ff6850a3cab4a16125f8 Mon Sep 17 00:00:00 2001 +++From: John Paul Adrian Glaubitz +++Date: Fri, 21 Dec 2018 15:18:17 +0300 +++Subject: [PATCH] Don't optimize fdlibm-fork for Zero on linux-sparc (Zero) +++ +++--- +++ make/hotspot/lib/JvmOverrideFiles.gmk | 9 +++++++++ +++ 1 file changed, 9 insertions(+) +++ +++--- a/make/hotspot/lib/JvmOverrideFiles.gmk ++++++ b/make/hotspot/lib/JvmOverrideFiles.gmk +++@@ -45,6 +45,15 @@ +++ # by using -ffp-contract=off on GCC/Clang platforms. +++ ifneq ($(FDLIBM_CFLAGS), ) +++ LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NORM) ++++ # Don't optimize fdlibm-fork for Zero on Linux sparc ++++ # See JDK-XXXX ++++ ifeq ($(call check-jvm-feature, zero), true) ++++ ifeq ($(OPENJDK_TARGET_OS), linux) ++++ ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) ++++ LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE) ++++ endif ++++ endif ++++ endif +++ endif +++ +++ ifeq ($(call isTargetOs, linux), true) diff --cc debian/patches/accessible-toolkit.diff index 000000000,000000000,000000000..b337a9c13 new file mode 100644 --- /dev/null +++ b/debian/patches/accessible-toolkit.diff @@@@ -1,0 -1,0 -1,0 +1,15 @@@@ +++--- a/jdk/src/share/classes/java/awt/Toolkit.java ++++++ b/jdk/src/share/classes/java/awt/Toolkit.java +++@@ -894,7 +894,11 @@ +++ return null; +++ } +++ }); +++- loadAssistiveTechnologies(); ++++ try { ++++ loadAssistiveTechnologies(); ++++ } catch ( AWTError error) { ++++ // ignore silently ++++ } +++ } finally { +++ // Make sure to always re-enable the JIT. +++ java.lang.Compiler.enable(); diff --cc debian/patches/adlc-parser.diff index 000000000,000000000,000000000..e10b422c2 new file mode 100644 --- /dev/null +++ b/debian/patches/adlc-parser.diff @@@@ -1,0 -1,0 -1,0 +1,22 @@@@ +++# DP: fixes an uninitialized memory issue in adlc +++--- a/src/hotspot/share/adlc/formsopt.cpp ++++++ b/src/hotspot/share/adlc/formsopt.cpp +++@@ -436,6 +436,10 @@ +++ //==============================Frame Handling================================= +++ //------------------------------FrameForm-------------------------------------- +++ FrameForm::FrameForm() { ++++ _sync_stack_slots = nullptr; ++++ _inline_cache_reg = nullptr; ++++ _interpreter_frame_pointer_reg = nullptr; ++++ _cisc_spilling_operand_name = nullptr; +++ _frame_pointer = nullptr; +++ _c_frame_pointer = nullptr; +++ _alignment = nullptr; +++@@ -444,7 +448,6 @@ +++ _varargs_C_out_slots_killed = nullptr; +++ _return_value = nullptr; +++ _c_return_value = nullptr; +++- _interpreter_frame_pointer_reg = nullptr; +++ } +++ +++ FrameForm::~FrameForm() { diff --cc debian/patches/arch-add-ports.diff index 000000000,000000000,000000000..da178abb1 new file mode 100644 --- /dev/null +++ b/debian/patches/arch-add-ports.diff @@@@ -1,0 -1,0 -1,0 +1,133 @@@@ +++--- a/src/java.base/share/classes/jdk/internal/util/Architecture.java ++++++ b/src/java.base/share/classes/jdk/internal/util/Architecture.java +++@@ -46,6 +46,13 @@ +++ LOONGARCH64(64, ByteOrder.LITTLE_ENDIAN), +++ MIPSEL(32, ByteOrder.LITTLE_ENDIAN), +++ MIPS64EL(64, ByteOrder.LITTLE_ENDIAN), ++++ ALPHA(64, ByteOrder.LITTLE_ENDIAN), ++++ ARC(32, ByteOrder.LITTLE_ENDIAN), ++++ HPPA(32, ByteOrder.BIG_ENDIAN), ++++ IA64(64, ByteOrder.LITTLE_ENDIAN), ++++ M68K(32, ByteOrder.BIG_ENDIAN), ++++ SH(32, ByteOrder.LITTLE_ENDIAN), ++++ X32(32, ByteOrder.LITTLE_ENDIAN), +++ OTHER(is64bit() ? 64 : 32, ByteOrder.nativeOrder()), +++ PPC(32, ByteOrder.BIG_ENDIAN), +++ PPC64(64, ByteOrder.BIG_ENDIAN), +++@@ -181,6 +188,69 @@ +++ } +++ +++ /** ++++ * {@return {@code true} if the current architecture is ALPHA} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isALPHA() { ++++ return PlatformProps.TARGET_ARCH_IS_ALPHA; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is ARC} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isARC() { ++++ return PlatformProps.TARGET_ARCH_IS_ARC; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is HPPA} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isHPPA() { ++++ return PlatformProps.TARGET_ARCH_IS_HPPA; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is IA64} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isIA64() { ++++ return PlatformProps.TARGET_ARCH_IS_IA64; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is X32} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isX32() { ++++ return PlatformProps.TARGET_ARCH_IS_X32; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is SH} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isSH() { ++++ return PlatformProps.TARGET_ARCH_IS_SH; ++++ } ++++ ++++ /** ++++ * {@return {@code true} if the current architecture is M68K} ++++ * Use {@link #isLittleEndian()} to determine big or little endian. ++++ */ ++++ @ForceInline ++++ public static boolean isM68K() { ++++ return PlatformProps.TARGET_ARCH_IS_M68K; ++++ } ++++ ++++ /** +++ * {@return {@code true} if the current architecture is ARM} +++ */ +++ @ForceInline +++--- a/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template ++++++ b/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template +++@@ -65,5 +65,12 @@ +++ static final boolean TARGET_ARCH_IS_SPARCV9 = "@@OPENJDK_TARGET_CPU@@" == "sparcv9"; +++ static final boolean TARGET_ARCH_IS_X86 = "@@OPENJDK_TARGET_CPU@@" == "x86"; +++ static final boolean TARGET_ARCH_IS_X64 = "@@OPENJDK_TARGET_CPU@@" == "x64"; ++++ static final boolean TARGET_ARCH_IS_ALPHA = "@@OPENJDK_TARGET_CPU@@" == "alpha"; ++++ static final boolean TARGET_ARCH_IS_ARC = "@@OPENJDK_TARGET_CPU@@" == "arc"; ++++ static final boolean TARGET_ARCH_IS_HPPA = "@@OPENJDK_TARGET_CPU@@" == "hppa"; ++++ static final boolean TARGET_ARCH_IS_IA64 = "@@OPENJDK_TARGET_CPU@@" == "ia64"; ++++ static final boolean TARGET_ARCH_IS_M68K = "@@OPENJDK_TARGET_CPU@@" == "m68k"; ++++ static final boolean TARGET_ARCH_IS_SH = "@@OPENJDK_TARGET_CPU@@" == "sh"; ++++ static final boolean TARGET_ARCH_IS_X32 = "@@OPENJDK_TARGET_CPU@@" == "x32"; +++ +++ } +++--- a/test/jdk/jdk/internal/util/ArchTest.java ++++++ b/test/jdk/jdk/internal/util/ArchTest.java +++@@ -41,6 +41,13 @@ +++ import static jdk.internal.util.Architecture.SPARCV9; +++ import static jdk.internal.util.Architecture.X64; +++ import static jdk.internal.util.Architecture.X86; ++++import static jdk.internal.util.Architecture.ALPHA; ++++import static jdk.internal.util.Architecture.ARC; ++++import static jdk.internal.util.Architecture.HPPA; ++++import static jdk.internal.util.Architecture.IA64; ++++import static jdk.internal.util.Architecture.SH; ++++import static jdk.internal.util.Architecture.X32; ++++import static jdk.internal.util.Architecture.M68K; +++ +++ import org.junit.jupiter.api.Test; +++ import org.junit.jupiter.params.ParameterizedTest; +++@@ -91,7 +98,14 @@ +++ Arguments.of("sparcv9", SPARCV9, 64, ByteOrder.BIG_ENDIAN, Architecture.isSPARCV9()), +++ Arguments.of("x64", X64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isX64()), +++ Arguments.of("x86", X86, 32, ByteOrder.LITTLE_ENDIAN, Architecture.isX86()), +++- Arguments.of("x86_64", X64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isX64()) ++++ Arguments.of("x86_64", X64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isX64()), ++++ Arguments.of("alpha", ALPHA, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isALPHA()), ++++ Arguments.of("arc", ARC, 32, ByteOrder.LITTLE_ENDIAN, Architecture.isARC()), ++++ Arguments.of("hppa", HPPA, 32, ByteOrder.BIG_ENDIAN, Architecture.isHPPA()), ++++ Arguments.of("ia64", IA64, 64, ByteOrder.LITTLE_ENDIAN, Architecture.isIA64()), ++++ Arguments.of("m68k", M68K, 32, ByteOrder.BIG_ENDIAN, Architecture.isM68K()), ++++ Arguments.of("sh", SH, 32, ByteOrder.LITTLE_ENDIAN, Architecture.isSH()), ++++ Arguments.of("x32", X32, 32, ByteOrder.LITTLE_ENDIAN, Architecture.isX32()) +++ ); +++ } +++ diff --cc debian/patches/atk-wrapper-security.diff index 000000000,000000000,000000000..411500908 new file mode 100644 --- /dev/null +++ b/debian/patches/atk-wrapper-security.diff @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++--- a/src/java.base/share/conf/security/java.security ++++++ b/src/java.base/share/conf/security/java.security +++@@ -313,6 +313,7 @@ +++ # +++ package.access=sun.misc.,\ +++ sun.reflect.,\ ++++ org.GNOME.Accessibility.,\ +++ +++ # +++ # List of comma-separated packages that start with or equal this string diff --cc debian/patches/compile-preview.diff index 000000000,000000000,000000000..0e34efc6c new file mode 100644 --- /dev/null +++ b/debian/patches/compile-preview.diff @@@@ -1,0 -1,0 -1,0 +1,28 @@@@ +++--- a/make/CompileInterimLangtools.gmk ++++++ b/make/CompileInterimLangtools.gmk +++@@ -80,6 +80,16 @@ +++ +++ TARGETS += $(COPY_PREVIEW_FEATURES) +++ ++++$(eval $(call SetupJavaCompilation, COMPILE_PREVIEW_FEATURES, \ ++++ COMPILER := bootjdk, \ ++++ TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ ++++ EXTRA_FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java \ ++++ $(TOPDIR)/src/java.base/share/classes/jdk/internal/javac/NoPreview.java, \ ++++ BIN := $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim/jdk/internal/javac/, \ ++++)) ++++ ++++TARGETS += $(COMPILE_PREVIEW_FEATURES) ++++ +++ ################################################################################ +++ # Setup the rules to build interim langtools, which is compiled by the boot +++ # javac and can be run on the boot jdk. This will be used to compile the rest of +++@@ -118,7 +128,7 @@ +++ $1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \ +++ $$(INTERIM_LANGTOOLS_BASE_MODULES), $$(call FindTransitiveDepsForModule, $1))) +++ +++- $$(BUILD_$1.interim): $$(foreach d, $$($1_DEPS_INTERIM), $$(BUILD_$$d)) $(COPY_PREVIEW_FEATURES) ++++ $$(BUILD_$1.interim): $$(foreach d, $$($1_DEPS_INTERIM), $$(BUILD_$$d)) $(COPY_PREVIEW_FEATURES) $(COMPILE_PREVIEW_FEATURES) +++ +++ TARGETS += $$(BUILD_$1.interim) +++ endef diff --cc debian/patches/default-jvm-cfg.diff index 000000000,000000000,000000000..bda403d70 new file mode 100644 --- /dev/null +++ b/debian/patches/default-jvm-cfg.diff @@@@ -1,0 -1,0 -1,0 +1,23 @@@@ +++--- a/src/java.base/share/native/libjli/java.c ++++++ b/src/java.base/share/native/libjli/java.c +++@@ -2047,7 +2047,7 @@ +++ ReadKnownVMs(const char *jvmCfgName, jboolean speculative) +++ { +++ FILE *jvmCfg; +++- char line[MAXPATHLEN+20]; ++++ char line[MAXPATHLEN+30]; +++ int cnt = 0; +++ int lineno = 0; +++ jlong start = 0, end = 0; +++@@ -2061,6 +2061,11 @@ +++ +++ jvmCfg = fopen(jvmCfgName, "r"); +++ if (jvmCfg == NULL) { ++++ char cfgName[strlen(jvmCfgName)+10]; ++++ sprintf(cfgName, "%s-default", jvmCfgName); ++++ jvmCfg = fopen(cfgName, "r"); ++++ } ++++ if (jvmCfg == NULL) { +++ if (!speculative) { +++ JLI_ReportErrorMessage(CFG_ERROR6, jvmCfgName); +++ exit(1); diff --cc debian/patches/dnd-files.diff index 000000000,000000000,000000000..0e6b09beb new file mode 100644 --- /dev/null +++ b/debian/patches/dnd-files.diff @@@@ -1,0 -1,0 -1,0 +1,20 @@@@ +++--- a/src/java.desktop/unix/classes/sun/awt/X11/XDataTransferer.java ++++++ b/src/java.desktop/unix/classes/sun/awt/X11/XDataTransferer.java +++@@ -273,14 +273,14 @@ +++ BufferedReader reader = new BufferedReader(isr)) { +++ String line; +++ ArrayList uriList = new ArrayList<>(); +++- URI uri; +++ while ((line = reader.readLine()) != null) { +++ try { +++- uri = new URI(line); ++++ if (!"\0".equals(line)) { ++++ uriList.add(new URI(line)); ++++ } +++ } catch (URISyntaxException uriSyntaxException) { +++ throw new IOException(uriSyntaxException); +++ } +++- uriList.add(uri); +++ } +++ return uriList.toArray(new URI[uriList.size()]); +++ } diff --cc debian/patches/enumipv6-fix.diff index 000000000,000000000,000000000..82f73c5c6 new file mode 100644 --- /dev/null +++ b/debian/patches/enumipv6-fix.diff @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++--- openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c~ 2012-02-15 09:26:50.000000000 +0100 ++++++ openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c 2012-02-26 14:13:22.602107361 +0100 +++@@ -1105,7 +1105,7 @@ +++ uint8_t ipv6addr[16]; +++ +++ if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) { +++- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", ++++ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %x %x %x %x %20s\n", +++ addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7], +++ &if_idx, &plen, &scope, &dad_status, devname) != EOF) { +++ diff --cc debian/patches/generated-headers.patch index 000000000,000000000,000000000..c2d2753b2 new file mode 100644 --- /dev/null +++ b/debian/patches/generated-headers.patch @@@@ -1,0 -1,0 -1,0 +1,20 @@@@ +++--- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk ++++++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk +++@@ -299,7 +299,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB +++ INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \ +++ OPTIMIZATION := HIGHEST, \ +++ CFLAGS := $(CFLAGS_JDKLIB) \ +++- $(LCMS_CFLAGS), \ ++++ $(LCMS_CFLAGS) -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ +++ CFLAGS_windows := -DCMS_IS_WINDOWS_, \ +++ EXTRA_HEADER_DIRS := \ +++ common/awt/debug \ +++@@ -345,7 +345,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIB +++ NAME := javajpeg, \ +++ INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \ +++ OPTIMIZATION := HIGHEST, \ +++- CFLAGS := $(CFLAGS_JDKLIB), \ ++++ CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ +++ HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \ +++ DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \ +++ DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \ diff --cc debian/patches/hotspot-disable-werror.diff index 000000000,000000000,000000000..0ec858322 new file mode 100644 --- /dev/null +++ b/debian/patches/hotspot-disable-werror.diff @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++--- a/src/hotspot/make/linux/makefiles/gcc.make ++++++ b/src/hotspot/make/linux/makefiles/gcc.make +++@@ -203,7 +203,7 @@ else +++ endif +++ +++ # Compiler warnings are treated as errors +++-WARNINGS_ARE_ERRORS ?= -Werror -Wno-error=format ++++WARNINGS_ARE_ERRORS ?= +++ +++ ifeq ($(USE_CLANG), true) +++ # However we need to clean the code up before we can unrestrictedly enable this option with Clang diff --cc debian/patches/hotspot-mips-align.diff index 000000000,000000000,000000000..0c3c398f9 new file mode 100644 --- /dev/null +++ b/debian/patches/hotspot-mips-align.diff @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++--- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp ++++++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++@@ -431,7 +431,7 @@ +++ ThreadStateTransition::transition_from_java(thread, _thread_in_native); +++ +++ // Make the call +++- intptr_t result[4 - LogBytesPerWord]; ++++ intptr_t result[4 - LogBytesPerWord] __attribute__((__aligned__(__alignof__(double)))); +++ ffi_call(handler->cif(), (void (*)()) function, result, arguments); +++ +++ // Change the thread state back to _thread_in_Java and ensure it diff --cc debian/patches/hotspot-set-compiler.diff index 000000000,000000000,000000000..181b71c62 new file mode 100644 --- /dev/null +++ b/debian/patches/hotspot-set-compiler.diff @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++--- a/src/hotspot/make/linux/makefiles/gcc.make ++++++ b/src/hotspot/make/linux/makefiles/gcc.make +++@@ -39,7 +39,7 @@ +++ ifeq ($(USE_CLANG), true) +++ CXX = clang++ +++ CC = clang +++- else ++++ else ifeq ($(CXX),) +++ CXX = g++ +++ CC = gcc +++ endif diff --cc debian/patches/hotspot-warn-no-errformat.diff index 000000000,000000000,000000000..0628b8935 new file mode 100644 --- /dev/null +++ b/debian/patches/hotspot-warn-no-errformat.diff @@@@ -1,0 -1,0 -1,0 +1,22 @@@@ +++--- a/src/hotspot/make/solaris/makefiles/gcc.make ++++++ b/src/hotspot/make/solaris/makefiles/gcc.make +++@@ -117,7 +117,7 @@ endif +++ +++ +++ # Compiler warnings are treated as errors +++-WARNINGS_ARE_ERRORS ?= -Werror ++++WARNINGS_ARE_ERRORS ?= -Werror -Wno-error=format +++ +++ # Enable these warnings. See 'info gcc' about details on these options +++ WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2 +++--- a/src/hotspot/make/linux/makefiles/gcc.make ++++++ b/src/hotspot/make/linux/makefiles/gcc.make +++@@ -203,7 +203,7 @@ else +++ endif +++ +++ # Compiler warnings are treated as errors +++-WARNINGS_ARE_ERRORS ?= -Werror ++++WARNINGS_ARE_ERRORS ?= -Werror -Wno-error=format +++ +++ ifeq ($(USE_CLANG), true) +++ # However we need to clean the code up before we can unrestrictedly enable this option with Clang diff --cc debian/patches/hsdis-fpic.patch index 000000000,000000000,000000000..6d533f4f9 new file mode 100644 --- /dev/null +++ b/debian/patches/hsdis-fpic.patch @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++Description: Link with -fPIC version of binutils +++ Link against -fPIC binutils library to avoid hard dependency on binutils. +++Author: Vladimir Petko +++Forwarded: not-needed +++Last-Update: 2024-03-19 +++--- a/make/autoconf/lib-hsdis.m4 ++++++ b/make/autoconf/lib-hsdis.m4 +++@@ -244,8 +244,8 @@ +++ disasm_header="" +++ +++ if test "x$BINUTILS_INSTALL_DIR" = xsystem; then +++- AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ]) +++- AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ]) ++++ AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd_pic -lsframe -lzstd -liberty" ], [ binutils_system_error="libbfd not found" ]) ++++ AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes_pic" ], [ binutils_system_error="libopcodes not found" ]) +++ AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) +++ # libiberty is not required on Ubuntu +++ AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ]) diff --cc debian/patches/icc_loading_with_symlink.diff index 000000000,000000000,000000000..23a160eab new file mode 100644 --- /dev/null +++ b/debian/patches/icc_loading_with_symlink.diff @@@@ -1,0 -1,0 -1,0 +1,12 @@@@ +++--- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java ++++++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java +++@@ -1316,9 +1316,6 @@ +++ dir = st.nextToken(); +++ fullPath = dir + File.separatorChar + fileName; +++ f = new File(fullPath); +++- if (!isChildOf(f, dir)) { +++- f = null; +++- } +++ } +++ } +++ diff --cc debian/patches/icedtea-override-redirect-compiz.diff index 000000000,000000000,000000000..5db98aa07 new file mode 100644 --- /dev/null +++ b/debian/patches/icedtea-override-redirect-compiz.diff @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++--- a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java ++++++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++@@ -1259,6 +1259,7 @@ +++ +++ boolean isOverrideRedirect() { +++ return XWM.getWMID() == XWM.OPENLOOK_WM || ++++ XWM.getWMID() == XWM.COMPIZ_WM || +++ Window.Type.POPUP.equals(getWindowType()); +++ } +++ diff --cc debian/patches/include-all-srcs.diff index 000000000,000000000,000000000..f73bfafb7 new file mode 100644 --- /dev/null +++ b/debian/patches/include-all-srcs.diff @@@@ -1,0 -1,0 -1,0 +1,54 @@@@ +++--- a/src/jdk/make/CreateJars.gmk ++++++ b/src/jdk/make/CreateJars.gmk +++@@ -569,38 +569,12 @@ +++ ########################################################################################## +++ +++ SRC_ZIP_INCLUDES = \ +++- com/sun/corba \ +++- com/sun/image/codec/jpeg \ +++- com/sun/imageio \ +++- com/sun/java_cup \ +++- com/sun/javadoc \ +++- com/sun/java/swing \ +++- com/sun/jmx \ +++- com/sun/naming \ +++- com/sun/org/apache \ +++- com/sun/security/auth \ +++- com/sun/security/jgss \ +++- com/sun/source \ ++++ com \ +++ java \ +++- javax/accessibility \ +++- javax/annotation \ +++- javax/imageio \ +++- javax/lang \ +++- javax/management \ +++- javax/naming \ +++- javax/print \ +++- javax/rmi \ +++- javax/script \ +++- javax/security \ +++- javax/sound \ +++- javax/sql \ +++- javax/swing \ +++- javax/tools \ +++- javax/xml \ +++- org/ietf \ +++- org/omg \ +++- org/w3c/dom \ +++- org/xml/sax \ ++++ javax \ ++++ jdk \ ++++ org \ ++++ sun \ +++ # +++ +++ SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes +++@@ -632,7 +606,6 @@ +++ $(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \ +++ SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \ +++ INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \ +++- EXCLUDES := javax/swing/beaninfo, \ +++ SUFFIXES := .java .c .h, \ +++ ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \ +++ EXTRA_DEPS := $(LAUNCHER_ZIP_SRC))) diff --cc debian/patches/java-access-bridge-security.diff index 000000000,000000000,000000000..2e5d0e1ca new file mode 100644 --- /dev/null +++ b/debian/patches/java-access-bridge-security.diff @@@@ -1,0 -1,0 -1,0 +1,15 @@@@ +++# patch only used for builds with java-access-bridge support +++ +++--- openjdk/jdk/src/share/lib/security/java.security-linux ++++++ openjdk/jdk/src/share/lib/security/java.security-linux +++@@ -149,7 +149,9 @@ +++ com.sun.org.apache.xml.internal.security.,\ +++ com.sun.org.glassfish.,\ +++ org.jcp.xml.dsig.internal.,\ +++- oracle.jrockit.jfr. ++++ oracle.jrockit.jfr.,\ ++++ org.GNOME.Accessibility.,\ ++++ org.GNOME.Bonobo. +++ # +++ # List of comma-separated packages that start with or equal this string +++ # will cause a security exception to be thrown when diff --cc debian/patches/jdk-8295795.patch index 000000000,000000000,000000000..30cab3852 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8295795.patch @@@@ -1,0 -1,0 -1,0 +1,226 @@@@ +++Description: 8295795: hsdis does not build with binutils 2.39+ +++ binutils 2.39 changed the signature of init_disassemble_info, +++ breaking the build. +++ See https://lore.kernel.org/bpf/20220622231624.t63bkmkzphqvh3kx@alap3.anarazel.de/T/ +++Origin: upstream, https://github.com/openjdk/jdk/commit/c2efd7741202a5e3c209de62b8b5e6bd8ae7611a +++Author: Robbin Ehn +++Bug: https://bugs.openjdk.org/browse/JDK-8295795 +++Last-Update: 2024-03-12 +++ +++diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4 +++index 974d0e8b793..987658bc411 100644 +++--- a/make/autoconf/lib-hsdis.m4 ++++++ b/make/autoconf/lib-hsdis.m4 +++@@ -134,7 +134,8 @@ AC_DEFUN([LIB_BUILD_BINUTILS], +++ BINUTILS_SRC="$with_binutils_src" +++ UTIL_FIXUP_PATH(BINUTILS_SRC) +++ +++- BINUTILS_DIR="$CONFIGURESUPPORT_OUTPUTDIR/binutils" ++++ BINUTILS_BUILD_DIR="$CONFIGURESUPPORT_OUTPUTDIR/binutils" ++++ BINUTILS_INSTALL_DIR="$CONFIGURESUPPORT_OUTPUTDIR/binutils-install" +++ +++ if ! test -d $BINUTILS_SRC; then +++ AC_MSG_ERROR([--with-binutils-src is not pointing to a directory]) +++@@ -143,15 +144,15 @@ AC_DEFUN([LIB_BUILD_BINUTILS], +++ AC_MSG_ERROR([--with-binutils-src does not look like a binutils source directory]) +++ fi +++ +++- if ! test -d $BINUTILS_DIR; then +++- $MKDIR -p $BINUTILS_DIR ++++ if ! test -d $BINUTILS_BUILD_DIR; then ++++ $MKDIR -p $BINUTILS_BUILD_DIR +++ fi +++ +++- if test -e $BINUTILS_DIR/bfd/libbfd.a && \ +++- test -e $BINUTILS_DIR/opcodes/libopcodes.a && \ +++- test -e $BINUTILS_DIR/libiberty/libiberty.a && \ +++- test -e $BINUTILS_DIR/zlib/libz.a; then +++- AC_MSG_NOTICE([Found binutils binaries in binutils source directory -- not building]) ++++ # We don't know the version, not checking for libsframe.a ++++ if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \ ++++ test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \ ++++ test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then ++++ AC_MSG_NOTICE([Found binutils binaries in binutils install directory -- not building]) +++ else +++ # On Windows, we cannot build with the normal Microsoft CL, but must instead use +++ # a separate mingw toolchain. +++@@ -190,20 +191,26 @@ AC_DEFUN([LIB_BUILD_BINUTILS], +++ binutils_cflags="$binutils_cflags $MACHINE_FLAG $JVM_PICFLAG $C_O_FLAG_NORM" +++ +++ AC_MSG_NOTICE([Running binutils configure]) +++- AC_MSG_NOTICE([configure command line: cd $BINUTILS_DIR && $BINUTILS_SRC/configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target]) ++++ AC_MSG_NOTICE([configure command line: cd $BINUTILS_BUILD_DIR && $BINUTILS_SRC/configure --disable-werror --prefix=$BINUTILS_INSTALL_DIR --enable-install-libiberty --with-system-zlib --without-zstd --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target]) +++ saved_dir=`pwd` +++- cd "$BINUTILS_DIR" +++- $BINUTILS_SRC/configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target +++- if test $? -ne 0 || ! test -e $BINUTILS_DIR/Makefile; then ++++ cd "$BINUTILS_BUILD_DIR" ++++ $BINUTILS_SRC/configure --disable-werror --prefix=$BINUTILS_INSTALL_DIR --enable-install-libiberty --with-system-zlib --without-zstd --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target ++++ if test $? -ne 0 || ! test -e $BINUTILS_BUILD_DIR/Makefile; then +++ AC_MSG_NOTICE([Automatic building of binutils failed on configure. Try building it manually]) +++ AC_MSG_ERROR([Cannot continue]) +++ fi +++ AC_MSG_NOTICE([Running binutils make]) +++- $MAKE all-opcodes ++++ $MAKE all-opcodes all-libiberty +++ if test $? -ne 0; then +++ AC_MSG_NOTICE([Automatic building of binutils failed on make. Try building it manually]) +++ AC_MSG_ERROR([Cannot continue]) +++ fi ++++ AC_MSG_NOTICE([Running binutils make install]) ++++ $MAKE install-opcodes install-libiberty ++++ if test $? -ne 0; then ++++ AC_MSG_NOTICE([Automatic building, install step, of binutils failed on make. Try building it manually]) ++++ AC_MSG_ERROR([Cannot continue]) ++++ fi +++ cd $saved_dir +++ AC_MSG_NOTICE([Building of binutils done]) +++ fi +++@@ -223,41 +230,57 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS], +++ +++ # We need the binutils static libs and includes. +++ if test "x$with_binutils_src" != x; then +++- # Try building the source first. If it succeeds, it sets $BINUTILS_DIR. ++++ # Try building the source first. If it succeeds, it sets $BINUTILS_INSTALL_DIR. +++ LIB_BUILD_BINUTILS +++ fi +++ +++ if test "x$with_binutils" != x; then +++- BINUTILS_DIR="$with_binutils" ++++ BINUTILS_INSTALL_DIR="$with_binutils" +++ fi +++ +++ binutils_system_error="" ++++ HSDIS_LDFLAGS="" +++ HSDIS_LIBS="" +++- if test "x$BINUTILS_DIR" = xsystem; then ++++ disasm_header="" ++++ ++++ if test "x$BINUTILS_INSTALL_DIR" = xsystem; then +++ AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ]) +++ AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ]) ++++ AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) +++ # libiberty is not required on Ubuntu +++ AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ]) +++- AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) ++++ AC_CHECK_LIB(sframe, frame, [ HSDIS_LIBS="$HSDIS_LIBS -lsframe" ], ) +++ HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB" +++- elif test "x$BINUTILS_DIR" != x; then +++- if test -e $BINUTILS_DIR/bfd/libbfd.a && \ +++- test -e $BINUTILS_DIR/opcodes/libopcodes.a && \ +++- test -e $BINUTILS_DIR/libiberty/libiberty.a && \ +++- test -e $BINUTILS_DIR/zlib/libz.a; then +++- HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB" +++- if test -n "$BINUTILS_SRC"; then +++- HSDIS_CFLAGS="$HSDIS_CFLAGS -I$BINUTILS_SRC/include -I$BINUTILS_DIR/bfd" +++- else +++- HSDIS_CFLAGS="$HSDIS_CFLAGS -I$BINUTILS_DIR/include -I$BINUTILS_DIR/bfd" ++++ elif test "x$BINUTILS_INSTALL_DIR" != x; then ++++ disasm_header="\"$BINUTILS_INSTALL_DIR/include/dis-asm.h\"" ++++ if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \ ++++ test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \ ++++ test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then ++++ HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB -I$BINUTILS_INSTALL_DIR/include" ++++ HSDIS_LIBS="$BINUTILS_INSTALL_DIR/lib/libbfd.a $BINUTILS_INSTALL_DIR/lib/libopcodes.a $BINUTILS_INSTALL_DIR/lib/libiberty.a" ++++ # If we have libsframe add it. ++++ if test -e $BINUTILS_INSTALL_DIR/lib/libsframe.a; then ++++ HSDIS_LIBS="$HSDIS_LIBS $BINUTILS_INSTALL_DIR/lib/libsframe.a" +++ fi +++- HSDIS_LDFLAGS="" +++- HSDIS_LIBS="$BINUTILS_DIR/bfd/libbfd.a $BINUTILS_DIR/opcodes/libopcodes.a $BINUTILS_DIR/libiberty/libiberty.a $BINUTILS_DIR/zlib/libz.a" ++++ AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], AC_MSG_ERROR([libz not found])) ++++ else ++++ AC_MSG_ERROR(["$BINUTILS_INSTALL_DIR/libs/ must contain libbfd.a, libopcodes.a, libiberty.a"]) +++ fi +++ fi +++ ++++ AC_MSG_CHECKING([Checking binutils API]) ++++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include $disasm_header],[[void foo() {init_disassemble_info(0, 0, 0, 0);}]])], ++++ [ ++++ AC_MSG_RESULT([New API]) ++++ HSDIS_CFLAGS="$HSDIS_CFLAGS -DBINUTILS_NEW_API" ++++ ], ++++ [ ++++ AC_MSG_RESULT([Old API]) ++++ ] ++++ ) ++++ +++ AC_MSG_CHECKING([for binutils to use with hsdis]) +++- case "x$BINUTILS_DIR" in ++++ case "x$BINUTILS_INSTALL_DIR" in +++ xsystem) +++ if test "x$OPENJDK_TARGET_OS" != xlinux; then +++ AC_MSG_RESULT([invalid]) +++@@ -280,10 +303,10 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS], +++ ;; +++ *) +++ if test "x$HSDIS_LIBS" != x; then +++- AC_MSG_RESULT([$BINUTILS_DIR]) ++++ AC_MSG_RESULT([$BINUTILS_INSTALL_DIR]) +++ else +++ AC_MSG_RESULT([invalid]) +++- AC_MSG_ERROR([$BINUTILS_DIR does not contain a proper binutils installation]) ++++ AC_MSG_ERROR([$BINUTILS_INSTALL_DIR does not contain a proper binutils installation]) +++ fi +++ ;; +++ esac +++diff --git a/src/utils/hsdis/binutils/hsdis-binutils.c b/src/utils/hsdis/binutils/hsdis-binutils.c +++index 28e374e05fc..86d49964f90 100644 +++--- a/src/utils/hsdis/binutils/hsdis-binutils.c ++++++ b/src/utils/hsdis/binutils/hsdis-binutils.c +++@@ -49,14 +49,16 @@ +++ HotSpot PrintAssembly option. +++ */ +++ +++-#ifndef SYSTEM_BINUTILS +++-#include /* required by bfd.h */ +++-#endif +++- +++ #include +++ #include +++ #include +++ ++++#ifndef SYSTEM_BINUTILS ++++/* defines for bfd.h */ ++++#define PACKAGE "hsdis" ++++#define PACKAGE_VERSION 1 ++++#endif ++++ +++ #include +++ #include +++ +++@@ -555,12 +557,34 @@ static void parse_fake_insn(disassembler_ftype dfn, +++ dinfo->fprintf_func = fprintf_func; +++ } +++ ++++static fprintf_ftype target_fprintf_func = NULL; ++++ ++++#ifdef BINUTILS_NEW_API ++++static int wrapper_fprintf_styled_ftype(void *v, enum disassembler_style style_unused, const char* fmt, ...) { ++++ char buffer[1024] = {}; ++++ va_list args; ++++ int r; ++++ va_start(args, fmt); ++++ r = vsnprintf(buffer, sizeof(buffer), fmt, args); ++++ va_end(args); ++++ if (target_fprintf_func != NULL) { ++++ return target_fprintf_func(v, "%s", buffer); ++++ } ++++ return r; ++++} ++++#endif ++++ +++ static void init_disassemble_info_from_bfd(struct disassemble_info* dinfo, +++ void *stream, +++ fprintf_ftype fprintf_func, +++ bfd* abfd, +++ char* disassembler_options) { ++++ target_fprintf_func = fprintf_func; ++++#ifdef BINUTILS_NEW_API ++++ init_disassemble_info(dinfo, stream, fprintf_func, wrapper_fprintf_styled_ftype); ++++#else +++ init_disassemble_info(dinfo, stream, fprintf_func); ++++#endif +++ +++ dinfo->flavour = bfd_get_flavour(abfd); +++ dinfo->arch = bfd_get_arch(abfd); diff --cc debian/patches/jdk-8307977-proposed.patch index 000000000,000000000,000000000..c6ab51df8 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8307977-proposed.patch @@@@ -1,0 -1,0 -1,0 +1,81 @@@@ +++Description: attach in linux hangs due to permission denied accessing /proc/pid/root +++ The attach API uses /proc/pid/root in order to support containers. +++ Dereferencing this symlink is governed by ptrace access mode PTRACE_MODE_READ_FSCREDS +++ which may not succeed when running as the user running the JRE. +++ This breaks running jcmd and jmap as the same user the JVM is running as. +++ Use tmpdir when pid matches ns_pid. +++Author: Sebastian Lövdahl +++Bug: https://bugs.openjdk.org/browse/JDK-8307977 +++Bug: https://bugs.openjdk.org/browse/JDK-8226919 +++Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034601 +++Last-Update: 2023-04-18 +++ +++From 36b554e2de46d77898be4d0feae0ee2171b445bc Mon Sep 17 00:00:00 2001 +++From: =?UTF-8?q?Sebastian=20L=C3=B6vdahl?= +++Date: Tue, 18 Apr 2023 12:50:32 +0300 +++Subject: [PATCH] 8226919: Fix dynamic attach in Linux for non-container +++ environments +++ +++--- +++ .../sun/tools/attach/VirtualMachineImpl.java | 37 ++++++++++++------- +++ 1 file changed, 23 insertions(+), 14 deletions(-) +++ +++--- a/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java ++++++ b/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java +++@@ -210,11 +210,8 @@ public class VirtualMachineImpl extends +++ } +++ +++ // Return the socket file for the given process. +++- private File findSocketFile(int pid, int ns_pid) { +++- // A process may not exist in the same mount namespace as the caller. +++- // Instead, attach relative to the target root filesystem as exposed by +++- // procfs regardless of namespaces. +++- String root = "/proc/" + pid + "/root/" + tmpdir; ++++ private File findSocketFile(int pid, int ns_pid) throws IOException { ++++ String root = findTargetProcessTmpDirectory(pid, ns_pid); +++ return new File(root, ".java_pid" + ns_pid); +++ } +++ +++@@ -230,21 +227,33 @@ public class VirtualMachineImpl extends +++ // Do not canonicalize the file path, or we will fail to attach to a VM in a container. +++ f.createNewFile(); +++ } catch (IOException x) { +++- String root; +++- if (pid != ns_pid) { +++- // A process may not exist in the same mount namespace as the caller. +++- // Instead, attach relative to the target root filesystem as exposed by +++- // procfs regardless of namespaces. +++- root = "/proc/" + pid + "/root/" + tmpdir; +++- } else { +++- root = tmpdir; +++- } ++++ String root = findTargetProcessTmpDirectory(pid, ns_pid); +++ f = new File(root, fn); +++ f.createNewFile(); +++ } +++ return f; +++ } +++ ++++ private String findTargetProcessTmpDirectory(int pid, int ns_pid) throws IOException { ++++ String root; ++++ if (pid != ns_pid) { ++++ // A process may not exist in the same mount namespace as the caller. ++++ // Instead, attach relative to the target root filesystem as exposed by ++++ // procfs regardless of namespaces. ++++ String procRootDirectory = "/proc/" + pid + "/root"; ++++ if (!Files.isReadable(Path.of(procRootDirectory))) { ++++ throw new IOException( ++++ String.format("Unable to access root directory %s " + ++++ "of target process %d", procRootDirectory, pid)); ++++ } ++++ ++++ root = procRootDirectory + "/" + tmpdir; ++++ } else { ++++ root = tmpdir; ++++ } ++++ return root; ++++ } ++++ +++ /* +++ * Write/sends the given to the target VM. String is transmitted in +++ * UTF-8 encoding. diff --cc debian/patches/jdk-8312488.patch index 000000000,000000000,000000000..b570177ee new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8312488.patch @@@@ -1,0 -1,0 -1,0 +1,56 @@@@ +++Description: tools/jpackage/share/AppLauncherEnvTest.java fails with dynamically linked libstdc++ +++ The generated image contains libjpackageapplauncheraux.so that +++ contains a destructor function dcon(). It calls already disposed +++ logger, causing a crash. +++Author: Vladimir Petko +++Origin: upstream, https://github.com/openjdk/jdk/commit/78a8a99d990dcc0b77c096bb2ca2c1bb86462e3f +++Bug: https://bugs.openjdk.org/browse/JDK-8312488 +++Reviewed-By: asemenyuk, almatvee +++Last-Update: 2024-07-18 +++--- +++ +++--- a/src/jdk.jpackage/share/native/common/app.cpp ++++++ b/src/jdk.jpackage/share/native/common/app.cpp +++@@ -1,5 +1,5 @@ +++ /* +++- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. ++++ * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +++ * +++ * This code is free software; you can redistribute it and/or modify it +++@@ -35,7 +35,7 @@ +++ namespace { +++ const std::string* theLastErrorMsg = 0; +++ +++-NopLogAppender nopLogAppender; ++++char nopLogAppenderMemory[sizeof(NopLogAppender)] = {}; +++ +++ class StandardLogAppender : public LogAppender { +++ public: +++@@ -46,7 +46,9 @@ +++ << ": " << v.message +++ << std::endl; +++ } +++-} standardLogAppender; ++++}; ++++ ++++char standardLogAppenderMemory[sizeof(StandardLogAppender)] = {}; +++ +++ class LastErrorLogAppender : public LogAppender { +++ public: +++@@ -114,10 +116,13 @@ +++ +++ int launch(const std::nothrow_t&, +++ LauncherFunc func, LogAppender* lastErrorLogAppender) { ++++ // The log appender is set for the lifetime of the application. ++++ // Use in-place new to avoid accessing destroyed instance ++++ // when the shared object destructor logs something. +++ if (isWithLogging()) { +++- Logger::defaultLogger().setAppender(standardLogAppender); ++++ Logger::defaultLogger().setAppender(*new (standardLogAppenderMemory) StandardLogAppender()); +++ } else { +++- Logger::defaultLogger().setAppender(nopLogAppender); ++++ Logger::defaultLogger().setAppender(*new (nopLogAppenderMemory) NopLogAppender()); +++ } +++ +++ LOG_TRACE_FUNCTION(); diff --cc debian/patches/jdk-8318418.patch index 000000000,000000000,000000000..0bcd6e159 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8318418.patch @@@@ -1,0 -1,0 -1,0 +1,47 @@@@ +++Description: 8318418: hsdis build fails with system binutils on Ubuntu +++ Ubuntu does not need libiberty.h include for the build. +++Origin: upstream, https://github.com/openjdk/jdk/commit/3c70f2c1e9fb91cd5d7a66ef1e2a39672230208c +++Author: Daniel Jeliński +++Bug: https://bugs.openjdk.org/browse/JDK-8318418 +++Last-Update: 2024-03-12 +++ +++diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4 +++index 470a0ae8358..974d0e8b793 100644 +++--- a/make/autoconf/lib-hsdis.m4 ++++++ b/make/autoconf/lib-hsdis.m4 +++@@ -1,5 +1,5 @@ +++ # +++-# Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. ++++# Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. +++ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +++ # +++ # This code is free software; you can redistribute it and/or modify it +++@@ -236,7 +236,8 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS], +++ if test "x$BINUTILS_DIR" = xsystem; then +++ AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ]) +++ AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ]) +++- AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ], [ binutils_system_error="libiberty not found" ]) ++++ # libiberty is not required on Ubuntu ++++ AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ]) +++ AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) +++ HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB" +++ elif test "x$BINUTILS_DIR" != x; then +++diff --git a/src/utils/hsdis/binutils/hsdis-binutils.c b/src/utils/hsdis/binutils/hsdis-binutils.c +++index 279ed53ba5d..28e374e05fc 100644 +++--- a/src/utils/hsdis/binutils/hsdis-binutils.c ++++++ b/src/utils/hsdis/binutils/hsdis-binutils.c +++@@ -1,5 +1,5 @@ +++ /* +++- * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. ++++ * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. +++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +++ * +++ * The Universal Permissive License (UPL), Version 1.0 +++@@ -57,7 +57,6 @@ +++ #include +++ #include +++ +++-#include +++ #include +++ #include +++ diff --cc debian/patches/jdk-8329983.patch index 000000000,000000000,000000000..6d446ec48 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8329983.patch @@@@ -1,0 -1,0 -1,0 +1,20 @@@@ +++Description: remove declaration of _Copy_conjoint_bytes +++ JDK-8142362 removed implementation of _Copy_conjoint_bytes +++ but left the symbol declaration in for armhf. +++ This causes link failure against libjvm.so. +++Author: Vladimir Petko +++Bug: https://bugs.openjdk.org/browse/JDK-8329983 +++Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/2058966 +++Last-Update: 2024-04-10 +++ +++--- a/src/hotspot/os_cpu/linux_arm/linux_arm_32.S ++++++ b/src/hotspot/os_cpu/linux_arm/linux_arm_32.S +++@@ -28,8 +28,6 @@ +++ # point or use it in the same manner as does the server +++ # compiler. +++ +++- .globl _Copy_conjoint_bytes +++- .type _Copy_conjoint_bytes, %function +++ .globl _Copy_arrayof_conjoint_bytes +++ .type _Copy_arrayof_conjoint_bytes, %function +++ .globl _Copy_disjoint_words diff --cc debian/patches/jdk-8331541.patch index 000000000,000000000,000000000..a6ea332b0 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8331541.patch @@@@ -1,0 -1,0 -1,0 +1,32 @@@@ +++Description: 8331541: [i386] linking with libjvm.so fails after JDK-8283326 +++ i386 declaration of _SafeFetch32_impl contains an underscore +++ that causes an undefined symbol in libjvm.so. +++ Disable -Wl,--allow-shlib-undefined link flag that allowed the +++ build to succeed. +++Author: Vladimir Petko +++Origin: https://github.com/openjdk/jdk/pull/19048 +++Bug: https://bugs.openjdk.org/browse/JDK-8331541 +++Applied-Upstream: commit:2d622152b07bba0aba8fd5b1e24293e28d6e69f5 +++Last-Update: 2024-05-02 +++ +++--- a/make/autoconf/flags-ldflags.m4 ++++++ b/make/autoconf/flags-ldflags.m4 +++@@ -133,7 +133,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], +++ +++ # Setup LDFLAGS for linking executables +++ if test "x$TOOLCHAIN_TYPE" = xgcc; then +++- EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined" +++ # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous +++ # java heap. +++ if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then +++--- a/src/hotspot/os_cpu/linux_x86/safefetch_linux_x86_32.S ++++++ b/src/hotspot/os_cpu/linux_x86/safefetch_linux_x86_32.S +++@@ -32,7 +32,7 @@ +++ # 8(%esp) : default value +++ # 4(%esp) : crash address +++ # 0(%esp) : return pc +++- .type _SafeFetch32_impl,@function ++++ .type SafeFetch32_impl,@function +++ SafeFetch32_impl: +++ movl 4(%esp),%ecx # load address from stack +++ _SafeFetch32_fault: diff --cc debian/patches/jdk-8334502-proposed.patch index 000000000,000000000,000000000..d38f2054e new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8334502-proposed.patch @@@@ -1,0 -1,0 -1,0 +1,19 @@@@ +++Description: use int instead of time_t to print timezone info +++ printf() call uses %02d format specifier that requires an int parameter. +++Author: Vladimir Petko +++Bug: https://bugs.openjdk.org/browse/JDK-8334502 +++Last-Update: 2024-06-19 +++ +++--- a/src/hotspot/share/runtime/os.cpp ++++++ b/src/hotspot/share/runtime/os.cpp +++@@ -197,8 +197,8 @@ char* os::iso8601_time(jlong millisecond +++ abs_local_to_UTC = -(abs_local_to_UTC); +++ } +++ // Convert time zone offset seconds to hours and minutes. +++- const time_t zone_hours = (abs_local_to_UTC / seconds_per_hour); +++- const time_t zone_min = ++++ const int zone_hours = (abs_local_to_UTC / seconds_per_hour); ++++ const int zone_min = +++ ((abs_local_to_UTC % seconds_per_hour) / seconds_per_minute); +++ +++ // Print an ISO 8601 date and time stamp into the buffer diff --cc debian/patches/jdk-8334895-proposed.patch index 000000000,000000000,000000000..77f7d4d70 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8334895-proposed.patch @@@@ -1,0 -1,0 -1,0 +1,20 @@@@ +++Description: set default compatible cds alignment to auto for arm64 +++ ARM64 requires cds alignment option to be enabled if CDS is enabled. +++ Setting it to true will enable the option even if CDS is disabled +++ causing a configuration error. Setting option to auto allows one to +++ enable it only when CDS is enabled. +++Author: Vladimir Petko +++Bug: https://bugs.openjdk.org/browse/JDK-8334895 +++Last-Update: 2024-06-25 +++ +++--- a/make/autoconf/jdk-options.m4 ++++++ b/make/autoconf/jdk-options.m4 +++@@ -197,7 +197,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS] +++ # three different page sizes: 4K, 64K, and if run on Mac m1 hardware, 16K. +++ COMPATIBLE_CDS_ALIGNMENT_DEFAULT=false +++ if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then +++- COMPATIBLE_CDS_ALIGNMENT_DEFAULT=true ++++ COMPATIBLE_CDS_ALIGNMENT_DEFAULT=auto +++ fi +++ AC_SUBST(COMPATIBLE_CDS_ALIGNMENT_DEFAULT) +++ diff --cc debian/patches/jdk-8336529-proposed.patch index 000000000,000000000,000000000..04b98bc99 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-8336529-proposed.patch @@@@ -1,0 -1,0 -1,0 +1,55 @@@@ +++Description: (fs) UnixFileAttributeViews setTimes() failing on armhf, Ubuntu noble +++ time_t transition in Debian/Ubuntu left 32 bit time_t symbols in glibc. +++ Looking up 'futimens' via dlsym returns 32 bit version of the function. +++ This is causing failure to set last modified time +++ (e.g. instead of year 2017 we get 1976 in the test). +++ Using the function directly correctly calls 64 bit versions. +++ When we lookup functions with time_t arguments through dlsym() +++ calls we should use 64 bit versions. +++Author: Vladimir Petko +++Origin: upstream, https://github.com/openjdk/jdk/pull/20208 +++Bug: https://bugs.openjdk.org/browse/JDK-8336529 +++Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openjdk-23/+bug/2073335 +++Last-Update: 2024-07-17 +++--- +++ +++--- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c ++++++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c +++@@ -280,6 +280,20 @@ +++ } +++ #endif +++ ++++/** ++++ * Lookup time functions symbols, trying 64 bit version first ++++ */ ++++static void* lookup_time_function(const char* symbol64, const char* symbol) { ++++ void* ret = NULL; ++++ if (sizeof(time_t) > 4) { ++++ ret = dlsym(RTLD_DEFAULT, symbol64); ++++ } ++++ if (ret == NULL) { ++++ ret = dlsym(RTLD_DEFAULT, symbol); ++++ } ++++ return ret; ++++} ++++ +++ #if defined(__linux__) +++ static int statx_wrapper(int dirfd, const char *restrict pathname, int flags, +++ unsigned int mask, struct my_statx *restrict statxbuf) { +++@@ -384,10 +398,13 @@ +++ my_unlinkat_func = (unlinkat_func*) dlsym(RTLD_DEFAULT, "unlinkat"); +++ my_renameat_func = (renameat_func*) dlsym(RTLD_DEFAULT, "renameat"); +++ #ifndef _ALLBSD_SOURCE +++- my_futimesat_func = (futimesat_func*) dlsym(RTLD_DEFAULT, "futimesat"); +++- my_lutimes_func = (lutimes_func*) dlsym(RTLD_DEFAULT, "lutimes"); ++++ my_futimesat_func = (futimesat_func*) lookup_time_function("__futimesat64", ++++ "futimesat"); ++++ my_lutimes_func = (lutimes_func*) lookup_time_function("__lutimes64", ++++ "lutimes"); +++ #endif +++- my_futimens_func = (futimens_func*) dlsym(RTLD_DEFAULT, "futimens"); ++++ my_futimens_func = (futimens_func*) lookup_time_function("__futimens64", ++++ "futimens"); +++ #if defined(_AIX) +++ my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir64"); +++ #else diff --cc debian/patches/jdk-getAccessibleValue.diff index 000000000,000000000,000000000..53c79fea7 new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-getAccessibleValue.diff @@@@ -1,0 -1,0 -1,0 +1,208 @@@@ +++--- a/src/java.desktop/share/classes/javax/swing/JTree.java ++++++ b/src/java.desktop/share/classes/javax/swing/JTree.java +++@@ -5153,7 +5153,7 @@ +++ public AccessibleSelection getAccessibleSelection() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null && isLeaf) { +++- return getCurrentAccessibleContext().getAccessibleSelection(); ++++ return ac.getAccessibleSelection(); +++ } else { +++ return this; +++ } +++@@ -5168,7 +5168,7 @@ +++ public AccessibleText getAccessibleText() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null) { +++- return getCurrentAccessibleContext().getAccessibleText(); ++++ return ac.getAccessibleText(); +++ } else { +++ return null; +++ } +++@@ -5183,7 +5183,7 @@ +++ public AccessibleValue getAccessibleValue() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null) { +++- return getCurrentAccessibleContext().getAccessibleValue(); ++++ return ac.getAccessibleValue(); +++ } else { +++ return null; +++ } +++--- a/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java ++++++ b/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java +++@@ -1143,7 +1143,12 @@ +++ } +++ +++ public AccessibleAction getAccessibleAction() { +++- return getCurrentAccessibleContext().getAccessibleAction(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleAction(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -1159,15 +1164,30 @@ +++ } +++ +++ public AccessibleSelection getAccessibleSelection() { +++- return getCurrentAccessibleContext().getAccessibleSelection(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleSelection(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ public AccessibleText getAccessibleText() { +++- return getCurrentAccessibleContext().getAccessibleText(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleText(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ public AccessibleValue getAccessibleValue() { +++- return getCurrentAccessibleContext().getAccessibleValue(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleValue(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ +++--- a/src/java.desktop/share/classes/javax/swing/JTable.java ++++++ b/src/java.desktop/share/classes/javax/swing/JTable.java +++@@ -8443,7 +8443,12 @@ +++ * null +++ */ +++ public AccessibleSelection getAccessibleSelection() { +++- return getCurrentAccessibleContext().getAccessibleSelection(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleSelection(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -8453,7 +8458,12 @@ +++ * @return the AccessibleText, or null +++ */ +++ public AccessibleText getAccessibleText() { +++- return getCurrentAccessibleContext().getAccessibleText(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleText(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -8463,7 +8473,12 @@ +++ * @return the AccessibleValue, or null +++ */ +++ public AccessibleValue getAccessibleValue() { +++- return getCurrentAccessibleContext().getAccessibleValue(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleValue(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ +++@@ -9223,7 +9238,12 @@ +++ * @return the AccessibleAction, or null +++ */ +++ public AccessibleAction getAccessibleAction() { +++- return getCurrentAccessibleContext().getAccessibleAction(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleAction(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -9245,7 +9265,12 @@ +++ * null +++ */ +++ public AccessibleSelection getAccessibleSelection() { +++- return getCurrentAccessibleContext().getAccessibleSelection(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleSelection(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -9255,7 +9280,12 @@ +++ * @return the AccessibleText, or null +++ */ +++ public AccessibleText getAccessibleText() { +++- return getCurrentAccessibleContext().getAccessibleText(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleText(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ /** +++@@ -9265,7 +9295,12 @@ +++ * @return the AccessibleValue, or null +++ */ +++ public AccessibleValue getAccessibleValue() { +++- return getCurrentAccessibleContext().getAccessibleValue(); ++++ AccessibleContext ac = getCurrentAccessibleContext(); ++++ if (ac != null) { ++++ return ac.getAccessibleValue(); ++++ } else { ++++ return null; ++++ } +++ } +++ +++ +++--- a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java ++++++ b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java +++@@ -6636,7 +6636,7 @@ +++ public AccessibleSelection getAccessibleSelection() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null && isLeaf) { +++- return getCurrentAccessibleContext().getAccessibleSelection(); ++++ return ac.getAccessibleSelection(); +++ } else { +++ return this; +++ } +++@@ -6651,7 +6651,7 @@ +++ public AccessibleText getAccessibleText() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null) { +++- return getCurrentAccessibleContext().getAccessibleText(); ++++ return ac.getAccessibleText(); +++ } else { +++ return null; +++ } +++@@ -6666,7 +6666,7 @@ +++ public AccessibleValue getAccessibleValue() { +++ AccessibleContext ac = getCurrentAccessibleContext(); +++ if (ac != null) { +++- return getCurrentAccessibleContext().getAccessibleValue(); ++++ return ac.getAccessibleValue(); +++ } else { +++ return null; +++ } diff --cc debian/patches/jdk-i18n-pt_BR.diff index 000000000,000000000,000000000..59e24653f new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-i18n-pt_BR.diff @@@@ -1,0 -1,0 -1,0 +1,11 @@@@ +++--- a/src/java.desktop/share/classes/sun/awt/resources/awt_pt_BR.properties ++++++ b/src/java.desktop/share/classes/sun/awt/resources/awt_pt_BR.properties +++@@ -38,7 +38,7 @@ +++ # Key names +++ AWT.enter=Enter +++ AWT.backSpace=Backspace +++-AWT.tab=Guia ++++AWT.tab=Tab +++ AWT.cancel=Cancelar +++ AWT.clear=Limpar +++ AWT.pause=Pausar diff --cc debian/patches/jdk-pulseaudio.diff index 000000000,000000000,000000000..5b758628b new file mode 100644 --- /dev/null +++ b/debian/patches/jdk-pulseaudio.diff @@@@ -1,0 -1,0 -1,0 +1,16 @@@@ +++--- a/src/jdk/src/java.desktop/share/conf/sound.properties ++++++ b/src/jdk/src/java.desktop/share/conf/sound.properties +++@@ -37,3 +37,13 @@ +++ # Specify the default Receiver by provider and name: +++ # javax.sound.midi.Receiver=com.sun.media.sound.MidiProvider#SunMIDI1 +++ # ++++ ++++javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider ++++javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider ++++javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider ++++javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider ++++ ++++#javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider ++++#javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider ++++#javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider ++++#javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider diff --cc debian/patches/jexec.diff index 000000000,000000000,000000000..47e598b99 new file mode 100644 --- /dev/null +++ b/debian/patches/jexec.diff @@@@ -1,0 -1,0 -1,0 +1,35 @@@@ +++--- a/src/java.base/unix/native/launcher/jexec.c ++++++ b/src/java.base/unix/native/launcher/jexec.c +++@@ -168,9 +168,10 @@ int main(int argc, const char * argv[]) +++ +++ /* Get the path to the java binary, which is in a known position relative +++ * to our current position, which is in argv[0]. */ +++- if (getJavaPath(argv[argi++], java, RELATIVE_DEPTH) != 0) { ++++ if (getJavaPath(JDK_BASE_DIR "/lib/jexec", java, RELATIVE_DEPTH) != 0) { +++ errorExit(errno, MISSING_JAVA_MSG); +++ } ++++ argi++; +++ alen = (argc + 2) * (sizeof (const char *)); +++ if (alen <= 0 || alen > INT_MAX / sizeof(char *)) { +++ errorExit(errno, BAD_ARG_MSG); +++--- a/make/launcher/Launcher-java.base.gmk ++++++ b/make/launcher/Launcher-java.base.gmk +++@@ -56,6 +56,9 @@ $(eval $(call SetupBuildLauncher, keytoo +++ ################################################################################ +++ +++ ifeq ($(call isTargetOs, linux), true) ++++ ifeq (,$(DEBIAN_JDK_BASE_DIR)) ++++ $(error DEBIAN_JDK_BASE_DIR must be defined for jexec build) ++++ endif +++ $(eval $(call SetupJdkExecutable, BUILD_JEXEC, \ +++ NAME := jexec, \ +++ SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \ +++@@ -63,7 +66,7 @@ ifeq ($(call isTargetOs, linux), true) +++ OPTIMIZATION := LOW, \ +++ CFLAGS := $(CFLAGS_JDKEXE) \ +++ -I$(TOPDIR)/src/$(MODULE)/share/native/libjli, \ +++- CFLAGS_linux := -fPIC, \ ++++ CFLAGS_linux := -fPIC '-DJDK_BASE_DIR="$(DEBIAN_JDK_BASE_DIR)"', \ +++ CFLAGS_solaris := -KPIC, \ +++ LDFLAGS := $(LDFLAGS_JDKEXE), \ +++ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \ diff --cc debian/patches/jtreg-location.diff index 000000000,000000000,000000000..1e8bfa748 new file mode 100644 --- /dev/null +++ b/debian/patches/jtreg-location.diff @@@@ -1,0 -1,0 -1,0 +1,51 @@@@ +++--- a/make/autoconf/toolchain.m4 ++++++ b/make/autoconf/toolchain.m4 +++@@ -1027,7 +1027,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +++ AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist]) +++ fi +++ +++- if test ! -e "$JT_HOME/lib/jtreg.jar"; then ++++ if test ! -e "$JT_HOME/lib/jtreg.jar" && test ! -e "$JT_HOME/share/java/jtreg.jar"; then +++ AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home]) +++ fi +++ +++@@ -1041,7 +1041,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +++ AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME]) +++ JT_HOME= +++ else +++- if test ! -e "$JT_HOME/lib/jtreg.jar"; then ++++ if test ! -e "$JT_HOME/lib/jtreg.jar" && test ! -e "$JT_HOME/share/java/jtreg.jar"; then +++ AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME]) +++ JT_HOME= +++ else +++@@ -1057,7 +1057,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +++ if test "x$JTREGEXE" != x; then +++ # That's good, now try to derive JT_HOME +++ JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` +++- if test ! -e "$JT_HOME/lib/jtreg.jar"; then ++++ if test ! -e "$JT_HOME/lib/jtreg.jar" && test ! -e "$JT_HOME/share/java/jtreg.jar"; then +++ AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found]) +++ JT_HOME= +++ else +++--- a/make/RunTests.gmk ++++++ b/make/RunTests.gmk +++@@ -849,7 +849,7 @@ define SetupRunJtregTestBody +++ +++ $1_COMMAND_LINE := \ +++ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ +++- -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \ ++++ -Dprogram=jtreg -jar $$(if $$(wildcard $$(JT_HOME)/lib/jtreg.jar),$$(JT_HOME)/lib/jtreg.jar,$$(JT_HOME)/share/java/jtreg.jar) \ +++ $$($1_JTREG_BASIC_OPTIONS) \ +++ -testjdk:$$(JDK_UNDER_TEST) \ +++ -dir:$$(JTREG_TOPDIR) \ +++--- a/make/test/BuildFailureHandler.gmk ++++++ b/make/test/BuildFailureHandler.gmk +++@@ -38,7 +38,7 @@ FH_BASEDIR := $(TOPDIR)/test/failure_han +++ FH_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/failure_handler +++ FH_JAR := $(FH_SUPPORT)/jtregFailureHandler.jar +++ +++-JTREG_JAR := $(JT_HOME)/lib/jtreg.jar ++++JTREG_JAR := $(if $(wildcard $(JT_HOME)/lib/jtreg.jar),$(JT_HOME)/lib/jtreg.jar,$(JT_HOME)/share/java/jtreg.jar) +++ ifeq ($(wildcard $(JTREG_JAR)), ) +++ $(error Cannot build failure handler without jtreg) +++ endif diff --cc debian/patches/ldap-timeout-test-use-ip.patch index 000000000,000000000,000000000..fd61a86b3 new file mode 100644 --- /dev/null +++ b/debian/patches/ldap-timeout-test-use-ip.patch @@@@ -1,0 -1,0 -1,0 +1,19 @@@@ +++Description: Replace hostname with a non-existant ip address +++ In Ubuntu build environment we do not have DNS resolver, causing an unexpected test +++ failure. Use a non-existant IP address instead of hostname. +++Author: Vladimir Petko +++Forwarded: no +++Last-Update: 2023-03-27 +++--- a/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java ++++++ b/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java +++@@ -86,7 +86,9 @@ +++ env.put("com.sun.jndi.ldap.read.timeout", String.valueOf(READ_MILLIS)); +++ env.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(CONNECT_MILLIS)); +++ env.put("com.sun.jndi.ldap.connect.pool", "true"); +++- env.put(Context.PROVIDER_URL, "ldap://example.com:1234"); ++++ // there should not be a LDAP provider on multicast address, but ++++ // network stack should be able to send to it ++++ env.put(Context.PROVIDER_URL, "ldap://224.0.0.0:1234"); +++ +++ try { +++ futures.add(executorService.submit(() -> { attemptConnect(env); return null; })); diff --cc debian/patches/m68k-support.diff index 000000000,000000000,000000000..30e0a0671 new file mode 100644 --- /dev/null +++ b/debian/patches/m68k-support.diff @@@@ -1,0 -1,0 -1,0 +1,1092 @@@@ +++Subject: Fix alignment issues on m68k +++Author: John Paul Adrian Glaubitz +++Last Update: 2019-04-29 +++ +++--- /dev/null ++++++ b/src/java.desktop/unix/data/x11wrappergen/sizes-32-linux-m68k.txt +++@@ -0,0 +1,1017 @@ ++++long 4 ++++int 4 ++++short 2 ++++ptr 4 ++++Bool 4 ++++Atom 4 ++++Window 4 ++++XExtData.number 0 ++++XExtData.next 4 ++++XExtData.free_private 8 ++++XExtData.private_data 12 ++++XExtData 16 ++++XIMStringConversionCallbackStruct.position 0 ++++XIMStringConversionCallbackStruct.direction 2 ++++XIMStringConversionCallbackStruct.operation 6 ++++XIMStringConversionCallbackStruct.factor 8 ++++XIMStringConversionCallbackStruct.text 10 ++++XIMStringConversionCallbackStruct 14 ++++XkbNewKeyboardNotifyEvent.type 0 ++++XkbNewKeyboardNotifyEvent.serial 4 ++++XkbNewKeyboardNotifyEvent.send_event 8 ++++XkbNewKeyboardNotifyEvent.display 12 ++++XkbNewKeyboardNotifyEvent.time 16 ++++XkbNewKeyboardNotifyEvent.xkb_type 20 ++++XkbNewKeyboardNotifyEvent.device 24 ++++XkbNewKeyboardNotifyEvent.old_device 28 ++++XkbNewKeyboardNotifyEvent.min_key_code 32 ++++XkbNewKeyboardNotifyEvent.max_key_code 36 ++++XkbNewKeyboardNotifyEvent.old_min_key_code 40 ++++XkbNewKeyboardNotifyEvent.old_max_key_code 44 ++++XkbNewKeyboardNotifyEvent.changed 48 ++++XkbNewKeyboardNotifyEvent.req_major 52 ++++XkbNewKeyboardNotifyEvent.req_minor 53 ++++XkbNewKeyboardNotifyEvent 54 ++++XTimeCoord.time 0 ++++XTimeCoord.x 4 ++++XTimeCoord.y 6 ++++XTimeCoord 8 ++++XkbCompatMapNotifyEvent.type 0 ++++XkbCompatMapNotifyEvent.serial 4 ++++XkbCompatMapNotifyEvent.send_event 8 ++++XkbCompatMapNotifyEvent.display 12 ++++XkbCompatMapNotifyEvent.time 16 ++++XkbCompatMapNotifyEvent.xkb_type 20 ++++XkbCompatMapNotifyEvent.device 24 ++++XkbCompatMapNotifyEvent.changed_groups 28 ++++XkbCompatMapNotifyEvent.first_si 32 ++++XkbCompatMapNotifyEvent.num_si 36 ++++XkbCompatMapNotifyEvent.num_total_si 40 ++++XkbCompatMapNotifyEvent 44 ++++XIMStatusDrawCallbackStruct.type 0 ++++XIMStatusDrawCallbackStruct.data 4 ++++XIMStatusDrawCallbackStruct 8 ++++XKeyboardControl.key_click_percent 0 ++++XKeyboardControl.bell_percent 4 ++++XKeyboardControl.bell_pitch 8 ++++XKeyboardControl.bell_duration 12 ++++XKeyboardControl.led 16 ++++XKeyboardControl.led_mode 20 ++++XKeyboardControl.key 24 ++++XKeyboardControl.auto_repeat_mode 28 ++++XKeyboardControl 32 ++++XSelectionClearEvent.type 0 ++++XSelectionClearEvent.serial 4 ++++XSelectionClearEvent.send_event 8 ++++XSelectionClearEvent.display 12 ++++XSelectionClearEvent.window 16 ++++XSelectionClearEvent.selection 20 ++++XSelectionClearEvent.time 24 ++++XSelectionClearEvent 28 ++++XWindowChanges.x 0 ++++XWindowChanges.y 4 ++++XWindowChanges.width 8 ++++XWindowChanges.height 12 ++++XWindowChanges.border_width 16 ++++XWindowChanges.sibling 20 ++++XWindowChanges.stack_mode 24 ++++XWindowChanges 28 ++++XIMPreeditCaretCallbackStruct.position 0 ++++XIMPreeditCaretCallbackStruct.direction 4 ++++XIMPreeditCaretCallbackStruct.style 8 ++++XIMPreeditCaretCallbackStruct 12 ++++XOMCharSetList.charset_count 0 ++++XOMCharSetList.charset_list 4 ++++XOMCharSetList 8 ++++XOMFontInfo.num_font 0 ++++XOMFontInfo.font_struct_list 4 ++++XOMFontInfo.font_name_list 8 ++++XOMFontInfo 12 ++++AwtScreenData.numConfigs 0 ++++AwtScreenData.root 4 ++++AwtScreenData.whitepixel 8 ++++AwtScreenData.blackpixel 12 ++++AwtScreenData.defaultConfig 16 ++++AwtScreenData.configs 20 ++++AwtScreenData 24 ++++XIMHotKeyTrigger.keysym 0 ++++XIMHotKeyTrigger.modifier 4 ++++XIMHotKeyTrigger.modifier_mask 8 ++++XIMHotKeyTrigger 12 ++++XCirculateEvent.type 0 ++++XCirculateEvent.serial 4 ++++XCirculateEvent.send_event 8 ++++XCirculateEvent.display 12 ++++XCirculateEvent.event 16 ++++XCirculateEvent.window 20 ++++XCirculateEvent.place 24 ++++XCirculateEvent 28 ++++Screen.ext_data 0 ++++Screen.display 4 ++++Screen.root 8 ++++Screen.width 12 ++++Screen.height 16 ++++Screen.mwidth 20 ++++Screen.mheight 24 ++++Screen.ndepths 28 ++++Screen.depths 32 ++++Screen.root_depth 36 ++++Screen.root_visual 40 ++++Screen.default_gc 44 ++++Screen.cmap 48 ++++Screen.white_pixel 52 ++++Screen.black_pixel 56 ++++Screen.max_maps 60 ++++Screen.min_maps 64 ++++Screen.backing_store 68 ++++Screen.save_unders 72 ++++Screen.root_input_mask 76 ++++Screen 80 ++++XMapRequestEvent.type 0 ++++XMapRequestEvent.serial 4 ++++XMapRequestEvent.send_event 8 ++++XMapRequestEvent.display 12 ++++XMapRequestEvent.parent 16 ++++XMapRequestEvent.window 20 ++++XMapRequestEvent 24 ++++XIMText.length 0 ++++XIMText.feedback 2 ++++XIMText.encoding_is_wchar 6 ++++XIMText.string 10 ++++XIMText 14 ++++XGraphicsExposeEvent.type 0 ++++XGraphicsExposeEvent.serial 4 ++++XGraphicsExposeEvent.send_event 8 ++++XGraphicsExposeEvent.display 12 ++++XGraphicsExposeEvent.drawable 16 ++++XGraphicsExposeEvent.x 20 ++++XGraphicsExposeEvent.y 24 ++++XGraphicsExposeEvent.width 28 ++++XGraphicsExposeEvent.height 32 ++++XGraphicsExposeEvent.count 36 ++++XGraphicsExposeEvent.major_code 40 ++++XGraphicsExposeEvent.minor_code 44 ++++XGraphicsExposeEvent 48 ++++XEvent.type 0 ++++XEvent.xany 0 ++++XEvent.xkey 0 ++++XEvent.xbutton 0 ++++XEvent.xmotion 0 ++++XEvent.xcrossing 0 ++++XEvent.xfocus 0 ++++XEvent.xexpose 0 ++++XEvent.xgraphicsexpose 0 ++++XEvent.xnoexpose 0 ++++XEvent.xvisibility 0 ++++XEvent.xcreatewindow 0 ++++XEvent.xdestroywindow 0 ++++XEvent.xunmap 0 ++++XEvent.xmap 0 ++++XEvent.xmaprequest 0 ++++XEvent.xreparent 0 ++++XEvent.xconfigure 0 ++++XEvent.xgravity 0 ++++XEvent.xresizerequest 0 ++++XEvent.xconfigurerequest 0 ++++XEvent.xcirculate 0 ++++XEvent.xcirculaterequest 0 ++++XEvent.xproperty 0 ++++XEvent.xselectionclear 0 ++++XEvent.xselectionrequest 0 ++++XEvent.xselection 0 ++++XEvent.xcolormap 0 ++++XEvent.xclient 0 ++++XEvent.xmapping 0 ++++XEvent.xerror 0 ++++XEvent.xkeymap 0 ++++XEvent.pad 0 ++++XEvent 96 ++++XRenderDirectFormat.red 0 ++++XRenderDirectFormat.redMask 2 ++++XRenderDirectFormat.green 4 ++++XRenderDirectFormat.greenMask 6 ++++XRenderDirectFormat.blue 8 ++++XRenderDirectFormat.blueMask 10 ++++XRenderDirectFormat.alpha 12 ++++XRenderDirectFormat.alphaMask 14 ++++XRenderDirectFormat 16 ++++ColorData.awt_Colors 0 ++++ColorData.awt_numICMcolors 4 ++++ColorData.awt_icmLUT 8 ++++ColorData.awt_icmLUT2Colors 12 ++++ColorData.img_grays 16 ++++ColorData.img_clr_tbl 20 ++++ColorData.img_oda_red 24 ++++ColorData.img_oda_green 28 ++++ColorData.img_oda_blue 32 ++++ColorData.pGrayInverseLutData 36 ++++ColorData.representsPrimaries 44 ++++ColorData.screendata 40 ++++ColorData 48 ++++XFontStruct.ext_data 0 ++++XFontStruct.fid 4 ++++XFontStruct.direction 8 ++++XFontStruct.min_char_or_byte2 12 ++++XFontStruct.max_char_or_byte2 16 ++++XFontStruct.min_byte1 20 ++++XFontStruct.max_byte1 24 ++++XFontStruct.all_chars_exist 28 ++++XFontStruct.n_properties 36 ++++XFontStruct.properties 40 ++++XFontStruct.min_bounds 44 ++++XFontStruct.max_bounds 56 ++++XFontStruct.per_char 68 ++++XFontStruct.ascent 72 ++++XFontStruct.descent 76 ++++XFontStruct 80 ++++XExtCodes.extension 0 ++++XExtCodes.major_opcode 4 ++++XExtCodes.first_event 8 ++++XExtCodes.first_error 12 ++++XExtCodes 16 ++++XFontSetExtents.max_ink_extent 0 ++++XFontSetExtents.max_logical_extent 8 ++++XFontSetExtents 16 ++++XSelectionEvent.type 0 ++++XSelectionEvent.serial 4 ++++XSelectionEvent.send_event 8 ++++XSelectionEvent.display 12 ++++XSelectionEvent.requestor 16 ++++XSelectionEvent.selection 20 ++++XSelectionEvent.target 24 ++++XSelectionEvent.property 28 ++++XSelectionEvent.time 32 ++++XSelectionEvent 36 ++++XArc.x 0 ++++XArc.y 2 ++++XArc.width 4 ++++XArc.height 6 ++++XArc.angle1 8 ++++XArc.angle2 10 ++++XArc 12 ++++XErrorEvent.type 0 ++++XErrorEvent.display 4 ++++XErrorEvent.resourceid 8 ++++XErrorEvent.serial 12 ++++XErrorEvent.error_code 16 ++++XErrorEvent.request_code 17 ++++XErrorEvent.minor_code 18 ++++XErrorEvent 20 ++++XConfigureRequestEvent.type 0 ++++XConfigureRequestEvent.serial 4 ++++XConfigureRequestEvent.send_event 8 ++++XConfigureRequestEvent.display 12 ++++XConfigureRequestEvent.parent 16 ++++XConfigureRequestEvent.window 20 ++++XConfigureRequestEvent.x 24 ++++XConfigureRequestEvent.y 28 ++++XConfigureRequestEvent.width 32 ++++XConfigureRequestEvent.height 36 ++++XConfigureRequestEvent.border_width 40 ++++XConfigureRequestEvent.above 44 ++++XConfigureRequestEvent.detail 48 ++++XConfigureRequestEvent.value_mask 52 ++++XConfigureRequestEvent 56 ++++ScreenFormat.ext_data 0 ++++ScreenFormat.depth 4 ++++ScreenFormat.bits_per_pixel 8 ++++ScreenFormat.scanline_pad 12 ++++ScreenFormat 16 ++++XButtonEvent.type 0 ++++XButtonEvent.serial 4 ++++XButtonEvent.send_event 8 ++++XButtonEvent.display 12 ++++XButtonEvent.window 16 ++++XButtonEvent.root 20 ++++XButtonEvent.subwindow 24 ++++XButtonEvent.time 28 ++++XButtonEvent.x 32 ++++XButtonEvent.y 36 ++++XButtonEvent.x_root 40 ++++XButtonEvent.y_root 44 ++++XButtonEvent.state 48 ++++XButtonEvent.button 52 ++++XButtonEvent.same_screen 56 ++++XButtonEvent 60 ++++XFontProp.name 0 ++++XFontProp.card32 4 ++++XFontProp 8 ++++XIMValuesList.count_values 0 ++++XIMValuesList.supported_values 2 ++++XIMValuesList 6 ++++XKeymapEvent.type 0 ++++XKeymapEvent.serial 4 ++++XKeymapEvent.send_event 8 ++++XKeymapEvent.display 12 ++++XKeymapEvent.window 16 ++++XKeymapEvent.key_vector 20 ++++XKeymapEvent 52 ++++XTextItem16.chars 0 ++++XTextItem16.nchars 4 ++++XTextItem16.delta 8 ++++XTextItem16.font 12 ++++XTextItem16 16 ++++XIMPreeditDrawCallbackStruct.caret 0 ++++XIMPreeditDrawCallbackStruct.chg_first 4 ++++XIMPreeditDrawCallbackStruct.chg_length 8 ++++XIMPreeditDrawCallbackStruct.text 12 ++++XIMPreeditDrawCallbackStruct 16 ++++XVisualInfo.visual 0 ++++XVisualInfo.visualid 4 ++++XVisualInfo.screen 8 ++++XVisualInfo.depth 12 ++++XVisualInfo.class 16 ++++XVisualInfo.red_mask 20 ++++XVisualInfo.green_mask 24 ++++XVisualInfo.blue_mask 28 ++++XVisualInfo.colormap_size 32 ++++XVisualInfo.bits_per_rgb 36 ++++XVisualInfo 40 ++++XkbControlsNotifyEvent.type 0 ++++XkbControlsNotifyEvent.serial 4 ++++XkbControlsNotifyEvent.send_event 8 ++++XkbControlsNotifyEvent.display 12 ++++XkbControlsNotifyEvent.time 16 ++++XkbControlsNotifyEvent.xkb_type 20 ++++XkbControlsNotifyEvent.device 24 ++++XkbControlsNotifyEvent.changed_ctrls 28 ++++XkbControlsNotifyEvent.enabled_ctrls 32 ++++XkbControlsNotifyEvent.enabled_ctrl_changes 36 ++++XkbControlsNotifyEvent.num_groups 40 ++++XkbControlsNotifyEvent.keycode 44 ++++XkbControlsNotifyEvent.event_type 45 ++++XkbControlsNotifyEvent.req_major 46 ++++XkbControlsNotifyEvent.req_minor 47 ++++XkbControlsNotifyEvent 48 ++++PropMwmHints.flags 0 ++++PropMwmHints.functions 4 ++++PropMwmHints.decorations 8 ++++PropMwmHints.inputMode 12 ++++PropMwmHints.status 16 ++++PropMwmHints 20 ++++XClientMessageEvent.type 0 ++++XClientMessageEvent.serial 4 ++++XClientMessageEvent.send_event 8 ++++XClientMessageEvent.display 12 ++++XClientMessageEvent.window 16 ++++XClientMessageEvent.message_type 20 ++++XClientMessageEvent.format 24 ++++XClientMessageEvent.data 28 ++++XClientMessageEvent 48 ++++XAnyEvent.type 0 ++++XAnyEvent.serial 4 ++++XAnyEvent.send_event 8 ++++XAnyEvent.display 12 ++++XAnyEvent.window 16 ++++XAnyEvent 20 ++++XkbIndicatorNotifyEvent.type 0 ++++XkbIndicatorNotifyEvent.serial 4 ++++XkbIndicatorNotifyEvent.send_event 8 ++++XkbIndicatorNotifyEvent.display 12 ++++XkbIndicatorNotifyEvent.time 16 ++++XkbIndicatorNotifyEvent.xkb_type 20 ++++XkbIndicatorNotifyEvent.device 24 ++++XkbIndicatorNotifyEvent.changed 28 ++++XkbIndicatorNotifyEvent.state 32 ++++XkbIndicatorNotifyEvent 36 ++++XIMPreeditStateNotifyCallbackStruct.state 0 ++++XIMPreeditStateNotifyCallbackStruct 4 ++++XkbAnyEvent.type 0 ++++XkbAnyEvent.serial 4 ++++XkbAnyEvent.send_event 8 ++++XkbAnyEvent.display 12 ++++XkbAnyEvent.time 16 ++++XkbAnyEvent.xkb_type 20 ++++XkbAnyEvent.device 24 ++++XkbAnyEvent 28 ++++XMotionEvent.type 0 ++++XMotionEvent.serial 4 ++++XMotionEvent.send_event 8 ++++XMotionEvent.display 12 ++++XMotionEvent.window 16 ++++XMotionEvent.root 20 ++++XMotionEvent.subwindow 24 ++++XMotionEvent.time 28 ++++XMotionEvent.x 32 ++++XMotionEvent.y 36 ++++XMotionEvent.x_root 40 ++++XMotionEvent.y_root 44 ++++XMotionEvent.state 48 ++++XMotionEvent.is_hint 52 ++++XMotionEvent.same_screen 54 ++++XMotionEvent 58 ++++XIMHotKeyTriggers.num_hot_key 0 ++++XIMHotKeyTriggers.key 4 ++++XIMHotKeyTriggers 8 ++++XIMStyles.count_styles 0 ++++XIMStyles.supported_styles 2 ++++XIMStyles 6 ++++XkbExtensionDeviceNotifyEvent.type 0 ++++XkbExtensionDeviceNotifyEvent.serial 4 ++++XkbExtensionDeviceNotifyEvent.send_event 8 ++++XkbExtensionDeviceNotifyEvent.display 12 ++++XkbExtensionDeviceNotifyEvent.time 16 ++++XkbExtensionDeviceNotifyEvent.xkb_type 20 ++++XkbExtensionDeviceNotifyEvent.device 24 ++++XkbExtensionDeviceNotifyEvent.reason 28 ++++XkbExtensionDeviceNotifyEvent.supported 32 ++++XkbExtensionDeviceNotifyEvent.unsupported 36 ++++XkbExtensionDeviceNotifyEvent.first_btn 40 ++++XkbExtensionDeviceNotifyEvent.num_btns 44 ++++XkbExtensionDeviceNotifyEvent.leds_defined 48 ++++XkbExtensionDeviceNotifyEvent.led_state 52 ++++XkbExtensionDeviceNotifyEvent.led_class 56 ++++XkbExtensionDeviceNotifyEvent.led_id 60 ++++XkbExtensionDeviceNotifyEvent 64 ++++XwcTextItem.chars 0 ++++XwcTextItem.nchars 4 ++++XwcTextItem.delta 8 ++++XwcTextItem.font_set 12 ++++XwcTextItem 16 ++++XClassHint.res_name 0 ++++XClassHint.res_class 4 ++++XClassHint 8 ++++XChar2b.byte1 0 ++++XChar2b.byte2 1 ++++XChar2b 2 ++++XSetWindowAttributes.background_pixmap 0 ++++XSetWindowAttributes.background_pixel 4 ++++XSetWindowAttributes.border_pixmap 8 ++++XSetWindowAttributes.border_pixel 12 ++++XSetWindowAttributes.bit_gravity 16 ++++XSetWindowAttributes.win_gravity 20 ++++XSetWindowAttributes.backing_store 24 ++++XSetWindowAttributes.backing_planes 28 ++++XSetWindowAttributes.backing_pixel 32 ++++XSetWindowAttributes.save_under 36 ++++XSetWindowAttributes.event_mask 40 ++++XSetWindowAttributes.do_not_propagate_mask 44 ++++XSetWindowAttributes.override_redirect 48 ++++XSetWindowAttributes.colormap 52 ++++XSetWindowAttributes.cursor 56 ++++XSetWindowAttributes 60 ++++XRenderPictFormat.id 0 ++++XRenderPictFormat.type 4 ++++XRenderPictFormat.depth 8 ++++XRenderPictFormat.direct 12 ++++XRenderPictFormat.colormap 28 ++++XRenderPictFormat 32 ++++XReparentEvent.type 0 ++++XReparentEvent.serial 4 ++++XReparentEvent.send_event 8 ++++XReparentEvent.display 12 ++++XReparentEvent.event 16 ++++XReparentEvent.window 20 ++++XReparentEvent.parent 24 ++++XReparentEvent.x 28 ++++XReparentEvent.y 32 ++++XReparentEvent.override_redirect 36 ++++XReparentEvent 40 ++++XCirculateRequestEvent.type 0 ++++XCirculateRequestEvent.serial 4 ++++XCirculateRequestEvent.send_event 8 ++++XCirculateRequestEvent.display 12 ++++XCirculateRequestEvent.parent 16 ++++XCirculateRequestEvent.window 20 ++++XCirculateRequestEvent.place 24 ++++XCirculateRequestEvent 28 ++++XImage.width 0 ++++XImage.height 4 ++++XImage.xoffset 8 ++++XImage.format 12 ++++XImage.data 16 ++++XImage.byte_order 20 ++++XImage.bitmap_unit 24 ++++XImage.bitmap_bit_order 28 ++++XImage.bitmap_pad 32 ++++XImage.depth 36 ++++XImage.bytes_per_line 40 ++++XImage.bits_per_pixel 44 ++++XImage.red_mask 48 ++++XImage.green_mask 52 ++++XImage.blue_mask 56 ++++XImage.obdata 60 ++++XImage.f.create_image 64 ++++XImage.f.destroy_image 68 ++++XImage.f.get_pixel 72 ++++XImage.f.put_pixel 76 ++++XImage.f.sub_image 80 ++++XImage.f.add_pixel 84 ++++XImage 88 ++++XKeyEvent.type 0 ++++XKeyEvent.serial 4 ++++XKeyEvent.send_event 8 ++++XKeyEvent.display 12 ++++XKeyEvent.window 16 ++++XKeyEvent.root 20 ++++XKeyEvent.subwindow 24 ++++XKeyEvent.time 28 ++++XKeyEvent.x 32 ++++XKeyEvent.y 36 ++++XKeyEvent.x_root 40 ++++XKeyEvent.y_root 44 ++++XKeyEvent.state 48 ++++XKeyEvent.keycode 52 ++++XKeyEvent.same_screen 56 ++++XKeyEvent 60 ++++XkbActionMessageEvent.type 0 ++++XkbActionMessageEvent.serial 4 ++++XkbActionMessageEvent.send_event 8 ++++XkbActionMessageEvent.display 12 ++++XkbActionMessageEvent.time 16 ++++XkbActionMessageEvent.xkb_type 20 ++++XkbActionMessageEvent.device 24 ++++XkbActionMessageEvent.keycode 28 ++++XkbActionMessageEvent.press 30 ++++XkbActionMessageEvent.key_event_follows 34 ++++XkbActionMessageEvent.group 38 ++++XkbActionMessageEvent.mods 42 ++++XkbActionMessageEvent.message 46 ++++XkbActionMessageEvent 54 ++++XdbeSwapInfo.swap_window 0 ++++XdbeSwapInfo.swap_action 4 ++++XdbeSwapInfo 6 ++++XTextItem.chars 0 ++++XTextItem.nchars 4 ++++XTextItem.delta 8 ++++XTextItem.font 12 ++++XTextItem 16 ++++XModifierKeymap.max_keypermod 0 ++++XModifierKeymap.modifiermap 4 ++++XModifierKeymap 8 ++++XCharStruct.lbearing 0 ++++XCharStruct.rbearing 2 ++++XCharStruct.width 4 ++++XCharStruct.ascent 6 ++++XCharStruct.descent 8 ++++XCharStruct.attributes 10 ++++XCharStruct 12 ++++XGravityEvent.type 0 ++++XGravityEvent.serial 4 ++++XGravityEvent.send_event 8 ++++XGravityEvent.display 12 ++++XGravityEvent.event 16 ++++XGravityEvent.window 20 ++++XGravityEvent.x 24 ++++XGravityEvent.y 28 ++++XGravityEvent 32 ++++Visual.ext_data 0 ++++Visual.visualid 4 ++++Visual.class 8 ++++Visual.red_mask 12 ++++Visual.green_mask 16 ++++Visual.blue_mask 20 ++++Visual.bits_per_rgb 24 ++++Visual.map_entries 28 ++++Visual 32 ++++XOMOrientation.num_orientation 0 ++++XOMOrientation.orientation 4 ++++XOMOrientation 8 ++++XkbAccessXNotifyEvent.type 0 ++++XkbAccessXNotifyEvent.serial 4 ++++XkbAccessXNotifyEvent.send_event 8 ++++XkbAccessXNotifyEvent.display 12 ++++XkbAccessXNotifyEvent.time 16 ++++XkbAccessXNotifyEvent.xkb_type 20 ++++XkbAccessXNotifyEvent.device 24 ++++XkbAccessXNotifyEvent.detail 28 ++++XkbAccessXNotifyEvent.keycode 32 ++++XkbAccessXNotifyEvent.sk_delay 36 ++++XkbAccessXNotifyEvent.debounce_delay 40 ++++XkbAccessXNotifyEvent 44 ++++XWindowAttributes.x 0 ++++XWindowAttributes.y 4 ++++XWindowAttributes.width 8 ++++XWindowAttributes.height 12 ++++XWindowAttributes.border_width 16 ++++XWindowAttributes.depth 20 ++++XWindowAttributes.visual 24 ++++XWindowAttributes.root 28 ++++XWindowAttributes.class 32 ++++XWindowAttributes.bit_gravity 36 ++++XWindowAttributes.win_gravity 40 ++++XWindowAttributes.backing_store 44 ++++XWindowAttributes.backing_planes 48 ++++XWindowAttributes.backing_pixel 52 ++++XWindowAttributes.save_under 56 ++++XWindowAttributes.colormap 60 ++++XWindowAttributes.map_installed 64 ++++XWindowAttributes.map_state 68 ++++XWindowAttributes.all_event_masks 72 ++++XWindowAttributes.your_event_mask 76 ++++XWindowAttributes.do_not_propagate_mask 80 ++++XWindowAttributes.override_redirect 84 ++++XWindowAttributes.screen 88 ++++XWindowAttributes 92 ++++XmbTextItem.chars 0 ++++XmbTextItem.nchars 4 ++++XmbTextItem.delta 8 ++++XmbTextItem.font_set 12 ++++XmbTextItem 16 ++++XMappingEvent.type 0 ++++XMappingEvent.serial 4 ++++XMappingEvent.send_event 8 ++++XMappingEvent.display 12 ++++XMappingEvent.window 16 ++++XMappingEvent.request 20 ++++XMappingEvent.first_keycode 24 ++++XMappingEvent.count 28 ++++XMappingEvent 32 ++++XSizeHints.flags 0 ++++XSizeHints.x 4 ++++XSizeHints.y 8 ++++XSizeHints.width 12 ++++XSizeHints.height 16 ++++XSizeHints.min_width 20 ++++XSizeHints.min_height 24 ++++XSizeHints.max_width 28 ++++XSizeHints.max_height 32 ++++XSizeHints.width_inc 36 ++++XSizeHints.height_inc 40 ++++XSizeHints.min_aspect.x 44 ++++XSizeHints.min_aspect.y 48 ++++XSizeHints.max_aspect.x 52 ++++XSizeHints.max_aspect.y 56 ++++XSizeHints.base_width 60 ++++XSizeHints.base_height 64 ++++XSizeHints.win_gravity 68 ++++XSizeHints 72 ++++XUnmapEvent.type 0 ++++XUnmapEvent.serial 4 ++++XUnmapEvent.send_event 8 ++++XUnmapEvent.display 12 ++++XUnmapEvent.event 16 ++++XUnmapEvent.window 20 ++++XUnmapEvent.from_configure 24 ++++XUnmapEvent 28 ++++awtImageData.Depth 0 ++++awtImageData.wsImageFormat 4 ++++awtImageData.clrdata 16 ++++awtImageData.convert 48 ++++awtImageData 304 ++++XkbStateNotifyEvent.type 0 ++++XkbStateNotifyEvent.serial 4 ++++XkbStateNotifyEvent.send_event 8 ++++XkbStateNotifyEvent.display 12 ++++XkbStateNotifyEvent.time 16 ++++XkbStateNotifyEvent.xkb_type 20 ++++XkbStateNotifyEvent.device 24 ++++XkbStateNotifyEvent.changed 28 ++++XkbStateNotifyEvent.group 32 ++++XkbStateNotifyEvent.base_group 36 ++++XkbStateNotifyEvent.latched_group 40 ++++XkbStateNotifyEvent.locked_group 44 ++++XkbStateNotifyEvent.mods 48 ++++XkbStateNotifyEvent.base_mods 52 ++++XkbStateNotifyEvent.latched_mods 56 ++++XkbStateNotifyEvent.locked_mods 60 ++++XkbStateNotifyEvent.compat_state 64 ++++XkbStateNotifyEvent.grab_mods 68 ++++XkbStateNotifyEvent.compat_grab_mods 69 ++++XkbStateNotifyEvent.lookup_mods 70 ++++XkbStateNotifyEvent.compat_lookup_mods 71 ++++XkbStateNotifyEvent.ptr_buttons 72 ++++XkbStateNotifyEvent.keycode 76 ++++XkbStateNotifyEvent.event_type 77 ++++XkbStateNotifyEvent.req_major 78 ++++XkbStateNotifyEvent.req_minor 79 ++++XkbStateNotifyEvent 80 ++++XExposeEvent.type 0 ++++XExposeEvent.serial 4 ++++XExposeEvent.send_event 8 ++++XExposeEvent.display 12 ++++XExposeEvent.window 16 ++++XExposeEvent.x 20 ++++XExposeEvent.y 24 ++++XExposeEvent.width 28 ++++XExposeEvent.height 32 ++++XExposeEvent.count 36 ++++XExposeEvent 40 ++++XkbMapNotifyEvent.type 0 ++++XkbMapNotifyEvent.serial 4 ++++XkbMapNotifyEvent.send_event 8 ++++XkbMapNotifyEvent.display 12 ++++XkbMapNotifyEvent.time 16 ++++XkbMapNotifyEvent.xkb_type 20 ++++XkbMapNotifyEvent.device 24 ++++XkbMapNotifyEvent.changed 28 ++++XkbMapNotifyEvent.flags 32 ++++XkbMapNotifyEvent.first_type 36 ++++XkbMapNotifyEvent.num_types 40 ++++XkbMapNotifyEvent.min_key_code 44 ++++XkbMapNotifyEvent.max_key_code 45 ++++XkbMapNotifyEvent.first_key_sym 46 ++++XkbMapNotifyEvent.first_key_act 47 ++++XkbMapNotifyEvent.first_key_behavior 48 ++++XkbMapNotifyEvent.first_key_explicit 49 ++++XkbMapNotifyEvent.first_modmap_key 50 ++++XkbMapNotifyEvent.first_vmodmap_key 51 ++++XkbMapNotifyEvent.num_key_syms 52 ++++XkbMapNotifyEvent.num_key_acts 56 ++++XkbMapNotifyEvent.num_key_behaviors 60 ++++XkbMapNotifyEvent.num_key_explicit 64 ++++XkbMapNotifyEvent.num_modmap_keys 68 ++++XkbMapNotifyEvent.num_vmodmap_keys 72 ++++XkbMapNotifyEvent.vmods 76 ++++XkbMapNotifyEvent 80 ++++XGCValues.function 0 ++++XGCValues.plane_mask 4 ++++XGCValues.foreground 8 ++++XGCValues.background 12 ++++XGCValues.line_width 16 ++++XGCValues.line_style 20 ++++XGCValues.cap_style 24 ++++XGCValues.join_style 28 ++++XGCValues.fill_style 32 ++++XGCValues.fill_rule 36 ++++XGCValues.arc_mode 40 ++++XGCValues.tile 44 ++++XGCValues.stipple 48 ++++XGCValues.ts_x_origin 52 ++++XGCValues.ts_y_origin 56 ++++XGCValues.font 60 ++++XGCValues.subwindow_mode 64 ++++XGCValues.graphics_exposures 68 ++++XGCValues.clip_x_origin 72 ++++XGCValues.clip_y_origin 76 ++++XGCValues.clip_mask 80 ++++XGCValues.dash_offset 84 ++++XGCValues.dashes 88 ++++XGCValues 90 ++++XFocusChangeEvent.type 0 ++++XFocusChangeEvent.serial 4 ++++XFocusChangeEvent.send_event 8 ++++XFocusChangeEvent.display 12 ++++XFocusChangeEvent.window 16 ++++XFocusChangeEvent.mode 20 ++++XFocusChangeEvent.detail 24 ++++XFocusChangeEvent 28 ++++XPixmapFormatValues.depth 0 ++++XPixmapFormatValues.bits_per_pixel 4 ++++XPixmapFormatValues.scanline_pad 8 ++++XPixmapFormatValues 12 ++++XMapEvent.type 0 ++++XMapEvent.serial 4 ++++XMapEvent.send_event 8 ++++XMapEvent.display 12 ++++XMapEvent.event 16 ++++XMapEvent.window 20 ++++XMapEvent.override_redirect 24 ++++XMapEvent 28 ++++XkbBellNotifyEvent.type 0 ++++XkbBellNotifyEvent.serial 4 ++++XkbBellNotifyEvent.send_event 8 ++++XkbBellNotifyEvent.display 12 ++++XkbBellNotifyEvent.time 16 ++++XkbBellNotifyEvent.xkb_type 20 ++++XkbBellNotifyEvent.device 24 ++++XkbBellNotifyEvent.percent 28 ++++XkbBellNotifyEvent.pitch 32 ++++XkbBellNotifyEvent.duration 36 ++++XkbBellNotifyEvent.bell_class 40 ++++XkbBellNotifyEvent.bell_id 44 ++++XkbBellNotifyEvent.name 48 ++++XkbBellNotifyEvent.window 52 ++++XkbBellNotifyEvent.event_only 56 ++++XkbBellNotifyEvent 60 ++++XIMStringConversionText.length 0 ++++XIMStringConversionText.feedback 2 ++++XIMStringConversionText.encoding_is_wchar 6 ++++XIMStringConversionText.string 10 ++++XIMStringConversionText 14 ++++XKeyboardState.key_click_percent 0 ++++XKeyboardState.bell_percent 4 ++++XKeyboardState.bell_pitch 8 ++++XKeyboardState.bell_duration 12 ++++XKeyboardState.led_mask 16 ++++XKeyboardState.global_auto_repeat 20 ++++XKeyboardState.auto_repeats 24 ++++XKeyboardState 56 ++++XkbEvent.type 0 ++++XkbEvent.any 0 ++++XkbEvent.new_kbd 0 ++++XkbEvent.map 0 ++++XkbEvent.state 0 ++++XkbEvent.ctrls 0 ++++XkbEvent.indicators 0 ++++XkbEvent.names 0 ++++XkbEvent.compat 0 ++++XkbEvent.bell 0 ++++XkbEvent.message 0 ++++XkbEvent.accessx 0 ++++XkbEvent.device 0 ++++XkbEvent.core 0 ++++XkbEvent 96 ++++XPoint.x 0 ++++XPoint.y 2 ++++XPoint 4 ++++XSegment.x1 0 ++++XSegment.y1 2 ++++XSegment.x2 4 ++++XSegment.y2 6 ++++XSegment 8 ++++XIconSize.min_width 0 ++++XIconSize.min_height 4 ++++XIconSize.max_width 8 ++++XIconSize.max_height 12 ++++XIconSize.width_inc 16 ++++XIconSize.height_inc 20 ++++XIconSize 24 ++++XIMCallback.client_data 0 ++++XIMCallback.callback 4 ++++XIMCallback 8 ++++XConfigureEvent.type 0 ++++XConfigureEvent.serial 4 ++++XConfigureEvent.send_event 8 ++++XConfigureEvent.display 12 ++++XConfigureEvent.event 16 ++++XConfigureEvent.window 20 ++++XConfigureEvent.x 24 ++++XConfigureEvent.y 28 ++++XConfigureEvent.width 32 ++++XConfigureEvent.height 36 ++++XConfigureEvent.border_width 40 ++++XConfigureEvent.above 44 ++++XConfigureEvent.override_redirect 48 ++++XConfigureEvent 52 ++++XRectangle.x 0 ++++XRectangle.y 2 ++++XRectangle.width 4 ++++XRectangle.height 6 ++++XRectangle 8 ++++XkbNamesNotifyEvent.type 0 ++++XkbNamesNotifyEvent.serial 4 ++++XkbNamesNotifyEvent.send_event 8 ++++XkbNamesNotifyEvent.display 12 ++++XkbNamesNotifyEvent.time 16 ++++XkbNamesNotifyEvent.xkb_type 20 ++++XkbNamesNotifyEvent.device 24 ++++XkbNamesNotifyEvent.changed 28 ++++XkbNamesNotifyEvent.first_type 32 ++++XkbNamesNotifyEvent.num_types 36 ++++XkbNamesNotifyEvent.first_lvl 40 ++++XkbNamesNotifyEvent.num_lvls 44 ++++XkbNamesNotifyEvent.num_aliases 48 ++++XkbNamesNotifyEvent.num_radio_groups 52 ++++XkbNamesNotifyEvent.changed_vmods 56 ++++XkbNamesNotifyEvent.changed_groups 60 ++++XkbNamesNotifyEvent.changed_indicators 64 ++++XkbNamesNotifyEvent.first_key 68 ++++XkbNamesNotifyEvent.num_keys 72 ++++XkbNamesNotifyEvent 76 ++++XCreateWindowEvent.type 0 ++++XCreateWindowEvent.serial 4 ++++XCreateWindowEvent.send_event 8 ++++XCreateWindowEvent.display 12 ++++XCreateWindowEvent.parent 16 ++++XCreateWindowEvent.window 20 ++++XCreateWindowEvent.x 24 ++++XCreateWindowEvent.y 28 ++++XCreateWindowEvent.width 32 ++++XCreateWindowEvent.height 36 ++++XCreateWindowEvent.border_width 40 ++++XCreateWindowEvent.override_redirect 44 ++++XCreateWindowEvent 48 ++++XVisibilityEvent.type 0 ++++XVisibilityEvent.serial 4 ++++XVisibilityEvent.send_event 8 ++++XVisibilityEvent.display 12 ++++XVisibilityEvent.window 16 ++++XVisibilityEvent.state 20 ++++XVisibilityEvent 24 ++++XWMHints.flags 0 ++++XWMHints.initial_state 8 ++++XWMHints.icon_pixmap 12 ++++XWMHints.icon_window 16 ++++XWMHints.icon_x 20 ++++XWMHints.icon_y 24 ++++XWMHints.icon_mask 28 ++++XWMHints.input 4 ++++XWMHints.window_group 32 ++++XWMHints 36 ++++XCrossingEvent.type 0 ++++XCrossingEvent.serial 4 ++++XCrossingEvent.send_event 8 ++++XCrossingEvent.display 12 ++++XCrossingEvent.window 16 ++++XCrossingEvent.root 20 ++++XCrossingEvent.subwindow 24 ++++XCrossingEvent.time 28 ++++XCrossingEvent.x 32 ++++XCrossingEvent.y 36 ++++XCrossingEvent.x_root 40 ++++XCrossingEvent.y_root 44 ++++XCrossingEvent.mode 48 ++++XCrossingEvent.detail 52 ++++XCrossingEvent.same_screen 56 ++++XCrossingEvent.focus 60 ++++XCrossingEvent.state 64 ++++XCrossingEvent 68 ++++XSelectionRequestEvent.type 0 ++++XSelectionRequestEvent.serial 4 ++++XSelectionRequestEvent.send_event 8 ++++XSelectionRequestEvent.display 12 ++++XSelectionRequestEvent.owner 16 ++++XSelectionRequestEvent.requestor 20 ++++XSelectionRequestEvent.selection 24 ++++XSelectionRequestEvent.target 28 ++++XSelectionRequestEvent.property 32 ++++XSelectionRequestEvent.time 36 ++++XSelectionRequestEvent 40 ++++XNoExposeEvent.type 0 ++++XNoExposeEvent.serial 4 ++++XNoExposeEvent.send_event 8 ++++XNoExposeEvent.display 12 ++++XNoExposeEvent.drawable 16 ++++XNoExposeEvent.major_code 20 ++++XNoExposeEvent.minor_code 24 ++++XNoExposeEvent 28 ++++XHostAddress.family 0 ++++XHostAddress.length 4 ++++XHostAddress.address 8 ++++XHostAddress 12 ++++XColormapEvent.type 0 ++++XColormapEvent.serial 4 ++++XColormapEvent.send_event 8 ++++XColormapEvent.display 12 ++++XColormapEvent.window 16 ++++XColormapEvent.colormap 20 ++++XColormapEvent.new 24 ++++XColormapEvent.state 28 ++++XColormapEvent 32 ++++ColorEntry.r 0 ++++ColorEntry.g 1 ++++ColorEntry.b 2 ++++ColorEntry.flags 3 ++++ColorEntry 4 ++++XResizeRequestEvent.type 0 ++++XResizeRequestEvent.serial 4 ++++XResizeRequestEvent.send_event 8 ++++XResizeRequestEvent.display 12 ++++XResizeRequestEvent.window 16 ++++XResizeRequestEvent.width 20 ++++XResizeRequestEvent.height 24 ++++XResizeRequestEvent 28 ++++Depth.depth 0 ++++Depth.nvisuals 4 ++++Depth.visuals 8 ++++Depth 12 ++++XPropertyEvent.type 0 ++++XPropertyEvent.serial 4 ++++XPropertyEvent.send_event 8 ++++XPropertyEvent.display 12 ++++XPropertyEvent.window 16 ++++XPropertyEvent.atom 20 ++++XPropertyEvent.time 24 ++++XPropertyEvent.state 28 ++++XPropertyEvent 32 ++++XDestroyWindowEvent.type 0 ++++XDestroyWindowEvent.serial 4 ++++XDestroyWindowEvent.send_event 8 ++++XDestroyWindowEvent.display 12 ++++XDestroyWindowEvent.event 16 ++++XDestroyWindowEvent.window 20 ++++XDestroyWindowEvent 24 ++++XStandardColormap.colormap 0 ++++XStandardColormap.red_max 4 ++++XStandardColormap.red_mult 8 ++++XStandardColormap.green_max 12 ++++XStandardColormap.green_mult 16 ++++XStandardColormap.blue_max 20 ++++XStandardColormap.blue_mult 24 ++++XStandardColormap.base_pixel 28 ++++XStandardColormap.visualid 32 ++++XStandardColormap.killid 36 ++++XStandardColormap 40 ++++XComposeStatus.compose_ptr 0 ++++XComposeStatus.chars_matched 4 ++++XComposeStatus 8 ++++AwtGraphicsConfigData.awt_depth 0 ++++AwtGraphicsConfigData.awt_cmap 4 ++++AwtGraphicsConfigData.awt_visInfo 8 ++++AwtGraphicsConfigData.awt_num_colors 48 ++++AwtGraphicsConfigData.awtImage 52 ++++AwtGraphicsConfigData.AwtColorMatch 56 ++++AwtGraphicsConfigData.monoImage 60 ++++AwtGraphicsConfigData.monoPixmap 64 ++++AwtGraphicsConfigData.monoPixmapWidth 68 ++++AwtGraphicsConfigData.monoPixmapHeight 72 ++++AwtGraphicsConfigData.monoPixmapGC 76 ++++AwtGraphicsConfigData.pixelStride 80 ++++AwtGraphicsConfigData.color_data 84 ++++AwtGraphicsConfigData.glxInfo 88 ++++AwtGraphicsConfigData.isTranslucencySupported 92 ++++AwtGraphicsConfigData.renderPictFormat 96 ++++AwtGraphicsConfigData 128 ++++XColor.pixel 0 ++++XColor.red 4 ++++XColor.green 6 ++++XColor.blue 8 ++++XColor.flags 10 ++++XColor.pad 11 ++++XColor 12 ++++XTextProperty.value 0 ++++XTextProperty.encoding 4 ++++XTextProperty.format 8 ++++XTextProperty.nitems 12 ++++XTextProperty 16 +++--- a/make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk ++++++ b/make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk +++@@ -29,9 +29,14 @@ +++ # Put the generated Java classes used to interface X11 from awt here. +++ GENSRC_X11WRAPPERS_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11 +++ ++++GENSRC_X11_VERSION_VARIANT := ++++ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-m68k) ++++ GENSRC_X11_VERSION_VARIANT := -linux-m68k ++++endif ++++ +++ # The pre-calculated offset file are stored here: +++ GENSRC_X11WRAPPERS_DATADIR := $(MODULE_SRC)/unix/data/x11wrappergen +++-GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt ++++GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS)$(GENSRC_X11_VERSION_VARIANT).txt +++ +++ # Run the tool on the offset files to generate several Java classes used in awt. +++ $(eval $(call SetupExecute, gen_x11wrappers, \ +++--- a/src/hotspot/share/memory/allocation.hpp ++++++ b/src/hotspot/share/memory/allocation.hpp +++@@ -276,7 +276,7 @@ class CHeapObj { +++ void operator delete [] (void* p) { +++ CHeapObjBase::operator delete[](p); +++ } +++-}; ++++} __attribute__ ((aligned (4))); +++ +++ // Base class for objects allocated on the stack only. +++ // Calling new or delete will result in fatal error. +++@@ -415,7 +415,7 @@ class MetaspaceObj { +++ // that should be read-only by default. See symbol.hpp for an example. This function +++ // is used by the templates in metaspaceClosure.hpp +++ static bool is_read_only_by_default() { return false; } +++-}; ++++} __attribute__ ((aligned (4))); +++ +++ // Base class for classes that constitute name spaces. +++ +++@@ -526,7 +526,7 @@ protected: +++ void print() const; +++ virtual void print_on(outputStream* st) const; +++ #endif // PRODUCT +++-}; ++++} __attribute__ ((aligned (4))); +++ +++ // One of the following macros must be used when allocating an array +++ // or object to determine whether it should reside in the C heap on in +++--- a/src/hotspot/share/oops/constMethod.hpp ++++++ b/src/hotspot/share/oops/constMethod.hpp +++@@ -495,6 +495,6 @@ private: +++ +++ // Verify +++ void verify_on(outputStream* st); +++-}; ++++} __attribute__ ((aligned (4))); +++ +++ #endif // SHARE_OOPS_CONSTMETHOD_HPP +++--- a/src/hotspot/share/oops/oop.hpp ++++++ b/src/hotspot/share/oops/oop.hpp +++@@ -321,7 +321,7 @@ class oopDesc { +++ static void* load_oop_raw(oop obj, int offset); +++ +++ DEBUG_ONLY(bool size_might_change();) +++-}; ++++} __attribute__ ((aligned (4))); +++ +++ // An oopDesc is not initialized via a constructor. Space is allocated in +++ // the Java heap, and static functions provided here on HeapWord* are used diff --cc debian/patches/machine-flag.diff index 000000000,000000000,000000000..e73441b3c new file mode 100644 --- /dev/null +++ b/debian/patches/machine-flag.diff @@@@ -1,0 -1,0 -1,0 +1,24 @@@@ +++--- a/make/autoconf/flags.m4 ++++++ b/make/autoconf/flags.m4 +++@@ -276,6 +276,7 @@ +++ test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then +++ MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" +++ fi ++++ case "$host" in *x32) MACHINE_FLAG=;; esac +++ fi +++ +++ if test "x$OPENJDK_TARGET_OS" = xmacosx; then +++@@ -358,11 +359,8 @@ +++ AC_SUBST(COMPILER_COMMAND_FILE_FLAG) +++ AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) +++ +++- # Check that the compiler supports -mX (or -qX on AIX) flags +++- # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does +++- FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], +++- IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], +++- IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) ++++ # Don't run the -mX check and set this always to false, or else x32 gets passed -m32 ++++ COMPILER_SUPPORTS_TARGET_BITS_FLAG=false +++ AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) +++ +++ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then diff --cc debian/patches/make-debug-print.diff index 000000000,000000000,000000000..1388aaa89 new file mode 100644 --- /dev/null +++ b/debian/patches/make-debug-print.diff @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++--- a/make/Main.gmk ++++++ b/make/Main.gmk +++@@ -1285,6 +1285,7 @@ +++ +++ # Aliases used for running tests. +++ ++++$(call PrintVar, ALL_NAMED_TESTS) +++ # Let "run-test" be an alias for "test" +++ $(foreach t, $(ALL_NAMED_TESTS), $(eval run-test-$t: test-$t)) +++ RUN_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS)) diff --cc debian/patches/mips.diff index 000000000,000000000,000000000..2b0e567e2 new file mode 100644 --- /dev/null +++ b/debian/patches/mips.diff @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++# DP: Untested patch suggested to fix #983878 +++ +++--- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c ++++++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c +++@@ -259,7 +259,7 @@ static statx_func* my_statx_func = NULL; +++ /** +++ * fstatat missing from glibc on Linux. +++ */ +++-#if defined(__linux__) && (defined(__i386) || defined(__arm__)) ++++#if defined(__linux__) && (defined(__i386) || defined(__arm__) || (defined(__mips__) && !defined(__mips64))) +++ #define FSTATAT64_SYSCALL_AVAILABLE +++ static int fstatat64_wrapper(int dfd, const char *path, +++ struct stat64 *statbuf, int flag) diff --cc debian/patches/misalign-pointer-for-armhf.patch index 000000000,000000000,000000000..911755490 new file mode 100644 --- /dev/null +++ b/debian/patches/misalign-pointer-for-armhf.patch @@@@ -1,0 -1,0 -1,0 +1,23 @@@@ +++Description: Misalign address in the test rather than structure +++ mk68-support.diff aligned metaspace structures by 4 bytes breaking the test. +++ Add 1 to address type rather than aligned structure to produce misaligned pointer. +++--- a/test/hotspot/gtest/metaspace/test_is_metaspace_obj.cpp ++++++ b/test/hotspot/gtest/metaspace/test_is_metaspace_obj.cpp +++@@ -61,7 +61,7 @@ +++ ASSERT_TRUE(MetaspaceObj::is_valid(p)); +++ +++ // A misaligned object shall not be recognized +++- const MetaspaceObj* p_misaligned = (MetaspaceObj*)((address)p) + 1; ++++ const MetaspaceObj* p_misaligned = (MetaspaceObj*)((address)p + 1); +++ ASSERT_FALSE(MetaspaceObj::is_valid(p_misaligned)); +++ +++ // Test VirtualSpaceList::contains +++@@ -72,7 +72,7 @@ +++ ASSERT_TRUE(vslist->contains((MetaWord*)p)); +++ +++ // A misaligned pointer shall still be recognized by list::contains +++- ASSERT_TRUE(vslist->contains((MetaWord*)((address)p) + 1)); ++++ ASSERT_TRUE(vslist->contains((MetaWord*)((address)p + 1))); +++ +++ // Now for some bogus values +++ ASSERT_FALSE(MetaspaceObj::is_valid((MetaspaceObj*)NULL)); diff --cc debian/patches/multiple-pkcs11-library-init.diff index 000000000,000000000,000000000..77d8275bf new file mode 100644 --- /dev/null +++ b/debian/patches/multiple-pkcs11-library-init.diff @@@@ -1,0 -1,0 -1,0 +1,73 @@@@ +++# HG changeset patch +++# User andrew +++# Date 1352129932 0 +++# Node ID e9c857dcb964dbfa5eef3a3590244cb4d999cf7a +++# Parent 1406789608b76d0906881979335d685855f44190 +++Allow multiple PKCS11 library initialisation to be a non-critical error. +++ +++--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java ++++++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java +++@@ -52,6 +52,7 @@ +++ static final int ERR_HALT = 1; +++ static final int ERR_IGNORE_ALL = 2; +++ static final int ERR_IGNORE_LIB = 3; ++++ static final int ERR_IGNORE_MULTI_INIT = 4; +++ +++ // same as allowSingleThreadedModules but controlled via a system property +++ // and applied to all providers. if set to false, no SunPKCS11 instances +++@@ -1038,6 +1039,7 @@ +++ case "ignoreAll" -> ERR_IGNORE_ALL; +++ case "ignoreMissingLibrary" -> ERR_IGNORE_LIB; +++ case "halt" -> ERR_HALT; ++++ case "ignoreMultipleInitialisation" -> ERR_IGNORE_MULTI_INIT; +++ default -> throw excToken("Invalid value for handleStartupErrors:"); +++ }; +++ if (DEBUG) { +++--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java ++++++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++@@ -184,26 +184,37 @@ +++ String nssLibraryDirectory = config.getNssLibraryDirectory(); +++ String nssSecmodDirectory = config.getNssSecmodDirectory(); +++ boolean nssOptimizeSpace = config.getNssOptimizeSpace(); ++++ int errorHandling = config.getHandleStartupErrors(); +++ +++ if (secmod.isInitialized()) { +++ if (nssSecmodDirectory != null) { +++ String s = secmod.getConfigDir(); +++ if ((s != null) && +++ (!s.equals(nssSecmodDirectory))) { +++- throw new ProviderException("Secmod directory " +++- + nssSecmodDirectory +++- + " invalid, NSS already initialized with " +++- + s); ++++ String msg = "Secmod directory " + nssSecmodDirectory ++++ + " invalid, NSS already initialized with " + s; ++++ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT || ++++ errorHandling == Config.ERR_IGNORE_ALL) { ++++ throw new UnsupportedOperationException(msg); ++++ } else { ++++ throw new ProviderException(msg); ++++ } +++ } +++ } +++ if (nssLibraryDirectory != null) { +++ String s = secmod.getLibDir(); +++ if ((s != null) && +++ (!s.equals(nssLibraryDirectory))) { +++- throw new ProviderException("NSS library directory " +++- + nssLibraryDirectory +++- + " invalid, NSS already initialized with " +++- + s); ++++ String msg = "NSS library directory " ++++ + nssLibraryDirectory ++++ + " invalid, NSS already initialized with " ++++ + s; ++++ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT || ++++ errorHandling == Config.ERR_IGNORE_ALL) { ++++ throw new UnsupportedOperationException(msg); ++++ } else { ++++ throw new ProviderException(msg); ++++ } +++ } +++ } +++ } else { diff --cc debian/patches/no-pch-build.diff index 000000000,000000000,000000000..76726e84b new file mode 100644 --- /dev/null +++ b/debian/patches/no-pch-build.diff @@@@ -1,0 -1,0 -1,0 +1,110 @@@@ +++--- a/src/hotspot/src/share/vm/oops/arrayKlassKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/arrayKlassKlass.cpp 2013-04-15 13:57:24.992929086 +0200 +++@@ -30,6 +30,7 @@ +++ #include "runtime/handles.inline.hpp" +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/oops/constantPoolKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/constantPoolKlass.cpp 2013-04-15 14:02:52.143087149 +0200 +++@@ -49,6 +49,7 @@ +++ #endif +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/oops/cpCacheKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/cpCacheKlass.cpp 2013-04-15 14:04:45.219838633 +0200 +++@@ -35,6 +35,7 @@ +++ #include "runtime/handles.inline.hpp" +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/oops/instanceKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/instanceKlass.cpp 2013-04-15 14:07:55.861109867 +0200 +++@@ -70,6 +70,7 @@ +++ #include "gc_implementation/g1/g1RemSet.inline.hpp" +++ #include "gc_implementation/g1/heapRegionSeq.inline.hpp" +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "oops/oop.pcgc.inline.hpp" +++--- a/src/hotspot/src/share/vm/oops/instanceKlassKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/instanceKlassKlass.cpp 2013-04-15 14:08:53.541485528 +0200 +++@@ -44,6 +44,7 @@ +++ #include "runtime/fieldDescriptor.hpp" +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp 2013-04-15 14:10:11.162003798 +0200 +++@@ -42,6 +42,7 @@ +++ #include "gc_implementation/g1/g1RemSet.inline.hpp" +++ #include "gc_implementation/g1/heapRegionSeq.inline.hpp" +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "oops/oop.pcgc.inline.hpp" +++--- a/src/hotspot/src/share/vm/oops/instanceRefKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/instanceRefKlass.cpp 2013-04-15 14:11:11.726403390 +0200 +++@@ -39,6 +39,7 @@ +++ #include "gc_implementation/g1/g1RemSet.inline.hpp" +++ #include "gc_implementation/g1/heapRegionSeq.inline.hpp" +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "oops/oop.pcgc.inline.hpp" +++--- a/src/hotspot/src/share/vm/oops/klassKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/klassKlass.cpp 2013-04-15 14:13:01.999133769 +0200 +++@@ -42,6 +42,7 @@ +++ #include "runtime/handles.inline.hpp" +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/oops/objArrayKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/objArrayKlass.cpp 2013-04-15 14:16:10.616389484 +0200 +++@@ -47,6 +47,7 @@ +++ #include "gc_implementation/g1/g1RemSet.inline.hpp" +++ #include "gc_implementation/g1/heapRegionSeq.inline.hpp" +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psCompactionManager.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++--- a/src/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp 2013-04-15 14:17:01.800729154 +0200 +++@@ -33,6 +33,7 @@ +++ #include "oops/oop.inline2.hpp" +++ #ifndef SERIALGC +++ #include "gc_implementation/parNew/parOopClosures.inline.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +++ #include "memory/cardTableRS.hpp" +++--- a/src/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp~ 2013-03-04 22:51:00.000000000 +0100 ++++++ b/src/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp 2013-04-15 14:20:24.782079605 +0200 +++@@ -28,6 +28,7 @@ +++ #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +++ #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +++ #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" ++++#include "gc_implementation/parallelScavenge/psOldGen.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +++ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +++ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" diff --cc debian/patches/nspr+nss-headers.diff index 000000000,000000000,000000000..235bb6d3e new file mode 100644 --- /dev/null +++ b/debian/patches/nspr+nss-headers.diff @@@@ -1,0 -1,0 -1,0 +1,9090 @@@@ +++Replace header files in src/jdk.crypto.cryptoki/share/native/libj2pkcs11. +++ +++Import from NSPR 4.29: +++ - prcpucfg.h +++ - prtypes.h +++ +++Import from NSS 2.63: +++ - pkcs11.h +++ - pkcs11f.h +++ - pkcs11n.h +++ - pkcs11p.h +++ - pkcs11t.h +++ - pkcs11u.h +++ +++src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h: +++ - Remove macro CK_PTR +++ - Remove macro CK_DEFINE_FUNCTION +++ - Remove macro CK_DECLARE_FUNCTION +++ - Remove macro CK_DECLARE_FUNCTION_POINTER +++ - Remove macro CK_CALLBACK_FUNCTION +++ +++src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h: +++ - use CK_TRUE/CK_FALSE instead of TRUE/FALSE +++ +++src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c: +++ - FIXME: CKM_KEA_DERIVE is undefined +++ +++src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c: +++ - FIXME: CKM_CAMELLIA_CTR is undefined +++ +++ +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h +++@@ -1,10 +1,15 @@ +++-/* Copyright (c) OASIS Open 2016-2019. All Rights Reserved. +++- * Distributed under the terms of the OASIS IPR Policy, +++- * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY +++- * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A +++- * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. ++++/* 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/. */ ++++/* ++++ * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document ++++ * is granted provided that it is identified as "RSA Security In.c Public-Key ++++ * Cryptography Standards (PKCS)" in all material mentioning or referencing ++++ * this document. ++++ * ++++ * The latest version of this header can be found at: ++++ * http://www.rsalabs.com/pkcs/pkcs-11/index.html +++ */ +++- +++ #ifndef _PKCS11_H_ +++ #define _PKCS11_H_ 1 +++ +++@@ -13,20 +18,21 @@ extern "C" { +++ #endif +++ +++ /* Before including this file (pkcs11.h) (or pkcs11t.h by +++- * itself), 5 platform-specific macros must be defined. These ++++ * itself), 6 platform-specific macros must be defined. These +++ * macros are described below, and typical definitions for them +++ * are also given. Be advised that these definitions can depend +++ * on both the platform and the compiler used (and possibly also +++- * on whether a Cryptoki library is linked statically or ++++ * on whether a PKCS #11 library is linked statically or +++ * dynamically). +++ * +++- * In addition to defining these 5 macros, the packing convention +++- * for Cryptoki structures should be set. The Cryptoki ++++ * In addition to defining these 6 macros, the packing convention ++++ * for PKCS #11 structures should be set. The PKCS #11 +++ * convention on packing is that structures should be 1-byte +++ * aligned. +++ * +++- * If you're using Windows this might be done by using the following +++- * preprocessor directive before including pkcs11.h or pkcs11t.h: ++++ * In a Win32 environment, this might be done by using the ++++ * following preprocessor directive before including pkcs11.h ++++ * or pkcs11t.h: +++ * +++ * #pragma pack(push, cryptoki, 1) +++ * +++@@ -35,8 +41,8 @@ extern "C" { +++ * +++ * #pragma pack(pop, cryptoki) +++ * +++- * In a UNIX environment, you're on your own for this. You might +++- * not need to do (or be able to do!) anything. ++++ * In a UNIX environment, you're on your own here. You might ++++ * not need to do anything. +++ * +++ * +++ * Now for the macros: +++@@ -47,17 +53,42 @@ extern "C" { +++ * +++ * typedef CK_BYTE CK_PTR CK_BYTE_PTR; +++ * +++- * If you're using windows, it might be defined by: ++++ * In a Win32 environment, it might be defined by +++ * +++ * #define CK_PTR * +++ * +++- * In a typical UNIX environment, it might be defined by: ++++ * In a UNIX environment, it might be defined by +++ * +++ * #define CK_PTR * +++ * +++ * +++- * 2. CK_DECLARE_FUNCTION(returnType, name): A macro which makes +++- * an importable Cryptoki library function declaration out of a ++++ * 2. CK_DEFINE_FUNCTION(returnType, name): A macro which makes ++++ * an exportable PKCS #11 library function definition out of a ++++ * return type and a function name. It should be used in the ++++ * following fashion to define the exposed PKCS #11 functions in ++++ * a PKCS #11 library: ++++ * ++++ * CK_DEFINE_FUNCTION(CK_RV, C_Initialize)( ++++ * CK_VOID_PTR pReserved ++++ * ) ++++ * { ++++ * ... ++++ * } ++++ * ++++ * For defining a function in a Win32 PKCS #11 .dll, it might be ++++ * defined by ++++ * ++++ * #define CK_DEFINE_FUNCTION(returnType, name) \ ++++ * returnType __declspec(dllexport) name ++++ * ++++ * In a UNIX environment, it might be defined by ++++ * ++++ * #define CK_DEFINE_FUNCTION(returnType, name) \ ++++ * returnType name ++++ * ++++ * ++++ * 3. CK_DECLARE_FUNCTION(returnType, name): A macro which makes ++++ * an importable PKCS #11 library function declaration out of a +++ * return type and a function name. It should be used in the +++ * following fashion: +++ * +++@@ -65,49 +96,49 @@ extern "C" { +++ * CK_VOID_PTR pReserved +++ * ); +++ * +++- * If you're using Windows to declare a function in a Win32 cryptoki .dll, +++- * it might be defined by: ++++ * For declaring a function in a Win32 PKCS #11 .dll, it might ++++ * be defined by +++ * +++ * #define CK_DECLARE_FUNCTION(returnType, name) \ +++ * returnType __declspec(dllimport) name +++ * +++- * In a UNIX environment, it might be defined by: ++++ * In a UNIX environment, it might be defined by +++ * +++ * #define CK_DECLARE_FUNCTION(returnType, name) \ +++ * returnType name +++ * +++ * +++- * 3. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro +++- * which makes a Cryptoki API function pointer declaration or ++++ * 4. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro ++++ * which makes a PKCS #11 API function pointer declaration or +++ * function pointer type declaration out of a return type and a +++ * function name. It should be used in the following fashion: +++ * +++- * // Define funcPtr to be a pointer to a Cryptoki API function ++++ * // Define funcPtr to be a pointer to a PKCS #11 API function +++ * // taking arguments args and returning CK_RV. +++ * CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtr)(args); +++ * +++ * or +++ * +++ * // Define funcPtrType to be the type of a pointer to a +++- * // Cryptoki API function taking arguments args and returning ++++ * // PKCS #11 API function taking arguments args and returning +++ * // CK_RV, and then define funcPtr to be a variable of type +++ * // funcPtrType. +++ * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); +++ * funcPtrType funcPtr; +++ * +++- * If you're using Windows to access +++- * functions in a Win32 Cryptoki .dll, in might be defined by: ++++ * For accessing functions in a Win32 PKCS #11 .dll, in might be ++++ * defined by +++ * +++ * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ +++ * returnType __declspec(dllimport) (* name) +++ * +++- * In a UNIX environment, it might be defined by: ++++ * In a UNIX environment, it might be defined by +++ * +++ * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ +++ * returnType (* name) +++ * +++ * +++- * 4. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes ++++ * 5. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes +++ * a function pointer type for an application callback out of +++ * a return type for the callback and a name for the callback. +++ * It should be used in the following fashion: +++@@ -121,77 +152,76 @@ extern "C" { +++ * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); +++ * myCallbackType myCallback; +++ * +++- * If you're using Windows, it might be defined by: ++++ * In a Win32 environment, it might be defined by +++ * +++ * #define CK_CALLBACK_FUNCTION(returnType, name) \ +++ * returnType (* name) +++ * +++- * In a UNIX environment, it might be defined by: ++++ * In a UNIX environment, it might be defined by +++ * +++ * #define CK_CALLBACK_FUNCTION(returnType, name) \ +++ * returnType (* name) +++ * +++ * +++- * 5. NULL_PTR: This macro is the value of a NULL pointer. ++++ * 6. NULL_PTR: This macro is the value of a NULL pointer. +++ * +++ * In any ANSI/ISO C environment (and in many others as well), +++- * this should best be defined by ++++ * this should be defined by +++ * +++ * #ifndef NULL_PTR +++ * #define NULL_PTR 0 +++ * #endif +++ */ +++ +++- +++-/* All the various Cryptoki types and #define'd values are in the +++- * file pkcs11t.h. +++- */ ++++/* All the various PKCS #11 types and #define'd values are in the ++++ * file pkcs11t.h. */ +++ #include "pkcs11t.h" +++ +++-#define __PASTE(x,y) x##y ++++#define __PASTE(x, y) x##y +++ ++++#ifndef CK_PKCS11_3_0 ++++/* remember that we set it so we can unset it at the end */ ++++#define __NSS_CK_PKCS11_3_IMPLICIT 1 ++++#define CK_PKCS11_3_0 1 ++++#endif +++ +++ /* ============================================================== +++ * Define the "extern" form of all the entry points. +++ * ============================================================== +++ */ +++ +++-#define CK_NEED_ARG_LIST 1 ++++#define CK_NEED_ARG_LIST 1 +++ #define CK_PKCS11_FUNCTION_INFO(name) \ +++- extern CK_DECLARE_FUNCTION(CK_RV, name) ++++ CK_DECLARE_FUNCTION(CK_RV, name) +++ +++-/* pkcs11f.h has all the information about the Cryptoki +++- * function prototypes. +++- */ ++++/* pkcs11f.h has all the information about the PKCS #11 ++++ * function prototypes. */ +++ #include "pkcs11f.h" +++ +++ #undef CK_NEED_ARG_LIST +++ #undef CK_PKCS11_FUNCTION_INFO +++ +++- +++ /* ============================================================== +++ * Define the typedef form of all the entry points. That is, for +++- * each Cryptoki function C_XXX, define a type CK_C_XXX which is ++++ * each PKCS #11 function C_XXX, define a type CK_C_XXX which is +++ * a pointer to that kind of function. +++ * ============================================================== +++ */ +++ +++-#define CK_NEED_ARG_LIST 1 ++++#define CK_NEED_ARG_LIST 1 +++ #define CK_PKCS11_FUNCTION_INFO(name) \ +++- typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name)) ++++ typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_, name)) +++ +++-/* pkcs11f.h has all the information about the Cryptoki +++- * function prototypes. +++- */ ++++/* pkcs11f.h has all the information about the PKCS #11 ++++ * function prototypes. */ +++ #include "pkcs11f.h" +++ +++ #undef CK_NEED_ARG_LIST +++ #undef CK_PKCS11_FUNCTION_INFO +++ +++- +++ /* ============================================================== +++- * Define structed vector of entry points. A CK_FUNCTION_LIST +++- * contains a CK_VERSION indicating a library's Cryptoki version ++++ * Define structed vector of entry points. A CK_FUNCTION_3_0_LIST ++++ * contains a CK_VERSION indicating a library's PKCS #11 version +++ * and then a whole slew of function pointers to the routines in +++ * the library. This type was declared, but not defined, in +++ * pkcs11t.h. +++@@ -199,39 +229,41 @@ extern "C" { +++ */ +++ +++ #define CK_PKCS11_FUNCTION_INFO(name) \ +++- __PASTE(CK_,name) name; ++++ __PASTE(CK_, name) \ ++++ name; +++ +++-/* Create the 3.0 Function list */ ++++#include "pkcs11p.h" +++ struct CK_FUNCTION_LIST_3_0 { +++ +++- CK_VERSION version; /* Cryptoki version */ ++++ CK_VERSION version; /* PKCS #11 version */ +++ +++-/* Pile all the function pointers into the CK_FUNCTION_LIST. */ +++-/* pkcs11f.h has all the information about the Cryptoki +++- * function prototypes. +++- */ ++++/* Pile all the function pointers into the CK_FUNCTION_LIST_3_0. */ ++++/* pkcs11f.h has all the information about the PKCS #11 ++++ * function prototypes. */ +++ #include "pkcs11f.h" +++- +++ }; +++ +++ #define CK_PKCS11_2_0_ONLY 1 +++ +++-/* Continue to define the old CK_FUNCTION_LIST */ ++++/* now define the 2.0 function list */ +++ struct CK_FUNCTION_LIST { +++ +++- CK_VERSION version; /* Cryptoki version */ ++++ CK_VERSION version; /* PKCS #11 version */ +++ +++ /* Pile all the function pointers into the CK_FUNCTION_LIST. */ +++-/* pkcs11f.h has all the information about the Cryptoki +++- * function prototypes. +++- */ ++++/* pkcs11f.h has all the information about the PKCS #11 ++++ * function prototypes. */ +++ #include "pkcs11f.h" +++- +++ }; ++++#include "pkcs11u.h" +++ +++ #undef CK_PKCS11_FUNCTION_INFO +++ #undef CK_PKCS11_2_0_ONLY +++ ++++#ifdef __NSS_CK_PKCS11_3_IMPLICIT ++++#undef CK_PKCS11_3_0 ++++#undef __NSS_CK_PKCS11_3_IMPLICIT ++++#endif +++ +++ #undef __PASTE +++ +++@@ -239,6 +271,4 @@ struct CK_FUNCTION_LIST { +++ } +++ #endif +++ +++-#endif /* _PKCS11_H_ */ +++- +++- ++++#endif +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h +++@@ -1,1197 +1,1044 @@ +++-/* Copyright (c) OASIS Open 2016, 2019. All Rights Reserved./ +++- * /Distributed under the terms of the OASIS IPR Policy, +++- * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY +++- * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A +++- * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. +++- */ +++- +++-/* Latest version of the specification: +++- * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html +++- */ +++- +++-/* This header file contains pretty much everything about all the +++- * Cryptoki function prototypes. Because this information is +++- * used for more than just declaring function prototypes, the +++- * order of the functions appearing herein is important, and +++- * should not be altered. +++- */ ++++/* 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/. */ ++++/* ++++ * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document ++++ * is granted provided that it is identified as "RSA Security In.c Public-Key ++++ * Cryptography Standards (PKCS)" in all material mentioning or referencing ++++ * this document. ++++ */ ++++/* This function contains pretty much everything about all the */ ++++/* PKCS #11 function prototypes. Because this information is */ ++++/* used for more than just declaring function prototypes, the */ ++++/* order of the functions appearing herein is important, and */ ++++/* should not be altered. */ +++ +++ /* General-purpose */ +++ +++-/* C_Initialize initializes the Cryptoki library. */ ++++/* C_Initialize initializes the PKCS #11 library. */ +++ CK_PKCS11_FUNCTION_INFO(C_Initialize) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets +++- * cast to CK_C_INITIALIZE_ARGS_PTR +++- * and dereferenced +++- */ +++-); ++++ CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets ++++ * cast to CK_C_INITIALIZE_ARGS_PTR ++++ * and dereferenced */ ++++ ); +++ #endif +++ +++- +++ /* C_Finalize indicates that an application is done with the +++- * Cryptoki library. +++- */ ++++ * PKCS #11 library. */ +++ CK_PKCS11_FUNCTION_INFO(C_Finalize) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */ +++-); ++++ CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */ ++++ ); +++ #endif +++ +++- +++-/* C_GetInfo returns general information about Cryptoki. */ ++++/* C_GetInfo returns general information about PKCS #11. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetInfo) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_INFO_PTR pInfo /* location that receives information */ +++-); ++++ CK_INFO_PTR pInfo /* location that receives information */ ++++ ); +++ #endif +++ +++- +++ /* C_GetFunctionList returns the function list. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to +++- * function list +++- */ +++-); ++++ CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to ++++ * function list */ ++++ ); +++ #endif +++ +++- +++- +++ /* Slot and token management */ +++ +++ /* C_GetSlotList obtains a list of slots in the system. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetSlotList) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_BBOOL tokenPresent, /* only slots with tokens */ +++- CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ +++- CK_ULONG_PTR pulCount /* receives number of slots */ +++-); ++++ CK_BBOOL tokenPresent, /* only slots with tokens? */ ++++ CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ ++++ CK_ULONG_PTR pulCount /* receives number of slots */ ++++ ); +++ #endif +++ +++- +++ /* C_GetSlotInfo obtains information about a particular slot in +++- * the system. +++- */ ++++ * the system. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID, /* the ID of the slot */ +++- CK_SLOT_INFO_PTR pInfo /* receives the slot information */ +++-); ++++ CK_SLOT_ID slotID, /* the ID of the slot */ ++++ CK_SLOT_INFO_PTR pInfo /* receives the slot information */ ++++ ); +++ #endif +++ +++- +++ /* C_GetTokenInfo obtains information about a particular token +++- * in the system. +++- */ ++++ * in the system. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID, /* ID of the token's slot */ +++- CK_TOKEN_INFO_PTR pInfo /* receives the token information */ +++-); ++++ CK_SLOT_ID slotID, /* ID of the token's slot */ ++++ CK_TOKEN_INFO_PTR pInfo /* receives the token information */ ++++ ); +++ #endif +++ +++- +++ /* C_GetMechanismList obtains a list of mechanism types +++- * supported by a token. +++- */ ++++ * supported by a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID, /* ID of token's slot */ +++- CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */ +++- CK_ULONG_PTR pulCount /* gets # of mechs. */ +++-); ++++ CK_SLOT_ID slotID, /* ID of token's slot */ ++++ CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */ ++++ CK_ULONG_PTR pulCount /* gets # of mechs. */ ++++ ); +++ #endif +++ +++- +++ /* C_GetMechanismInfo obtains information about a particular +++- * mechanism possibly supported by a token. +++- */ ++++ * mechanism possibly supported by a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID, /* ID of the token's slot */ +++- CK_MECHANISM_TYPE type, /* type of mechanism */ +++- CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */ +++-); ++++ CK_SLOT_ID slotID, /* ID of the token's slot */ ++++ CK_MECHANISM_TYPE type, /* type of mechanism */ ++++ CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */ ++++ ); +++ #endif +++ +++- +++ /* C_InitToken initializes a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_InitToken) +++ #ifdef CK_NEED_ARG_LIST ++++/* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */ +++ ( +++- CK_SLOT_ID slotID, /* ID of the token's slot */ +++- CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ +++- CK_ULONG ulPinLen, /* length in bytes of the PIN */ +++- CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */ +++-); ++++ CK_SLOT_ID slotID, /* ID of the token's slot */ ++++ CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ ++++ CK_ULONG ulPinLen, /* length in bytes of the PIN */ ++++ CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */ ++++ ); +++ #endif +++ +++- +++ /* C_InitPIN initializes the normal user's PIN. */ +++ CK_PKCS11_FUNCTION_INFO(C_InitPIN) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */ +++- CK_ULONG ulPinLen /* length in bytes of the PIN */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */ ++++ CK_ULONG ulPinLen /* length in bytes of the PIN */ ++++ ); +++ #endif +++ +++- +++ /* C_SetPIN modifies the PIN of the user who is logged in. */ +++ CK_PKCS11_FUNCTION_INFO(C_SetPIN) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_UTF8CHAR_PTR pOldPin, /* the old PIN */ +++- CK_ULONG ulOldLen, /* length of the old PIN */ +++- CK_UTF8CHAR_PTR pNewPin, /* the new PIN */ +++- CK_ULONG ulNewLen /* length of the new PIN */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_UTF8CHAR_PTR pOldPin, /* the old PIN */ ++++ CK_ULONG ulOldLen, /* length of the old PIN */ ++++ CK_UTF8CHAR_PTR pNewPin, /* the new PIN */ ++++ CK_ULONG ulNewLen /* length of the new PIN */ ++++ ); +++ #endif +++ +++- +++- +++ /* Session management */ +++ +++ /* C_OpenSession opens a session between an application and a +++- * token. +++- */ ++++ * token. */ +++ CK_PKCS11_FUNCTION_INFO(C_OpenSession) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID, /* the slot's ID */ +++- CK_FLAGS flags, /* from CK_SESSION_INFO */ +++- CK_VOID_PTR pApplication, /* passed to callback */ +++- CK_NOTIFY Notify, /* callback function */ +++- CK_SESSION_HANDLE_PTR phSession /* gets session handle */ +++-); ++++ CK_SLOT_ID slotID, /* the slot's ID */ ++++ CK_FLAGS flags, /* from CK_SESSION_INFO */ ++++ CK_VOID_PTR pApplication, /* passed to callback */ ++++ CK_NOTIFY Notify, /* callback function */ ++++ CK_SESSION_HANDLE_PTR phSession /* gets session handle */ ++++ ); +++ #endif +++ +++- +++ /* C_CloseSession closes a session between an application and a +++- * token. +++- */ ++++ * token. */ +++ CK_PKCS11_FUNCTION_INFO(C_CloseSession) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession /* the session's handle */ ++++ ); +++ #endif +++ +++- +++ /* C_CloseAllSessions closes all sessions with a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SLOT_ID slotID /* the token's slot */ +++-); ++++ CK_SLOT_ID slotID /* the token's slot */ ++++ ); +++ #endif +++ +++- +++ /* C_GetSessionInfo obtains information about the session. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_SESSION_INFO_PTR pInfo /* receives session info */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_SESSION_INFO_PTR pInfo /* receives session info */ ++++ ); +++ #endif +++ +++- +++ /* C_GetOperationState obtains the state of the cryptographic operation +++- * in a session. +++- */ ++++ * in a session. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetOperationState) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pOperationState, /* gets state */ +++- CK_ULONG_PTR pulOperationStateLen /* gets state length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pOperationState, /* gets state */ ++++ CK_ULONG_PTR pulOperationStateLen /* gets state length */ ++++ ); +++ #endif +++ +++- +++ /* C_SetOperationState restores the state of the cryptographic +++- * operation in a session. +++- */ ++++ * operation in a session. */ +++ CK_PKCS11_FUNCTION_INFO(C_SetOperationState) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pOperationState, /* holds state */ +++- CK_ULONG ulOperationStateLen, /* holds state length */ +++- CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */ +++- CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pOperationState, /* holds state */ ++++ CK_ULONG ulOperationStateLen, /* holds state length */ ++++ CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */ ++++ CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */ ++++ ); +++ #endif +++ +++- +++ /* C_Login logs a user into a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_Login) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_USER_TYPE userType, /* the user type */ +++- CK_UTF8CHAR_PTR pPin, /* the user's PIN */ +++- CK_ULONG ulPinLen /* the length of the PIN */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_USER_TYPE userType, /* the user type */ ++++ CK_UTF8CHAR_PTR pPin, /* the user's PIN */ ++++ CK_ULONG ulPinLen /* the length of the PIN */ ++++ ); +++ #endif +++ +++- +++ /* C_Logout logs a user out from a token. */ +++ CK_PKCS11_FUNCTION_INFO(C_Logout) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession /* the session's handle */ ++++ ); +++ #endif +++ +++- +++- +++ /* Object management */ +++ +++ /* C_CreateObject creates a new object. */ +++ CK_PKCS11_FUNCTION_INFO(C_CreateObject) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_ATTRIBUTE_PTR pTemplate, /* the object's template */ +++- CK_ULONG ulCount, /* attributes in template */ +++- CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* the object's template */ ++++ CK_ULONG ulCount, /* attributes in template */ ++++ CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */ ++++ ); +++ #endif +++ +++- +++ /* C_CopyObject copies an object, creating a new object for the +++- * copy. +++- */ ++++ * copy. */ +++ CK_PKCS11_FUNCTION_INFO(C_CopyObject) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hObject, /* the object's handle */ +++- CK_ATTRIBUTE_PTR pTemplate, /* template for new object */ +++- CK_ULONG ulCount, /* attributes in template */ +++- CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hObject, /* the object's handle */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* template for new object */ ++++ CK_ULONG ulCount, /* attributes in template */ ++++ CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */ ++++ ); +++ #endif +++ +++- +++ /* C_DestroyObject destroys an object. */ +++ CK_PKCS11_FUNCTION_INFO(C_DestroyObject) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hObject /* the object's handle */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hObject /* the object's handle */ ++++ ); +++ #endif +++ +++- +++ /* C_GetObjectSize gets the size of an object in bytes. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetObjectSize) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hObject, /* the object's handle */ +++- CK_ULONG_PTR pulSize /* receives size of object */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hObject, /* the object's handle */ ++++ CK_ULONG_PTR pulSize /* receives size of object */ ++++ ); +++ #endif +++ +++- +++ /* C_GetAttributeValue obtains the value of one or more object +++- * attributes. +++- */ ++++ * attributes. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hObject, /* the object's handle */ +++- CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */ +++- CK_ULONG ulCount /* attributes in template */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hObject, /* the object's handle */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */ ++++ CK_ULONG ulCount /* attributes in template */ ++++ ); +++ #endif +++ +++- +++ /* C_SetAttributeValue modifies the value of one or more object +++- * attributes. +++- */ ++++ * attributes */ +++ CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hObject, /* the object's handle */ +++- CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */ +++- CK_ULONG ulCount /* attributes in template */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hObject, /* the object's handle */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */ ++++ CK_ULONG ulCount /* attributes in template */ ++++ ); +++ #endif +++ +++- +++ /* C_FindObjectsInit initializes a search for token and session +++- * objects that match a template. +++- */ ++++ * objects that match a template. */ +++ CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */ +++- CK_ULONG ulCount /* attrs in search template */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */ ++++ CK_ULONG ulCount /* attrs in search template */ ++++ ); +++ #endif +++ +++- +++ /* C_FindObjects continues a search for token and session +++ * objects that match a template, obtaining additional object +++- * handles. +++- */ ++++ * handles. */ +++ CK_PKCS11_FUNCTION_INFO(C_FindObjects) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */ +++- CK_ULONG ulMaxObjectCount, /* max handles to get */ +++- CK_ULONG_PTR pulObjectCount /* actual # returned */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */ ++++ CK_ULONG ulMaxObjectCount, /* max handles to get */ ++++ CK_ULONG_PTR pulObjectCount /* actual # returned */ ++++ ); +++ #endif +++ +++- +++ /* C_FindObjectsFinal finishes a search for token and session +++- * objects. +++- */ ++++ * objects. */ +++ CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession /* the session's handle */ ++++ ); +++ #endif +++ +++- +++- +++ /* Encryption and decryption */ +++ +++ /* C_EncryptInit initializes an encryption operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of encryption key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ ++++ CK_OBJECT_HANDLE hKey /* handle of encryption key */ ++++ ); +++ #endif +++ +++- +++ /* C_Encrypt encrypts single-part data. */ +++ CK_PKCS11_FUNCTION_INFO(C_Encrypt) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pData, /* the plaintext data */ +++- CK_ULONG ulDataLen, /* bytes of plaintext */ +++- CK_BYTE_PTR pEncryptedData, /* gets ciphertext */ +++- CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pData, /* the plaintext data */ ++++ CK_ULONG ulDataLen, /* bytes of plaintext */ ++++ CK_BYTE_PTR pEncryptedData, /* gets ciphertext */ ++++ CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */ ++++ ); +++ #endif +++ +++- +++ /* C_EncryptUpdate continues a multiple-part encryption +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pPart, /* the plaintext data */ +++- CK_ULONG ulPartLen, /* plaintext data len */ +++- CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ +++- CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pPart, /* the plaintext data */ ++++ CK_ULONG ulPartLen, /* plaintext data len */ ++++ CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ ++++ CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */ ++++ ); +++ #endif +++ +++- +++ /* C_EncryptFinal finishes a multiple-part encryption +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session handle */ +++- CK_BYTE_PTR pLastEncryptedPart, /* last c-text */ +++- CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session handle */ ++++ CK_BYTE_PTR pLastEncryptedPart, /* last c-text */ ++++ CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */ ++++ ); +++ #endif +++ +++- +++ /* C_DecryptInit initializes a decryption operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of decryption key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ ++++ CK_OBJECT_HANDLE hKey /* handle of decryption key */ ++++ ); +++ #endif +++ +++- +++ /* C_Decrypt decrypts encrypted data in a single part. */ +++ CK_PKCS11_FUNCTION_INFO(C_Decrypt) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pEncryptedData, /* ciphertext */ +++- CK_ULONG ulEncryptedDataLen, /* ciphertext length */ +++- CK_BYTE_PTR pData, /* gets plaintext */ +++- CK_ULONG_PTR pulDataLen /* gets p-text size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pEncryptedData, /* ciphertext */ ++++ CK_ULONG ulEncryptedDataLen, /* ciphertext length */ ++++ CK_BYTE_PTR pData, /* gets plaintext */ ++++ CK_ULONG_PTR pulDataLen /* gets p-text size */ ++++ ); +++ #endif +++ +++- +++ /* C_DecryptUpdate continues a multiple-part decryption +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pEncryptedPart, /* encrypted data */ +++- CK_ULONG ulEncryptedPartLen, /* input length */ +++- CK_BYTE_PTR pPart, /* gets plaintext */ +++- CK_ULONG_PTR pulPartLen /* p-text size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pEncryptedPart, /* encrypted data */ ++++ CK_ULONG ulEncryptedPartLen, /* input length */ ++++ CK_BYTE_PTR pPart, /* gets plaintext */ ++++ CK_ULONG_PTR pulPartLen /* p-text size */ ++++ ); +++ #endif +++ +++- +++ /* C_DecryptFinal finishes a multiple-part decryption +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pLastPart, /* gets plaintext */ +++- CK_ULONG_PTR pulLastPartLen /* p-text size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pLastPart, /* gets plaintext */ ++++ CK_ULONG_PTR pulLastPartLen /* p-text size */ ++++ ); +++ #endif +++ +++- +++- +++ /* Message digesting */ +++ +++ /* C_DigestInit initializes a message-digesting operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DigestInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism /* the digesting mechanism */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism /* the digesting mechanism */ ++++ ); +++ #endif +++ +++- +++ /* C_Digest digests data in a single part. */ +++ CK_PKCS11_FUNCTION_INFO(C_Digest) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pData, /* data to be digested */ +++- CK_ULONG ulDataLen, /* bytes of data to digest */ +++- CK_BYTE_PTR pDigest, /* gets the message digest */ +++- CK_ULONG_PTR pulDigestLen /* gets digest length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pData, /* data to be digested */ ++++ CK_ULONG ulDataLen, /* bytes of data to digest */ ++++ CK_BYTE_PTR pDigest, /* gets the message digest */ ++++ CK_ULONG_PTR pulDigestLen /* gets digest length */ ++++ ); +++ #endif +++ +++- +++ /* C_DigestUpdate continues a multiple-part message-digesting +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pPart, /* data to be digested */ +++- CK_ULONG ulPartLen /* bytes of data to be digested */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pPart, /* data to be digested */ ++++ CK_ULONG ulPartLen /* bytes of data to be digested */ ++++ ); +++ #endif +++ +++- +++ /* C_DigestKey continues a multi-part message-digesting +++ * operation, by digesting the value of a secret key as part of +++- * the data already digested. +++- */ ++++ * the data already digested. */ +++ CK_PKCS11_FUNCTION_INFO(C_DigestKey) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_OBJECT_HANDLE hKey /* secret key to digest */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_OBJECT_HANDLE hKey /* secret key to digest */ ++++ ); +++ #endif +++ +++- +++ /* C_DigestFinal finishes a multiple-part message-digesting +++- * operation. +++- */ ++++ * operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DigestFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pDigest, /* gets the message digest */ +++- CK_ULONG_PTR pulDigestLen /* gets byte count of digest */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pDigest, /* gets the message digest */ ++++ CK_ULONG_PTR pulDigestLen /* gets byte count of digest */ ++++ ); +++ #endif +++ +++- +++- +++ /* Signing and MACing */ +++ +++ /* C_SignInit initializes a signature (private key encryption) +++ * operation, where the signature is (will be) an appendix to +++ * the data, and plaintext cannot be recovered from the +++- * signature. +++- */ ++++ *signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of signature key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ ++++ CK_OBJECT_HANDLE hKey /* handle of signature key */ ++++ ); +++ #endif +++ +++- +++ /* C_Sign signs (encrypts with private key) data in a single +++ * part, where the signature is (will be) an appendix to the +++- * data, and plaintext cannot be recovered from the signature. +++- */ ++++ * data, and plaintext cannot be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_Sign) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pData, /* the data to sign */ +++- CK_ULONG ulDataLen, /* count of bytes to sign */ +++- CK_BYTE_PTR pSignature, /* gets the signature */ +++- CK_ULONG_PTR pulSignatureLen /* gets signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pData, /* the data to sign */ ++++ CK_ULONG ulDataLen, /* count of bytes to sign */ ++++ CK_BYTE_PTR pSignature, /* gets the signature */ ++++ CK_ULONG_PTR pulSignatureLen /* gets signature length */ ++++ ); +++ #endif +++ +++- +++ /* C_SignUpdate continues a multiple-part signature operation, +++ * where the signature is (will be) an appendix to the data, +++- * and plaintext cannot be recovered from the signature. +++- */ ++++ * and plaintext cannot be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pPart, /* the data to sign */ +++- CK_ULONG ulPartLen /* count of bytes to sign */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pPart, /* the data to sign */ ++++ CK_ULONG ulPartLen /* count of bytes to sign */ ++++ ); +++ #endif +++ +++- +++ /* C_SignFinal finishes a multiple-part signature operation, +++- * returning the signature. +++- */ ++++ * returning the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pSignature, /* gets the signature */ +++- CK_ULONG_PTR pulSignatureLen /* gets signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pSignature, /* gets the signature */ ++++ CK_ULONG_PTR pulSignatureLen /* gets signature length */ ++++ ); +++ #endif +++ +++- +++ /* C_SignRecoverInit initializes a signature operation, where +++- * the data can be recovered from the signature. +++- */ ++++ * the data can be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of the signature key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ ++++ CK_OBJECT_HANDLE hKey /* handle of the signature key */ ++++ ); +++ #endif +++ +++- +++ /* C_SignRecover signs data in a single operation, where the +++- * data can be recovered from the signature. +++- */ ++++ * data can be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignRecover) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pData, /* the data to sign */ +++- CK_ULONG ulDataLen, /* count of bytes to sign */ +++- CK_BYTE_PTR pSignature, /* gets the signature */ +++- CK_ULONG_PTR pulSignatureLen /* gets signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pData, /* the data to sign */ ++++ CK_ULONG ulDataLen, /* count of bytes to sign */ ++++ CK_BYTE_PTR pSignature, /* gets the signature */ ++++ CK_ULONG_PTR pulSignatureLen /* gets signature length */ ++++ ); +++ #endif +++ +++- +++- +++ /* Verifying signatures and MACs */ +++ +++ /* C_VerifyInit initializes a verification operation, where the +++ * signature is an appendix to the data, and plaintext cannot +++- * cannot be recovered from the signature (e.g. DSA). +++- */ ++++ * cannot be recovered from the signature (e.g. DSA). */ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ +++- CK_OBJECT_HANDLE hKey /* verification key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ ++++ CK_OBJECT_HANDLE hKey /* verification key */ ++++ ); +++ #endif +++ +++- +++ /* C_Verify verifies a signature in a single-part operation, +++ * where the signature is an appendix to the data, and plaintext +++- * cannot be recovered from the signature. +++- */ ++++ * cannot be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_Verify) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pData, /* signed data */ +++- CK_ULONG ulDataLen, /* length of signed data */ +++- CK_BYTE_PTR pSignature, /* signature */ +++- CK_ULONG ulSignatureLen /* signature length*/ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pData, /* signed data */ ++++ CK_ULONG ulDataLen, /* length of signed data */ ++++ CK_BYTE_PTR pSignature, /* signature */ ++++ CK_ULONG ulSignatureLen /* signature length*/ ++++ ); +++ #endif +++ +++- +++ /* C_VerifyUpdate continues a multiple-part verification +++ * operation, where the signature is an appendix to the data, +++- * and plaintext cannot be recovered from the signature. +++- */ ++++ * and plaintext cannot be recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pPart, /* signed data */ +++- CK_ULONG ulPartLen /* length of signed data */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pPart, /* signed data */ ++++ CK_ULONG ulPartLen /* length of signed data */ ++++ ); +++ #endif +++ +++- +++ /* C_VerifyFinal finishes a multiple-part verification +++- * operation, checking the signature. +++- */ ++++ * operation, checking the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pSignature, /* signature to verify */ +++- CK_ULONG ulSignatureLen /* signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pSignature, /* signature to verify */ ++++ CK_ULONG ulSignatureLen /* signature length */ ++++ ); +++ #endif +++ +++- +++ /* C_VerifyRecoverInit initializes a signature verification +++- * operation, where the data is recovered from the signature. +++- */ ++++ * operation, where the data is recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ +++- CK_OBJECT_HANDLE hKey /* verification key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ ++++ CK_OBJECT_HANDLE hKey /* verification key */ ++++ ); +++ #endif +++ +++- +++ /* C_VerifyRecover verifies a signature in a single-part +++- * operation, where the data is recovered from the signature. +++- */ ++++ * operation, where the data is recovered from the signature. */ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pSignature, /* signature to verify */ +++- CK_ULONG ulSignatureLen, /* signature length */ +++- CK_BYTE_PTR pData, /* gets signed data */ +++- CK_ULONG_PTR pulDataLen /* gets signed data len */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pSignature, /* signature to verify */ ++++ CK_ULONG ulSignatureLen, /* signature length */ ++++ CK_BYTE_PTR pData, /* gets signed data */ ++++ CK_ULONG_PTR pulDataLen /* gets signed data len */ ++++ ); +++ #endif +++ +++- +++- +++ /* Dual-function cryptographic operations */ +++ +++ /* C_DigestEncryptUpdate continues a multiple-part digesting +++- * and encryption operation. +++- */ ++++ * and encryption operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pPart, /* the plaintext data */ +++- CK_ULONG ulPartLen, /* plaintext length */ +++- CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ +++- CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pPart, /* the plaintext data */ ++++ CK_ULONG ulPartLen, /* plaintext length */ ++++ CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ ++++ CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ ++++ ); +++ #endif +++ +++- +++ /* C_DecryptDigestUpdate continues a multiple-part decryption and +++- * digesting operation. +++- */ ++++ * digesting operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pEncryptedPart, /* ciphertext */ +++- CK_ULONG ulEncryptedPartLen, /* ciphertext length */ +++- CK_BYTE_PTR pPart, /* gets plaintext */ +++- CK_ULONG_PTR pulPartLen /* gets plaintext len */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pEncryptedPart, /* ciphertext */ ++++ CK_ULONG ulEncryptedPartLen, /* ciphertext length */ ++++ CK_BYTE_PTR pPart, /* gets plaintext */ ++++ CK_ULONG_PTR pulPartLen /* gets plaintext len */ ++++ ); +++ #endif +++ +++- +++ /* C_SignEncryptUpdate continues a multiple-part signing and +++- * encryption operation. +++- */ ++++ * encryption operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pPart, /* the plaintext data */ +++- CK_ULONG ulPartLen, /* plaintext length */ +++- CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ +++- CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pPart, /* the plaintext data */ ++++ CK_ULONG ulPartLen, /* plaintext length */ ++++ CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ ++++ CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ ++++ ); +++ #endif +++ +++- +++ /* C_DecryptVerifyUpdate continues a multiple-part decryption and +++- * verify operation. +++- */ ++++ * verify operation. */ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_BYTE_PTR pEncryptedPart, /* ciphertext */ +++- CK_ULONG ulEncryptedPartLen, /* ciphertext length */ +++- CK_BYTE_PTR pPart, /* gets plaintext */ +++- CK_ULONG_PTR pulPartLen /* gets p-text length */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_BYTE_PTR pEncryptedPart, /* ciphertext */ ++++ CK_ULONG ulEncryptedPartLen, /* ciphertext length */ ++++ CK_BYTE_PTR pPart, /* gets plaintext */ ++++ CK_ULONG_PTR pulPartLen /* gets p-text length */ ++++ ); +++ #endif +++ +++- +++- +++ /* Key management */ +++ +++ /* C_GenerateKey generates a secret key, creating a new key +++- * object. +++- */ ++++ * object. */ +++ CK_PKCS11_FUNCTION_INFO(C_GenerateKey) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* key generation mech. */ +++- CK_ATTRIBUTE_PTR pTemplate, /* template for new key */ +++- CK_ULONG ulCount, /* # of attrs in template */ +++- CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* key generation mech. */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* template for new key */ ++++ CK_ULONG ulCount, /* # of attrs in template */ ++++ CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */ ++++ ); +++ #endif +++ +++- +++ /* C_GenerateKeyPair generates a public-key/private-key pair, +++- * creating new key objects. +++- */ ++++ * creating new key objects. */ +++ CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session handle */ +++- CK_MECHANISM_PTR pMechanism, /* key-gen mech. */ +++- CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template for pub. key */ +++- CK_ULONG ulPublicKeyAttributeCount, /* # pub. attrs. */ +++- CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template for priv. key */ +++- CK_ULONG ulPrivateKeyAttributeCount, /* # priv. attrs. */ +++- CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. key handle */ +++- CK_OBJECT_HANDLE_PTR phPrivateKey /* gets priv. key handle */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session handle */ ++++ CK_MECHANISM_PTR pMechanism, /* key-gen mech. */ ++++ CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template for pub. key */ ++++ CK_ULONG ulPublicKeyAttributeCount, /* # pub. attrs. */ ++++ CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template for priv. key */ ++++ CK_ULONG ulPrivateKeyAttributeCount, /* # priv. attrs. */ ++++ CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. key handle */ ++++ CK_OBJECT_HANDLE_PTR phPrivateKey /* gets priv. key handle */ ++++ ); +++ #endif +++ +++- +++ /* C_WrapKey wraps (i.e., encrypts) a key. */ +++ CK_PKCS11_FUNCTION_INFO(C_WrapKey) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */ +++- CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */ +++- CK_OBJECT_HANDLE hKey, /* key to be wrapped */ +++- CK_BYTE_PTR pWrappedKey, /* gets wrapped key */ +++- CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */ ++++ CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */ ++++ CK_OBJECT_HANDLE hKey, /* key to be wrapped */ ++++ CK_BYTE_PTR pWrappedKey, /* gets wrapped key */ ++++ CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */ ++++ ); +++ #endif +++ +++- +++ /* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new +++- * key object. +++- */ ++++ * key object. */ +++ CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */ +++- CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */ +++- CK_BYTE_PTR pWrappedKey, /* the wrapped key */ +++- CK_ULONG ulWrappedKeyLen, /* wrapped key len */ +++- CK_ATTRIBUTE_PTR pTemplate, /* new key template */ +++- CK_ULONG ulAttributeCount, /* template length */ +++- CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */ ++++ CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */ ++++ CK_BYTE_PTR pWrappedKey, /* the wrapped key */ ++++ CK_ULONG ulWrappedKeyLen, /* wrapped key len */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* new key template */ ++++ CK_ULONG ulAttributeCount, /* template length */ ++++ CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ ++++ ); +++ #endif +++ +++- +++ /* C_DeriveKey derives a key from a base key, creating a new key +++- * object. +++- */ ++++ * object. */ +++ CK_PKCS11_FUNCTION_INFO(C_DeriveKey) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */ +++- CK_OBJECT_HANDLE hBaseKey, /* base key */ +++- CK_ATTRIBUTE_PTR pTemplate, /* new key template */ +++- CK_ULONG ulAttributeCount, /* template length */ +++- CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ +++-); ++++ CK_SESSION_HANDLE hSession, /* session's handle */ ++++ CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */ ++++ CK_OBJECT_HANDLE hBaseKey, /* base key */ ++++ CK_ATTRIBUTE_PTR pTemplate, /* new key template */ ++++ CK_ULONG ulAttributeCount, /* template length */ ++++ CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ ++++ ); +++ #endif +++ +++- +++- +++ /* Random number generation */ +++ +++ /* C_SeedRandom mixes additional seed material into the token's +++- * random number generator. +++- */ ++++ * random number generator. */ +++ CK_PKCS11_FUNCTION_INFO(C_SeedRandom) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR pSeed, /* the seed material */ +++- CK_ULONG ulSeedLen /* length of seed material */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR pSeed, /* the seed material */ ++++ CK_ULONG ulSeedLen /* length of seed material */ ++++ ); +++ #endif +++ +++- +++ /* C_GenerateRandom generates random data. */ +++ CK_PKCS11_FUNCTION_INFO(C_GenerateRandom) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_BYTE_PTR RandomData, /* receives the random data */ +++- CK_ULONG ulRandomLen /* # of bytes to generate */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_BYTE_PTR RandomData, /* receives the random data */ ++++ CK_ULONG ulRandomLen /* # of bytes to generate */ ++++ ); +++ #endif +++ +++- +++- +++ /* Parallel function management */ +++ +++ /* C_GetFunctionStatus is a legacy function; it obtains an +++ * updated status of a function running in parallel with an +++- * application. +++- */ ++++ * application. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession /* the session's handle */ ++++ ); +++ #endif +++ +++- +++ /* C_CancelFunction is a legacy function; it cancels a function +++- * running in parallel. +++- */ ++++ * running in parallel. */ +++ CK_PKCS11_FUNCTION_INFO(C_CancelFunction) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession /* the session's handle */ ++++ ); +++ #endif +++ ++++/* Functions added in for PKCS #11 Version 2.01 or later */ +++ +++ /* C_WaitForSlotEvent waits for a slot event (token insertion, +++- * removal, etc.) to occur. +++- */ ++++ * removal, etc.) to occur. */ +++ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_FLAGS flags, /* blocking/nonblocking flag */ +++- CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */ +++- CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ +++-); ++++ CK_FLAGS flags, /* blocking/nonblocking flag */ ++++ CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */ ++++ CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ ++++ ); +++ #endif +++ +++-#ifndef CK_PKCS11_2_0_ONLY +++-/* C_GetInterfaceList returns all the interfaces supported by the module*/ ++++#if defined(CK_PKCS11_3_0) && !defined(CK_PKCS11_2_0_ONLY) +++ CK_PKCS11_FUNCTION_INFO(C_GetInterfaceList) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_INTERFACE_PTR pInterfacesList, /* returned interfaces */ +++- CK_ULONG_PTR pulCount /* number of interfaces returned */ +++-); ++++ CK_INTERFACE_PTR interfaces, ++++ CK_ULONG_PTR pulCount); +++ #endif +++ +++-/* C_GetInterface returns a specific interface from the module. */ +++ CK_PKCS11_FUNCTION_INFO(C_GetInterface) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_UTF8CHAR_PTR pInterfaceName, /* name of the interface */ +++- CK_VERSION_PTR pVersion, /* version of the interface */ +++- CK_INTERFACE_PTR_PTR ppInterface, /* returned interface */ +++- CK_FLAGS flags /* flags controlling the semantics +++- * of the interface */ +++-); ++++ CK_UTF8CHAR_PTR pInterfaceName, ++++ CK_VERSION_PTR pVersion, ++++ CK_INTERFACE_PTR_PTR ppInterface, ++++ CK_FLAGS flags); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_LoginUser) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_USER_TYPE userType, /* the user type */ +++- CK_UTF8CHAR_PTR pPin, /* the user's PIN */ +++- CK_ULONG ulPinLen, /* the length of the PIN */ +++- CK_UTF8CHAR_PTR pUsername, /* the user's name */ +++- CK_ULONG ulUsernameLen /*the length of the user's name */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_USER_TYPE userType, ++++ CK_CHAR_PTR pPin, ++++ CK_ULONG ulPinLen, ++++ CK_UTF8CHAR_PTR pUsername, ++++ CK_ULONG ulUsernameLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_SessionCancel) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_FLAGS flags /* flags control which sessions are cancelled */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_FLAGS flags); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageEncryptInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of encryption key */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_MECHANISM_PTR pMechanism, ++++ CK_OBJECT_HANDLE hKey); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptMessage) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ +++- CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ +++- CK_BYTE_PTR pPlaintext, /* plain text */ +++- CK_ULONG ulPlaintextLen, /* plain text length */ +++- CK_BYTE_PTR pCiphertext, /* gets cipher text */ +++- CK_ULONG_PTR pulCiphertextLen /* gets cipher text length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pAssociatedData, ++++ CK_ULONG ulAssociatedDataLen, ++++ CK_BYTE_PTR pPlaintext, ++++ CK_ULONG ulPlaintextLen, ++++ CK_BYTE_PTR pCiphertext, ++++ CK_ULONG_PTR pulCiphertextLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptMessageBegin) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ +++- CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pAssociatedData, ++++ CK_ULONG ulAssociatedDataLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_EncryptMessageNext) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pPlaintextPart, /* plain text */ +++- CK_ULONG ulPlaintextPartLen, /* plain text length */ +++- CK_BYTE_PTR pCiphertextPart, /* gets cipher text */ +++- CK_ULONG_PTR pulCiphertextPartLen, /* gets cipher text length */ +++- CK_FLAGS flags /* multi mode flag */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pPlaintextPart, ++++ CK_ULONG ulPlaintextPartLen, ++++ CK_BYTE_PTR pCiphertextPart, ++++ CK_ULONG_PTR pulCiphertextPartLen, ++++ CK_FLAGS flags); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageEncryptFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageDecryptInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of decryption key */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_MECHANISM_PTR pMechanism, ++++ CK_OBJECT_HANDLE hKey); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptMessage) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ +++- CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ +++- CK_BYTE_PTR pCiphertext, /* cipher text */ +++- CK_ULONG ulCiphertextLen, /* cipher text length */ +++- CK_BYTE_PTR pPlaintext, /* gets plain text */ +++- CK_ULONG_PTR pulPlaintextLen /* gets plain text length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pAssociatedData, ++++ CK_ULONG ulAssociatedDataLen, ++++ CK_BYTE_PTR pCiphertext, ++++ CK_ULONG ulCiphertextLen, ++++ CK_BYTE_PTR pPlaintext, ++++ CK_ULONG_PTR pulPlaintextLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptMessageBegin) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ +++- CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pAssociatedData, ++++ CK_ULONG ulAssociatedDataLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_DecryptMessageNext) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pCiphertextPart, /* cipher text */ +++- CK_ULONG ulCiphertextPartLen, /* cipher text length */ +++- CK_BYTE_PTR pPlaintextPart, /* gets plain text */ +++- CK_ULONG_PTR pulPlaintextPartLen, /* gets plain text length */ +++- CK_FLAGS flags /* multi mode flag */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pCiphertextPart, ++++ CK_ULONG ulCiphertextPartLen, ++++ CK_BYTE_PTR pPlaintextPart, ++++ CK_ULONG_PTR pulPlaintextPartLen, ++++ CK_FLAGS flags); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageDecryptFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageSignInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of signing key */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_MECHANISM_PTR pMechanism, ++++ CK_OBJECT_HANDLE hKey); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_SignMessage) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pData, /* data to sign */ +++- CK_ULONG ulDataLen, /* data to sign length */ +++- CK_BYTE_PTR pSignature, /* gets signature */ +++- CK_ULONG_PTR pulSignatureLen /* gets signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pData, ++++ CK_ULONG ulDataLen, ++++ ++++ CK_BYTE_PTR pSignature, ++++ CK_ULONG_PTR pulSignatureLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_SignMessageBegin) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen /* length of message specific parameter */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_SignMessageNext) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pData, /* data to sign */ +++- CK_ULONG ulDataLen, /* data to sign length */ +++- CK_BYTE_PTR pSignature, /* gets signature */ +++- CK_ULONG_PTR pulSignatureLen /* gets signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pData, ++++ CK_ULONG ulDataLen, ++++ CK_BYTE_PTR pSignature, ++++ CK_ULONG_PTR pulSignatureLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageSignFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageVerifyInit) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ +++- CK_OBJECT_HANDLE hKey /* handle of signing key */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_MECHANISM_PTR pMechanism, ++++ CK_OBJECT_HANDLE hKey); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyMessage) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pData, /* data to sign */ +++- CK_ULONG ulDataLen, /* data to sign length */ +++- CK_BYTE_PTR pSignature, /* signature */ +++- CK_ULONG ulSignatureLen /* signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pData, ++++ CK_ULONG ulDataLen, ++++ CK_BYTE_PTR pSignature, ++++ CK_ULONG ulSignatureLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyMessageBegin) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen /* length of message specific parameter */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_VerifyMessageNext) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_VOID_PTR pParameter, /* message specific parameter */ +++- CK_ULONG ulParameterLen, /* length of message specific parameter */ +++- CK_BYTE_PTR pData, /* data to sign */ +++- CK_ULONG ulDataLen, /* data to sign length */ +++- CK_BYTE_PTR pSignature, /* signature */ +++- CK_ULONG ulSignatureLen /* signature length */ +++-); ++++ CK_SESSION_HANDLE hSession, ++++ CK_VOID_PTR pParameter, ++++ CK_ULONG ulParameterLen, ++++ CK_BYTE_PTR pData, ++++ CK_ULONG ulDataLen, ++++ CK_BYTE_PTR pSignature, ++++ CK_ULONG ulSignatureLen); +++ #endif +++ +++ CK_PKCS11_FUNCTION_INFO(C_MessageVerifyFinal) +++ #ifdef CK_NEED_ARG_LIST +++ ( +++- CK_SESSION_HANDLE hSession /* the session's handle */ +++-); ++++ CK_SESSION_HANDLE hSession); +++ #endif +++ +++-#endif /* CK_PKCS11_2_0_ONLY */ +++- ++++#endif +++--- /dev/null ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11n.h +++@@ -0,0 +1,672 @@ ++++/* 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/. */ ++++ ++++#ifndef _PKCS11N_H_ ++++#define _PKCS11N_H_ ++++ ++++/* ++++ * pkcs11n.h ++++ * ++++ * This file contains the NSS-specific type definitions for Cryptoki ++++ * (PKCS#11). ++++ */ ++++ ++++/* ++++ * NSSCK_VENDOR_NSS ++++ * ++++ * Cryptoki reserves the high half of all the number spaces for ++++ * vendor-defined use. I'd like to keep all of our NSS- ++++ * specific values together, but not in the oh-so-obvious ++++ * 0x80000001, 0x80000002, etc. area. So I've picked an offset, ++++ * and constructed values for the beginnings of our spaces. ++++ * ++++ * Note that some "historical" Netscape values don't fall within ++++ * this range. ++++ */ ++++#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */ ++++ ++++/* ++++ * NSS-defined object classes ++++ * ++++ */ ++++#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++#define CKO_NSS_CRL (CKO_NSS + 1) ++++#define CKO_NSS_SMIME (CKO_NSS + 2) ++++#define CKO_NSS_TRUST (CKO_NSS + 3) ++++#define CKO_NSS_BUILTIN_ROOT_LIST (CKO_NSS + 4) ++++#define CKO_NSS_NEWSLOT (CKO_NSS + 5) ++++#define CKO_NSS_DELSLOT (CKO_NSS + 6) ++++ ++++/* ++++ * NSS-defined key types ++++ * ++++ */ ++++#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++#define CKK_NSS_PKCS8 (CKK_NSS + 1) ++++ ++++#define CKK_NSS_JPAKE_ROUND1 (CKK_NSS + 2) ++++#define CKK_NSS_JPAKE_ROUND2 (CKK_NSS + 3) ++++ ++++#define CKK_NSS_CHACHA20 (CKK_NSS + 4) ++++ ++++/* ++++ * NSS-defined certificate types ++++ * ++++ */ ++++#define CKC_NSS (CKC_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++/* FAKE PKCS #11 defines */ ++++#define CKA_DIGEST 0x81000000L ++++#define CKA_NSS_MESSAGE 0x82000000L ++++#define CKA_NSS_MESSAGE_MASK 0xff000000L ++++#define CKA_FLAGS_ONLY 0 /* CKA_CLASS */ ++++ ++++/* ++++ * NSS-defined object attributes ++++ * ++++ */ ++++#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++#define CKA_NSS_URL (CKA_NSS + 1) ++++#define CKA_NSS_EMAIL (CKA_NSS + 2) ++++#define CKA_NSS_SMIME_INFO (CKA_NSS + 3) ++++#define CKA_NSS_SMIME_TIMESTAMP (CKA_NSS + 4) ++++#define CKA_NSS_PKCS8_SALT (CKA_NSS + 5) ++++#define CKA_NSS_PASSWORD_CHECK (CKA_NSS + 6) ++++#define CKA_NSS_EXPIRES (CKA_NSS + 7) ++++#define CKA_NSS_KRL (CKA_NSS + 8) ++++ ++++#define CKA_NSS_PQG_COUNTER (CKA_NSS + 20) ++++#define CKA_NSS_PQG_SEED (CKA_NSS + 21) ++++#define CKA_NSS_PQG_H (CKA_NSS + 22) ++++#define CKA_NSS_PQG_SEED_BITS (CKA_NSS + 23) ++++#define CKA_NSS_MODULE_SPEC (CKA_NSS + 24) ++++#define CKA_NSS_OVERRIDE_EXTENSIONS (CKA_NSS + 25) ++++ ++++#define CKA_NSS_JPAKE_SIGNERID (CKA_NSS + 26) ++++#define CKA_NSS_JPAKE_PEERID (CKA_NSS + 27) ++++#define CKA_NSS_JPAKE_GX1 (CKA_NSS + 28) ++++#define CKA_NSS_JPAKE_GX2 (CKA_NSS + 29) ++++#define CKA_NSS_JPAKE_GX3 (CKA_NSS + 30) ++++#define CKA_NSS_JPAKE_GX4 (CKA_NSS + 31) ++++#define CKA_NSS_JPAKE_X2 (CKA_NSS + 32) ++++#define CKA_NSS_JPAKE_X2S (CKA_NSS + 33) ++++ ++++#define CKA_NSS_MOZILLA_CA_POLICY (CKA_NSS + 34) ++++#define CKA_NSS_SERVER_DISTRUST_AFTER (CKA_NSS + 35) ++++#define CKA_NSS_EMAIL_DISTRUST_AFTER (CKA_NSS + 36) ++++ ++++/* ++++ * Trust attributes: ++++ * ++++ * If trust goes standard, these probably will too. So I'll ++++ * put them all in one place. ++++ */ ++++ ++++#define CKA_TRUST (CKA_NSS + 0x2000) ++++ ++++/* "Usage" key information */ ++++#define CKA_TRUST_DIGITAL_SIGNATURE (CKA_TRUST + 1) ++++#define CKA_TRUST_NON_REPUDIATION (CKA_TRUST + 2) ++++#define CKA_TRUST_KEY_ENCIPHERMENT (CKA_TRUST + 3) ++++#define CKA_TRUST_DATA_ENCIPHERMENT (CKA_TRUST + 4) ++++#define CKA_TRUST_KEY_AGREEMENT (CKA_TRUST + 5) ++++#define CKA_TRUST_KEY_CERT_SIGN (CKA_TRUST + 6) ++++#define CKA_TRUST_CRL_SIGN (CKA_TRUST + 7) ++++ ++++/* "Purpose" trust information */ ++++#define CKA_TRUST_SERVER_AUTH (CKA_TRUST + 8) ++++#define CKA_TRUST_CLIENT_AUTH (CKA_TRUST + 9) ++++#define CKA_TRUST_CODE_SIGNING (CKA_TRUST + 10) ++++#define CKA_TRUST_EMAIL_PROTECTION (CKA_TRUST + 11) ++++#define CKA_TRUST_IPSEC_END_SYSTEM (CKA_TRUST + 12) ++++#define CKA_TRUST_IPSEC_TUNNEL (CKA_TRUST + 13) ++++#define CKA_TRUST_IPSEC_USER (CKA_TRUST + 14) ++++#define CKA_TRUST_TIME_STAMPING (CKA_TRUST + 15) ++++#define CKA_TRUST_STEP_UP_APPROVED (CKA_TRUST + 16) ++++ ++++#define CKA_CERT_SHA1_HASH (CKA_TRUST + 100) ++++#define CKA_CERT_MD5_HASH (CKA_TRUST + 101) ++++ ++++/* NSS trust stuff */ ++++ ++++/* HISTORICAL: define used to pass in the database key for DSA private keys */ ++++#define CKA_NSS_DB 0xD5A0DB00L ++++#define CKA_NSS_TRUST 0x80000001L ++++ ++++/* FAKE PKCS #11 defines */ ++++#define CKM_FAKE_RANDOM 0x80000efeUL ++++#define CKM_INVALID_MECHANISM 0xffffffffUL ++++#define CKT_INVALID_TYPE 0xffffffffUL ++++ ++++/* ++++ * NSS-defined crypto mechanisms ++++ * ++++ */ ++++#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++#define CKM_NSS_AES_KEY_WRAP (CKM_NSS + 1) ++++#define CKM_NSS_AES_KEY_WRAP_PAD (CKM_NSS + 2) ++++ ++++/* HKDF key derivation mechanisms. See CK_NSS_HKDFParams for documentation. */ ++++#define CKM_NSS_HKDF_SHA1 (CKM_NSS + 3) ++++#define CKM_NSS_HKDF_SHA256 (CKM_NSS + 4) ++++#define CKM_NSS_HKDF_SHA384 (CKM_NSS + 5) ++++#define CKM_NSS_HKDF_SHA512 (CKM_NSS + 6) ++++ ++++/* J-PAKE round 1 key generation mechanisms. ++++ * ++++ * Required template attributes: CKA_PRIME, CKA_SUBPRIME, CKA_BASE, ++++ * CKA_NSS_JPAKE_SIGNERID ++++ * Output key type: CKK_NSS_JPAKE_ROUND1 ++++ * Output key class: CKO_PRIVATE_KEY ++++ * Parameter type: CK_NSS_JPAKERound1Params ++++ * ++++ */ ++++#define CKM_NSS_JPAKE_ROUND1_SHA1 (CKM_NSS + 7) ++++#define CKM_NSS_JPAKE_ROUND1_SHA256 (CKM_NSS + 8) ++++#define CKM_NSS_JPAKE_ROUND1_SHA384 (CKM_NSS + 9) ++++#define CKM_NSS_JPAKE_ROUND1_SHA512 (CKM_NSS + 10) ++++ ++++/* J-PAKE round 2 key derivation mechanisms. ++++ * ++++ * Required template attributes: CKA_NSS_JPAKE_PEERID ++++ * Input key type: CKK_NSS_JPAKE_ROUND1 ++++ * Output key type: CKK_NSS_JPAKE_ROUND2 ++++ * Output key class: CKO_PRIVATE_KEY ++++ * Parameter type: CK_NSS_JPAKERound2Params ++++ */ ++++#define CKM_NSS_JPAKE_ROUND2_SHA1 (CKM_NSS + 11) ++++#define CKM_NSS_JPAKE_ROUND2_SHA256 (CKM_NSS + 12) ++++#define CKM_NSS_JPAKE_ROUND2_SHA384 (CKM_NSS + 13) ++++#define CKM_NSS_JPAKE_ROUND2_SHA512 (CKM_NSS + 14) ++++ ++++/* J-PAKE final key material derivation mechanisms ++++ * ++++ * Input key type: CKK_NSS_JPAKE_ROUND2 ++++ * Output key type: CKK_GENERIC_SECRET ++++ * Output key class: CKO_SECRET_KEY ++++ * Parameter type: CK_NSS_JPAKEFinalParams ++++ * ++++ * You must apply a KDF (e.g. CKM_NSS_HKDF_*) to resultant keying material ++++ * to get a key with uniformly distributed bits. ++++ */ ++++#define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15) ++++#define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16) ++++#define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17) ++++#define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18) ++++ ++++/* Constant-time MAC mechanisms: ++++ * ++++ * These operations verify a padded, MAC-then-encrypt block of data in ++++ * constant-time. Because of the order of operations, the padding bytes are not ++++ * protected by the MAC. However, disclosing the value of the padding bytes ++++ * gives an attacker the ability to decrypt ciphertexts. Such disclosure can be ++++ * as subtle as taking slightly less time to perform the MAC when the padding ++++ * is one byte longer. See https://www.isg.rhul.ac.uk/tls/ ++++ * ++++ * CKM_NSS_HMAC_CONSTANT_TIME: performs an HMAC authentication. ++++ * CKM_NSS_SSL3_MAC_CONSTANT_TIME: performs an authentication with SSLv3 MAC. ++++ * ++++ * Parameter type: CK_NSS_MAC_CONSTANT_TIME_PARAMS ++++ */ ++++#define CKM_NSS_HMAC_CONSTANT_TIME (CKM_NSS + 19) ++++#define CKM_NSS_SSL3_MAC_CONSTANT_TIME (CKM_NSS + 20) ++++ ++++/* TLS 1.2 mechanisms */ ++++#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21) ++++#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22) ++++#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23) ++++#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24) ++++ ++++/* TLS extended master secret derivation */ ++++#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25) ++++#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26) ++++ ++++#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27) ++++#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28) ++++ ++++/* Additional PKCS #12 PBE algorithms defined in v1.1 */ ++++#define CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN (CKM_NSS + 29) ++++#define CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN (CKM_NSS + 30) ++++#define CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN (CKM_NSS + 31) ++++#define CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN (CKM_NSS + 32) ++++ ++++#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33) ++++ ++++/* IKE mechanism (to be proposed to PKCS #11 */ ++++#define CKM_NSS_IKE_PRF_PLUS_DERIVE (CKM_NSS + 34) ++++#define CKM_NSS_IKE_PRF_DERIVE (CKM_NSS + 35) ++++#define CKM_NSS_IKE1_PRF_DERIVE (CKM_NSS + 36) ++++#define CKM_NSS_IKE1_APP_B_PRF_DERIVE (CKM_NSS + 37) ++++ ++++#define CKM_NSS_PUB_FROM_PRIV (CKM_NSS + 40) ++++ ++++/* SP800-108 NSS mechanism with support for data object derivation */ ++++#define CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA (CKM_NSS + 42) ++++#define CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA (CKM_NSS + 43) ++++#define CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA (CKM_NSS + 44) ++++ ++++/* ++++ * HISTORICAL: ++++ * Do not attempt to use these. They are only used by NSS's internal ++++ * PKCS #11 interface. Most of these are place holders for other mechanism ++++ * and will change in the future. ++++ */ ++++#define CKM_NSS_PBE_SHA1_DES_CBC 0x80000002UL ++++#define CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL ++++#define CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL ++++#define CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL ++++#define CKM_NSS_PBE_SHA1_40_BIT_RC4 0x80000006UL ++++#define CKM_NSS_PBE_SHA1_128_BIT_RC4 0x80000007UL ++++#define CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC 0x80000008UL ++++#define CKM_NSS_PBE_SHA1_HMAC_KEY_GEN 0x80000009UL ++++#define CKM_NSS_PBE_MD5_HMAC_KEY_GEN 0x8000000aUL ++++#define CKM_NSS_PBE_MD2_HMAC_KEY_GEN 0x8000000bUL ++++ ++++#define CKM_TLS_PRF_GENERAL 0x80000373UL ++++ ++++typedef struct CK_NSS_JPAKEPublicValue { ++++ CK_BYTE *pGX; ++++ CK_ULONG ulGXLen; ++++ CK_BYTE *pGV; ++++ CK_ULONG ulGVLen; ++++ CK_BYTE *pR; ++++ CK_ULONG ulRLen; ++++} CK_NSS_JPAKEPublicValue; ++++ ++++typedef struct CK_NSS_JPAKERound1Params { ++++ CK_NSS_JPAKEPublicValue gx1; /* out */ ++++ CK_NSS_JPAKEPublicValue gx2; /* out */ ++++} CK_NSS_JPAKERound1Params; ++++ ++++typedef struct CK_NSS_JPAKERound2Params { ++++ CK_BYTE *pSharedKey; /* in */ ++++ CK_ULONG ulSharedKeyLen; /* in */ ++++ CK_NSS_JPAKEPublicValue gx3; /* in */ ++++ CK_NSS_JPAKEPublicValue gx4; /* in */ ++++ CK_NSS_JPAKEPublicValue A; /* out */ ++++} CK_NSS_JPAKERound2Params; ++++ ++++typedef struct CK_NSS_JPAKEFinalParams { ++++ CK_NSS_JPAKEPublicValue B; /* in */ ++++} CK_NSS_JPAKEFinalParams; ++++ ++++/* macAlg: the MAC algorithm to use. This determines the hash function used in ++++ * the HMAC/SSLv3 MAC calculations. ++++ * ulBodyTotalLen: the total length of the data, including padding bytes and ++++ * padding length. ++++ * pHeader: points to a block of data that contains additional data to ++++ * authenticate. For TLS this includes the sequence number etc. For SSLv3, ++++ * this also includes the initial padding bytes. ++++ * ++++ * NOTE: the softoken's implementation of CKM_NSS_HMAC_CONSTANT_TIME and ++++ * CKM_NSS_SSL3_MAC_CONSTANT_TIME requires that the sum of ulBodyTotalLen ++++ * and ulHeaderLen be much smaller than 2^32 / 8 bytes because it uses an ++++ * unsigned int variable to represent the length in bits. This should not ++++ * be a problem because the SSL/TLS protocol limits the size of an SSL ++++ * record to something considerably less than 2^32 bytes. ++++ */ ++++typedef struct CK_NSS_MAC_CONSTANT_TIME_PARAMS { ++++ CK_MECHANISM_TYPE macAlg; /* in */ ++++ CK_ULONG ulBodyTotalLen; /* in */ ++++ CK_BYTE *pHeader; /* in */ ++++ CK_ULONG ulHeaderLen; /* in */ ++++} CK_NSS_MAC_CONSTANT_TIME_PARAMS; ++++ ++++typedef struct CK_NSS_AEAD_PARAMS { ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceLen; ++++ CK_BYTE_PTR pAAD; ++++ CK_ULONG ulAADLen; ++++ CK_ULONG ulTagLen; ++++} CK_NSS_AEAD_PARAMS; ++++ ++++/* ++++ * NSS-defined return values ++++ * ++++ */ ++++#define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++#define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1) ++++#define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2) ++++ ++++/* Mandatory parameter for the CKM_NSS_HKDF_* key deriviation mechanisms. ++++ See RFC 5869. ++++ ++++ bExtract: If set, HKDF-Extract will be applied to the input key. If ++++ the optional salt is given, it is used; otherwise, the salt is ++++ set to a sequence of zeros equal in length to the HMAC output. ++++ If bExpand is not set, then the key template given to ++++ C_DeriveKey must indicate an output key size less than or equal ++++ to the output size of the HMAC. ++++ ++++ bExpand: If set, HKDF-Expand will be applied to the input key (if ++++ bExtract is not set) or to the result of HKDF-Extract (if ++++ bExtract is set). Any info given in the optional pInfo field will ++++ be included in the calculation. ++++ ++++ The size of the output key must be specified in the template passed to ++++ C_DeriveKey. ++++*/ ++++typedef struct CK_NSS_HKDFParams { ++++ CK_BBOOL bExtract; ++++ CK_BYTE_PTR pSalt; ++++ CK_ULONG ulSaltLen; ++++ CK_BBOOL bExpand; ++++ CK_BYTE_PTR pInfo; ++++ CK_ULONG ulInfoLen; ++++} CK_NSS_HKDFParams; ++++ ++++/* ++++ * CK_NSS_IKE_PRF_PLUS_PARAMS is a structure that provides the parameters to ++++ * the CKM_NSS_IKE_PRF_PLUS_DERIVE mechanism. ++++ * The fields of the structure have the following meanings: ++++ * prfMechanism underlying MAC mechanism used to generate the prf. ++++ * bHasSeedKey hSeed key is present. ++++ * hSeedKey optional seed from key ++++ * pSeedData optional seed from data. ++++ * ulSeedDataLen length of optional seed data. ++++ * If no seed data is present this value is NULL. ++++ */ ++++typedef struct CK_NSS_IKE_PRF_PLUS_DERIVE_PARAMS { ++++ CK_MECHANISM_TYPE prfMechanism; ++++ CK_BBOOL bHasSeedKey; ++++ CK_OBJECT_HANDLE hSeedKey; ++++ CK_BYTE_PTR pSeedData; ++++ CK_ULONG ulSeedDataLen; ++++} CK_NSS_IKE_PRF_PLUS_DERIVE_PARAMS; ++++ ++++/* CK_NSS_IKE_PRF_DERIVE_PARAMS is a structure that provides the parameters to ++++ * the CKM_NSS_IKE_PRF_DERIVE mechanism. ++++ * ++++ * The fields of the structure have the following meanings: ++++ * prfMechanism underlying MAC mechanism used to generate the prf. ++++ * bRekey hNewKey is present. ++++ * pNi Ni value ++++ * ulNiLen length of Ni ++++ * pNr Nr value ++++ * ulNrLen length of Nr ++++ * hNewKey New key value to drive the rekey. ++++ */ ++++typedef struct CK_NSS_IKE_PRF_DERIVE_PARAMS { ++++ CK_MECHANISM_TYPE prfMechanism; ++++ CK_BBOOL bDataAsKey; ++++ CK_BBOOL bRekey; ++++ CK_BYTE_PTR pNi; ++++ CK_ULONG ulNiLen; ++++ CK_BYTE_PTR pNr; ++++ CK_ULONG ulNrLen; ++++ CK_OBJECT_HANDLE hNewKey; ++++} CK_NSS_IKE_PRF_DERIVE_PARAMS; ++++ ++++/* CK_NSS_IKE1_PRF_DERIVE_PARAMS is a structure that provides the parameters ++++ * to the CKM_NSS_IKE_PRF_DERIVE mechanism. ++++ * ++++ * The fields of the structure have the following meanings: ++++ * prfMechanism underlying MAC mechanism used to generate the prf. ++++ * bRekey hNewKey is present. ++++ * pCKYi CKYi value ++++ * ulCKYiLen length of CKYi ++++ * pCKYr CKYr value ++++ * ulCKYrLen length of CKYr ++++ * hNewKey New key value to drive the rekey. ++++ */ ++++typedef struct CK_NSS_IKE1_PRF_DERIVE_PARAMS { ++++ CK_MECHANISM_TYPE prfMechanism; ++++ CK_BBOOL bHasPrevKey; ++++ CK_OBJECT_HANDLE hKeygxy; ++++ CK_OBJECT_HANDLE hPrevKey; ++++ CK_BYTE_PTR pCKYi; ++++ CK_ULONG ulCKYiLen; ++++ CK_BYTE_PTR pCKYr; ++++ CK_ULONG ulCKYrLen; ++++ CK_BYTE keyNumber; ++++} CK_NSS_IKE1_PRF_DERIVE_PARAMS; ++++ ++++/* CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS is a structure that provides the ++++ * parameters to the CKM_NSS_IKE_APP_B_PRF_DERIVE mechanism. ++++ * ++++ * The fields of the structure have the following meanings: ++++ * prfMechanism underlying MAC mechanism used to generate the prf. ++++ * bHasKeygxy hKeygxy exists ++++ * hKeygxy optional key to hash in the prf ++++ * pExtraData optional extra data to hash in the prf ++++ * ulExtraData length of the optional extra data. ++++ * ++++ * CK_NSS_IKE_APP_B_PRF_DERIVE can take wither CK_NSS_IKE1_APP_B_PRF_DRIVE_PARAMS ++++ * or a single CK_MECHANISM_TYPE. In the latter cases bHashKeygx is assumed to ++++ * be false and ulExtraDataLen is assumed to be '0'. ++++ */ ++++typedef struct CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS { ++++ CK_MECHANISM_TYPE prfMechanism; ++++ CK_BBOOL bHasKeygxy; ++++ CK_OBJECT_HANDLE hKeygxy; ++++ CK_BYTE_PTR pExtraData; ++++ CK_ULONG ulExtraDataLen; ++++} CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS; ++++ ++++/* ++++ * Parameter for the TLS extended master secret key derivation mechanisms: ++++ * ++++ * * CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE ++++ * * CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH ++++ * ++++ * For the TLS 1.2 PRF, the prfHashMechanism parameter determines the hash ++++ * function used. For earlier versions of the PRF, set the prfHashMechanism ++++ * value to CKM_TLS_PRF. ++++ * ++++ * The session hash input is expected to be the output of the same hash ++++ * function as the PRF uses (as required by draft-ietf-tls-session-hash). So ++++ * the ulSessionHashLen member must be equal the output length of the hash ++++ * function specified by the prfHashMechanism member (or, for pre-TLS 1.2 PRF, ++++ * the length of concatenated MD5 and SHA-1 digests). ++++ * ++++ */ ++++typedef struct CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS { ++++ CK_MECHANISM_TYPE prfHashMechanism; ++++ CK_BYTE_PTR pSessionHash; ++++ CK_ULONG ulSessionHashLen; ++++ CK_VERSION_PTR pVersion; ++++} CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS; ++++ ++++/* ++++ * Trust info ++++ * ++++ * This isn't part of the Cryptoki standard (yet), so I'm putting ++++ * all the definitions here. Some of this would move to nssckt.h ++++ * if trust info were made part of the standard. In view of this ++++ * possibility, I'm putting my (NSS) values in the NSS ++++ * vendor space, like everything else. ++++ */ ++++ ++++typedef CK_ULONG CK_TRUST; ++++ ++++/* The following trust types are defined: */ ++++#define CKT_VENDOR_DEFINED 0x80000000 ++++ ++++#define CKT_NSS (CKT_VENDOR_DEFINED | NSSCK_VENDOR_NSS) ++++ ++++/* If trust goes standard, these'll probably drop out of vendor space. */ ++++#define CKT_NSS_TRUSTED (CKT_NSS + 1) ++++#define CKT_NSS_TRUSTED_DELEGATOR (CKT_NSS + 2) ++++#define CKT_NSS_MUST_VERIFY_TRUST (CKT_NSS + 3) ++++#define CKT_NSS_NOT_TRUSTED (CKT_NSS + 10) ++++#define CKT_NSS_TRUST_UNKNOWN (CKT_NSS + 5) /* default */ ++++ ++++/* ++++ * These may well remain NSS-specific; I'm only using them ++++ * to cache resolution data. ++++ */ ++++#define CKT_NSS_VALID_DELEGATOR (CKT_NSS + 11) ++++ ++++/* ++++ * old definitions. They still exist, but the plain meaning of the ++++ * labels have never been accurate to what was really implemented. ++++ * The new labels correctly reflect what the values effectively mean. ++++ */ ++++#if defined(__GNUC__) && (__GNUC__ > 3) ++++/* make GCC warn when we use these #defines */ ++++/* ++++ * This is really painful because GCC doesn't allow us to mark random ++++ * #defines as deprecated. We can only mark the following: ++++ * functions, variables, and types. ++++ * const variables will create extra storage for everyone including this ++++ * header file, so it's undesirable. ++++ * functions could be inlined to prevent storage creation, but will fail ++++ * when constant values are expected (like switch statements). ++++ * enum types do not seem to pay attention to the deprecated attribute. ++++ * ++++ * That leaves typedefs. We declare new types that we then deprecate, then ++++ * cast the resulting value to the deprecated type in the #define, thus ++++ * producting the warning when the #define is used. ++++ */ ++++#if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) ++++/* The mac doesn't like the friendlier deprecate messages. I'm assuming this ++++ * is a gcc version issue rather than mac or ppc specific */ ++++typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated)); ++++typedef CK_TRUST __CKT_NSS_VALID __attribute__((deprecated)); ++++typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated)); ++++#else ++++/* when possible, get a full deprecation warning. This works on gcc 4.5 ++++ * it may work on earlier versions of gcc */ ++++typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated("CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST"))); ++++typedef CK_TRUST __CKT_NSS_VALID __attribute__((deprecated("CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED"))); ++++typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated("CKT_NSS_MUST_VERIFY really functions as CKT_NSS_TRUST_UNKNOWN"))); ++++#endif ++++#define CKT_NSS_UNTRUSTED ((__CKT_NSS_UNTRUSTED)CKT_NSS_MUST_VERIFY_TRUST) ++++#define CKT_NSS_VALID ((__CKT_NSS_VALID)CKT_NSS_NOT_TRUSTED) ++++/* keep the old value for compatibility reasons*/ ++++#define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4)) ++++#else ++++#ifdef _WIN32 ++++/* This magic gets the windows compiler to give us a deprecation ++++ * warning */ ++++#pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID) ++++#endif ++++/* CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST */ ++++#define CKT_NSS_UNTRUSTED CKT_NSS_MUST_VERIFY_TRUST ++++/* CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED */ ++++#define CKT_NSS_VALID CKT_NSS_NOT_TRUSTED ++++/* CKT_NSS_MUST_VERIFY was always treated as CKT_NSS_TRUST_UNKNOWN */ ++++#define CKT_NSS_MUST_VERIFY (CKT_NSS + 4) /*really means trust unknown*/ ++++#endif ++++ ++++/* ++++ * These are not really PKCS #11 values specifically. They are the 'loadable' ++++ * module spec NSS uses. They are available for others to use as well, but not ++++ * part of the formal PKCS #11 spec. ++++ * ++++ * The function 'FIND' returns an array of PKCS #11 initialization strings ++++ * The function 'ADD' takes a PKCS #11 initialization string and stores it. ++++ * The function 'DEL' takes a 'name= library=' value and deletes the associated ++++ * string. ++++ * The function 'RELEASE' frees the array returned by 'FIND' ++++ */ ++++#define SECMOD_MODULE_DB_FUNCTION_FIND 0 ++++#define SECMOD_MODULE_DB_FUNCTION_ADD 1 ++++#define SECMOD_MODULE_DB_FUNCTION_DEL 2 ++++#define SECMOD_MODULE_DB_FUNCTION_RELEASE 3 ++++typedef char **(PR_CALLBACK *SECMODModuleDBFunc)(unsigned long function, ++++ char *parameters, void *moduleSpec); ++++ ++++/* softoken slot ID's */ ++++#define SFTK_MIN_USER_SLOT_ID 4 ++++#define SFTK_MAX_USER_SLOT_ID 100 ++++#define SFTK_MIN_FIPS_USER_SLOT_ID 101 ++++#define SFTK_MAX_FIPS_USER_SLOT_ID 127 ++++ ++++/* Module Interface. This is the old NSS private module interface, now exported ++++ * as a PKCS #11 v3 interface. It's interface name is ++++ * "Vendor NSS Module Interface" */ ++++typedef char **(*CK_NSS_ModuleDBFunc)(unsigned long function, ++++ char *parameters, void *args); ++++typedef struct CK_NSS_MODULE_FUNCTIONS { ++++ CK_VERSION version; ++++ CK_NSS_ModuleDBFunc NSC_ModuleDBFunc; ++++} CK_NSS_MODULE_FUNCTIONS; ++++ ++++/* There was an inconsistency between the spec and the header file in defining ++++ * the CK_GCM_PARAMS structure. The authoritative reference is the header file, ++++ * but NSS used the spec when adding it to its own header. In V3 we've ++++ * corrected it, but we need to handle the old case for devices that followed ++++ * us in using the incorrect specification. */ ++++typedef struct CK_NSS_GCM_PARAMS { ++++ CK_BYTE_PTR pIv; ++++ CK_ULONG ulIvLen; ++++ CK_BYTE_PTR pAAD; ++++ CK_ULONG ulAADLen; ++++ CK_ULONG ulTagBits; ++++} CK_NSS_GCM_PARAMS; ++++ ++++typedef CK_NSS_GCM_PARAMS CK_PTR CK_NSS_GCM_PARAMS_PTR; ++++ ++++/* deprecated #defines. Drop in future NSS releases */ ++++#ifdef NSS_PKCS11_2_0_COMPAT ++++ ++++/* defines that were changed between NSS's PKCS #11 and the Oasis headers */ ++++#define CKF_EC_FP CKF_EC_F_P ++++#define CKO_KG_PARAMETERS CKO_DOMAIN_PARAMETERS ++++#define CK_INVALID_SESSION CK_INVALID_HANDLE ++++#define CKR_KEY_PARAMS_INVALID 0x0000006B ++++ ++++/* use the old wrong CK_GCM_PARAMS is NSS_PCKS11_2_0_COMPAT is defined */ ++++typedef struct CK_NSS_GCM_PARAMS CK_GCM_PARAMS; ++++typedef CK_NSS_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; ++++ ++++/* don't leave old programs in a lurch just yet, give them the old NETSCAPE ++++ * synonym if NSS_PKCS11_2_0_COMPAT is defined*/ ++++#define CKO_NETSCAPE_CRL CKO_NSS_CRL ++++#define CKO_NETSCAPE_SMIME CKO_NSS_SMIME ++++#define CKO_NETSCAPE_TRUST CKO_NSS_TRUST ++++#define CKO_NETSCAPE_BUILTIN_ROOT_LIST CKO_NSS_BUILTIN_ROOT_LIST ++++#define CKO_NETSCAPE_NEWSLOT CKO_NSS_NEWSLOT ++++#define CKO_NETSCAPE_DELSLOT CKO_NSS_DELSLOT ++++#define CKK_NETSCAPE_PKCS8 CKK_NSS_PKCS8 ++++#define CKA_NETSCAPE_URL CKA_NSS_URL ++++#define CKA_NETSCAPE_EMAIL CKA_NSS_EMAIL ++++#define CKA_NETSCAPE_SMIME_INFO CKA_NSS_SMIME_INFO ++++#define CKA_NETSCAPE_SMIME_TIMESTAMP CKA_NSS_SMIME_TIMESTAMP ++++#define CKA_NETSCAPE_PKCS8_SALT CKA_NSS_PKCS8_SALT ++++#define CKA_NETSCAPE_PASSWORD_CHECK CKA_NSS_PASSWORD_CHECK ++++#define CKA_NETSCAPE_EXPIRES CKA_NSS_EXPIRES ++++#define CKA_NETSCAPE_KRL CKA_NSS_KRL ++++#define CKA_NETSCAPE_PQG_COUNTER CKA_NSS_PQG_COUNTER ++++#define CKA_NETSCAPE_PQG_SEED CKA_NSS_PQG_SEED ++++#define CKA_NETSCAPE_PQG_H CKA_NSS_PQG_H ++++#define CKA_NETSCAPE_PQG_SEED_BITS CKA_NSS_PQG_SEED_BITS ++++#define CKA_NETSCAPE_MODULE_SPEC CKA_NSS_MODULE_SPEC ++++#define CKA_NETSCAPE_DB CKA_NSS_DB ++++#define CKA_NETSCAPE_TRUST CKA_NSS_TRUST ++++#define CKM_NETSCAPE_AES_KEY_WRAP CKM_NSS_AES_KEY_WRAP ++++#define CKM_NETSCAPE_AES_KEY_WRAP_PAD CKM_NSS_AES_KEY_WRAP_PAD ++++#define CKM_NETSCAPE_PBE_SHA1_DES_CBC CKM_NSS_PBE_SHA1_DES_CBC ++++#define CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC ++++#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC ++++#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC ++++#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4 CKM_NSS_PBE_SHA1_40_BIT_RC4 ++++#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4 CKM_NSS_PBE_SHA1_128_BIT_RC4 ++++#define CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC ++++#define CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN CKM_NSS_PBE_SHA1_HMAC_KEY_GEN ++++#define CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN CKM_NSS_PBE_MD5_HMAC_KEY_GEN ++++#define CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN CKM_NSS_PBE_MD2_HMAC_KEY_GEN ++++#define CKR_NETSCAPE_CERTDB_FAILED CKR_NSS_CERTDB_FAILED ++++#define CKR_NETSCAPE_KEYDB_FAILED CKR_NSS_KEYDB_FAILED ++++ ++++#define CKT_NETSCAPE_TRUSTED CKT_NSS_TRUSTED ++++#define CKT_NETSCAPE_TRUSTED_DELEGATOR CKT_NSS_TRUSTED_DELEGATOR ++++#define CKT_NETSCAPE_UNTRUSTED CKT_NSS_UNTRUSTED ++++#define CKT_NETSCAPE_MUST_VERIFY CKT_NSS_MUST_VERIFY ++++#define CKT_NETSCAPE_TRUST_UNKNOWN CKT_NSS_TRUST_UNKNOWN ++++#define CKT_NETSCAPE_VALID CKT_NSS_VALID ++++#define CKT_NETSCAPE_VALID_DELEGATOR CKT_NSS_VALID_DELEGATOR ++++#else ++++/* use the new CK_GCM_PARAMS if NSS_PKCS11_2_0_COMPAT is not defined */ ++++typedef struct CK_GCM_PARAMS_V3 CK_GCM_PARAMS; ++++typedef CK_GCM_PARAMS_V3 CK_PTR CK_GCM_PARAMS_PTR; ++++#endif ++++ ++++#endif /* _PKCS11N_H_ */ +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h +++@@ -1,1150 +1,1265 @@ +++-/* Copyright (c) OASIS Open 2016, 2019. All Rights Reserved./ +++- * /Distributed under the terms of the OASIS IPR Policy, +++- * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY +++- * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A +++- * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. +++- */ +++- +++-/* Latest version of the specification: +++- * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html +++- */ +++- +++-/* See top of pkcs11.h for information about the macros that +++- * must be defined and the structure-packing conventions that +++- * must be set before including this file. ++++/* 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/. */ ++++/* License to copy and use this software is granted provided that it is ++++ * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface ++++ * (Cryptoki)" in all material mentioning or referencing this software. ++++ ++++ * License is also granted to make and use derivative works provided that ++++ * such works are identified as "derived from the RSA Security Inc. PKCS #11 ++++ * Cryptographic Token Interface (Cryptoki)" in all material mentioning or ++++ * referencing the derived work. ++++ ++++ * RSA Security Inc. makes no representations concerning either the ++++ * merchantability of this software or the suitability of this software for ++++ * any particular purpose. It is provided "as is" without express or implied ++++ * warranty of any kind. +++ */ +++ +++ #ifndef _PKCS11T_H_ +++ #define _PKCS11T_H_ 1 +++ +++-#define CRYPTOKI_VERSION_MAJOR 3 +++-#define CRYPTOKI_VERSION_MINOR 0 +++-#define CRYPTOKI_VERSION_AMENDMENT 0 +++- +++-#define CK_TRUE 1 +++-#define CK_FALSE 0 +++- +++-#ifndef CK_DISABLE_TRUE_FALSE +++-#ifndef FALSE +++-#define FALSE CK_FALSE +++-#endif +++-#ifndef TRUE +++-#define TRUE CK_TRUE +++-#endif ++++#define CK_TRUE 1 ++++#define CK_FALSE 0 ++++ ++++#include "prtypes.h" ++++ ++++#define CK_PTR * ++++#define CK_NULL_PTR 0 ++++#define CK_CALLBACK_FUNCTION(rtype, func) rtype(PR_CALLBACK *func) ++++#define CK_DECLARE_FUNCTION(rtype, func) extern rtype func ++++#define CK_DECLARE_FUNCTION_POINTER(rtype, func) rtype(PR_CALLBACK *func) ++++ ++++#ifdef NSS_PCKS11_2_0_COMPAT ++++#define prfHashMechanism prfMechanism +++ #endif +++ ++++#define CRYPTOKI_VERSION_MAJOR 3 ++++#define CRYPTOKI_VERSION_MINOR 0 ++++#define CRYPTOKI_VERSION_AMENDMENT 0 ++++ +++ /* an unsigned 8-bit value */ +++-typedef unsigned char CK_BYTE; ++++typedef unsigned char CK_BYTE; +++ +++ /* an unsigned 8-bit character */ +++-typedef CK_BYTE CK_CHAR; ++++typedef CK_BYTE CK_CHAR; +++ +++ /* an 8-bit UTF-8 character */ +++-typedef CK_BYTE CK_UTF8CHAR; ++++typedef CK_BYTE CK_UTF8CHAR; +++ +++ /* a BYTE-sized Boolean flag */ +++-typedef CK_BYTE CK_BBOOL; ++++typedef CK_BYTE CK_BBOOL; +++ +++ /* an unsigned value, at least 32 bits long */ +++ typedef unsigned long int CK_ULONG; +++ +++ /* a signed value, the same size as a CK_ULONG */ +++-typedef long int CK_LONG; ++++/* CK_LONG is new for v2.0 */ ++++typedef long int CK_LONG; +++ +++ /* at least 32 bits; each bit is a Boolean flag */ +++-typedef CK_ULONG CK_FLAGS; +++- ++++typedef CK_ULONG CK_FLAGS; +++ +++ /* some special values for certain CK_ULONG variables */ +++-#define CK_UNAVAILABLE_INFORMATION (~0UL) +++-#define CK_EFFECTIVELY_INFINITE 0UL +++- ++++#define CK_UNAVAILABLE_INFORMATION (~0UL) ++++#define CK_EFFECTIVELY_INFINITE 0 +++ +++-typedef CK_BYTE CK_PTR CK_BYTE_PTR; +++-typedef CK_CHAR CK_PTR CK_CHAR_PTR; +++-typedef CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR; +++-typedef CK_ULONG CK_PTR CK_ULONG_PTR; +++-typedef void CK_PTR CK_VOID_PTR; ++++typedef CK_BYTE CK_PTR CK_BYTE_PTR; ++++typedef CK_CHAR CK_PTR CK_CHAR_PTR; ++++typedef CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR; ++++typedef CK_ULONG CK_PTR CK_ULONG_PTR; ++++typedef void CK_PTR CK_VOID_PTR; +++ +++ /* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */ +++ typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; +++ ++++/* The following value is always invalid if used as a session */ ++++/* handle or object handle */ ++++#define CK_INVALID_HANDLE 0 +++ +++-/* The following value is always invalid if used as a session +++- * handle or object handle +++- */ +++-#define CK_INVALID_HANDLE 0UL +++- ++++/* pack */ ++++// #include "pkcs11p.h" +++ +++ typedef struct CK_VERSION { +++- CK_BYTE major; /* integer portion of version number */ +++- CK_BYTE minor; /* 1/100ths portion of version number */ ++++ CK_BYTE major; /* integer portion of version number */ ++++ CK_BYTE minor; /* 1/100ths portion of version number */ +++ } CK_VERSION; +++ +++ typedef CK_VERSION CK_PTR CK_VERSION_PTR; +++ +++- +++ typedef struct CK_INFO { +++- CK_VERSION cryptokiVersion; /* Cryptoki interface ver */ +++- CK_UTF8CHAR manufacturerID[32]; /* blank padded */ +++- CK_FLAGS flags; /* must be zero */ ++++ /* manufacturerID and libraryDecription have been changed from ++++ * CK_CHAR to CK_UTF8CHAR for v2.10 */ ++++ CK_VERSION cryptokiVersion; /* PKCS #11 interface ver */ ++++ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ ++++ CK_FLAGS flags; /* must be zero */ ++++ ++++ /* libraryDescription and libraryVersion are new for v2.0 */ +++ CK_UTF8CHAR libraryDescription[32]; /* blank padded */ +++- CK_VERSION libraryVersion; /* version of library */ ++++ CK_VERSION libraryVersion; /* version of library */ +++ } CK_INFO; +++ +++-typedef CK_INFO CK_PTR CK_INFO_PTR; +++- ++++typedef CK_INFO CK_PTR CK_INFO_PTR; +++ +++ /* CK_NOTIFICATION enumerates the types of notifications that +++- * Cryptoki provides to an application +++- */ ++++ * PKCS #11 provides to an application */ ++++/* CK_NOTIFICATION has been changed from an enum to a CK_ULONG ++++ * for v2.0 */ +++ typedef CK_ULONG CK_NOTIFICATION; +++-#define CKN_SURRENDER 0UL +++-#define CKN_OTP_CHANGED 1UL ++++#define CKN_SURRENDER 0 +++ +++-typedef CK_ULONG CK_SLOT_ID; ++++typedef CK_ULONG CK_SLOT_ID; +++ +++ typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR; +++ +++- +++ /* CK_SLOT_INFO provides information about a slot */ +++ typedef struct CK_SLOT_INFO { +++- CK_UTF8CHAR slotDescription[64]; /* blank padded */ +++- CK_UTF8CHAR manufacturerID[32]; /* blank padded */ +++- CK_FLAGS flags; ++++ /* slotDescription and manufacturerID have been changed from ++++ * CK_CHAR to CK_UTF8CHAR for v2.10 */ ++++ CK_UTF8CHAR slotDescription[64]; /* blank padded */ ++++ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ ++++ CK_FLAGS flags; +++ +++- CK_VERSION hardwareVersion; /* version of hardware */ +++- CK_VERSION firmwareVersion; /* version of firmware */ ++++ /* hardwareVersion and firmwareVersion are new for v2.0 */ ++++ CK_VERSION hardwareVersion; /* version of hardware */ ++++ CK_VERSION firmwareVersion; /* version of firmware */ +++ } CK_SLOT_INFO; +++ +++ /* flags: bit flags that provide capabilities of the slot +++ * Bit Flag Mask Meaning +++ */ +++-#define CKF_TOKEN_PRESENT 0x00000001UL /* a token is there */ +++-#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/ +++-#define CKF_HW_SLOT 0x00000004UL /* hardware slot */ ++++#define CKF_TOKEN_PRESENT 0x00000001UL /* a token is there */ ++++#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/ ++++#define CKF_HW_SLOT 0x00000004UL /* hardware slot */ +++ +++ typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR; +++ +++- +++ /* CK_TOKEN_INFO provides information about a token */ +++ typedef struct CK_TOKEN_INFO { +++- CK_UTF8CHAR label[32]; /* blank padded */ +++- CK_UTF8CHAR manufacturerID[32]; /* blank padded */ +++- CK_UTF8CHAR model[16]; /* blank padded */ +++- CK_CHAR serialNumber[16]; /* blank padded */ +++- CK_FLAGS flags; /* see below */ +++- +++- CK_ULONG ulMaxSessionCount; /* max open sessions */ +++- CK_ULONG ulSessionCount; /* sess. now open */ +++- CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ +++- CK_ULONG ulRwSessionCount; /* R/W sess. now open */ +++- CK_ULONG ulMaxPinLen; /* in bytes */ +++- CK_ULONG ulMinPinLen; /* in bytes */ +++- CK_ULONG ulTotalPublicMemory; /* in bytes */ +++- CK_ULONG ulFreePublicMemory; /* in bytes */ +++- CK_ULONG ulTotalPrivateMemory; /* in bytes */ +++- CK_ULONG ulFreePrivateMemory; /* in bytes */ +++- CK_VERSION hardwareVersion; /* version of hardware */ +++- CK_VERSION firmwareVersion; /* version of firmware */ +++- CK_CHAR utcTime[16]; /* time */ ++++ /* label, manufacturerID, and model have been changed from ++++ * CK_CHAR to CK_UTF8CHAR for v2.10 */ ++++ CK_UTF8CHAR label[32]; /* blank padded */ ++++ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ ++++ CK_UTF8CHAR model[16]; /* blank padded */ ++++ CK_CHAR serialNumber[16]; /* blank padded */ ++++ CK_FLAGS flags; /* see below */ ++++ ++++ /* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, ++++ * ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been ++++ * changed from CK_USHORT to CK_ULONG for v2.0 */ ++++ CK_ULONG ulMaxSessionCount; /* max open sessions */ ++++ CK_ULONG ulSessionCount; /* sess. now open */ ++++ CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ ++++ CK_ULONG ulRwSessionCount; /* R/W sess. now open */ ++++ CK_ULONG ulMaxPinLen; /* in bytes */ ++++ CK_ULONG ulMinPinLen; /* in bytes */ ++++ CK_ULONG ulTotalPublicMemory; /* in bytes */ ++++ CK_ULONG ulFreePublicMemory; /* in bytes */ ++++ CK_ULONG ulTotalPrivateMemory; /* in bytes */ ++++ CK_ULONG ulFreePrivateMemory; /* in bytes */ ++++ ++++ /* hardwareVersion, firmwareVersion, and time are new for ++++ * v2.0 */ ++++ CK_VERSION hardwareVersion; /* version of hardware */ ++++ CK_VERSION firmwareVersion; /* version of firmware */ ++++ CK_CHAR utcTime[16]; /* time */ +++ } CK_TOKEN_INFO; +++ +++ /* The flags parameter is defined as follows: +++ * Bit Flag Mask Meaning +++ */ +++-#define CKF_RNG 0x00000001UL /* has random # generator */ +++-#define CKF_WRITE_PROTECTED 0x00000002UL /* token is write-protected */ +++-#define CKF_LOGIN_REQUIRED 0x00000004UL /* user must login */ +++-#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's PIN is set */ ++++#define CKF_RNG 0x00000001UL /* has random # \ ++++ * generator */ ++++#define CKF_WRITE_PROTECTED 0x00000002UL /* token is \ ++++ * write- \ ++++ * protected */ ++++#define CKF_LOGIN_REQUIRED 0x00000004UL /* user must \ ++++ * login */ ++++#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \ ++++ * PIN is set */ +++ +++-/* CKF_RESTORE_KEY_NOT_NEEDED. If it is set, ++++/* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0. If it is set, +++ * that means that *every* time the state of cryptographic +++ * operations of a session is successfully saved, all keys +++- * needed to continue those operations are stored in the state +++- */ +++-#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020UL ++++ * needed to continue those operations are stored in the state */ ++++#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020UL +++ +++-/* CKF_CLOCK_ON_TOKEN. If it is set, that means ++++/* CKF_CLOCK_ON_TOKEN is new for v2.0. If it is set, that means +++ * that the token has some sort of clock. The time on that +++- * clock is returned in the token info structure +++- */ +++-#define CKF_CLOCK_ON_TOKEN 0x00000040UL ++++ * clock is returned in the token info structure */ ++++#define CKF_CLOCK_ON_TOKEN 0x00000040UL +++ +++-/* CKF_PROTECTED_AUTHENTICATION_PATH. If it is ++++/* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0. If it is +++ * set, that means that there is some way for the user to login +++- * without sending a PIN through the Cryptoki library itself +++- */ ++++ * without sending a PIN through the PKCS #11 library itself */ +++ #define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100UL +++ +++-/* CKF_DUAL_CRYPTO_OPERATIONS. If it is true, ++++/* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0. If it is true, +++ * that means that a single session with the token can perform +++ * dual simultaneous cryptographic operations (digest and +++ * encrypt; decrypt and digest; sign and encrypt; and decrypt +++- * and sign) +++- */ +++-#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200UL ++++ * and sign) */ ++++#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200UL +++ +++-/* CKF_TOKEN_INITIALIZED. If it is true, the ++++/* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the +++ * token has been initialized using C_InitializeToken or an +++ * equivalent mechanism outside the scope of PKCS #11. +++ * Calling C_InitializeToken when this flag is set will cause +++- * the token to be reinitialized. +++- */ +++-#define CKF_TOKEN_INITIALIZED 0x00000400UL ++++ * the token to be reinitialized. */ ++++#define CKF_TOKEN_INITIALIZED 0x00000400UL +++ +++-/* CKF_SECONDARY_AUTHENTICATION. If it is ++++/* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is +++ * true, the token supports secondary authentication for +++- * private key objects. +++- */ +++-#define CKF_SECONDARY_AUTHENTICATION 0x00000800UL ++++ * private key objects. This flag is deprecated in v2.11 and ++++ onwards. */ ++++#define CKF_SECONDARY_AUTHENTICATION 0x00000800UL +++ +++-/* CKF_USER_PIN_COUNT_LOW. If it is true, an ++++/* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an +++ * incorrect user login PIN has been entered at least once +++- * since the last successful authentication. +++- */ +++-#define CKF_USER_PIN_COUNT_LOW 0x00010000UL ++++ * since the last successful authentication. */ ++++#define CKF_USER_PIN_COUNT_LOW 0x00010000UL +++ +++-/* CKF_USER_PIN_FINAL_TRY. If it is true, +++- * supplying an incorrect user PIN will it to become locked. +++- */ +++-#define CKF_USER_PIN_FINAL_TRY 0x00020000UL ++++/* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true, ++++ * supplying an incorrect user PIN will it to become locked. */ ++++#define CKF_USER_PIN_FINAL_TRY 0x00020000UL +++ +++-/* CKF_USER_PIN_LOCKED. If it is true, the ++++/* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the +++ * user PIN has been locked. User login to the token is not +++- * possible. +++- */ +++-#define CKF_USER_PIN_LOCKED 0x00040000UL ++++ * possible. */ ++++#define CKF_USER_PIN_LOCKED 0x00040000UL +++ +++-/* CKF_USER_PIN_TO_BE_CHANGED. If it is true, ++++/* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, +++ * the user PIN value is the default value set by token +++ * initialization or manufacturing, or the PIN has been +++- * expired by the card. +++- */ +++-#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000UL ++++ * expired by the card. */ ++++#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000UL +++ +++-/* CKF_SO_PIN_COUNT_LOW. If it is true, an ++++/* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an +++ * incorrect SO login PIN has been entered at least once since +++- * the last successful authentication. +++- */ +++-#define CKF_SO_PIN_COUNT_LOW 0x00100000UL ++++ * the last successful authentication. */ ++++#define CKF_SO_PIN_COUNT_LOW 0x00100000UL +++ +++-/* CKF_SO_PIN_FINAL_TRY. If it is true, +++- * supplying an incorrect SO PIN will it to become locked. +++- */ +++-#define CKF_SO_PIN_FINAL_TRY 0x00200000UL ++++/* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true, ++++ * supplying an incorrect SO PIN will it to become locked. */ ++++#define CKF_SO_PIN_FINAL_TRY 0x00200000UL +++ +++-/* CKF_SO_PIN_LOCKED. If it is true, the SO ++++/* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO +++ * PIN has been locked. SO login to the token is not possible. +++ */ +++-#define CKF_SO_PIN_LOCKED 0x00400000UL ++++#define CKF_SO_PIN_LOCKED 0x00400000UL +++ +++-/* CKF_SO_PIN_TO_BE_CHANGED. If it is true, ++++/* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, +++ * the SO PIN value is the default value set by token +++ * initialization or manufacturing, or the PIN has been +++- * expired by the card. +++- */ +++-#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000UL ++++ * expired by the card. */ ++++#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000UL +++ +++-#define CKF_ERROR_STATE 0x01000000UL ++++#define CKF_ERROR_STATE 0x01000000UL +++ +++ typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR; +++ +++- +++-/* CK_SESSION_HANDLE is a Cryptoki-assigned value that +++- * identifies a session +++- */ +++-typedef CK_ULONG CK_SESSION_HANDLE; ++++/* CK_SESSION_HANDLE is a PKCS #11-assigned value that ++++ * identifies a session */ ++++typedef CK_ULONG CK_SESSION_HANDLE; +++ +++ typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR; +++ +++- +++-/* CK_USER_TYPE enumerates the types of Cryptoki users */ +++-typedef CK_ULONG CK_USER_TYPE; ++++/* CK_USER_TYPE enumerates the types of PKCS #11 users */ ++++/* CK_USER_TYPE has been changed from an enum to a CK_ULONG for ++++ * v2.0 */ ++++typedef CK_ULONG CK_USER_TYPE; +++ /* Security Officer */ +++-#define CKU_SO 0UL ++++#define CKU_SO 0 +++ /* Normal user */ +++-#define CKU_USER 1UL +++-/* Context specific */ +++-#define CKU_CONTEXT_SPECIFIC 2UL ++++#define CKU_USER 1 ++++/* Context specific (added in v2.20) */ ++++#define CKU_CONTEXT_SPECIFIC 2 +++ +++ /* CK_STATE enumerates the session states */ +++-typedef CK_ULONG CK_STATE; +++-#define CKS_RO_PUBLIC_SESSION 0UL +++-#define CKS_RO_USER_FUNCTIONS 1UL +++-#define CKS_RW_PUBLIC_SESSION 2UL +++-#define CKS_RW_USER_FUNCTIONS 3UL +++-#define CKS_RW_SO_FUNCTIONS 4UL ++++/* CK_STATE has been changed from an enum to a CK_ULONG for ++++ * v2.0 */ ++++typedef CK_ULONG CK_STATE; ++++#define CKS_RO_PUBLIC_SESSION 0 ++++#define CKS_RO_USER_FUNCTIONS 1 ++++#define CKS_RW_PUBLIC_SESSION 2 ++++#define CKS_RW_USER_FUNCTIONS 3 ++++#define CKS_RW_SO_FUNCTIONS 4 +++ +++ /* CK_SESSION_INFO provides information about a session */ +++ typedef struct CK_SESSION_INFO { +++ CK_SLOT_ID slotID; +++- CK_STATE state; +++- CK_FLAGS flags; /* see below */ +++- CK_ULONG ulDeviceError; /* device-dependent error code */ ++++ CK_STATE state; ++++ CK_FLAGS flags; /* see below */ ++++ ++++ /* ulDeviceError was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++ CK_ULONG ulDeviceError; /* device-dependent error code */ +++ } CK_SESSION_INFO; +++ +++ /* The flags are defined in the following table: +++ * Bit Flag Mask Meaning +++ */ +++-#define CKF_RW_SESSION 0x00000002UL /* session is r/w */ +++-#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */ ++++#define CKF_RW_SESSION 0x00000002UL /* session is r/w */ ++++#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */ +++ +++ typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR; +++ +++- +++ /* CK_OBJECT_HANDLE is a token-specific identifier for an +++- * object +++- */ +++-typedef CK_ULONG CK_OBJECT_HANDLE; ++++ * object */ ++++typedef CK_ULONG CK_OBJECT_HANDLE; +++ +++ typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; +++ +++- +++ /* CK_OBJECT_CLASS is a value that identifies the classes (or +++- * types) of objects that Cryptoki recognizes. It is defined +++- * as follows: +++- */ +++-typedef CK_ULONG CK_OBJECT_CLASS; ++++ * types) of objects that PKCS #11 recognizes. It is defined ++++ * as follows: */ ++++/* CK_OBJECT_CLASS was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++typedef CK_ULONG CK_OBJECT_CLASS; +++ +++ /* The following classes of objects are defined: */ +++-#define CKO_DATA 0x00000000UL +++-#define CKO_CERTIFICATE 0x00000001UL +++-#define CKO_PUBLIC_KEY 0x00000002UL +++-#define CKO_PRIVATE_KEY 0x00000003UL +++-#define CKO_SECRET_KEY 0x00000004UL +++-#define CKO_HW_FEATURE 0x00000005UL ++++/* CKO_HW_FEATURE is new for v2.10 */ ++++/* CKO_DOMAIN_PARAMETERS is new for v2.11 */ ++++/* CKO_MECHANISM is new for v2.20 */ ++++/* CKO_PROFILE is new for v3.00 */ ++++#define CKO_DATA 0x00000000UL ++++#define CKO_CERTIFICATE 0x00000001UL ++++#define CKO_PUBLIC_KEY 0x00000002UL ++++#define CKO_PRIVATE_KEY 0x00000003UL ++++#define CKO_SECRET_KEY 0x00000004UL ++++#define CKO_HW_FEATURE 0x00000005UL +++ #define CKO_DOMAIN_PARAMETERS 0x00000006UL +++-#define CKO_MECHANISM 0x00000007UL +++-#define CKO_OTP_KEY 0x00000008UL +++-#define CKO_PROFILE 0x00000009UL +++- +++-#define CKO_VENDOR_DEFINED 0x80000000UL ++++#define CKO_MECHANISM 0x00000007UL ++++#define CKO_PROFILE 0x00000009UL ++++#define CKO_VENDOR_DEFINED 0x80000000UL +++ +++ typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; +++ ++++/* CK_PROFILE_ID is new for v3.00. CK_PROFILE_ID is a value that ++++ * identifies the profile that the token supports. */ ++++typedef CK_ULONG CK_PROFILE_ID; ++++ +++ /* Profile ID's */ +++-#define CKP_INVALID_ID 0x00000000UL +++-#define CKP_BASELINE_PROVIDER 0x00000001UL +++-#define CKP_EXTENDED_PROVIDER 0x00000002UL +++-#define CKP_AUTHENTICATION_TOKEN 0x00000003UL ++++#define CKP_INVALID_ID 0x00000000UL ++++#define CKP_BASELINE_PROVIDER 0x00000001UL ++++#define CKP_EXTENDED_PROVIDER 0x00000002UL ++++#define CKP_AUTHENTICATION_TOKEN 0x00000003UL +++ #define CKP_PUBLIC_CERTIFICATES_TOKEN 0x00000004UL +++-#define CKP_VENDOR_DEFINED 0x80000000UL ++++#define CKP_VENDOR_DEFINED 0x80000000UL +++ +++-/* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type +++- * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. +++- */ +++-typedef CK_ULONG CK_HW_FEATURE_TYPE; ++++/* CK_HW_FEATURE_TYPE is new for v2.10. CK_HW_FEATURE_TYPE is a ++++ * value that identifies the hardware feature type of an object ++++ * with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */ ++++typedef CK_ULONG CK_HW_FEATURE_TYPE; +++ +++ /* The following hardware feature types are defined */ +++-#define CKH_MONOTONIC_COUNTER 0x00000001UL +++-#define CKH_CLOCK 0x00000002UL +++-#define CKH_USER_INTERFACE 0x00000003UL +++-#define CKH_VENDOR_DEFINED 0x80000000UL ++++/* CKH_USER_INTERFACE is new for v2.20 */ ++++#define CKH_MONOTONIC_COUNTER 0x00000001UL ++++#define CKH_CLOCK 0x00000002UL ++++#define CKH_USER_INTERFACE 0x00000003UL ++++#define CKH_VENDOR_DEFINED 0x80000000UL +++ +++ /* CK_KEY_TYPE is a value that identifies a key type */ +++-typedef CK_ULONG CK_KEY_TYPE; ++++/* CK_KEY_TYPE was changed from CK_USHORT to CK_ULONG for v2.0 */ ++++typedef CK_ULONG CK_KEY_TYPE; +++ +++ /* the following key types are defined: */ +++-#define CKK_RSA 0x00000000UL +++-#define CKK_DSA 0x00000001UL +++-#define CKK_DH 0x00000002UL +++-#define CKK_ECDSA 0x00000003UL /* Deprecated */ +++-#define CKK_EC 0x00000003UL +++-#define CKK_X9_42_DH 0x00000004UL +++-#define CKK_KEA 0x00000005UL +++-#define CKK_GENERIC_SECRET 0x00000010UL +++-#define CKK_RC2 0x00000011UL +++-#define CKK_RC4 0x00000012UL +++-#define CKK_DES 0x00000013UL +++-#define CKK_DES2 0x00000014UL +++-#define CKK_DES3 0x00000015UL +++-#define CKK_CAST 0x00000016UL +++-#define CKK_CAST3 0x00000017UL +++-#define CKK_CAST5 0x00000018UL /* Deprecated */ +++-#define CKK_CAST128 0x00000018UL +++-#define CKK_RC5 0x00000019UL +++-#define CKK_IDEA 0x0000001AUL +++-#define CKK_SKIPJACK 0x0000001BUL +++-#define CKK_BATON 0x0000001CUL +++-#define CKK_JUNIPER 0x0000001DUL +++-#define CKK_CDMF 0x0000001EUL +++-#define CKK_AES 0x0000001FUL +++-#define CKK_BLOWFISH 0x00000020UL +++-#define CKK_TWOFISH 0x00000021UL +++-#define CKK_SECURID 0x00000022UL +++-#define CKK_HOTP 0x00000023UL +++-#define CKK_ACTI 0x00000024UL +++-#define CKK_CAMELLIA 0x00000025UL +++-#define CKK_ARIA 0x00000026UL +++- +++-/* the following definitions were added in the 2.30 header file, +++- * but never defined in the spec. */ +++-#define CKK_MD5_HMAC 0x00000027UL +++-#define CKK_SHA_1_HMAC 0x00000028UL +++-#define CKK_RIPEMD128_HMAC 0x00000029UL +++-#define CKK_RIPEMD160_HMAC 0x0000002AUL +++-#define CKK_SHA256_HMAC 0x0000002BUL +++-#define CKK_SHA384_HMAC 0x0000002CUL +++-#define CKK_SHA512_HMAC 0x0000002DUL +++-#define CKK_SHA224_HMAC 0x0000002EUL +++- +++-#define CKK_SEED 0x0000002FUL +++-#define CKK_GOSTR3410 0x00000030UL +++-#define CKK_GOSTR3411 0x00000031UL +++-#define CKK_GOST28147 0x00000032UL +++-#define CKK_CHACHA20 0x00000033UL +++-#define CKK_POLY1305 0x00000034UL +++-#define CKK_AES_XTS 0x00000035UL +++-#define CKK_SHA3_224_HMAC 0x00000036UL +++-#define CKK_SHA3_256_HMAC 0x00000037UL +++-#define CKK_SHA3_384_HMAC 0x00000038UL +++-#define CKK_SHA3_512_HMAC 0x00000039UL +++-#define CKK_BLAKE2B_160_HMAC 0x0000003aUL +++-#define CKK_BLAKE2B_256_HMAC 0x0000003bUL +++-#define CKK_BLAKE2B_384_HMAC 0x0000003cUL +++-#define CKK_BLAKE2B_512_HMAC 0x0000003dUL +++-#define CKK_SALSA20 0x0000003eUL +++-#define CKK_X2RATCHET 0x0000003fUL +++-#define CKK_EC_EDWARDS 0x00000040UL +++-#define CKK_EC_MONTGOMERY 0x00000041UL +++-#define CKK_HKDF 0x00000042UL +++-#define CKK_SHA512_224_HMAC 0x00000043UL +++-#define CKK_SHA512_256_HMAC 0x00000044UL +++-#define CKK_SHA512_T_HMAC 0x00000045UL +++- +++-#define CKK_VENDOR_DEFINED 0x80000000UL ++++#define CKK_RSA 0x00000000UL ++++#define CKK_DSA 0x00000001UL ++++#define CKK_DH 0x00000002UL ++++ ++++/* CKK_ECDSA and CKK_KEA are new for v2.0 */ ++++/* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */ ++++#define CKK_ECDSA 0x00000003UL ++++#define CKK_EC 0x00000003UL ++++#define CKK_X9_42_DH 0x00000004UL ++++#define CKK_KEA 0x00000005UL ++++ ++++#define CKK_GENERIC_SECRET 0x00000010UL ++++#define CKK_RC2 0x00000011UL ++++#define CKK_RC4 0x00000012UL ++++#define CKK_DES 0x00000013UL ++++#define CKK_DES2 0x00000014UL ++++#define CKK_DES3 0x00000015UL ++++ ++++/* all these key types are new for v2.0 */ ++++#define CKK_CAST 0x00000016UL ++++#define CKK_CAST3 0x00000017UL ++++/* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */ ++++#define CKK_CAST5 0x00000018UL ++++#define CKK_CAST128 0x00000018UL ++++#define CKK_RC5 0x00000019UL ++++#define CKK_IDEA 0x0000001AUL ++++#define CKK_SKIPJACK 0x0000001BUL ++++#define CKK_BATON 0x0000001CUL ++++#define CKK_JUNIPER 0x0000001DUL ++++#define CKK_CDMF 0x0000001EUL ++++#define CKK_AES 0x0000001FUL ++++ ++++/* BlowFish and TwoFish are new for v2.20 */ ++++#define CKK_BLOWFISH 0x00000020UL ++++#define CKK_TWOFISH 0x00000021UL ++++ ++++/* Camellia is proposed for v2.20 Amendment 3 */ ++++#define CKK_CAMELLIA 0x00000025UL ++++ ++++#define CKK_SEED 0x0000002FUL /* was 2A */ ++++ ++++/* added in v2.30 */ ++++#define CKK_ARIA 0x00000026UL ++++ ++++/* added in 2.40 */ ++++#define CKK_MD5_HMAC 0x00000027UL ++++#define CKK_SHA_1_HMAC 0x00000028UL ++++#define CKK_RIPEMD128_HMAC 0x00000029UL ++++#define CKK_RIPEMD160_HMAC 0x0000002AUL ++++#define CKK_SHA256_HMAC 0x0000002BUL ++++#define CKK_SHA384_HMAC 0x0000002CUL ++++#define CKK_SHA512_HMAC 0x0000002DUL ++++#define CKK_SHA224_HMAC 0x0000002EUL ++++#define CKK_GOSTR3410 0x00000030UL ++++#define CKK_GOSTR3411 0x00000031UL ++++#define CKK_GOST28147 0x00000032UL ++++#define CKK_CHACHA20 0x00000033UL ++++#define CKK_POLY1305 0x00000034UL ++++#define CKK_AES_XTS 0x00000035UL ++++#define CKK_SHA3_224_HMAC 0x00000036UL ++++#define CKK_SHA3_256_HMAC 0x00000037UL ++++#define CKK_SHA3_384_HMAC 0x00000038UL ++++#define CKK_SHA3_512_HMAC 0x00000039UL ++++ ++++/* added in 3.0 */ ++++#define CKK_BLAKE2B_160_HMAC 0x0000003aUL ++++#define CKK_BLAKE2B_256_HMAC 0x0000003bUL ++++#define CKK_BLAKE2B_384_HMAC 0x0000003cUL ++++#define CKK_BLAKE2B_512_HMAC 0x0000003dUL ++++#define CKK_SALSA20 0x0000003eUL ++++#define CKK_X2RATCHET 0x0000003fUL ++++#define CKK_EC_EDWARDS 0x00000040UL ++++#define CKK_EC_MONTGOMERY 0x00000041UL ++++#define CKK_HKDF 0x00000042UL ++++#define CKK_SHA512_224_HMAC 0x00000043UL ++++#define CKK_SHA512_256_HMAC 0x00000044UL ++++#define CKK_SHA512_T_HMAC 0x00000045UL +++ ++++#define CKK_VENDOR_DEFINED 0x80000000UL +++ +++ /* CK_CERTIFICATE_TYPE is a value that identifies a certificate +++- * type +++- */ +++-typedef CK_ULONG CK_CERTIFICATE_TYPE; +++- +++-#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED 0UL +++-#define CK_CERTIFICATE_CATEGORY_TOKEN_USER 1UL +++-#define CK_CERTIFICATE_CATEGORY_AUTHORITY 2UL +++-#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY 3UL +++- +++-#define CK_SECURITY_DOMAIN_UNSPECIFIED 0UL +++-#define CK_SECURITY_DOMAIN_MANUFACTURER 1UL +++-#define CK_SECURITY_DOMAIN_OPERATOR 2UL +++-#define CK_SECURITY_DOMAIN_THIRD_PARTY 3UL +++- ++++ * type */ ++++/* CK_CERTIFICATE_TYPE was changed from CK_USHORT to CK_ULONG ++++ * for v2.0 */ ++++typedef CK_ULONG CK_CERTIFICATE_TYPE; +++ +++ /* The following certificate types are defined: */ +++-#define CKC_X_509 0x00000000UL +++-#define CKC_X_509_ATTR_CERT 0x00000001UL +++-#define CKC_WTLS 0x00000002UL +++-#define CKC_VENDOR_DEFINED 0x80000000UL +++- ++++/* CKC_X_509_ATTR_CERT is new for v2.10 */ ++++/* CKC_WTLS is new for v2.20 */ ++++#define CKC_X_509 0x00000000UL ++++#define CKC_X_509_ATTR_CERT 0x00000001UL ++++#define CKC_WTLS 0x00000002UL ++++#define CKC_VENDOR_DEFINED 0x80000000UL +++ +++ /* CK_ATTRIBUTE_TYPE is a value that identifies an attribute +++- * type +++- */ +++-typedef CK_ULONG CK_ATTRIBUTE_TYPE; ++++ * type */ ++++/* CK_ATTRIBUTE_TYPE was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++typedef CK_ULONG CK_ATTRIBUTE_TYPE; +++ +++-/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which +++- * consists of an array of values. +++- */ +++-#define CKF_ARRAY_ATTRIBUTE 0x40000000UL ++++/* values for CKA_CERTIFICATE_CATEGORY v2.20 */ ++++typedef CK_ULONG CK_CERTIFICATE_CATEGORY; ++++#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED 0UL ++++#define CK_CERTIFICATE_CATEGORY_TOKEN_USER 1UL ++++#define CK_CERTIFICATE_CATEGORY_AUTHORITY 2UL ++++#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY 3UL +++ +++-/* The following OTP-related defines relate to the CKA_OTP_FORMAT attribute */ +++-#define CK_OTP_FORMAT_DECIMAL 0UL +++-#define CK_OTP_FORMAT_HEXADECIMAL 1UL +++-#define CK_OTP_FORMAT_ALPHANUMERIC 2UL +++-#define CK_OTP_FORMAT_BINARY 3UL ++++/* values for CKA_JAVA_MIDP_SECURITY_DOMAIN v2.20 */ ++++typedef CK_ULONG CK_JAVA_MIDP_SECURITY_DOMAIN; ++++#define CK_SECURITY_DOMAIN_UNSPECIFIED 0UL ++++#define CK_SECURITY_DOMAIN_MANUFACTURER 1UL ++++#define CK_SECURITY_DOMAIN_OPERATOR 2UL ++++#define CK_SECURITY_DOMAIN_THIRD_PARTY 3UL ++++ ++++/* values for CKA_OTP_FORMAT */ ++++#define CK_OTP_FORMAT_DECIMAL 0UL ++++#define CK_OTP_FORMAT_HEXADECIMAL 1UL ++++#define CK_OTP_FORMAT_ALPHANUMERIC 2UL ++++#define CK_OTP_FORMAT_BINARY 3UL ++++ ++++/* values for CKA_OTP_CHALLENGE_REQUIREMENT, CKA_OTP_TIME_REQUIREMENT, ++++ * CKA_OTP_COUNTER_REQUIREMENT, CKA_OTP_PIN_REQUIREMENT */ ++++#define CK_OTP_PARAM_IGNORED 0UL ++++#define CK_OTP_PARAM_OPTIONAL 1UL ++++#define CK_OTP_PARAM_MANDATORY 2UL +++ +++-/* The following OTP-related defines relate to the CKA_OTP_..._REQUIREMENT +++- * attributes +++- */ +++-#define CK_OTP_PARAM_IGNORED 0UL +++-#define CK_OTP_PARAM_OPTIONAL 1UL +++-#define CK_OTP_PARAM_MANDATORY 2UL ++++/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which ++++ consists of an array of values. */ ++++#define CKF_ARRAY_ATTRIBUTE 0x40000000UL +++ +++ /* The following attribute types are defined: */ +++-#define CKA_CLASS 0x00000000UL +++-#define CKA_TOKEN 0x00000001UL +++-#define CKA_PRIVATE 0x00000002UL +++-#define CKA_LABEL 0x00000003UL +++-#define CKA_UNIQUE_ID 0x00000004UL +++-#define CKA_APPLICATION 0x00000010UL +++-#define CKA_VALUE 0x00000011UL +++-#define CKA_OBJECT_ID 0x00000012UL +++-#define CKA_CERTIFICATE_TYPE 0x00000080UL +++-#define CKA_ISSUER 0x00000081UL +++-#define CKA_SERIAL_NUMBER 0x00000082UL +++-#define CKA_AC_ISSUER 0x00000083UL +++-#define CKA_OWNER 0x00000084UL +++-#define CKA_ATTR_TYPES 0x00000085UL +++-#define CKA_TRUSTED 0x00000086UL +++-#define CKA_CERTIFICATE_CATEGORY 0x00000087UL +++-#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088UL +++-#define CKA_URL 0x00000089UL +++-#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008AUL +++-#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008BUL +++-#define CKA_NAME_HASH_ALGORITHM 0x0000008CUL +++-#define CKA_CHECK_VALUE 0x00000090UL +++- +++-#define CKA_KEY_TYPE 0x00000100UL +++-#define CKA_SUBJECT 0x00000101UL +++-#define CKA_ID 0x00000102UL +++-#define CKA_SENSITIVE 0x00000103UL +++-#define CKA_ENCRYPT 0x00000104UL +++-#define CKA_DECRYPT 0x00000105UL +++-#define CKA_WRAP 0x00000106UL +++-#define CKA_UNWRAP 0x00000107UL +++-#define CKA_SIGN 0x00000108UL +++-#define CKA_SIGN_RECOVER 0x00000109UL +++-#define CKA_VERIFY 0x0000010AUL +++-#define CKA_VERIFY_RECOVER 0x0000010BUL +++-#define CKA_DERIVE 0x0000010CUL +++-#define CKA_START_DATE 0x00000110UL +++-#define CKA_END_DATE 0x00000111UL +++-#define CKA_MODULUS 0x00000120UL +++-#define CKA_MODULUS_BITS 0x00000121UL +++-#define CKA_PUBLIC_EXPONENT 0x00000122UL +++-#define CKA_PRIVATE_EXPONENT 0x00000123UL +++-#define CKA_PRIME_1 0x00000124UL +++-#define CKA_PRIME_2 0x00000125UL +++-#define CKA_EXPONENT_1 0x00000126UL +++-#define CKA_EXPONENT_2 0x00000127UL +++-#define CKA_COEFFICIENT 0x00000128UL +++-#define CKA_PUBLIC_KEY_INFO 0x00000129UL +++-#define CKA_PRIME 0x00000130UL +++-#define CKA_SUBPRIME 0x00000131UL +++-#define CKA_BASE 0x00000132UL +++- +++-#define CKA_PRIME_BITS 0x00000133UL +++-#define CKA_SUBPRIME_BITS 0x00000134UL +++-#define CKA_SUB_PRIME_BITS CKA_SUBPRIME_BITS +++- +++-#define CKA_VALUE_BITS 0x00000160UL +++-#define CKA_VALUE_LEN 0x00000161UL +++-#define CKA_EXTRACTABLE 0x00000162UL +++-#define CKA_LOCAL 0x00000163UL +++-#define CKA_NEVER_EXTRACTABLE 0x00000164UL +++-#define CKA_ALWAYS_SENSITIVE 0x00000165UL +++-#define CKA_KEY_GEN_MECHANISM 0x00000166UL +++- +++-#define CKA_MODIFIABLE 0x00000170UL +++-#define CKA_COPYABLE 0x00000171UL +++- +++-#define CKA_DESTROYABLE 0x00000172UL +++- +++-#define CKA_ECDSA_PARAMS 0x00000180UL /* Deprecated */ +++-#define CKA_EC_PARAMS 0x00000180UL +++- +++-#define CKA_EC_POINT 0x00000181UL +++- +++-#define CKA_SECONDARY_AUTH 0x00000200UL /* Deprecated */ +++-#define CKA_AUTH_PIN_FLAGS 0x00000201UL /* Deprecated */ +++- +++-#define CKA_ALWAYS_AUTHENTICATE 0x00000202UL +++- +++-#define CKA_WRAP_WITH_TRUSTED 0x00000210UL +++-#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000211UL) +++-#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000212UL) +++-#define CKA_DERIVE_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000213UL) +++- +++-#define CKA_OTP_FORMAT 0x00000220UL +++-#define CKA_OTP_LENGTH 0x00000221UL +++-#define CKA_OTP_TIME_INTERVAL 0x00000222UL +++-#define CKA_OTP_USER_FRIENDLY_MODE 0x00000223UL ++++#define CKA_CLASS 0x00000000UL ++++#define CKA_TOKEN 0x00000001UL ++++#define CKA_PRIVATE 0x00000002UL ++++#define CKA_LABEL 0x00000003UL ++++#define CKA_APPLICATION 0x00000010UL ++++#define CKA_VALUE 0x00000011UL ++++ ++++/* CKA_OBJECT_ID is new for v2.10 */ ++++#define CKA_OBJECT_ID 0x00000012UL ++++ ++++#define CKA_CERTIFICATE_TYPE 0x00000080UL ++++#define CKA_ISSUER 0x00000081UL ++++#define CKA_SERIAL_NUMBER 0x00000082UL ++++ ++++/* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new ++++ * for v2.10 */ ++++#define CKA_AC_ISSUER 0x00000083UL ++++#define CKA_OWNER 0x00000084UL ++++#define CKA_ATTR_TYPES 0x00000085UL ++++ ++++/* CKA_TRUSTED is new for v2.11 */ ++++#define CKA_TRUSTED 0x00000086UL ++++ ++++/* CKA_CERTIFICATE_CATEGORY ... ++++ * CKA_CHECK_VALUE are new for v2.20 */ ++++#define CKA_CERTIFICATE_CATEGORY 0x00000087UL ++++#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088UL ++++#define CKA_URL 0x00000089UL ++++#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008AUL ++++#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008BUL ++++#define CKA_CHECK_VALUE 0x00000090UL ++++ ++++#define CKA_KEY_TYPE 0x00000100UL ++++#define CKA_SUBJECT 0x00000101UL ++++#define CKA_ID 0x00000102UL ++++#define CKA_SENSITIVE 0x00000103UL ++++#define CKA_ENCRYPT 0x00000104UL ++++#define CKA_DECRYPT 0x00000105UL ++++#define CKA_WRAP 0x00000106UL ++++#define CKA_UNWRAP 0x00000107UL ++++#define CKA_SIGN 0x00000108UL ++++#define CKA_SIGN_RECOVER 0x00000109UL ++++#define CKA_VERIFY 0x0000010AUL ++++#define CKA_VERIFY_RECOVER 0x0000010BUL ++++#define CKA_DERIVE 0x0000010CUL ++++#define CKA_START_DATE 0x00000110UL ++++#define CKA_END_DATE 0x00000111UL ++++#define CKA_MODULUS 0x00000120UL ++++#define CKA_MODULUS_BITS 0x00000121UL ++++#define CKA_PUBLIC_EXPONENT 0x00000122UL ++++#define CKA_PRIVATE_EXPONENT 0x00000123UL ++++#define CKA_PRIME_1 0x00000124UL ++++#define CKA_PRIME_2 0x00000125UL ++++#define CKA_EXPONENT_1 0x00000126UL ++++#define CKA_EXPONENT_2 0x00000127UL ++++#define CKA_COEFFICIENT 0x00000128UL ++++/* CKA_PUBLIC_KEY_INFO is new for v2.40 */ ++++#define CKA_PUBLIC_KEY_INFO 0x00000129UL ++++#define CKA_PRIME 0x00000130UL ++++#define CKA_SUBPRIME 0x00000131UL ++++#define CKA_BASE 0x00000132UL ++++ ++++/* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */ ++++#define CKA_PRIME_BITS 0x00000133UL ++++#define CKA_SUBPRIME_BITS 0x00000134UL ++++#define CKA_SUB_PRIME_BITS CKA_SUBPRIME_BITS ++++/* (To retain backwards-compatibility) */ ++++ ++++#define CKA_VALUE_BITS 0x00000160UL ++++#define CKA_VALUE_LEN 0x00000161UL ++++ ++++/* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE, ++++ * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS, ++++ * and CKA_EC_POINT are new for v2.0 */ ++++#define CKA_EXTRACTABLE 0x00000162UL ++++#define CKA_LOCAL 0x00000163UL ++++#define CKA_NEVER_EXTRACTABLE 0x00000164UL ++++#define CKA_ALWAYS_SENSITIVE 0x00000165UL ++++ ++++/* CKA_KEY_GEN_MECHANISM is new for v2.11 */ ++++#define CKA_KEY_GEN_MECHANISM 0x00000166UL ++++ ++++#define CKA_MODIFIABLE 0x00000170UL ++++ ++++/* New for 2.40 */ ++++#define CKA_COPYABLE 0x00000171UL ++++#define CKA_DESTROYABLE 0x00000172UL ++++ ++++/* CKA_ECDSA_PARAMS is deprecated in v2.11, ++++ * CKA_EC_PARAMS is preferred. */ ++++#define CKA_ECDSA_PARAMS 0x00000180UL ++++#define CKA_EC_PARAMS 0x00000180UL ++++ ++++#define CKA_EC_POINT 0x00000181UL ++++ ++++/* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, ++++ * are new for v2.10. Deprecated in v2.11 and onwards. */ ++++#define CKA_SECONDARY_AUTH 0x00000200UL ++++#define CKA_AUTH_PIN_FLAGS 0x00000201UL ++++ ++++/* CKA_ALWAYS_AUTHENTICATE ... ++++ * CKA_UNWRAP_TEMPLATE are new for v2.20 */ ++++#define CKA_ALWAYS_AUTHENTICATE 0x00000202UL ++++ ++++#define CKA_WRAP_WITH_TRUSTED 0x00000210UL ++++#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x00000211UL) ++++#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x00000212UL) ++++ ++++/* new for 2.40 */ ++++#define CKA_DERIVE_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x00000213UL) ++++#define CKA_OTP_FORMAT 0x00000220UL ++++#define CKA_OTP_LENGTH 0x00000221UL ++++#define CKA_OTP_TIME_INTERVAL 0x00000222UL ++++#define CKA_OTP_USER_FRIENDLY_MODE 0x00000223UL +++ #define CKA_OTP_CHALLENGE_REQUIREMENT 0x00000224UL +++-#define CKA_OTP_TIME_REQUIREMENT 0x00000225UL +++-#define CKA_OTP_COUNTER_REQUIREMENT 0x00000226UL +++-#define CKA_OTP_PIN_REQUIREMENT 0x00000227UL +++-#define CKA_OTP_COUNTER 0x0000022EUL +++-#define CKA_OTP_TIME 0x0000022FUL +++-#define CKA_OTP_USER_IDENTIFIER 0x0000022AUL +++-#define CKA_OTP_SERVICE_IDENTIFIER 0x0000022BUL +++-#define CKA_OTP_SERVICE_LOGO 0x0000022CUL +++-#define CKA_OTP_SERVICE_LOGO_TYPE 0x0000022DUL +++- +++-#define CKA_GOSTR3410_PARAMS 0x00000250UL +++-#define CKA_GOSTR3411_PARAMS 0x00000251UL +++-#define CKA_GOST28147_PARAMS 0x00000252UL +++- +++-#define CKA_HW_FEATURE_TYPE 0x00000300UL +++-#define CKA_RESET_ON_INIT 0x00000301UL +++-#define CKA_HAS_RESET 0x00000302UL +++- +++-#define CKA_PIXEL_X 0x00000400UL +++-#define CKA_PIXEL_Y 0x00000401UL +++-#define CKA_RESOLUTION 0x00000402UL +++-#define CKA_CHAR_ROWS 0x00000403UL +++-#define CKA_CHAR_COLUMNS 0x00000404UL +++-#define CKA_COLOR 0x00000405UL +++-#define CKA_BITS_PER_PIXEL 0x00000406UL +++-#define CKA_CHAR_SETS 0x00000480UL +++-#define CKA_ENCODING_METHODS 0x00000481UL +++-#define CKA_MIME_TYPES 0x00000482UL +++-#define CKA_MECHANISM_TYPE 0x00000500UL +++-#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501UL +++-#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL +++-#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL +++-#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL) +++-#define CKA_PROFILE_ID 0x00000601UL +++-#define CKA_X2RATCHET_BAG 0x00000602UL +++-#define CKA_X2RATCHET_BAGSIZE 0x00000603UL +++-#define CKA_X2RATCHET_BOBS1STMSG 0x00000604UL +++-#define CKA_X2RATCHET_CKR 0x00000605UL +++-#define CKA_X2RATCHET_CKS 0x00000606UL +++-#define CKA_X2RATCHET_DHP 0x00000607UL +++-#define CKA_X2RATCHET_DHR 0x00000608UL +++-#define CKA_X2RATCHET_DHS 0x00000609UL +++-#define CKA_X2RATCHET_HKR 0x0000060aUL +++-#define CKA_X2RATCHET_HKS 0x0000060bUL +++-#define CKA_X2RATCHET_ISALICE 0x0000060cUL +++-#define CKA_X2RATCHET_NHKR 0x0000060dUL +++-#define CKA_X2RATCHET_NHKS 0x0000060eUL +++-#define CKA_X2RATCHET_NR 0x0000060fUL +++-#define CKA_X2RATCHET_NS 0x00000610UL +++-#define CKA_X2RATCHET_PNS 0x00000611UL +++-#define CKA_X2RATCHET_RK 0x00000612UL ++++#define CKA_OTP_TIME_REQUIREMENT 0x00000225UL ++++#define CKA_OTP_COUNTER_REQUIREMENT 0x00000226UL ++++#define CKA_OTP_PIN_REQUIREMENT 0x00000227UL ++++#define CKA_OTP_COUNTER 0x0000022EUL ++++#define CKA_OTP_TIME 0x0000022FUL ++++#define CKA_OTP_USER_IDENTIFIER 0x0000022AUL ++++#define CKA_OTP_SERVICE_IDENTIFIER 0x0000022BUL ++++#define CKA_OTP_SERVICE_LOGO 0x0000022CUL ++++#define CKA_OTP_SERVICE_LOGO_TYPE 0x0000022DUL ++++#define CKA_GOSTR3410_PARAMS 0x00000250UL ++++#define CKA_GOSTR3411_PARAMS 0x00000251UL ++++#define CKA_GOST28147_PARAMS 0x00000252UL ++++ ++++/* CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET ++++ * are new for v2.10 */ ++++#define CKA_HW_FEATURE_TYPE 0x00000300UL ++++#define CKA_RESET_ON_INIT 0x00000301UL ++++#define CKA_HAS_RESET 0x00000302UL ++++ ++++/* The following attributes are new for v2.20 */ ++++#define CKA_PIXEL_X 0x00000400UL ++++#define CKA_PIXEL_Y 0x00000401UL ++++#define CKA_RESOLUTION 0x00000402UL ++++#define CKA_CHAR_ROWS 0x00000403UL ++++#define CKA_CHAR_COLUMNS 0x00000404UL ++++#define CKA_COLOR 0x00000405UL ++++#define CKA_BITS_PER_PIXEL 0x00000406UL ++++#define CKA_CHAR_SETS 0x00000480UL ++++#define CKA_ENCODING_METHODS 0x00000481UL ++++#define CKA_MIME_TYPES 0x00000482UL ++++#define CKA_MECHANISM_TYPE 0x00000500UL ++++#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501UL ++++#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL ++++#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL ++++#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x00000600UL) ++++ ++++/* new for v3.0 */ ++++#define CKA_PROFILE_ID 0x00000601UL ++++#define CKA_X2RATCHET_BAG 0x00000602UL ++++#define CKA_X2RATCHET_BAGSIZE 0x00000603UL ++++#define CKA_X2RATCHET_BOBS1STMSG 0x00000604UL ++++#define CKA_X2RATCHET_CKR 0x00000605UL ++++#define CKA_X2RATCHET_CKS 0x00000606UL ++++#define CKA_X2RATCHET_DHP 0x00000607UL ++++#define CKA_X2RATCHET_DHR 0x00000608UL ++++#define CKA_X2RATCHET_DHS 0x00000609UL ++++#define CKA_X2RATCHET_HKR 0x0000060aUL ++++#define CKA_X2RATCHET_HKS 0x0000060bUL ++++#define CKA_X2RATCHET_ISALICE 0x0000060cUL ++++#define CKA_X2RATCHET_NHKR 0x0000060dUL ++++#define CKA_X2RATCHET_NHKS 0x0000060eUL ++++#define CKA_X2RATCHET_NR 0x0000060fUL ++++#define CKA_X2RATCHET_NS 0x00000610UL ++++#define CKA_X2RATCHET_PNS 0x00000611UL ++++#define CKA_X2RATCHET_RK 0x00000612UL +++ +++-#define CKA_VENDOR_DEFINED 0x80000000UL ++++#define CKA_VENDOR_DEFINED 0x80000000UL +++ +++ /* CK_ATTRIBUTE is a structure that includes the type, length +++- * and value of an attribute +++- */ ++++ * and value of an attribute */ +++ typedef struct CK_ATTRIBUTE { +++ CK_ATTRIBUTE_TYPE type; +++- CK_VOID_PTR pValue; +++- CK_ULONG ulValueLen; /* in bytes */ ++++ CK_VOID_PTR pValue; ++++ ++++ /* ulValueLen went from CK_USHORT to CK_ULONG for v2.0 */ ++++ CK_ULONG ulValueLen; /* in bytes */ +++ } CK_ATTRIBUTE; +++ +++ typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR; +++ +++ /* CK_DATE is a structure that defines a date */ +++-typedef struct CK_DATE{ +++- CK_CHAR year[4]; /* the year ("1900" - "9999") */ +++- CK_CHAR month[2]; /* the month ("01" - "12") */ +++- CK_CHAR day[2]; /* the day ("01" - "31") */ ++++typedef struct CK_DATE { ++++ CK_CHAR year[4]; /* the year ("1900" - "9999") */ ++++ CK_CHAR month[2]; /* the month ("01" - "12") */ ++++ CK_CHAR day[2]; /* the day ("01" - "31") */ +++ } CK_DATE; +++ +++- +++ /* CK_MECHANISM_TYPE is a value that identifies a mechanism +++- * type +++- */ +++-typedef CK_ULONG CK_MECHANISM_TYPE; ++++ * type */ ++++/* CK_MECHANISM_TYPE was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++typedef CK_ULONG CK_MECHANISM_TYPE; +++ +++ /* the following mechanism types are defined: */ +++-#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL +++-#define CKM_RSA_PKCS 0x00000001UL +++-#define CKM_RSA_9796 0x00000002UL +++-#define CKM_RSA_X_509 0x00000003UL +++- +++-#define CKM_MD2_RSA_PKCS 0x00000004UL +++-#define CKM_MD5_RSA_PKCS 0x00000005UL +++-#define CKM_SHA1_RSA_PKCS 0x00000006UL +++- +++-#define CKM_RIPEMD128_RSA_PKCS 0x00000007UL +++-#define CKM_RIPEMD160_RSA_PKCS 0x00000008UL +++-#define CKM_RSA_PKCS_OAEP 0x00000009UL +++- +++-#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL +++-#define CKM_RSA_X9_31 0x0000000BUL +++-#define CKM_SHA1_RSA_X9_31 0x0000000CUL +++-#define CKM_RSA_PKCS_PSS 0x0000000DUL +++-#define CKM_SHA1_RSA_PKCS_PSS 0x0000000EUL +++- +++-#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL +++-#define CKM_DSA 0x00000011UL +++-#define CKM_DSA_SHA1 0x00000012UL +++-#define CKM_DSA_SHA224 0x00000013UL +++-#define CKM_DSA_SHA256 0x00000014UL +++-#define CKM_DSA_SHA384 0x00000015UL +++-#define CKM_DSA_SHA512 0x00000016UL +++-#define CKM_DSA_SHA3_224 0x00000018UL +++-#define CKM_DSA_SHA3_256 0x00000019UL +++-#define CKM_DSA_SHA3_384 0x0000001AUL +++-#define CKM_DSA_SHA3_512 0x0000001BUL +++- +++-#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL +++-#define CKM_DH_PKCS_DERIVE 0x00000021UL +++- +++-#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030UL +++-#define CKM_X9_42_DH_DERIVE 0x00000031UL +++-#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032UL +++-#define CKM_X9_42_MQV_DERIVE 0x00000033UL +++- +++-#define CKM_SHA256_RSA_PKCS 0x00000040UL +++-#define CKM_SHA384_RSA_PKCS 0x00000041UL +++-#define CKM_SHA512_RSA_PKCS 0x00000042UL +++-#define CKM_SHA256_RSA_PKCS_PSS 0x00000043UL +++-#define CKM_SHA384_RSA_PKCS_PSS 0x00000044UL +++-#define CKM_SHA512_RSA_PKCS_PSS 0x00000045UL +++- +++-#define CKM_SHA224_RSA_PKCS 0x00000046UL +++-#define CKM_SHA224_RSA_PKCS_PSS 0x00000047UL +++- +++-#define CKM_SHA512_224 0x00000048UL +++-#define CKM_SHA512_224_HMAC 0x00000049UL +++-#define CKM_SHA512_224_HMAC_GENERAL 0x0000004AUL +++-#define CKM_SHA512_224_KEY_DERIVATION 0x0000004BUL +++-#define CKM_SHA512_256 0x0000004CUL +++-#define CKM_SHA512_256_HMAC 0x0000004DUL +++-#define CKM_SHA512_256_HMAC_GENERAL 0x0000004EUL +++-#define CKM_SHA512_256_KEY_DERIVATION 0x0000004FUL +++- +++-#define CKM_SHA512_T 0x00000050UL +++-#define CKM_SHA512_T_HMAC 0x00000051UL +++-#define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL +++-#define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL +++- +++-#define CKM_SHA3_256_RSA_PKCS 0x00000060UL +++-#define CKM_SHA3_384_RSA_PKCS 0x00000061UL +++-#define CKM_SHA3_512_RSA_PKCS 0x00000062UL +++-#define CKM_SHA3_256_RSA_PKCS_PSS 0x00000063UL +++-#define CKM_SHA3_384_RSA_PKCS_PSS 0x00000064UL +++-#define CKM_SHA3_512_RSA_PKCS_PSS 0x00000065UL +++-#define CKM_SHA3_224_RSA_PKCS 0x00000066UL +++-#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL +++- +++-#define CKM_RC2_KEY_GEN 0x00000100UL +++-#define CKM_RC2_ECB 0x00000101UL +++-#define CKM_RC2_CBC 0x00000102UL +++-#define CKM_RC2_MAC 0x00000103UL +++- +++-#define CKM_RC2_MAC_GENERAL 0x00000104UL +++-#define CKM_RC2_CBC_PAD 0x00000105UL +++- +++-#define CKM_RC4_KEY_GEN 0x00000110UL +++-#define CKM_RC4 0x00000111UL +++-#define CKM_DES_KEY_GEN 0x00000120UL +++-#define CKM_DES_ECB 0x00000121UL +++-#define CKM_DES_CBC 0x00000122UL +++-#define CKM_DES_MAC 0x00000123UL +++- +++-#define CKM_DES_MAC_GENERAL 0x00000124UL +++-#define CKM_DES_CBC_PAD 0x00000125UL +++- +++-#define CKM_DES2_KEY_GEN 0x00000130UL +++-#define CKM_DES3_KEY_GEN 0x00000131UL +++-#define CKM_DES3_ECB 0x00000132UL +++-#define CKM_DES3_CBC 0x00000133UL +++-#define CKM_DES3_MAC 0x00000134UL +++- +++-#define CKM_DES3_MAC_GENERAL 0x00000135UL +++-#define CKM_DES3_CBC_PAD 0x00000136UL +++-#define CKM_DES3_CMAC_GENERAL 0x00000137UL +++-#define CKM_DES3_CMAC 0x00000138UL +++-#define CKM_CDMF_KEY_GEN 0x00000140UL +++-#define CKM_CDMF_ECB 0x00000141UL +++-#define CKM_CDMF_CBC 0x00000142UL +++-#define CKM_CDMF_MAC 0x00000143UL +++-#define CKM_CDMF_MAC_GENERAL 0x00000144UL +++-#define CKM_CDMF_CBC_PAD 0x00000145UL +++- +++-#define CKM_DES_OFB64 0x00000150UL +++-#define CKM_DES_OFB8 0x00000151UL +++-#define CKM_DES_CFB64 0x00000152UL +++-#define CKM_DES_CFB8 0x00000153UL +++- +++-#define CKM_MD2 0x00000200UL +++- +++-#define CKM_MD2_HMAC 0x00000201UL +++-#define CKM_MD2_HMAC_GENERAL 0x00000202UL +++- +++-#define CKM_MD5 0x00000210UL +++- +++-#define CKM_MD5_HMAC 0x00000211UL +++-#define CKM_MD5_HMAC_GENERAL 0x00000212UL +++- +++-#define CKM_SHA_1 0x00000220UL +++- +++-#define CKM_SHA_1_HMAC 0x00000221UL +++-#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL +++- +++-#define CKM_RIPEMD128 0x00000230UL +++-#define CKM_RIPEMD128_HMAC 0x00000231UL +++-#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232UL +++-#define CKM_RIPEMD160 0x00000240UL +++-#define CKM_RIPEMD160_HMAC 0x00000241UL +++-#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242UL +++- +++-#define CKM_SHA256 0x00000250UL +++-#define CKM_SHA256_HMAC 0x00000251UL +++-#define CKM_SHA256_HMAC_GENERAL 0x00000252UL +++-#define CKM_SHA224 0x00000255UL +++-#define CKM_SHA224_HMAC 0x00000256UL +++-#define CKM_SHA224_HMAC_GENERAL 0x00000257UL +++-#define CKM_SHA384 0x00000260UL +++-#define CKM_SHA384_HMAC 0x00000261UL +++-#define CKM_SHA384_HMAC_GENERAL 0x00000262UL +++-#define CKM_SHA512 0x00000270UL +++-#define CKM_SHA512_HMAC 0x00000271UL +++-#define CKM_SHA512_HMAC_GENERAL 0x00000272UL +++-#define CKM_SECURID_KEY_GEN 0x00000280UL +++-#define CKM_SECURID 0x00000282UL +++-#define CKM_HOTP_KEY_GEN 0x00000290UL +++-#define CKM_HOTP 0x00000291UL +++-#define CKM_ACTI 0x000002A0UL +++-#define CKM_ACTI_KEY_GEN 0x000002A1UL +++- +++-#define CKM_SHA3_256 0x000002B0UL +++-#define CKM_SHA3_256_HMAC 0x000002B1UL +++-#define CKM_SHA3_256_HMAC_GENERAL 0x000002B2UL +++-#define CKM_SHA3_256_KEY_GEN 0x000002B3UL +++-#define CKM_SHA3_224 0x000002B5UL +++-#define CKM_SHA3_224_HMAC 0x000002B6UL +++-#define CKM_SHA3_224_HMAC_GENERAL 0x000002B7UL +++-#define CKM_SHA3_224_KEY_GEN 0x000002B8UL +++-#define CKM_SHA3_384 0x000002C0UL +++-#define CKM_SHA3_384_HMAC 0x000002C1UL +++-#define CKM_SHA3_384_HMAC_GENERAL 0x000002C2UL +++-#define CKM_SHA3_384_KEY_GEN 0x000002C3UL +++-#define CKM_SHA3_512 0x000002D0UL +++-#define CKM_SHA3_512_HMAC 0x000002D1UL +++-#define CKM_SHA3_512_HMAC_GENERAL 0x000002D2UL +++-#define CKM_SHA3_512_KEY_GEN 0x000002D3UL +++- +++- +++-#define CKM_CAST_KEY_GEN 0x00000300UL +++-#define CKM_CAST_ECB 0x00000301UL +++-#define CKM_CAST_CBC 0x00000302UL +++-#define CKM_CAST_MAC 0x00000303UL +++-#define CKM_CAST_MAC_GENERAL 0x00000304UL +++-#define CKM_CAST_CBC_PAD 0x00000305UL +++-#define CKM_CAST3_KEY_GEN 0x00000310UL +++-#define CKM_CAST3_ECB 0x00000311UL +++-#define CKM_CAST3_CBC 0x00000312UL +++-#define CKM_CAST3_MAC 0x00000313UL +++-#define CKM_CAST3_MAC_GENERAL 0x00000314UL +++-#define CKM_CAST3_CBC_PAD 0x00000315UL ++++#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL ++++#define CKM_RSA_PKCS 0x00000001UL ++++#define CKM_RSA_9796 0x00000002UL ++++#define CKM_RSA_X_509 0x00000003UL ++++ ++++/* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS ++++ * are new for v2.0. They are mechanisms which hash and sign */ ++++#define CKM_MD2_RSA_PKCS 0x00000004UL ++++#define CKM_MD5_RSA_PKCS 0x00000005UL ++++#define CKM_SHA1_RSA_PKCS 0x00000006UL ++++ ++++/* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and ++++ * CKM_RSA_PKCS_OAEP are new for v2.10 */ ++++#define CKM_RIPEMD128_RSA_PKCS 0x00000007UL ++++#define CKM_RIPEMD160_RSA_PKCS 0x00000008UL ++++#define CKM_RSA_PKCS_OAEP 0x00000009UL ++++ ++++/* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31, ++++ * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */ ++++#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL ++++#define CKM_RSA_X9_31 0x0000000BUL ++++#define CKM_SHA1_RSA_X9_31 0x0000000CUL ++++#define CKM_RSA_PKCS_PSS 0x0000000DUL ++++#define CKM_SHA1_RSA_PKCS_PSS 0x0000000EUL ++++ ++++#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL ++++#define CKM_DSA 0x00000011UL ++++#define CKM_DSA_SHA1 0x00000012UL ++++ ++++/* new for v2.40 */ ++++#define CKM_DSA_SHA224 0x00000013UL ++++#define CKM_DSA_SHA256 0x00000014UL ++++#define CKM_DSA_SHA384 0x00000015UL ++++#define CKM_DSA_SHA512 0x00000016UL ++++#define CKM_DSA_SHA3_224 0x00000018UL ++++#define CKM_DSA_SHA3_256 0x00000019UL ++++#define CKM_DSA_SHA3_384 0x0000001AUL ++++#define CKM_DSA_SHA3_512 0x0000001BUL ++++ ++++#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL ++++#define CKM_DH_PKCS_DERIVE 0x00000021UL ++++ ++++/* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE, ++++ * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for ++++ * v2.11 */ ++++#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030UL ++++#define CKM_X9_42_DH_DERIVE 0x00000031UL ++++#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032UL ++++#define CKM_X9_42_MQV_DERIVE 0x00000033UL ++++ ++++/* CKM_SHA256/384/512 are new for v2.20 */ ++++#define CKM_SHA256_RSA_PKCS 0x00000040UL ++++#define CKM_SHA384_RSA_PKCS 0x00000041UL ++++#define CKM_SHA512_RSA_PKCS 0x00000042UL ++++#define CKM_SHA256_RSA_PKCS_PSS 0x00000043UL ++++#define CKM_SHA384_RSA_PKCS_PSS 0x00000044UL ++++#define CKM_SHA512_RSA_PKCS_PSS 0x00000045UL ++++ ++++/* CKM_SHA224 new for v2.20 amendment 3 */ ++++#define CKM_SHA224_RSA_PKCS 0x00000046UL ++++#define CKM_SHA224_RSA_PKCS_PSS 0x00000047UL ++++ ++++/* new for v2.40 */ ++++#define CKM_SHA512_224 0x00000048UL ++++#define CKM_SHA512_224_HMAC 0x00000049UL ++++#define CKM_SHA512_224_HMAC_GENERAL 0x0000004AUL ++++#define CKM_SHA512_224_KEY_DERIVATION 0x0000004BUL ++++#define CKM_SHA512_256 0x0000004CUL ++++#define CKM_SHA512_256_HMAC 0x0000004DUL ++++#define CKM_SHA512_256_HMAC_GENERAL 0x0000004EUL ++++#define CKM_SHA512_256_KEY_DERIVATION 0x0000004FUL ++++#define CKM_SHA512_T 0x00000050UL ++++#define CKM_SHA512_T_HMAC 0x00000051UL ++++#define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL ++++#define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL ++++#define CKM_SHA3_256_RSA_PKCS 0x00000060UL ++++#define CKM_SHA3_384_RSA_PKCS 0x00000061UL ++++#define CKM_SHA3_512_RSA_PKCS 0x00000062UL ++++#define CKM_SHA3_256_RSA_PKCS_PSS 0x00000063UL ++++#define CKM_SHA3_384_RSA_PKCS_PSS 0x00000064UL ++++#define CKM_SHA3_512_RSA_PKCS_PSS 0x00000065UL ++++#define CKM_SHA3_224_RSA_PKCS 0x00000066UL ++++#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL ++++ ++++#define CKM_RC2_KEY_GEN 0x00000100UL ++++#define CKM_RC2_ECB 0x00000101UL ++++#define CKM_RC2_CBC 0x00000102UL ++++#define CKM_RC2_MAC 0x00000103UL ++++ ++++/* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */ ++++#define CKM_RC2_MAC_GENERAL 0x00000104UL ++++#define CKM_RC2_CBC_PAD 0x00000105UL ++++ ++++#define CKM_RC4_KEY_GEN 0x00000110UL ++++#define CKM_RC4 0x00000111UL ++++#define CKM_DES_KEY_GEN 0x00000120UL ++++#define CKM_DES_ECB 0x00000121UL ++++#define CKM_DES_CBC 0x00000122UL ++++#define CKM_DES_MAC 0x00000123UL ++++ ++++/* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */ ++++#define CKM_DES_MAC_GENERAL 0x00000124UL ++++#define CKM_DES_CBC_PAD 0x00000125UL ++++ ++++#define CKM_DES2_KEY_GEN 0x00000130UL ++++#define CKM_DES3_KEY_GEN 0x00000131UL ++++#define CKM_DES3_ECB 0x00000132UL ++++#define CKM_DES3_CBC 0x00000133UL ++++#define CKM_DES3_MAC 0x00000134UL ++++ ++++/* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN, ++++ * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC, ++++ * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */ ++++#define CKM_DES3_MAC_GENERAL 0x00000135UL ++++#define CKM_DES3_CBC_PAD 0x00000136UL ++++#define CKM_CDMF_KEY_GEN 0x00000140UL ++++#define CKM_CDMF_ECB 0x00000141UL ++++#define CKM_CDMF_CBC 0x00000142UL ++++#define CKM_CDMF_MAC 0x00000143UL ++++#define CKM_CDMF_MAC_GENERAL 0x00000144UL ++++#define CKM_CDMF_CBC_PAD 0x00000145UL ++++ ++++/* the following four DES mechanisms are new for v2.20 */ ++++#define CKM_DES_OFB64 0x00000150UL ++++#define CKM_DES_OFB8 0x00000151UL ++++#define CKM_DES_CFB64 0x00000152UL ++++#define CKM_DES_CFB8 0x00000153UL ++++ ++++#define CKM_MD2 0x00000200UL ++++ ++++/* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */ ++++#define CKM_MD2_HMAC 0x00000201UL ++++#define CKM_MD2_HMAC_GENERAL 0x00000202UL ++++ ++++#define CKM_MD5 0x00000210UL ++++ ++++/* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */ ++++#define CKM_MD5_HMAC 0x00000211UL ++++#define CKM_MD5_HMAC_GENERAL 0x00000212UL ++++ ++++#define CKM_SHA_1 0x00000220UL ++++ ++++/* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */ ++++#define CKM_SHA_1_HMAC 0x00000221UL ++++#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL ++++ ++++/* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, ++++ * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, ++++ * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ ++++#define CKM_RIPEMD128 0x00000230UL ++++#define CKM_RIPEMD128_HMAC 0x00000231UL ++++#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232UL ++++#define CKM_RIPEMD160 0x00000240UL ++++#define CKM_RIPEMD160_HMAC 0x00000241UL ++++#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242UL ++++ ++++/* CKM_SHA256/384/512 are new for v2.20 */ ++++#define CKM_SHA256 0x00000250UL ++++#define CKM_SHA256_HMAC 0x00000251UL ++++#define CKM_SHA256_HMAC_GENERAL 0x00000252UL ++++#define CKM_SHA384 0x00000260UL ++++#define CKM_SHA384_HMAC 0x00000261UL ++++#define CKM_SHA384_HMAC_GENERAL 0x00000262UL ++++#define CKM_SHA512 0x00000270UL ++++#define CKM_SHA512_HMAC 0x00000271UL ++++#define CKM_SHA512_HMAC_GENERAL 0x00000272UL ++++ ++++/* CKM_SHA224 new for v2.20 amendment 3 */ ++++#define CKM_SHA224 0x00000255UL ++++#define CKM_SHA224_HMAC 0x00000256UL ++++#define CKM_SHA224_HMAC_GENERAL 0x00000257UL ++++ ++++/* new for v2.40 */ ++++#define CKM_SECURID_KEY_GEN 0x00000280UL ++++#define CKM_SECURID 0x00000282UL ++++#define CKM_HOTP_KEY_GEN 0x00000290UL ++++#define CKM_HOTP 0x00000291UL ++++#define CKM_ACTI 0x000002A0UL ++++#define CKM_ACTI_KEY_GEN 0x000002A1UL ++++#define CKM_SHA3_256 0x000002B0UL ++++#define CKM_SHA3_256_HMAC 0x000002B1UL ++++#define CKM_SHA3_256_HMAC_GENERAL 0x000002B2UL ++++#define CKM_SHA3_256_KEY_GEN 0x000002B3UL ++++#define CKM_SHA3_224 0x000002B5UL ++++#define CKM_SHA3_224_HMAC 0x000002B6UL ++++#define CKM_SHA3_224_HMAC_GENERAL 0x000002B7UL ++++#define CKM_SHA3_224_KEY_GEN 0x000002B8UL ++++#define CKM_SHA3_384 0x000002C0UL ++++#define CKM_SHA3_384_HMAC 0x000002C1UL ++++#define CKM_SHA3_384_HMAC_GENERAL 0x000002C2UL ++++#define CKM_SHA3_384_KEY_GEN 0x000002C3UL ++++#define CKM_SHA3_512 0x000002D0UL ++++#define CKM_SHA3_512_HMAC 0x000002D1UL ++++#define CKM_SHA3_512_HMAC_GENERAL 0x000002D2UL ++++#define CKM_SHA3_512_KEY_GEN 0x000002D3UL ++++ ++++/* All of the following mechanisms are new for v2.0 */ +++ /* Note that CAST128 and CAST5 are the same algorithm */ +++-#define CKM_CAST5_KEY_GEN 0x00000320UL +++-#define CKM_CAST128_KEY_GEN 0x00000320UL +++-#define CKM_CAST5_ECB 0x00000321UL +++-#define CKM_CAST128_ECB 0x00000321UL +++-#define CKM_CAST5_CBC 0x00000322UL /* Deprecated */ +++-#define CKM_CAST128_CBC 0x00000322UL +++-#define CKM_CAST5_MAC 0x00000323UL /* Deprecated */ +++-#define CKM_CAST128_MAC 0x00000323UL +++-#define CKM_CAST5_MAC_GENERAL 0x00000324UL /* Deprecated */ +++-#define CKM_CAST128_MAC_GENERAL 0x00000324UL +++-#define CKM_CAST5_CBC_PAD 0x00000325UL /* Deprecated */ +++-#define CKM_CAST128_CBC_PAD 0x00000325UL +++-#define CKM_RC5_KEY_GEN 0x00000330UL +++-#define CKM_RC5_ECB 0x00000331UL +++-#define CKM_RC5_CBC 0x00000332UL +++-#define CKM_RC5_MAC 0x00000333UL +++-#define CKM_RC5_MAC_GENERAL 0x00000334UL +++-#define CKM_RC5_CBC_PAD 0x00000335UL +++-#define CKM_IDEA_KEY_GEN 0x00000340UL +++-#define CKM_IDEA_ECB 0x00000341UL +++-#define CKM_IDEA_CBC 0x00000342UL +++-#define CKM_IDEA_MAC 0x00000343UL +++-#define CKM_IDEA_MAC_GENERAL 0x00000344UL +++-#define CKM_IDEA_CBC_PAD 0x00000345UL +++-#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL +++-#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL +++-#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL +++-#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL +++-#define CKM_XOR_BASE_AND_DATA 0x00000364UL +++-#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365UL +++-#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL +++-#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL +++-#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL +++- +++-#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL +++-#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374UL +++-#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL +++-#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL +++-#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL +++- +++-#define CKM_TLS_PRF 0x00000378UL +++- +++-#define CKM_SSL3_MD5_MAC 0x00000380UL +++-#define CKM_SSL3_SHA1_MAC 0x00000381UL +++-#define CKM_MD5_KEY_DERIVATION 0x00000390UL +++-#define CKM_MD2_KEY_DERIVATION 0x00000391UL +++-#define CKM_SHA1_KEY_DERIVATION 0x00000392UL +++- +++-#define CKM_SHA256_KEY_DERIVATION 0x00000393UL +++-#define CKM_SHA384_KEY_DERIVATION 0x00000394UL +++-#define CKM_SHA512_KEY_DERIVATION 0x00000395UL +++-#define CKM_SHA224_KEY_DERIVATION 0x00000396UL +++-#define CKM_SHA3_256_KEY_DERIVATION 0x00000397UL +++-#define CKM_SHA3_224_KEY_DERIVATION 0x00000398UL +++-#define CKM_SHA3_384_KEY_DERIVATION 0x00000399UL +++-#define CKM_SHA3_512_KEY_DERIVATION 0x0000039AUL +++-#define CKM_SHAKE_128_KEY_DERIVATION 0x0000039BUL +++-#define CKM_SHAKE_256_KEY_DERIVATION 0x0000039CUL +++-#define CKM_SHA3_256_KEY_DERIVE CKM_SHA3_256_KEY_DERIVATION +++-#define CKM_SHA3_224_KEY_DERIVE CKM_SHA3_224_KEY_DERIVATION +++-#define CKM_SHA3_384_KEY_DERIVE CKM_SHA3_384_KEY_DERIVATION +++-#define CKM_SHA3_512_KEY_DERIVE CKM_SHA3_512_KEY_DERIVATION +++-#define CKM_SHAKE_128_KEY_DERIVE CKM_SHAKE_128_KEY_DERIVATION +++-#define CKM_SHAKE_256_KEY_DERIVE CKM_SHAKE_256_KEY_DERIVATION +++- +++-#define CKM_PBE_MD2_DES_CBC 0x000003A0UL +++-#define CKM_PBE_MD5_DES_CBC 0x000003A1UL +++-#define CKM_PBE_MD5_CAST_CBC 0x000003A2UL +++-#define CKM_PBE_MD5_CAST3_CBC 0x000003A3UL +++-#define CKM_PBE_MD5_CAST5_CBC 0x000003A4UL /* Deprecated */ +++-#define CKM_PBE_MD5_CAST128_CBC 0x000003A4UL +++-#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5UL /* Deprecated */ +++-#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5UL +++-#define CKM_PBE_SHA1_RC4_128 0x000003A6UL +++-#define CKM_PBE_SHA1_RC4_40 0x000003A7UL +++-#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL +++-#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL +++-#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL +++-#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL +++- +++-#define CKM_PKCS5_PBKD2 0x000003B0UL +++- +++-#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL +++- +++-#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0UL +++-#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1UL +++-#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2UL +++-#define CKM_WTLS_PRF 0x000003D3UL +++-#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL +++-#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL +++- +++-#define CKM_TLS12_MAC 0x000003D8UL +++-#define CKM_TLS12_KDF 0x000003D9UL +++-#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL +++-#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL +++-#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL +++-#define CKM_TLS12_KEY_SAFE_DERIVE 0x000003E3UL +++-#define CKM_TLS_MAC 0x000003E4UL +++-#define CKM_TLS_KDF 0x000003E5UL +++- +++-#define CKM_KEY_WRAP_LYNKS 0x00000400UL +++-#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL +++- +++-#define CKM_CMS_SIG 0x00000500UL +++-#define CKM_KIP_DERIVE 0x00000510UL +++-#define CKM_KIP_WRAP 0x00000511UL +++-#define CKM_KIP_MAC 0x00000512UL +++- +++-#define CKM_CAMELLIA_KEY_GEN 0x00000550UL +++-#define CKM_CAMELLIA_ECB 0x00000551UL +++-#define CKM_CAMELLIA_CBC 0x00000552UL +++-#define CKM_CAMELLIA_MAC 0x00000553UL +++-#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL +++-#define CKM_CAMELLIA_CBC_PAD 0x00000555UL +++-#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL +++-#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL +++-#define CKM_CAMELLIA_CTR 0x00000558UL +++- +++-#define CKM_ARIA_KEY_GEN 0x00000560UL +++-#define CKM_ARIA_ECB 0x00000561UL +++-#define CKM_ARIA_CBC 0x00000562UL +++-#define CKM_ARIA_MAC 0x00000563UL +++-#define CKM_ARIA_MAC_GENERAL 0x00000564UL +++-#define CKM_ARIA_CBC_PAD 0x00000565UL +++-#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566UL +++-#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567UL +++- +++-#define CKM_SEED_KEY_GEN 0x00000650UL +++-#define CKM_SEED_ECB 0x00000651UL +++-#define CKM_SEED_CBC 0x00000652UL +++-#define CKM_SEED_MAC 0x00000653UL +++-#define CKM_SEED_MAC_GENERAL 0x00000654UL +++-#define CKM_SEED_CBC_PAD 0x00000655UL +++-#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL +++-#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL +++- +++-#define CKM_SKIPJACK_KEY_GEN 0x00001000UL +++-#define CKM_SKIPJACK_ECB64 0x00001001UL +++-#define CKM_SKIPJACK_CBC64 0x00001002UL +++-#define CKM_SKIPJACK_OFB64 0x00001003UL +++-#define CKM_SKIPJACK_CFB64 0x00001004UL +++-#define CKM_SKIPJACK_CFB32 0x00001005UL +++-#define CKM_SKIPJACK_CFB16 0x00001006UL +++-#define CKM_SKIPJACK_CFB8 0x00001007UL +++-#define CKM_SKIPJACK_WRAP 0x00001008UL +++-#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009UL +++-#define CKM_SKIPJACK_RELAYX 0x0000100aUL +++-#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL +++-#define CKM_KEA_KEY_DERIVE 0x00001011UL +++-#define CKM_KEA_DERIVE 0x00001012UL +++-#define CKM_FORTEZZA_TIMESTAMP 0x00001020UL +++-#define CKM_BATON_KEY_GEN 0x00001030UL +++-#define CKM_BATON_ECB128 0x00001031UL +++-#define CKM_BATON_ECB96 0x00001032UL +++-#define CKM_BATON_CBC128 0x00001033UL +++-#define CKM_BATON_COUNTER 0x00001034UL +++-#define CKM_BATON_SHUFFLE 0x00001035UL +++-#define CKM_BATON_WRAP 0x00001036UL +++- +++-#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040UL /* Deprecated */ +++-#define CKM_EC_KEY_PAIR_GEN 0x00001040UL +++- +++-#define CKM_ECDSA 0x00001041UL +++-#define CKM_ECDSA_SHA1 0x00001042UL +++-#define CKM_ECDSA_SHA224 0x00001043UL +++-#define CKM_ECDSA_SHA256 0x00001044UL +++-#define CKM_ECDSA_SHA384 0x00001045UL +++-#define CKM_ECDSA_SHA512 0x00001046UL ++++#define CKM_CAST_KEY_GEN 0x00000300UL ++++#define CKM_CAST_ECB 0x00000301UL ++++#define CKM_CAST_CBC 0x00000302UL ++++#define CKM_CAST_MAC 0x00000303UL ++++#define CKM_CAST_MAC_GENERAL 0x00000304UL ++++#define CKM_CAST_CBC_PAD 0x00000305UL ++++#define CKM_CAST3_KEY_GEN 0x00000310UL ++++#define CKM_CAST3_ECB 0x00000311UL ++++#define CKM_CAST3_CBC 0x00000312UL ++++#define CKM_CAST3_MAC 0x00000313UL ++++#define CKM_CAST3_MAC_GENERAL 0x00000314UL ++++#define CKM_CAST3_CBC_PAD 0x00000315UL ++++#define CKM_CAST5_KEY_GEN 0x00000320UL ++++#define CKM_CAST128_KEY_GEN 0x00000320UL ++++#define CKM_CAST5_ECB 0x00000321UL ++++#define CKM_CAST128_ECB 0x00000321UL ++++#define CKM_CAST5_CBC 0x00000322UL ++++#define CKM_CAST128_CBC 0x00000322UL ++++#define CKM_CAST5_MAC 0x00000323UL ++++#define CKM_CAST128_MAC 0x00000323UL ++++#define CKM_CAST5_MAC_GENERAL 0x00000324UL ++++#define CKM_CAST128_MAC_GENERAL 0x00000324UL ++++#define CKM_CAST5_CBC_PAD 0x00000325UL ++++#define CKM_CAST128_CBC_PAD 0x00000325UL ++++#define CKM_RC5_KEY_GEN 0x00000330UL ++++#define CKM_RC5_ECB 0x00000331UL ++++#define CKM_RC5_CBC 0x00000332UL ++++#define CKM_RC5_MAC 0x00000333UL ++++#define CKM_RC5_MAC_GENERAL 0x00000334UL ++++#define CKM_RC5_CBC_PAD 0x00000335UL ++++#define CKM_IDEA_KEY_GEN 0x00000340UL ++++#define CKM_IDEA_ECB 0x00000341UL ++++#define CKM_IDEA_CBC 0x00000342UL ++++#define CKM_IDEA_MAC 0x00000343UL ++++#define CKM_IDEA_MAC_GENERAL 0x00000344UL ++++#define CKM_IDEA_CBC_PAD 0x00000345UL ++++#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL ++++#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL ++++#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL ++++#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL ++++#define CKM_XOR_BASE_AND_DATA 0x00000364UL ++++#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365UL ++++#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL ++++#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL ++++#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL ++++ ++++/* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN, ++++ * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and ++++ * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */ ++++#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL ++++#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374UL ++++#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL ++++#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL ++++#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL ++++ ++++/* CKM_TLS_PRF is new for v2.20 */ ++++#define CKM_TLS_PRF 0x00000378UL ++++ ++++#define CKM_SSL3_MD5_MAC 0x00000380UL ++++#define CKM_SSL3_SHA1_MAC 0x00000381UL ++++#define CKM_MD5_KEY_DERIVATION 0x00000390UL ++++#define CKM_MD2_KEY_DERIVATION 0x00000391UL ++++#define CKM_SHA1_KEY_DERIVATION 0x00000392UL ++++ ++++/* CKM_SHA256/384/512 are new for v2.20 */ ++++#define CKM_SHA256_KEY_DERIVATION 0x00000393UL ++++#define CKM_SHA384_KEY_DERIVATION 0x00000394UL ++++#define CKM_SHA512_KEY_DERIVATION 0x00000395UL ++++ ++++/* CKM_SHA224 new for v2.20 amendment 3 */ ++++#define CKM_SHA224_KEY_DERIVATION 0x00000396UL ++++ ++++/* new for v2.40 */ ++++#define CKM_SHA3_256_KEY_DERIVATION 0x00000397UL ++++#define CKM_SHA3_224_KEY_DERIVATION 0x00000398UL ++++#define CKM_SHA3_384_KEY_DERIVATION 0x00000399UL ++++#define CKM_SHA3_512_KEY_DERIVATION 0x0000039AUL ++++#define CKM_SHAKE_128_KEY_DERIVATION 0x0000039BUL ++++#define CKM_SHAKE_256_KEY_DERIVATION 0x0000039CUL ++++ ++++#define CKM_PBE_MD2_DES_CBC 0x000003A0UL ++++#define CKM_PBE_MD5_DES_CBC 0x000003A1UL ++++#define CKM_PBE_MD5_CAST_CBC 0x000003A2UL ++++#define CKM_PBE_MD5_CAST3_CBC 0x000003A3UL ++++#define CKM_PBE_MD5_CAST5_CBC 0x000003A4UL ++++#define CKM_PBE_MD5_CAST128_CBC 0x000003A4UL ++++#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5UL ++++#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5UL ++++#define CKM_PBE_SHA1_RC4_128 0x000003A6UL ++++#define CKM_PBE_SHA1_RC4_40 0x000003A7UL ++++#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL ++++#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL ++++#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL ++++#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL ++++ ++++/* CKM_PKCS5_PBKD2 is new for v2.10 */ ++++#define CKM_PKCS5_PBKD2 0x000003B0UL ++++ ++++#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL ++++ ++++/* WTLS mechanisms are new for v2.20 */ ++++#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0UL ++++#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1UL ++++#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2UL ++++#define CKM_WTLS_PRF 0x000003D3UL ++++#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL ++++#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL ++++ ++++/* TLS 1.2 mechanisms are new for v2.40 */ ++++#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL ++++#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL ++++#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL ++++#define CKM_TLS12_KEY_SAFE_DERIVE 0x000003E3UL ++++#define CKM_TLS12_MAC 0x000003D8UL ++++#define CKM_TLS12_KDF 0x000003D9UL ++++#define CKM_TLS_MAC 0x000003E4UL ++++#define CKM_TLS_KDF 0x000003E5UL ++++ ++++#define CKM_KEY_WRAP_LYNKS 0x00000400UL ++++#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL ++++ ++++/* CKM_CMS_SIG is new for v2.20 */ ++++#define CKM_CMS_SIG 0x00000500UL ++++ ++++/* new for 2.40 */ ++++#define CKM_KIP_DERIVE 0x00000510UL ++++#define CKM_KIP_WRAP 0x00000511UL ++++#define CKM_KIP_MAC 0x00000512UL ++++ ++++/* Fortezza mechanisms */ ++++#define CKM_SKIPJACK_KEY_GEN 0x00001000UL ++++#define CKM_SKIPJACK_ECB64 0x00001001UL ++++#define CKM_SKIPJACK_CBC64 0x00001002UL ++++#define CKM_SKIPJACK_OFB64 0x00001003UL ++++#define CKM_SKIPJACK_CFB64 0x00001004UL ++++#define CKM_SKIPJACK_CFB32 0x00001005UL ++++#define CKM_SKIPJACK_CFB16 0x00001006UL ++++#define CKM_SKIPJACK_CFB8 0x00001007UL ++++#define CKM_SKIPJACK_WRAP 0x00001008UL ++++#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009UL ++++#define CKM_SKIPJACK_RELAYX 0x0000100aUL ++++#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL ++++#define CKM_KEA_KEY_DERIVE 0x00001011UL ++++#define CKM_FORTEZZA_TIMESTAMP 0x00001020UL ++++#define CKM_BATON_KEY_GEN 0x00001030UL ++++#define CKM_BATON_ECB128 0x00001031UL ++++#define CKM_BATON_ECB96 0x00001032UL ++++#define CKM_BATON_CBC128 0x00001033UL ++++#define CKM_BATON_COUNTER 0x00001034UL ++++#define CKM_BATON_SHUFFLE 0x00001035UL ++++#define CKM_BATON_WRAP 0x00001036UL ++++ ++++/* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11, ++++ * CKM_EC_KEY_PAIR_GEN is preferred */ ++++#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040UL ++++#define CKM_EC_KEY_PAIR_GEN 0x00001040UL ++++ ++++#define CKM_ECDSA 0x00001041UL ++++#define CKM_ECDSA_SHA1 0x00001042UL ++++ ++++/* new for v2.40 */ ++++#define CKM_ECDSA_SHA224 0x00001043UL ++++#define CKM_ECDSA_SHA256 0x00001044UL ++++#define CKM_ECDSA_SHA384 0x00001045UL ++++#define CKM_ECDSA_SHA512 0x00001046UL +++ #define CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS 0x0000140BUL +++ +++-#define CKM_ECDH1_DERIVE 0x00001050UL +++-#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL +++-#define CKM_ECMQV_DERIVE 0x00001052UL +++- +++-#define CKM_ECDH_AES_KEY_WRAP 0x00001053UL +++-#define CKM_RSA_AES_KEY_WRAP 0x00001054UL +++- +++-#define CKM_JUNIPER_KEY_GEN 0x00001060UL +++-#define CKM_JUNIPER_ECB128 0x00001061UL +++-#define CKM_JUNIPER_CBC128 0x00001062UL +++-#define CKM_JUNIPER_COUNTER 0x00001063UL +++-#define CKM_JUNIPER_SHUFFLE 0x00001064UL +++-#define CKM_JUNIPER_WRAP 0x00001065UL +++-#define CKM_FASTHASH 0x00001070UL +++- +++-#define CKM_AES_XTS 0x00001071UL +++-#define CKM_AES_XTS_KEY_GEN 0x00001072UL +++-#define CKM_AES_KEY_GEN 0x00001080UL +++-#define CKM_AES_ECB 0x00001081UL +++-#define CKM_AES_CBC 0x00001082UL +++-#define CKM_AES_MAC 0x00001083UL +++-#define CKM_AES_MAC_GENERAL 0x00001084UL +++-#define CKM_AES_CBC_PAD 0x00001085UL +++-#define CKM_AES_CTR 0x00001086UL +++-#define CKM_AES_GCM 0x00001087UL +++-#define CKM_AES_CCM 0x00001088UL +++-#define CKM_AES_CTS 0x00001089UL +++-#define CKM_AES_CMAC 0x0000108AUL +++-#define CKM_AES_CMAC_GENERAL 0x0000108BUL +++- +++-#define CKM_AES_XCBC_MAC 0x0000108CUL +++-#define CKM_AES_XCBC_MAC_96 0x0000108DUL +++-#define CKM_AES_GMAC 0x0000108EUL +++- +++-#define CKM_BLOWFISH_KEY_GEN 0x00001090UL +++-#define CKM_BLOWFISH_CBC 0x00001091UL +++-#define CKM_TWOFISH_KEY_GEN 0x00001092UL +++-#define CKM_TWOFISH_CBC 0x00001093UL +++-#define CKM_BLOWFISH_CBC_PAD 0x00001094UL +++-#define CKM_TWOFISH_CBC_PAD 0x00001095UL +++- +++-#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100UL +++-#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101UL +++-#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL +++-#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL +++-#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL +++-#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL +++- +++-#define CKM_GOSTR3410_KEY_PAIR_GEN 0x00001200UL +++-#define CKM_GOSTR3410 0x00001201UL +++-#define CKM_GOSTR3410_WITH_GOSTR3411 0x00001202UL +++-#define CKM_GOSTR3410_KEY_WRAP 0x00001203UL +++-#define CKM_GOSTR3410_DERIVE 0x00001204UL +++-#define CKM_GOSTR3411 0x00001210UL +++-#define CKM_GOSTR3411_HMAC 0x00001211UL +++-#define CKM_GOST28147_KEY_GEN 0x00001220UL +++-#define CKM_GOST28147_ECB 0x00001221UL +++-#define CKM_GOST28147 0x00001222UL +++-#define CKM_GOST28147_MAC 0x00001223UL +++-#define CKM_GOST28147_KEY_WRAP 0x00001224UL +++-#define CKM_CHACHA20_KEY_GEN 0x00001225UL +++-#define CKM_CHACHA20 0x00001226UL +++-#define CKM_POLY1305_KEY_GEN 0x00001227UL +++-#define CKM_POLY1305 0x00001228UL +++-#define CKM_DSA_PARAMETER_GEN 0x00002000UL +++-#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL +++-#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL +++-#define CKM_DSA_PROBABILISTIC_PARAMETER_GEN 0x00002003UL +++-#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN CKM_DSA_PROBABILISTIC_PARAMETER_GEN +++-#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL +++-#define CKM_DSA_FIPS_G_GEN 0x00002005UL +++- +++-#define CKM_AES_OFB 0x00002104UL +++-#define CKM_AES_CFB64 0x00002105UL +++-#define CKM_AES_CFB8 0x00002106UL +++-#define CKM_AES_CFB128 0x00002107UL +++- +++-#define CKM_AES_CFB1 0x00002108UL +++-#define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */ +++-#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */ +++-#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL +++- +++-#define CKM_RSA_PKCS_TPM_1_1 0x00004001UL +++-#define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL +++- +++-#define CKM_SHA_1_KEY_GEN 0x00004003UL +++-#define CKM_SHA224_KEY_GEN 0x00004004UL +++-#define CKM_SHA256_KEY_GEN 0x00004005UL +++-#define CKM_SHA384_KEY_GEN 0x00004006UL +++-#define CKM_SHA512_KEY_GEN 0x00004007UL +++-#define CKM_SHA512_224_KEY_GEN 0x00004008UL +++-#define CKM_SHA512_256_KEY_GEN 0x00004009UL +++-#define CKM_SHA512_T_KEY_GEN 0x0000400aUL +++-#define CKM_NULL 0x0000400bUL +++-#define CKM_BLAKE2B_160 0x0000400cUL +++-#define CKM_BLAKE2B_160_HMAC 0x0000400dUL +++-#define CKM_BLAKE2B_160_HMAC_GENERAL 0x0000400eUL +++-#define CKM_BLAKE2B_160_KEY_DERIVE 0x0000400fUL +++-#define CKM_BLAKE2B_160_KEY_GEN 0x00004010UL +++-#define CKM_BLAKE2B_256 0x00004011UL +++-#define CKM_BLAKE2B_256_HMAC 0x00004012UL +++-#define CKM_BLAKE2B_256_HMAC_GENERAL 0x00004013UL +++-#define CKM_BLAKE2B_256_KEY_DERIVE 0x00004014UL +++-#define CKM_BLAKE2B_256_KEY_GEN 0x00004015UL +++-#define CKM_BLAKE2B_384 0x00004016UL +++-#define CKM_BLAKE2B_384_HMAC 0x00004017UL +++-#define CKM_BLAKE2B_384_HMAC_GENERAL 0x00004018UL +++-#define CKM_BLAKE2B_384_KEY_DERIVE 0x00004019UL +++-#define CKM_BLAKE2B_384_KEY_GEN 0x0000401aUL +++-#define CKM_BLAKE2B_512 0x0000401bUL +++-#define CKM_BLAKE2B_512_HMAC 0x0000401cUL +++-#define CKM_BLAKE2B_512_HMAC_GENERAL 0x0000401dUL +++-#define CKM_BLAKE2B_512_KEY_DERIVE 0x0000401eUL +++-#define CKM_BLAKE2B_512_KEY_GEN 0x0000401fUL +++-#define CKM_SALSA20 0x00004020UL +++-#define CKM_CHACHA20_POLY1305 0x00004021UL +++-#define CKM_SALSA20_POLY1305 0x00004022UL +++-#define CKM_X3DH_INITIALIZE 0x00004023UL +++-#define CKM_X3DH_RESPOND 0x00004024UL +++-#define CKM_X2RATCHET_INITIALIZE 0x00004025UL +++-#define CKM_X2RATCHET_RESPOND 0x00004026UL +++-#define CKM_X2RATCHET_ENCRYPT 0x00004027UL +++-#define CKM_X2RATCHET_DECRYPT 0x00004028UL +++-#define CKM_XEDDSA 0x00004029UL +++-#define CKM_HKDF_DERIVE 0x0000402aUL +++-#define CKM_HKDF_DATA 0x0000402bUL +++-#define CKM_HKDF_KEY_GEN 0x0000402cUL +++-#define CKM_SALSA20_KEY_GEN 0x0000402dUL +++- +++-#define CKM_ECDSA_SHA3_224 0x00001047UL +++-#define CKM_ECDSA_SHA3_256 0x00001048UL +++-#define CKM_ECDSA_SHA3_384 0x00001049UL +++-#define CKM_ECDSA_SHA3_512 0x0000104aUL +++-#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL ++++/* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE ++++ * are new for v2.11 */ ++++#define CKM_ECDH1_DERIVE 0x00001050UL ++++#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL ++++#define CKM_ECMQV_DERIVE 0x00001052UL ++++ ++++/* new for v2.40 */ ++++#define CKM_ECDH_AES_KEY_WRAP 0x00001053UL ++++#define CKM_RSA_AES_KEY_WRAP 0x00001054UL ++++ ++++#define CKM_JUNIPER_KEY_GEN 0x00001060UL ++++#define CKM_JUNIPER_ECB128 0x00001061UL ++++#define CKM_JUNIPER_CBC128 0x00001062UL ++++#define CKM_JUNIPER_COUNTER 0x00001063UL ++++#define CKM_JUNIPER_SHUFFLE 0x00001064UL ++++#define CKM_JUNIPER_WRAP 0x00001065UL ++++#define CKM_FASTHASH 0x00001070UL ++++ ++++/* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, ++++ * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, ++++ * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are ++++ * new for v2.11 */ ++++#define CKM_AES_KEY_GEN 0x00001080UL ++++#define CKM_AES_ECB 0x00001081UL ++++#define CKM_AES_CBC 0x00001082UL ++++#define CKM_AES_MAC 0x00001083UL ++++#define CKM_AES_MAC_GENERAL 0x00001084UL ++++#define CKM_AES_CBC_PAD 0x00001085UL ++++/* new for v2.20 amendment 3 */ ++++#define CKM_AES_CTR 0x00001086UL ++++/* new for v2.30 */ ++++#define CKM_AES_GCM 0x00001087UL ++++#define CKM_AES_CCM 0x00001088UL ++++#define CKM_AES_CTS 0x00001089UL ++++/* AES-CMAC values copied from v2.40 errata 1 header file */ ++++#define CKM_AES_CMAC 0x0000108AUL ++++#define CKM_AES_CMAC_GENERAL 0x0000108BUL ++++#define CKM_AES_XCBC_MAC 0x0000108CUL ++++#define CKM_AES_XCBC_MAC_96 0x0000108DUL ++++ ++++/* BlowFish and TwoFish are new for v2.20 */ ++++#define CKM_BLOWFISH_KEY_GEN 0x00001090UL ++++#define CKM_BLOWFISH_CBC 0x00001091UL ++++#define CKM_TWOFISH_KEY_GEN 0x00001092UL ++++#define CKM_TWOFISH_CBC 0x00001093UL ++++ ++++/* new for v2.40 */ ++++#define CKM_BLOWFISH_CBC_PAD 0x00001094UL ++++#define CKM_TWOFISH_CBC_PAD 0x00001095UL ++++ ++++/* Camellia is proposed for v2.20 Amendment 3 */ ++++#define CKM_CAMELLIA_KEY_GEN 0x00000550UL ++++#define CKM_CAMELLIA_ECB 0x00000551UL ++++#define CKM_CAMELLIA_CBC 0x00000552UL ++++#define CKM_CAMELLIA_MAC 0x00000553UL ++++#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL ++++#define CKM_CAMELLIA_CBC_PAD 0x00000555UL ++++#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL ++++#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL ++++ ++++/* new for v2.40 */ ++++#define CKM_ARIA_KEY_GEN 0x00000560UL ++++#define CKM_ARIA_ECB 0x00000561UL ++++#define CKM_ARIA_CBC 0x00000562UL ++++#define CKM_ARIA_MAC 0x00000563UL ++++#define CKM_ARIA_MAC_GENERAL 0x00000564UL ++++#define CKM_ARIA_CBC_PAD 0x00000565UL ++++#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566UL ++++#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567UL ++++ ++++#define CKM_SEED_KEY_GEN 0x00000650UL ++++#define CKM_SEED_ECB 0x00000651UL ++++#define CKM_SEED_CBC 0x00000652UL ++++#define CKM_SEED_MAC 0x00000653UL ++++#define CKM_SEED_MAC_GENERAL 0x00000654UL ++++#define CKM_SEED_CBC_PAD 0x00000655UL ++++#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL ++++#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL ++++ ++++/* new for v2.40 */ ++++#define CKM_ECDSA_SHA3_224 0x00001047UL ++++#define CKM_ECDSA_SHA3_256 0x00001048UL ++++#define CKM_ECDSA_SHA3_384 0x00001049UL ++++#define CKM_ECDSA_SHA3_512 0x0000104aUL ++++#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL +++ #define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL +++-#define CKM_EDDSA 0x00001057UL +++-#define CKM_SP800_108_COUNTER_KDF 0x000003acUL +++-#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL ++++#define CKM_EDDSA 0x00001057UL ++++ ++++/* CKM_xxx_ENCRYPT_DATA mechanisms are new for v2.20 */ ++++#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100UL ++++#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101UL ++++#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL ++++#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL ++++#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL ++++#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL ++++ ++++#define CKM_GOSTR3410_KEY_PAIR_GEN 0x00001200UL ++++#define CKM_GOSTR3410 0x00001201UL ++++#define CKM_GOSTR3410_WITH_GOSTR3411 0x00001202UL ++++#define CKM_GOSTR3410_KEY_WRAP 0x00001203UL ++++#define CKM_GOSTR3410_DERIVE 0x00001204UL ++++#define CKM_GOSTR3411 0x00001210UL ++++#define CKM_GOSTR3411_HMAC 0x00001211UL ++++#define CKM_GOST28147_KEY_GEN 0x00001220UL ++++#define CKM_GOST28147_ECB 0x00001221UL ++++#define CKM_GOST28147 0x00001222UL ++++#define CKM_GOST28147_MAC 0x00001223UL ++++#define CKM_GOST28147_KEY_WRAP 0x00001224UL ++++ ++++/* new for v2.40 */ ++++#define CKM_CHACHA20_KEY_GEN 0x00001225UL ++++#define CKM_CHACHA20 0x00001226UL ++++#define CKM_POLY1305_KEY_GEN 0x00001227UL ++++#define CKM_POLY1305 0x00001228UL ++++ ++++#define CKM_DSA_PARAMETER_GEN 0x00002000UL ++++#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL ++++#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL ++++ ++++/* new for v2.40 */ ++++#define CKM_DSA_PROBABILISTIC_PARAMETER_GEN 0x00002003UL ++++#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL ++++#define CKM_DSA_FIPS_G_GEN 0x00002005UL ++++#define CKM_AES_CFB1 0x00002108UL ++++#define CKM_AES_KEY_WRAP 0x00002109UL ++++#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL ++++#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL ++++ ++++/* CKM_SP800_108_xxx_KDF are new for v3.0 */ ++++#define CKM_SP800_108_COUNTER_KDF 0x000003acUL ++++#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL +++ #define CKM_SP800_108_DOUBLE_PIPELINE_KDF 0x000003aeUL +++ +++-#define CKM_VENDOR_DEFINED 0x80000000UL ++++/* new for v2.4 */ ++++#define CKM_RSA_PKCS_TPM_1_1 0x00004001UL ++++#define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL ++++#define CKM_SHA_1_KEY_GEN 0x00004003UL ++++#define CKM_SHA224_KEY_GEN 0x00004004UL ++++#define CKM_SHA256_KEY_GEN 0x00004005UL ++++#define CKM_SHA384_KEY_GEN 0x00004006UL ++++#define CKM_SHA512_KEY_GEN 0x00004007UL ++++#define CKM_SHA512_224_KEY_GEN 0x00004008UL ++++#define CKM_SHA512_256_KEY_GEN 0x00004009UL ++++#define CKM_SHA512_T_KEY_GEN 0x0000400aUL ++++ ++++/* new for v3.0 */ ++++#define CKM_NULL 0x0000400bUL ++++#define CKM_BLAKE2B_160 0x0000400cUL ++++#define CKM_BLAKE2B_160_HMAC 0x0000400dUL ++++#define CKM_BLAKE2B_160_HMAC_GENERAL 0x0000400eUL ++++#define CKM_BLAKE2B_160_KEY_DERIVE 0x0000400fUL ++++#define CKM_BLAKE2B_160_KEY_GEN 0x00004010UL ++++#define CKM_BLAKE2B_256 0x00004011UL ++++#define CKM_BLAKE2B_256_HMAC 0x00004012UL ++++#define CKM_BLAKE2B_256_HMAC_GENERAL 0x00004013UL ++++#define CKM_BLAKE2B_256_KEY_DERIVE 0x00004014UL ++++#define CKM_BLAKE2B_256_KEY_GEN 0x00004015UL ++++#define CKM_BLAKE2B_384 0x00004016UL ++++#define CKM_BLAKE2B_384_HMAC 0x00004017UL ++++#define CKM_BLAKE2B_384_HMAC_GENERAL 0x00004018UL ++++#define CKM_BLAKE2B_384_KEY_DERIVE 0x00004019UL ++++#define CKM_BLAKE2B_384_KEY_GEN 0x0000401aUL ++++#define CKM_BLAKE2B_512 0x0000401bUL ++++#define CKM_BLAKE2B_512_HMAC 0x0000401cUL ++++#define CKM_BLAKE2B_512_HMAC_GENERAL 0x0000401dUL ++++#define CKM_BLAKE2B_512_KEY_DERIVE 0x0000401eUL ++++#define CKM_BLAKE2B_512_KEY_GEN 0x0000401fUL ++++#define CKM_SALSA20 0x00004020UL ++++#define CKM_CHACHA20_POLY1305 0x00004021UL ++++#define CKM_SALSA20_POLY1305 0x00004022UL ++++#define CKM_X3DH_INITIALIZE 0x00004023UL ++++#define CKM_X3DH_RESPOND 0x00004024UL ++++#define CKM_X2RATCHET_INITIALIZE 0x00004025UL ++++#define CKM_X2RATCHET_RESPOND 0x00004026UL ++++#define CKM_X2RATCHET_ENCRYPT 0x00004027UL ++++#define CKM_X2RATCHET_DECRYPT 0x00004028UL ++++#define CKM_XEDDSA 0x00004029UL ++++#define CKM_HKDF_DERIVE 0x0000402aUL ++++#define CKM_HKDF_DATA 0x0000402bUL ++++#define CKM_HKDF_KEY_GEN 0x0000402cUL ++++#define CKM_SALSA20_KEY_GEN 0x0000402dUL +++ +++-typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; ++++#define CKM_VENDOR_DEFINED 0x80000000UL +++ ++++typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; +++ +++ /* CK_MECHANISM is a structure that specifies a particular +++- * mechanism +++- */ ++++ * mechanism */ +++ typedef struct CK_MECHANISM { +++ CK_MECHANISM_TYPE mechanism; +++- CK_VOID_PTR pParameter; +++- CK_ULONG ulParameterLen; /* in bytes */ ++++ CK_VOID_PTR pParameter; ++++ ++++ /* ulParameterLen was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++ CK_ULONG ulParameterLen; /* in bytes */ +++ } CK_MECHANISM; +++ +++ typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR; +++ +++- +++ /* CK_MECHANISM_INFO provides information about a particular +++- * mechanism +++- */ ++++ * mechanism */ +++ typedef struct CK_MECHANISM_INFO { +++ CK_ULONG ulMinKeySize; +++ CK_ULONG ulMaxKeySize; +++@@ -1152,711 +1267,947 @@ typedef struct CK_MECHANISM_INFO { +++ } CK_MECHANISM_INFO; +++ +++ /* The flags are defined as follows: +++- * Bit Flag Mask Meaning */ +++-#define CKF_HW 0x00000001UL /* performed by HW */ +++- +++-/* Specify whether or not a mechanism can be used for a particular task */ +++-#define CKF_MESSAGE_ENCRYPT 0x00000002UL +++-#define CKF_MESSAGE_DECRYPT 0x00000004UL +++-#define CKF_MESSAGE_SIGN 0x00000008UL +++-#define CKF_MESSAGE_VERIFY 0x00000010UL +++-#define CKF_MULTI_MESSAGE 0x00000020UL +++-#define CKF_MULTI_MESSGE CKF_MULTI_MESSAGE +++-#define CKF_FIND_OBJECTS 0x00000040UL +++- +++-#define CKF_ENCRYPT 0x00000100UL +++-#define CKF_DECRYPT 0x00000200UL +++-#define CKF_DIGEST 0x00000400UL +++-#define CKF_SIGN 0x00000800UL +++-#define CKF_SIGN_RECOVER 0x00001000UL +++-#define CKF_VERIFY 0x00002000UL +++-#define CKF_VERIFY_RECOVER 0x00004000UL +++-#define CKF_GENERATE 0x00008000UL +++-#define CKF_GENERATE_KEY_PAIR 0x00010000UL +++-#define CKF_WRAP 0x00020000UL +++-#define CKF_UNWRAP 0x00040000UL +++-#define CKF_DERIVE 0x00080000UL ++++ * Bit Flag Mask Meaning */ ++++#define CKF_HW 0x00000001UL /* performed by HW */ +++ +++-/* Describe a token's EC capabilities not available in mechanism +++- * information. +++- */ +++-#define CKF_EC_F_P 0x00100000UL +++-#define CKF_EC_F_2M 0x00200000UL +++-#define CKF_EC_ECPARAMETERS 0x00400000UL +++-#define CKF_EC_OID 0x00800000UL +++-#define CKF_EC_NAMEDCURVE CKF_EC_OID /* deprecated since PKCS#11 3.00 */ +++-#define CKF_EC_UNCOMPRESS 0x01000000UL +++-#define CKF_EC_COMPRESS 0x02000000UL +++-#define CKF_EC_CURVENAME 0x04000000UL ++++/* Message interface Flags, new for v3.0 */ ++++#define CKF_MESSAGE_ENCRYPT 0x00000002UL ++++#define CKF_MESSAGE_DECRYPT 0x00000004UL ++++#define CKF_MESSAGE_SIGN 0x00000008UL ++++#define CKF_MESSAGE_VERIFY 0x00000010UL ++++#define CKF_MULTI_MESSAGE 0x00000020UL ++++ ++++/* FindObjects (not for CK_MECHANISM_INFO, but for C_CancelSession) v3.0 */ ++++#define CKF_FIND_OBJECTS 0x00000040UL ++++ ++++/* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN, ++++ * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER, ++++ * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP, ++++ * and CKF_DERIVE are new for v2.0. They specify whether or not ++++ * a mechanism can be used for a particular task */ ++++#define CKF_ENCRYPT 0x00000100UL ++++#define CKF_DECRYPT 0x00000200UL ++++#define CKF_DIGEST 0x00000400UL ++++#define CKF_SIGN 0x00000800UL ++++#define CKF_SIGN_RECOVER 0x00001000UL ++++#define CKF_VERIFY 0x00002000 ++++#define CKF_VERIFY_RECOVER 0x00004000UL ++++#define CKF_GENERATE 0x00008000UL ++++#define CKF_GENERATE_KEY_PAIR 0x00010000UL ++++#define CKF_WRAP 0x00020000UL ++++#define CKF_UNWRAP 0x00040000UL ++++#define CKF_DERIVE 0x00080000UL ++++ ++++/* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE, ++++ * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They ++++ * describe a token's EC capabilities not available in mechanism ++++ * information. */ ++++#define CKF_EC_F_P 0x00100000UL ++++#define CKF_EC_F_2M 0x00200000UL ++++#define CKF_EC_ECPARAMETERS 0x00400000UL ++++#define CKF_EC_OID 0x00800000UL ++++#define CKF_EC_NAMEDCURVE CKF_EC_OID /* renamed in v3.0 */ ++++#define CKF_EC_UNCOMPRESS 0x01000000UL ++++#define CKF_EC_COMPRESS 0x02000000UL +++ +++-#define CKF_EXTENSION 0x80000000UL ++++#define CKF_EXTENSION 0x80000000UL /* FALSE for this version */ +++ +++ typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR; +++ +++ /* CK_RV is a value that identifies the return value of a +++- * Cryptoki function +++- */ +++-typedef CK_ULONG CK_RV; +++- +++-#define CKR_OK 0x00000000UL +++-#define CKR_CANCEL 0x00000001UL +++-#define CKR_HOST_MEMORY 0x00000002UL +++-#define CKR_SLOT_ID_INVALID 0x00000003UL +++- +++-#define CKR_GENERAL_ERROR 0x00000005UL +++-#define CKR_FUNCTION_FAILED 0x00000006UL +++- +++-#define CKR_ARGUMENTS_BAD 0x00000007UL +++-#define CKR_NO_EVENT 0x00000008UL +++-#define CKR_NEED_TO_CREATE_THREADS 0x00000009UL +++-#define CKR_CANT_LOCK 0x0000000AUL +++- +++-#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL +++-#define CKR_ATTRIBUTE_SENSITIVE 0x00000011UL +++-#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL +++-#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL +++- +++-#define CKR_ACTION_PROHIBITED 0x0000001BUL +++- +++-#define CKR_DATA_INVALID 0x00000020UL +++-#define CKR_DATA_LEN_RANGE 0x00000021UL +++-#define CKR_DEVICE_ERROR 0x00000030UL +++-#define CKR_DEVICE_MEMORY 0x00000031UL +++-#define CKR_DEVICE_REMOVED 0x00000032UL +++-#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL +++-#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL +++-#define CKR_AEAD_DECRYPT_FAILED 0x00000042UL +++-#define CKR_FUNCTION_CANCELED 0x00000050UL +++-#define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL +++- +++-#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL +++- +++-#define CKR_KEY_HANDLE_INVALID 0x00000060UL +++- +++-#define CKR_KEY_SIZE_RANGE 0x00000062UL +++-#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL +++- +++-#define CKR_KEY_NOT_NEEDED 0x00000064UL +++-#define CKR_KEY_CHANGED 0x00000065UL +++-#define CKR_KEY_NEEDED 0x00000066UL +++-#define CKR_KEY_INDIGESTIBLE 0x00000067UL +++-#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL +++-#define CKR_KEY_NOT_WRAPPABLE 0x00000069UL +++-#define CKR_KEY_UNEXTRACTABLE 0x0000006AUL +++- +++-#define CKR_MECHANISM_INVALID 0x00000070UL +++-#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL +++- +++-#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL +++-#define CKR_OPERATION_ACTIVE 0x00000090UL +++-#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL +++-#define CKR_PIN_INCORRECT 0x000000A0UL +++-#define CKR_PIN_INVALID 0x000000A1UL +++-#define CKR_PIN_LEN_RANGE 0x000000A2UL +++- +++-#define CKR_PIN_EXPIRED 0x000000A3UL +++-#define CKR_PIN_LOCKED 0x000000A4UL +++- +++-#define CKR_SESSION_CLOSED 0x000000B0UL +++-#define CKR_SESSION_COUNT 0x000000B1UL +++-#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL +++-#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4UL +++-#define CKR_SESSION_READ_ONLY 0x000000B5UL +++-#define CKR_SESSION_EXISTS 0x000000B6UL +++- +++-#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7UL +++-#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8UL +++- +++-#define CKR_SIGNATURE_INVALID 0x000000C0UL +++-#define CKR_SIGNATURE_LEN_RANGE 0x000000C1UL +++-#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL +++-#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL +++-#define CKR_TOKEN_NOT_PRESENT 0x000000E0UL +++-#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1UL +++-#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL +++-#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0UL +++-#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1UL +++-#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2UL +++-#define CKR_USER_ALREADY_LOGGED_IN 0x00000100UL +++-#define CKR_USER_NOT_LOGGED_IN 0x00000101UL +++-#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102UL +++-#define CKR_USER_TYPE_INVALID 0x00000103UL +++- +++-#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104UL +++-#define CKR_USER_TOO_MANY_TYPES 0x00000105UL +++- +++-#define CKR_WRAPPED_KEY_INVALID 0x00000110UL +++-#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112UL +++-#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113UL +++-#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114UL +++-#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115UL +++-#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120UL +++- +++-#define CKR_RANDOM_NO_RNG 0x00000121UL +++- +++-#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL +++- +++-#define CKR_CURVE_NOT_SUPPORTED 0x00000140UL +++- +++-#define CKR_BUFFER_TOO_SMALL 0x00000150UL +++-#define CKR_SAVED_STATE_INVALID 0x00000160UL +++-#define CKR_INFORMATION_SENSITIVE 0x00000170UL +++-#define CKR_STATE_UNSAVEABLE 0x00000180UL +++- +++-#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190UL +++-#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL +++-#define CKR_MUTEX_BAD 0x000001A0UL +++-#define CKR_MUTEX_NOT_LOCKED 0x000001A1UL +++- +++-#define CKR_NEW_PIN_MODE 0x000001B0UL +++-#define CKR_NEXT_OTP 0x000001B1UL +++- +++-#define CKR_EXCEEDED_MAX_ITERATIONS 0x000001B5UL +++-#define CKR_FIPS_SELF_TEST_FAILED 0x000001B6UL +++-#define CKR_LIBRARY_LOAD_FAILED 0x000001B7UL +++-#define CKR_PIN_TOO_WEAK 0x000001B8UL +++-#define CKR_PUBLIC_KEY_INVALID 0x000001B9UL +++- +++-#define CKR_FUNCTION_REJECTED 0x00000200UL +++-#define CKR_TOKEN_RESOURCE_EXCEEDED 0x00000201UL +++-#define CKR_OPERATION_CANCEL_FAILED 0x00000202UL +++- +++-#define CKR_VENDOR_DEFINED 0x80000000UL ++++ * PKCS #11 function */ ++++/* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */ ++++typedef CK_ULONG CK_RV; ++++ ++++#define CKR_OK 0x00000000UL ++++#define CKR_CANCEL 0x00000001UL ++++#define CKR_HOST_MEMORY 0x00000002UL ++++#define CKR_SLOT_ID_INVALID 0x00000003UL ++++ ++++/* CKR_FLAGS_INVALID was removed for v2.0 */ ++++ ++++/* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */ ++++#define CKR_GENERAL_ERROR 0x00000005UL ++++#define CKR_FUNCTION_FAILED 0x00000006UL ++++ ++++/* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS, ++++ * and CKR_CANT_LOCK are new for v2.01 */ ++++#define CKR_ARGUMENTS_BAD 0x00000007UL ++++#define CKR_NO_EVENT 0x00000008UL ++++#define CKR_NEED_TO_CREATE_THREADS 0x00000009UL ++++#define CKR_CANT_LOCK 0x0000000AUL ++++ ++++#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL ++++#define CKR_ATTRIBUTE_SENSITIVE 0x00000011UL ++++#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL ++++#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL ++++ ++++/* new for v3.0 */ ++++#define CKR_ACTION_PROHIBITED 0x0000001BUL ++++ ++++#define CKR_DATA_INVALID 0x00000020UL ++++#define CKR_DATA_LEN_RANGE 0x00000021UL ++++#define CKR_DEVICE_ERROR 0x00000030UL ++++#define CKR_DEVICE_MEMORY 0x00000031UL ++++#define CKR_DEVICE_REMOVED 0x00000032UL ++++#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL ++++#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL ++++#define CKR_FUNCTION_CANCELED 0x00000050UL ++++#define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL ++++ ++++/* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */ ++++#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL ++++ ++++#define CKR_KEY_HANDLE_INVALID 0x00000060UL ++++ ++++/* CKR_KEY_SENSITIVE was removed for v2.0 */ ++++ ++++#define CKR_KEY_SIZE_RANGE 0x00000062UL ++++#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL ++++ ++++/* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED, ++++ * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED, ++++ * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for ++++ * v2.0 */ ++++#define CKR_KEY_NOT_NEEDED 0x00000064UL ++++#define CKR_KEY_CHANGED 0x00000065UL ++++#define CKR_KEY_NEEDED 0x00000066UL ++++#define CKR_KEY_INDIGESTIBLE 0x00000067UL ++++#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL ++++#define CKR_KEY_NOT_WRAPPABLE 0x00000069UL ++++#define CKR_KEY_UNEXTRACTABLE 0x0000006AUL ++++ ++++#define CKR_MECHANISM_INVALID 0x00000070UL ++++#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL ++++ ++++/* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID ++++ * were removed for v2.0 */ ++++#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL ++++#define CKR_OPERATION_ACTIVE 0x00000090UL ++++#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL ++++#define CKR_PIN_INCORRECT 0x000000A0UL ++++#define CKR_PIN_INVALID 0x000000A1UL ++++#define CKR_PIN_LEN_RANGE 0x000000A2UL ++++ ++++/* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */ ++++#define CKR_PIN_EXPIRED 0x000000A3UL ++++#define CKR_PIN_LOCKED 0x000000A4UL ++++ ++++#define CKR_SESSION_CLOSED 0x000000B0UL ++++#define CKR_SESSION_COUNT 0x000000B1UL ++++#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL ++++#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4UL ++++#define CKR_SESSION_READ_ONLY 0x000000B5UL ++++#define CKR_SESSION_EXISTS 0x000000B6UL ++++ ++++/* CKR_SESSION_READ_ONLY_EXISTS and ++++ * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */ ++++#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7UL ++++#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8UL ++++ ++++#define CKR_SIGNATURE_INVALID 0x000000C0UL ++++#define CKR_SIGNATURE_LEN_RANGE 0x000000C1UL ++++#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL ++++#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL ++++#define CKR_TOKEN_NOT_PRESENT 0x000000E0UL ++++#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1UL ++++#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL ++++#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0UL ++++#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1UL ++++#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2UL ++++#define CKR_USER_ALREADY_LOGGED_IN 0x00000100UL ++++#define CKR_USER_NOT_LOGGED_IN 0x00000101UL ++++#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102UL ++++#define CKR_USER_TYPE_INVALID 0x00000103UL ++++ ++++/* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES ++++ * are new to v2.01 */ ++++#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104UL ++++#define CKR_USER_TOO_MANY_TYPES 0x00000105UL ++++ ++++#define CKR_WRAPPED_KEY_INVALID 0x00000110UL ++++#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112UL ++++#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113UL ++++#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114UL ++++#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115UL ++++#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120UL ++++ ++++/* This is new to v2.0 */ ++++#define CKR_RANDOM_NO_RNG 0x00000121UL ++++ ++++/* This is new to v2.11 */ ++++#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL ++++ ++++/* This is new to v2.40 */ ++++#define CKR_CURVE_NOT_SUPPORTED 0x00000140UL ++++ ++++/* These are new to v2.0 */ ++++#define CKR_BUFFER_TOO_SMALL 0x00000150UL ++++#define CKR_SAVED_STATE_INVALID 0x00000160UL ++++#define CKR_INFORMATION_SENSITIVE 0x00000170UL ++++#define CKR_STATE_UNSAVEABLE 0x00000180UL ++++ ++++/* These are new to v2.01 */ ++++#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190UL ++++#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL ++++#define CKR_MUTEX_BAD 0x000001A0UL ++++#define CKR_MUTEX_NOT_LOCKED 0x000001A1UL ++++ ++++/* These are new to v2.40 */ ++++#define CKR_NEW_PIN_MODE 0x000001B0UL ++++#define CKR_NEXT_OTP 0x000001B1UL ++++#define CKR_EXCEEDED_MAX_ITERATIONS 0x000001B5UL ++++#define CKR_FIPS_SELF_TEST_FAILED 0x000001B6UL ++++#define CKR_LIBRARY_LOAD_FAILED 0x000001B7UL ++++#define CKR_PIN_TOO_WEAK 0x000001B8UL ++++#define CKR_PUBLIC_KEY_INVALID 0x000001B9UL ++++ ++++/* This is new to v2.20 */ ++++#define CKR_FUNCTION_REJECTED 0x00000200UL ++++ ++++/* This is new to v3.0 */ ++++#define CKR_TOKEN_RESOURCE_EXCEEDED 0x00000201UL ++++#define CKR_OPERATION_CANCEL_FAILED 0x00000202UL +++ ++++#define CKR_VENDOR_DEFINED 0x80000000UL +++ +++ /* CK_NOTIFY is an application callback that processes events */ +++ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( +++- CK_SESSION_HANDLE hSession, /* the session's handle */ +++- CK_NOTIFICATION event, +++- CK_VOID_PTR pApplication /* passed to C_OpenSession */ +++-); ++++ CK_SESSION_HANDLE hSession, /* the session's handle */ ++++ CK_NOTIFICATION event, ++++ CK_VOID_PTR pApplication /* passed to C_OpenSession */ ++++ ); +++ +++- +++-/* CK_FUNCTION_LIST is a structure holding a Cryptoki spec ++++/* CK_FUNCTION_LIST is a structure holding a PKCS #11 spec +++ * version and pointers of appropriate types to all the +++- * Cryptoki functions +++- */ ++++ * PKCS #11 functions */ ++++/* CK_FUNCTION_LIST is new for v2.0 */ +++ typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; +++-typedef struct CK_FUNCTION_LIST_3_0 CK_FUNCTION_LIST_3_0; +++ +++ typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; +++-typedef CK_FUNCTION_LIST_3_0 CK_PTR CK_FUNCTION_LIST_3_0_PTR; +++ +++ typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; ++++ ++++/* These are new for v3.0 */ ++++typedef struct CK_FUNCTION_LIST_3_0 CK_FUNCTION_LIST_3_0; ++++typedef CK_FUNCTION_LIST_3_0 CK_PTR CK_FUNCTION_LIST_3_0_PTR; +++ typedef CK_FUNCTION_LIST_3_0_PTR CK_PTR CK_FUNCTION_LIST_3_0_PTR_PTR; +++ ++++/* Interfaces are new in v3.0 */ +++ typedef struct CK_INTERFACE { +++- CK_CHAR *pInterfaceName; ++++ CK_CHAR *pInterfaceName; +++ CK_VOID_PTR pFunctionList; +++- CK_FLAGS flags; ++++ CK_FLAGS flags; +++ } CK_INTERFACE; +++ +++ typedef CK_INTERFACE CK_PTR CK_INTERFACE_PTR; +++ typedef CK_INTERFACE_PTR CK_PTR CK_INTERFACE_PTR_PTR; +++ +++-#define CKF_END_OF_MESSAGE 0x00000001UL +++- ++++#define CKF_END_OF_MESSAGE 0x00000001UL ++++#define CKF_INTERFACE_FORK_SAFE 0x00000001UL +++ +++ /* CK_CREATEMUTEX is an application callback for creating a +++- * mutex object +++- */ ++++ * mutex object */ +++ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)( +++- CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ +++-); +++- ++++ CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ ++++ ); +++ +++ /* CK_DESTROYMUTEX is an application callback for destroying a +++- * mutex object +++- */ ++++ * mutex object */ +++ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)( +++- CK_VOID_PTR pMutex /* pointer to mutex */ +++-); +++- ++++ CK_VOID_PTR pMutex /* pointer to mutex */ ++++ ); +++ +++ /* CK_LOCKMUTEX is an application callback for locking a mutex */ +++ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)( +++- CK_VOID_PTR pMutex /* pointer to mutex */ +++-); +++- ++++ CK_VOID_PTR pMutex /* pointer to mutex */ ++++ ); +++ +++ /* CK_UNLOCKMUTEX is an application callback for unlocking a +++- * mutex +++- */ ++++ * mutex */ +++ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( +++- CK_VOID_PTR pMutex /* pointer to mutex */ +++-); +++- +++-/* Get functionlist flags */ +++-#define CKF_INTERFACE_FORK_SAFE 0x00000001UL ++++ CK_VOID_PTR pMutex /* pointer to mutex */ ++++ ); +++ +++ /* CK_C_INITIALIZE_ARGS provides the optional arguments to +++- * C_Initialize +++- */ ++++ * C_Initialize */ +++ typedef struct CK_C_INITIALIZE_ARGS { +++- CK_CREATEMUTEX CreateMutex; ++++ CK_CREATEMUTEX CreateMutex; +++ CK_DESTROYMUTEX DestroyMutex; +++- CK_LOCKMUTEX LockMutex; +++- CK_UNLOCKMUTEX UnlockMutex; +++- CK_FLAGS flags; +++- CK_VOID_PTR pReserved; ++++ CK_LOCKMUTEX LockMutex; ++++ CK_UNLOCKMUTEX UnlockMutex; ++++ CK_FLAGS flags; ++++ /* The official PKCS #11 spec does not have a 'LibraryParameters' field, but ++++ * a reserved field. NSS needs a way to pass instance-specific information ++++ * to the library (like where to find its config files, etc). This ++++ * information is usually provided by the installer and passed uninterpreted ++++ * by NSS to the library, though NSS does know the specifics of the softoken ++++ * version of this parameter. Most compliant PKCS#11 modules expect this ++++ * parameter to be NULL, and will return CKR_ARGUMENTS_BAD from ++++ * C_Initialize if Library parameters is supplied. */ ++++ CK_CHAR_PTR *LibraryParameters; ++++ /* This field is only present if the LibraryParameters is not NULL. It must ++++ * be NULL in all cases */ ++++ CK_VOID_PTR pReserved; +++ } CK_C_INITIALIZE_ARGS; +++ +++ /* flags: bit flags that provide capabilities of the slot +++ * Bit Flag Mask Meaning +++ */ +++ #define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001UL +++-#define CKF_OS_LOCKING_OK 0x00000002UL ++++#define CKF_OS_LOCKING_OK 0x00000002UL +++ +++ typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; +++ +++- +++- +++ /* additional flags for parameters to functions */ +++ +++ /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ +++-#define CKF_DONT_BLOCK 1 ++++#define CKF_DONT_BLOCK 1 +++ +++-/* CK_RSA_PKCS_MGF_TYPE is used to indicate the Message ++++/* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10. ++++ * CK_RSA_PKCS_OAEP_MGF_TYPE is used to indicate the Message +++ * Generation Function (MGF) applied to a message block when +++ * formatting a message block for the PKCS #1 OAEP encryption +++- * scheme. +++- */ ++++ * scheme. */ +++ typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; +++ +++ typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; +++ +++ /* The following MGFs are defined */ +++-#define CKG_MGF1_SHA1 0x00000001UL +++-#define CKG_MGF1_SHA256 0x00000002UL +++-#define CKG_MGF1_SHA384 0x00000003UL +++-#define CKG_MGF1_SHA512 0x00000004UL +++-#define CKG_MGF1_SHA224 0x00000005UL +++-#define CKG_MGF1_SHA3_224 0x00000006UL +++-#define CKG_MGF1_SHA3_256 0x00000007UL +++-#define CKG_MGF1_SHA3_384 0x00000008UL +++-#define CKG_MGF1_SHA3_512 0x00000009UL ++++/* CKG_MGF1_SHA256, CKG_MGF1_SHA384, and CKG_MGF1_SHA512 ++++ * are new for v2.20 */ ++++#define CKG_MGF1_SHA1 0x00000001UL ++++#define CKG_MGF1_SHA256 0x00000002UL ++++#define CKG_MGF1_SHA384 0x00000003UL ++++#define CKG_MGF1_SHA512 0x00000004UL ++++ ++++/* v2.20 amendment 3 */ ++++#define CKG_MGF1_SHA224 0x00000005UL ++++ ++++/* v2.40 */ ++++#define CKG_MGF1_SHA3_224 0x00000006UL ++++#define CKG_MGF1_SHA3_256 0x00000007UL ++++#define CKG_MGF1_SHA3_384 0x00000008UL ++++#define CKG_MGF1_SHA3_512 0x00000009UL +++ +++-/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source ++++/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10. ++++ * CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source +++ * of the encoding parameter when formatting a message block +++- * for the PKCS #1 OAEP encryption scheme. +++- */ ++++ * for the PKCS #1 OAEP encryption scheme. */ +++ typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; +++ +++ typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR; +++ +++ /* The following encoding parameter sources are defined */ +++-#define CKZ_DATA_SPECIFIED 0x00000001UL ++++#define CKZ_DATA_SPECIFIED 0x00000001UL +++ +++-/* CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the +++- * CKM_RSA_PKCS_OAEP mechanism. +++- */ ++++/* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10. ++++ * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the ++++ * CKM_RSA_PKCS_OAEP mechanism. */ +++ typedef struct CK_RSA_PKCS_OAEP_PARAMS { +++- CK_MECHANISM_TYPE hashAlg; +++- CK_RSA_PKCS_MGF_TYPE mgf; ++++ CK_MECHANISM_TYPE hashAlg; ++++ CK_RSA_PKCS_MGF_TYPE mgf; +++ CK_RSA_PKCS_OAEP_SOURCE_TYPE source; +++- CK_VOID_PTR pSourceData; +++- CK_ULONG ulSourceDataLen; ++++ CK_VOID_PTR pSourceData; ++++ CK_ULONG ulSourceDataLen; +++ } CK_RSA_PKCS_OAEP_PARAMS; +++ +++ typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR; +++ +++-/* CK_RSA_PKCS_PSS_PARAMS provides the parameters to the +++- * CKM_RSA_PKCS_PSS mechanism(s). +++- */ ++++/* CK_RSA_PKCS_PSS_PARAMS is new for v2.11. ++++ * CK_RSA_PKCS_PSS_PARAMS provides the parameters to the ++++ * CKM_RSA_PKCS_PSS mechanism(s). */ +++ typedef struct CK_RSA_PKCS_PSS_PARAMS { +++- CK_MECHANISM_TYPE hashAlg; ++++ CK_MECHANISM_TYPE hashAlg; +++ CK_RSA_PKCS_MGF_TYPE mgf; +++- CK_ULONG sLen; ++++ CK_ULONG sLen; +++ } CK_RSA_PKCS_PSS_PARAMS; +++ +++ typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; +++ ++++/* CK_EC_KDF_TYPE is new for v2.11. */ +++ typedef CK_ULONG CK_EC_KDF_TYPE; +++-typedef CK_EC_KDF_TYPE CK_PTR CK_EC_KDF_TYPE_PTR; +++ +++ /* The following EC Key Derivation Functions are defined */ +++-#define CKD_NULL 0x00000001UL +++-#define CKD_SHA1_KDF 0x00000002UL +++- +++-/* The following X9.42 DH key derivation functions are defined */ +++-#define CKD_SHA1_KDF_ASN1 0x00000003UL +++-#define CKD_SHA1_KDF_CONCATENATE 0x00000004UL +++-#define CKD_SHA224_KDF 0x00000005UL +++-#define CKD_SHA256_KDF 0x00000006UL +++-#define CKD_SHA384_KDF 0x00000007UL +++-#define CKD_SHA512_KDF 0x00000008UL +++-#define CKD_CPDIVERSIFY_KDF 0x00000009UL +++-#define CKD_SHA3_224_KDF 0x0000000AUL +++-#define CKD_SHA3_256_KDF 0x0000000BUL +++-#define CKD_SHA3_384_KDF 0x0000000CUL +++-#define CKD_SHA3_512_KDF 0x0000000DUL +++-#define CKD_SHA1_KDF_SP800 0x0000000EUL +++-#define CKD_SHA224_KDF_SP800 0x0000000FUL +++-#define CKD_SHA256_KDF_SP800 0x00000010UL +++-#define CKD_SHA384_KDF_SP800 0x00000011UL +++-#define CKD_SHA512_KDF_SP800 0x00000012UL +++-#define CKD_SHA3_224_KDF_SP800 0x00000013UL +++-#define CKD_SHA3_256_KDF_SP800 0x00000014UL +++-#define CKD_SHA3_384_KDF_SP800 0x00000015UL +++-#define CKD_SHA3_512_KDF_SP800 0x00000016UL +++-#define CKD_BLAKE2B_160_KDF 0x00000017UL +++-#define CKD_BLAKE2B_256_KDF 0x00000018UL +++-#define CKD_BLAKE2B_384_KDF 0x00000019UL +++-#define CKD_BLAKE2B_512_KDF 0x0000001aUL ++++#define CKD_NULL 0x00000001UL ++++#define CKD_SHA1_KDF 0x00000002UL ++++#define CKD_SHA224_KDF 0x00000005UL ++++#define CKD_SHA256_KDF 0x00000006UL ++++#define CKD_SHA384_KDF 0x00000007UL ++++#define CKD_SHA512_KDF 0x00000008UL ++++ ++++/* new for v2.40 */ ++++#define CKD_CPDIVERSIFY_KDF 0x00000009UL ++++#define CKD_SHA3_224_KDF 0x0000000AUL ++++#define CKD_SHA3_256_KDF 0x0000000BUL ++++#define CKD_SHA3_384_KDF 0x0000000CUL ++++#define CKD_SHA3_512_KDF 0x0000000DUL ++++ ++++/* new for v3.0 */ ++++#define CKD_SHA1_KDF_SP800 0x0000000EUL ++++#define CKD_SHA224_KDF_SP800 0x0000000FUL ++++#define CKD_SHA256_KDF_SP800 0x00000010UL ++++#define CKD_SHA384_KDF_SP800 0x00000011UL ++++#define CKD_SHA512_KDF_SP800 0x00000012UL ++++#define CKD_SHA3_224_KDF_SP800 0x00000013UL ++++#define CKD_SHA3_256_KDF_SP800 0x00000014UL ++++#define CKD_SHA3_384_KDF_SP800 0x00000015UL ++++#define CKD_SHA3_512_KDF_SP800 0x00000016UL ++++#define CKD_BLAKE2B_160_KDF 0x00000017UL ++++#define CKD_BLAKE2B_256_KDF 0x00000018UL ++++#define CKD_BLAKE2B_384_KDF 0x00000019UL ++++#define CKD_BLAKE2B_512_KDF 0x0000001aUL +++ +++-/* CK_ECDH1_DERIVE_PARAMS provides the parameters to the ++++/* CK_ECDH1_DERIVE_PARAMS is new for v2.11. ++++ * CK_ECDH1_DERIVE_PARAMS provides the parameters to the +++ * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, +++ * where each party contributes one key pair. +++ */ +++ typedef struct CK_ECDH1_DERIVE_PARAMS { +++ CK_EC_KDF_TYPE kdf; +++- CK_ULONG ulSharedDataLen; +++- CK_BYTE_PTR pSharedData; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulSharedDataLen; ++++ CK_BYTE_PTR pSharedData; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; +++ } CK_ECDH1_DERIVE_PARAMS; +++ +++ typedef CK_ECDH1_DERIVE_PARAMS CK_PTR CK_ECDH1_DERIVE_PARAMS_PTR; +++ +++-/* ++++/* CK_ECDH2_DERIVE_PARAMS is new for v2.11. +++ * CK_ECDH2_DERIVE_PARAMS provides the parameters to the +++- * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. +++- */ ++++ * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. */ +++ typedef struct CK_ECDH2_DERIVE_PARAMS { +++- CK_EC_KDF_TYPE kdf; +++- CK_ULONG ulSharedDataLen; +++- CK_BYTE_PTR pSharedData; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPrivateDataLen; ++++ CK_EC_KDF_TYPE kdf; ++++ CK_ULONG ulSharedDataLen; ++++ CK_BYTE_PTR pSharedData; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulPrivateDataLen; +++ CK_OBJECT_HANDLE hPrivateData; +++- CK_ULONG ulPublicDataLen2; +++- CK_BYTE_PTR pPublicData2; ++++ CK_ULONG ulPublicDataLen2; ++++ CK_BYTE_PTR pPublicData2; +++ } CK_ECDH2_DERIVE_PARAMS; +++ +++ typedef CK_ECDH2_DERIVE_PARAMS CK_PTR CK_ECDH2_DERIVE_PARAMS_PTR; +++ +++ typedef struct CK_ECMQV_DERIVE_PARAMS { +++- CK_EC_KDF_TYPE kdf; +++- CK_ULONG ulSharedDataLen; +++- CK_BYTE_PTR pSharedData; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPrivateDataLen; ++++ CK_EC_KDF_TYPE kdf; ++++ CK_ULONG ulSharedDataLen; ++++ CK_BYTE_PTR pSharedData; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulPrivateDataLen; +++ CK_OBJECT_HANDLE hPrivateData; +++- CK_ULONG ulPublicDataLen2; +++- CK_BYTE_PTR pPublicData2; ++++ CK_ULONG ulPublicDataLen2; ++++ CK_BYTE_PTR pPublicData2; +++ CK_OBJECT_HANDLE publicKey; +++ } CK_ECMQV_DERIVE_PARAMS; +++ +++ typedef CK_ECMQV_DERIVE_PARAMS CK_PTR CK_ECMQV_DERIVE_PARAMS_PTR; +++ +++ /* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the +++- * CKM_X9_42_DH_PARAMETER_GEN mechanisms +++- */ ++++ * CKM_X9_42_DH_PARAMETER_GEN mechanisms (new for PKCS #11 v2.11) */ +++ typedef CK_ULONG CK_X9_42_DH_KDF_TYPE; +++ typedef CK_X9_42_DH_KDF_TYPE CK_PTR CK_X9_42_DH_KDF_TYPE_PTR; +++ +++-/* CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the ++++/* The following X9.42 DH key derivation functions are defined ++++ (besides CKD_NULL already defined : */ ++++#define CKD_SHA1_KDF_ASN1 0x00000003UL ++++#define CKD_SHA1_KDF_CONCATENATE 0x00000004UL ++++ ++++/* CK_X9_42_DH1_DERIVE_PARAMS is new for v2.11. ++++ * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the +++ * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party +++- * contributes one key pair +++- */ ++++ * contributes one key pair */ +++ typedef struct CK_X9_42_DH1_DERIVE_PARAMS { +++ CK_X9_42_DH_KDF_TYPE kdf; +++- CK_ULONG ulOtherInfoLen; +++- CK_BYTE_PTR pOtherInfo; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulOtherInfoLen; ++++ CK_BYTE_PTR pOtherInfo; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; +++ } CK_X9_42_DH1_DERIVE_PARAMS; +++ +++ typedef struct CK_X9_42_DH1_DERIVE_PARAMS CK_PTR CK_X9_42_DH1_DERIVE_PARAMS_PTR; +++ +++-/* CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the ++++/* CK_X9_42_DH2_DERIVE_PARAMS is new for v2.11. ++++ * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the +++ * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation +++- * mechanisms, where each party contributes two key pairs +++- */ ++++ * mechanisms, where each party contributes two key pairs */ +++ typedef struct CK_X9_42_DH2_DERIVE_PARAMS { +++ CK_X9_42_DH_KDF_TYPE kdf; +++- CK_ULONG ulOtherInfoLen; +++- CK_BYTE_PTR pOtherInfo; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPrivateDataLen; +++- CK_OBJECT_HANDLE hPrivateData; +++- CK_ULONG ulPublicDataLen2; +++- CK_BYTE_PTR pPublicData2; ++++ CK_ULONG ulOtherInfoLen; ++++ CK_BYTE_PTR pOtherInfo; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulPrivateDataLen; ++++ CK_OBJECT_HANDLE hPrivateData; ++++ CK_ULONG ulPublicDataLen2; ++++ CK_BYTE_PTR pPublicData2; +++ } CK_X9_42_DH2_DERIVE_PARAMS; +++ +++ typedef CK_X9_42_DH2_DERIVE_PARAMS CK_PTR CK_X9_42_DH2_DERIVE_PARAMS_PTR; +++ +++ typedef struct CK_X9_42_MQV_DERIVE_PARAMS { +++ CK_X9_42_DH_KDF_TYPE kdf; +++- CK_ULONG ulOtherInfoLen; +++- CK_BYTE_PTR pOtherInfo; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPrivateDataLen; +++- CK_OBJECT_HANDLE hPrivateData; +++- CK_ULONG ulPublicDataLen2; +++- CK_BYTE_PTR pPublicData2; +++- CK_OBJECT_HANDLE publicKey; ++++ CK_ULONG ulOtherInfoLen; ++++ CK_BYTE_PTR pOtherInfo; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulPrivateDataLen; ++++ CK_OBJECT_HANDLE hPrivateData; ++++ CK_ULONG ulPublicDataLen2; ++++ CK_BYTE_PTR pPublicData2; ++++ CK_OBJECT_HANDLE publicKey; +++ } CK_X9_42_MQV_DERIVE_PARAMS; +++ +++ typedef CK_X9_42_MQV_DERIVE_PARAMS CK_PTR CK_X9_42_MQV_DERIVE_PARAMS_PTR; +++ +++ /* CK_KEA_DERIVE_PARAMS provides the parameters to the +++- * CKM_KEA_DERIVE mechanism +++- */ ++++ * CKM_KEA_DERIVE mechanism */ ++++/* CK_KEA_DERIVE_PARAMS is new for v2.0 */ +++ typedef struct CK_KEA_DERIVE_PARAMS { +++- CK_BBOOL isSender; +++- CK_ULONG ulRandomLen; ++++ CK_BBOOL isSender; ++++ CK_ULONG ulRandomLen; +++ CK_BYTE_PTR pRandomA; +++ CK_BYTE_PTR pRandomB; +++- CK_ULONG ulPublicDataLen; ++++ CK_ULONG ulPublicDataLen; +++ CK_BYTE_PTR pPublicData; +++ } CK_KEA_DERIVE_PARAMS; +++ +++ typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR; +++ +++- +++ /* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and +++ * CKM_RC2_MAC mechanisms. An instance of CK_RC2_PARAMS just +++- * holds the effective keysize +++- */ +++-typedef CK_ULONG CK_RC2_PARAMS; ++++ * holds the effective keysize */ ++++typedef CK_ULONG CK_RC2_PARAMS; +++ +++ typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR; +++ +++- +++ /* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC +++- * mechanism +++- */ ++++ * mechanism */ +++ typedef struct CK_RC2_CBC_PARAMS { +++- CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ +++- CK_BYTE iv[8]; /* IV for CBC mode */ ++++ /* ulEffectiveBits was changed from CK_USHORT to CK_ULONG for ++++ * v2.0 */ ++++ CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ ++++ ++++ CK_BYTE iv[8]; /* IV for CBC mode */ +++ } CK_RC2_CBC_PARAMS; +++ +++ typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR; +++ +++- +++ /* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the +++- * CKM_RC2_MAC_GENERAL mechanism +++- */ ++++ * CKM_RC2_MAC_GENERAL mechanism */ ++++/* CK_RC2_MAC_GENERAL_PARAMS is new for v2.0 */ +++ typedef struct CK_RC2_MAC_GENERAL_PARAMS { +++- CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ +++- CK_ULONG ulMacLength; /* Length of MAC in bytes */ ++++ CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ ++++ CK_ULONG ulMacLength; /* Length of MAC in bytes */ +++ } CK_RC2_MAC_GENERAL_PARAMS; +++ +++-typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \ +++- CK_RC2_MAC_GENERAL_PARAMS_PTR; +++- ++++typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR ++++ CK_RC2_MAC_GENERAL_PARAMS_PTR; +++ +++ /* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and +++- * CKM_RC5_MAC mechanisms +++- */ ++++ * CKM_RC5_MAC mechanisms */ ++++/* CK_RC5_PARAMS is new for v2.0 */ +++ typedef struct CK_RC5_PARAMS { +++- CK_ULONG ulWordsize; /* wordsize in bits */ +++- CK_ULONG ulRounds; /* number of rounds */ ++++ CK_ULONG ulWordsize; /* wordsize in bits */ ++++ CK_ULONG ulRounds; /* number of rounds */ +++ } CK_RC5_PARAMS; +++ +++ typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR; +++ +++- +++ /* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC +++- * mechanism +++- */ ++++ * mechanism */ ++++/* CK_RC5_CBC_PARAMS is new for v2.0 */ +++ typedef struct CK_RC5_CBC_PARAMS { +++- CK_ULONG ulWordsize; /* wordsize in bits */ +++- CK_ULONG ulRounds; /* number of rounds */ +++- CK_BYTE_PTR pIv; /* pointer to IV */ +++- CK_ULONG ulIvLen; /* length of IV in bytes */ ++++ CK_ULONG ulWordsize; /* wordsize in bits */ ++++ CK_ULONG ulRounds; /* number of rounds */ ++++ CK_BYTE_PTR pIv; /* pointer to IV */ ++++ CK_ULONG ulIvLen; /* length of IV in bytes */ +++ } CK_RC5_CBC_PARAMS; +++ +++ typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR; +++ +++- +++ /* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the +++- * CKM_RC5_MAC_GENERAL mechanism +++- */ ++++ * CKM_RC5_MAC_GENERAL mechanism */ ++++/* CK_RC5_MAC_GENERAL_PARAMS is new for v2.0 */ +++ typedef struct CK_RC5_MAC_GENERAL_PARAMS { +++- CK_ULONG ulWordsize; /* wordsize in bits */ +++- CK_ULONG ulRounds; /* number of rounds */ +++- CK_ULONG ulMacLength; /* Length of MAC in bytes */ ++++ CK_ULONG ulWordsize; /* wordsize in bits */ ++++ CK_ULONG ulRounds; /* number of rounds */ ++++ CK_ULONG ulMacLength; /* Length of MAC in bytes */ +++ } CK_RC5_MAC_GENERAL_PARAMS; +++ +++-typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \ +++- CK_RC5_MAC_GENERAL_PARAMS_PTR; ++++typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR ++++ CK_RC5_MAC_GENERAL_PARAMS_PTR; +++ +++ /* CK_MAC_GENERAL_PARAMS provides the parameters to most block +++ * ciphers' MAC_GENERAL mechanisms. Its value is the length of +++- * the MAC +++- */ +++-typedef CK_ULONG CK_MAC_GENERAL_PARAMS; ++++ * the MAC */ ++++/* CK_MAC_GENERAL_PARAMS is new for v2.0 */ ++++typedef CK_ULONG CK_MAC_GENERAL_PARAMS; +++ +++ typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR; +++ ++++/* CK_DES/AES_ECB/CBC_ENCRYPT_DATA_PARAMS are new for v2.20 */ +++ typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { +++- CK_BYTE iv[8]; ++++ CK_BYTE iv[8]; +++ CK_BYTE_PTR pData; +++- CK_ULONG length; ++++ CK_ULONG length; +++ } CK_DES_CBC_ENCRYPT_DATA_PARAMS; +++ +++-typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ +++- CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; +++ +++ typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { +++- CK_BYTE iv[16]; ++++ CK_BYTE iv[16]; +++ CK_BYTE_PTR pData; +++- CK_ULONG length; ++++ CK_ULONG length; +++ } CK_AES_CBC_ENCRYPT_DATA_PARAMS; +++ +++-typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ +++- CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++ ++++/* CK_AES_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */ ++++typedef struct CK_AES_CTR_PARAMS { ++++ CK_ULONG ulCounterBits; ++++ CK_BYTE cb[16]; ++++} CK_AES_CTR_PARAMS; ++++ ++++typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; ++++ ++++/* CK_GCM_PARAMS is new for version 2.30 */ ++++/* There was a discrepency between the doc and the headers ++++ * in PKCS #11 v2.40, NSS had the doc version, but the header ++++ * was normative. In V3.0 they were reconsiled as the header ++++ * version. In NSS the header version is called CK_GCM_PARAMS_V3 ++++ * and the v2.40 doc version is called CK_NSS_GCM_PARAMS. ++++ * CK_GCM_PARMS is define as CK_NSS_GCM_PARAMS if ++++ * NSS_PCKS11_2_0_COMPAT is defined and CK_GCM_PARAMS_V3 if it's not. ++++ * Softoken accepts either version and internally uses CK_NSS_GCM_PARAMS */ ++++typedef struct CK_GCM_PARAMS_V3 { ++++ CK_BYTE_PTR pIv; ++++ CK_ULONG ulIvLen; ++++ CK_ULONG ulIvBits; ++++ CK_BYTE_PTR pAAD; ++++ CK_ULONG ulAADLen; ++++ CK_ULONG ulTagBits; ++++} CK_GCM_PARAMS_V3; ++++ ++++typedef CK_GCM_PARAMS_V3 CK_PTR CK_GCM_PARAMS_V3_PTR; ++++ ++++/* CK_CCM_PARAMS is new for version 2.30 */ ++++typedef struct CK_CCM_PARAMS { ++++ CK_ULONG ulDataLen; ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceLen; ++++ CK_BYTE_PTR pAAD; ++++ CK_ULONG ulAADLen; ++++ CK_ULONG ulMACLen; ++++} CK_CCM_PARAMS; ++++ ++++typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; ++++ ++++/* SALSA20_POLY1305 and CHACHA20_POLY1305 is AEAD is new in v3.0 */ ++++typedef struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceLen; ++++ CK_BYTE_PTR pAAD; ++++ CK_ULONG ulAADLen; ++++} CK_SALSA20_CHACHA20_POLY1305_PARAMS; ++++ ++++typedef CK_SALSA20_CHACHA20_POLY1305_PARAMS ++++ CK_PTR CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR; ++++ ++++/* MESSAGE params are new for v3.0 */ ++++typedef CK_ULONG CK_GENERATOR_FUNCTION; ++++#define CKG_NO_GENERATE 0x00000000UL ++++#define CKG_GENERATE 0x00000001UL ++++#define CKG_GENERATE_COUNTER 0x00000002UL ++++#define CKG_GENERATE_RANDOM 0x00000003UL ++++#define CKG_GENERATE_COUNTER_XOR 0x00000004UL ++++ ++++typedef struct CK_GCM_MESSAGE_PARAMS { ++++ CK_BYTE_PTR pIv; ++++ CK_ULONG ulIvLen; ++++ CK_ULONG ulIvFixedBits; ++++ CK_GENERATOR_FUNCTION ivGenerator; ++++ CK_BYTE_PTR pTag; ++++ CK_ULONG ulTagBits; ++++} CK_GCM_MESSAGE_PARAMS; ++++ ++++typedef CK_GCM_MESSAGE_PARAMS CK_GCM_MESSAGE_PARAMS_PTR; ++++ ++++typedef struct CK_CCM_MESSAGE_PARAMS { ++++ CK_ULONG ulDataLen; /*plaintext or ciphertext*/ ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceLen; ++++ CK_ULONG ulNonceFixedBits; ++++ CK_GENERATOR_FUNCTION nonceGenerator; ++++ CK_BYTE_PTR pMAC; ++++ CK_ULONG ulMACLen; ++++} CK_CCM_MESSAGE_PARAMS; ++++ ++++typedef CK_CCM_MESSAGE_PARAMS CK_CCM_MESSAGE_PARAMS_PTR; ++++ ++++/* SALSA20/CHACHA20 doe not define IV generators */ ++++typedef struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceLen; ++++ CK_BYTE_PTR pTag; ++++} CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; ++++ ++++typedef CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS ++++ CK_PTR CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR; +++ +++ /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the +++- * CKM_SKIPJACK_PRIVATE_WRAP mechanism +++- */ ++++ * CKM_SKIPJACK_PRIVATE_WRAP mechanism */ ++++/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */ +++ typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { +++- CK_ULONG ulPasswordLen; ++++ CK_ULONG ulPasswordLen; +++ CK_BYTE_PTR pPassword; +++- CK_ULONG ulPublicDataLen; ++++ CK_ULONG ulPublicDataLen; +++ CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPAndGLen; +++- CK_ULONG ulQLen; +++- CK_ULONG ulRandomLen; ++++ CK_ULONG ulPAndGLen; ++++ CK_ULONG ulQLen; ++++ CK_ULONG ulRandomLen; +++ CK_BYTE_PTR pRandomA; +++ CK_BYTE_PTR pPrimeP; +++ CK_BYTE_PTR pBaseG; +++ CK_BYTE_PTR pSubprimeQ; +++ } CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +++ +++-typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \ +++- CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR; +++- ++++typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR ++++ CK_SKIPJACK_PRIVATE_WRAP_PTR; +++ +++ /* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the +++- * CKM_SKIPJACK_RELAYX mechanism +++- */ ++++ * CKM_SKIPJACK_RELAYX mechanism */ ++++/* CK_SKIPJACK_RELAYX_PARAMS is new for v2.0 */ +++ typedef struct CK_SKIPJACK_RELAYX_PARAMS { +++- CK_ULONG ulOldWrappedXLen; ++++ CK_ULONG ulOldWrappedXLen; +++ CK_BYTE_PTR pOldWrappedX; +++- CK_ULONG ulOldPasswordLen; ++++ CK_ULONG ulOldPasswordLen; +++ CK_BYTE_PTR pOldPassword; +++- CK_ULONG ulOldPublicDataLen; ++++ CK_ULONG ulOldPublicDataLen; +++ CK_BYTE_PTR pOldPublicData; +++- CK_ULONG ulOldRandomLen; ++++ CK_ULONG ulOldRandomLen; +++ CK_BYTE_PTR pOldRandomA; +++- CK_ULONG ulNewPasswordLen; ++++ CK_ULONG ulNewPasswordLen; +++ CK_BYTE_PTR pNewPassword; +++- CK_ULONG ulNewPublicDataLen; ++++ CK_ULONG ulNewPublicDataLen; +++ CK_BYTE_PTR pNewPublicData; +++- CK_ULONG ulNewRandomLen; ++++ CK_ULONG ulNewRandomLen; +++ CK_BYTE_PTR pNewRandomA; +++ } CK_SKIPJACK_RELAYX_PARAMS; +++ +++-typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR \ +++- CK_SKIPJACK_RELAYX_PARAMS_PTR; ++++typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR ++++ CK_SKIPJACK_RELAYX_PARAMS_PTR; ++++ ++++/* New for v2.40, CAMELLIA, ARIA, SEED */ ++++typedef struct CK_CAMELLIA_CTR_PARAMS { ++++ CK_ULONG ulCounterBits; ++++ CK_BYTE cb[16]; ++++} CK_CAMELLIA_CTR_PARAMS; ++++ ++++typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR; +++ ++++typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { ++++ CK_BYTE iv[16]; ++++ CK_BYTE_PTR pData; ++++ CK_ULONG length; ++++} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; ++++ ++++typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR ++++ CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++ ++++typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { ++++ CK_BYTE iv[16]; ++++ CK_BYTE_PTR pData; ++++ CK_ULONG length; ++++} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; ++++ ++++typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR ++++ CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++ ++++typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { ++++ CK_BYTE iv[16]; ++++ CK_BYTE_PTR pData; ++++ CK_ULONG length; ++++} CK_SEED_CBC_ENCRYPT_DATA_PARAMS; ++++ ++++typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR ++++ CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; ++++ ++++/* ChaCha20/Salsa20 Counter support is new in v3.0*/ ++++typedef struct CK_CHACHA20_PARAMS { ++++ CK_BYTE_PTR pBlockCounter; ++++ CK_ULONG blockCounterBits; ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceBits; ++++} CK_CHACHA20_PARAMS; ++++ ++++typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR; ++++ ++++typedef struct CK_SALSA20_PARAMS { ++++ CK_BYTE_PTR pBlockCounter; ++++ CK_BYTE_PTR pNonce; ++++ CK_ULONG ulNonceBits; ++++} CK_SALSA20_PARAMS; ++++typedef CK_SALSA20_PARAMS CK_PTR CK_SALSA20_PARAMS_PTR; +++ +++ typedef struct CK_PBE_PARAMS { +++- CK_BYTE_PTR pInitVector; ++++ CK_BYTE_PTR pInitVector; +++ CK_UTF8CHAR_PTR pPassword; +++- CK_ULONG ulPasswordLen; +++- CK_BYTE_PTR pSalt; +++- CK_ULONG ulSaltLen; +++- CK_ULONG ulIteration; ++++ CK_ULONG ulPasswordLen; ++++ CK_BYTE_PTR pSalt; ++++ CK_ULONG ulSaltLen; ++++ CK_ULONG ulIteration; +++ } CK_PBE_PARAMS; +++ +++ typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR; +++ +++- +++ /* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the +++- * CKM_KEY_WRAP_SET_OAEP mechanism +++- */ ++++ * CKM_KEY_WRAP_SET_OAEP mechanism */ ++++/* CK_KEY_WRAP_SET_OAEP_PARAMS is new for v2.0 */ +++ typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS { +++- CK_BYTE bBC; /* block contents byte */ +++- CK_BYTE_PTR pX; /* extra data */ +++- CK_ULONG ulXLen; /* length of extra data in bytes */ ++++ CK_BYTE bBC; /* block contents byte */ ++++ CK_BYTE_PTR pX; /* extra data */ ++++ CK_ULONG ulXLen; /* length of extra data in bytes */ +++ } CK_KEY_WRAP_SET_OAEP_PARAMS; +++ +++-typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; ++++typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR ++++ CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; +++ +++ typedef struct CK_SSL3_RANDOM_DATA { +++ CK_BYTE_PTR pClientRandom; +++- CK_ULONG ulClientRandomLen; ++++ CK_ULONG ulClientRandomLen; +++ CK_BYTE_PTR pServerRandom; +++- CK_ULONG ulServerRandomLen; ++++ CK_ULONG ulServerRandomLen; +++ } CK_SSL3_RANDOM_DATA; +++ +++- +++ typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { +++ CK_SSL3_RANDOM_DATA RandomInfo; +++- CK_VERSION_PTR pVersion; ++++ CK_VERSION_PTR pVersion; +++ } CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +++ +++-typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \ +++- CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; ++++typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR ++++ CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; +++ +++ typedef struct CK_SSL3_KEY_MAT_OUT { +++ CK_OBJECT_HANDLE hClientMacSecret; +++ CK_OBJECT_HANDLE hServerMacSecret; +++ CK_OBJECT_HANDLE hClientKey; +++ CK_OBJECT_HANDLE hServerKey; +++- CK_BYTE_PTR pIVClient; +++- CK_BYTE_PTR pIVServer; ++++ CK_BYTE_PTR pIVClient; ++++ CK_BYTE_PTR pIVServer; +++ } CK_SSL3_KEY_MAT_OUT; +++ +++ typedef CK_SSL3_KEY_MAT_OUT CK_PTR CK_SSL3_KEY_MAT_OUT_PTR; +++ +++- +++ typedef struct CK_SSL3_KEY_MAT_PARAMS { +++- CK_ULONG ulMacSizeInBits; +++- CK_ULONG ulKeySizeInBits; +++- CK_ULONG ulIVSizeInBits; +++- CK_BBOOL bIsExport; +++- CK_SSL3_RANDOM_DATA RandomInfo; ++++ CK_ULONG ulMacSizeInBits; ++++ CK_ULONG ulKeySizeInBits; ++++ CK_ULONG ulIVSizeInBits; ++++ CK_BBOOL bIsExport; /* Unused. Must be set to CK_FALSE. */ ++++ CK_SSL3_RANDOM_DATA RandomInfo; +++ CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; +++ } CK_SSL3_KEY_MAT_PARAMS; +++ +++ typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR; +++ ++++/* CK_TLS_PRF_PARAMS is new for version 2.20 */ +++ typedef struct CK_TLS_PRF_PARAMS { +++- CK_BYTE_PTR pSeed; +++- CK_ULONG ulSeedLen; +++- CK_BYTE_PTR pLabel; +++- CK_ULONG ulLabelLen; +++- CK_BYTE_PTR pOutput; ++++ CK_BYTE_PTR pSeed; ++++ CK_ULONG ulSeedLen; ++++ CK_BYTE_PTR pLabel; ++++ CK_ULONG ulLabelLen; ++++ CK_BYTE_PTR pOutput; +++ CK_ULONG_PTR pulOutputLen; +++ } CK_TLS_PRF_PARAMS; +++ +++ typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR; +++ ++++/* TLS 1.2 is new for version 2.40 */ ++++typedef struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { ++++ CK_SSL3_RANDOM_DATA RandomInfo; ++++ CK_VERSION_PTR pVersion; ++++ CK_MECHANISM_TYPE prfHashMechanism; ++++} CK_TLS12_MASTER_KEY_DERIVE_PARAMS; ++++ ++++typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR ++++ CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR; ++++ ++++typedef struct CK_TLS12_KEY_MAT_PARAMS { ++++ CK_ULONG ulMacSizeInBits; ++++ CK_ULONG ulKeySizeInBits; ++++ CK_ULONG ulIVSizeInBits; ++++ CK_BBOOL bIsExport; /* Unused. Must be set to CK_FALSE. */ ++++ CK_SSL3_RANDOM_DATA RandomInfo; ++++ CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; ++++ CK_MECHANISM_TYPE prfHashMechanism; ++++} CK_TLS12_KEY_MAT_PARAMS; ++++ ++++typedef CK_TLS12_KEY_MAT_PARAMS CK_PTR CK_TLS12_KEY_MAT_PARAMS_PTR; ++++ ++++typedef struct CK_TLS_KDF_PARAMS { ++++ CK_MECHANISM_TYPE prfMechanism; ++++ CK_BYTE_PTR pLabel; ++++ CK_ULONG ulLabelLength; ++++ CK_SSL3_RANDOM_DATA RandomInfo; ++++ CK_BYTE_PTR pContextData; ++++ CK_ULONG ulContextDataLength; ++++} CK_TLS_KDF_PARAMS; ++++ ++++typedef struct CK_TLS_MAC_PARAMS { ++++ CK_MECHANISM_TYPE prfHashMechanism; ++++ CK_ULONG ulMacLength; ++++ CK_ULONG ulServerOrClient; ++++} CK_TLS_MAC_PARAMS; ++++ ++++typedef CK_TLS_MAC_PARAMS CK_PTR CK_TLS_MAC_PARAMS_PTR; ++++ ++++/* HKDF is new for v3.0 */ ++++typedef struct CK_HKDF_PARAMS { ++++ CK_BBOOL bExtract; ++++ CK_BBOOL bExpand; ++++ CK_MECHANISM_TYPE prfHashMechanism; ++++ CK_ULONG ulSaltType; ++++ CK_BYTE_PTR pSalt; ++++ CK_ULONG ulSaltLen; ++++ CK_OBJECT_HANDLE hSaltKey; ++++ CK_BYTE_PTR pInfo; ++++ CK_ULONG ulInfoLen; ++++} CK_HKDF_PARAMS; ++++typedef CK_HKDF_PARAMS CK_PTR CK_HKDF_PARAMS_PTR; ++++ ++++#define CKF_HKDF_SALT_NULL 0x00000001UL ++++#define CKF_HKDF_SALT_DATA 0x00000002UL ++++#define CKF_HKDF_SALT_KEY 0x00000004UL ++++ ++++/* WTLS is new for version 2.20 */ +++ typedef struct CK_WTLS_RANDOM_DATA { +++ CK_BYTE_PTR pClientRandom; +++- CK_ULONG ulClientRandomLen; ++++ CK_ULONG ulClientRandomLen; +++ CK_BYTE_PTR pServerRandom; +++- CK_ULONG ulServerRandomLen; ++++ CK_ULONG ulServerRandomLen; +++ } CK_WTLS_RANDOM_DATA; +++ +++ typedef CK_WTLS_RANDOM_DATA CK_PTR CK_WTLS_RANDOM_DATA_PTR; +++ +++ typedef struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { +++- CK_MECHANISM_TYPE DigestMechanism; ++++ CK_MECHANISM_TYPE DigestMechanism; +++ CK_WTLS_RANDOM_DATA RandomInfo; +++- CK_BYTE_PTR pVersion; ++++ CK_BYTE_PTR pVersion; +++ } CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +++ +++-typedef CK_WTLS_MASTER_KEY_DERIVE_PARAMS CK_PTR \ +++- CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR; ++++typedef CK_WTLS_MASTER_KEY_DERIVE_PARAMS CK_PTR ++++ CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR; +++ +++ typedef struct CK_WTLS_PRF_PARAMS { +++ CK_MECHANISM_TYPE DigestMechanism; +++- CK_BYTE_PTR pSeed; +++- CK_ULONG ulSeedLen; +++- CK_BYTE_PTR pLabel; +++- CK_ULONG ulLabelLen; +++- CK_BYTE_PTR pOutput; +++- CK_ULONG_PTR pulOutputLen; ++++ CK_BYTE_PTR pSeed; ++++ CK_ULONG ulSeedLen; ++++ CK_BYTE_PTR pLabel; ++++ CK_ULONG ulLabelLen; ++++ CK_BYTE_PTR pOutput; ++++ CK_ULONG_PTR pulOutputLen; +++ } CK_WTLS_PRF_PARAMS; +++ +++ typedef CK_WTLS_PRF_PARAMS CK_PTR CK_WTLS_PRF_PARAMS_PTR; +++@@ -1864,581 +2215,377 @@ typedef CK_WTLS_PRF_PARAMS CK_PTR CK_WTL +++ typedef struct CK_WTLS_KEY_MAT_OUT { +++ CK_OBJECT_HANDLE hMacSecret; +++ CK_OBJECT_HANDLE hKey; +++- CK_BYTE_PTR pIV; ++++ CK_BYTE_PTR pIV; +++ } CK_WTLS_KEY_MAT_OUT; +++ +++ typedef CK_WTLS_KEY_MAT_OUT CK_PTR CK_WTLS_KEY_MAT_OUT_PTR; +++ +++ typedef struct CK_WTLS_KEY_MAT_PARAMS { +++- CK_MECHANISM_TYPE DigestMechanism; +++- CK_ULONG ulMacSizeInBits; +++- CK_ULONG ulKeySizeInBits; +++- CK_ULONG ulIVSizeInBits; +++- CK_ULONG ulSequenceNumber; +++- CK_BBOOL bIsExport; +++- CK_WTLS_RANDOM_DATA RandomInfo; ++++ CK_MECHANISM_TYPE DigestMechanism; ++++ CK_ULONG ulMacSizeInBits; ++++ CK_ULONG ulKeySizeInBits; ++++ CK_ULONG ulIVSizeInBits; ++++ CK_ULONG ulSequenceNumber; ++++ CK_BBOOL bIsExport; /* Unused. Must be set to CK_FALSE. */ ++++ CK_WTLS_RANDOM_DATA RandomInfo; +++ CK_WTLS_KEY_MAT_OUT_PTR pReturnedKeyMaterial; +++ } CK_WTLS_KEY_MAT_PARAMS; +++ +++ typedef CK_WTLS_KEY_MAT_PARAMS CK_PTR CK_WTLS_KEY_MAT_PARAMS_PTR; +++ ++++/* The following types for NIST 800-108 KBKDF are defined in PKCS#11 v3.0 */ ++++typedef CK_MECHANISM_TYPE CK_SP800_108_PRF_TYPE; ++++typedef CK_ULONG CK_PRF_DATA_TYPE; ++++ ++++#define CK_SP800_108_ITERATION_VARIABLE 0x00000001UL ++++#define CK_SP800_108_OPTIONAL_COUNTER 0x00000002UL ++++#define CK_SP800_108_DKM_LENGTH 0x00000003UL ++++#define CK_SP800_108_BYTE_ARRAY 0x00000004UL ++++ ++++/* ERRATA: PKCS#11 v3.0 Cryptographic Token Interface Current Mechanisms ++++ * specification specifies a CK_SP800_108_COUNTER, while the pkcs11t.h from ++++ * PKCS#11 v3.0 Cryptographic Token Interface Base Specification specifies ++++ * CK_SP800_108_OPTIONAL_COUNTER. */ ++++#define CK_SP800_108_COUNTER CK_SP800_108_OPTIONAL_COUNTER ++++ ++++typedef struct CK_PRF_DATA_PARAM { ++++ CK_PRF_DATA_TYPE type; ++++ CK_VOID_PTR pValue; ++++ CK_ULONG ulValueLen; ++++} CK_PRF_DATA_PARAM; ++++ ++++typedef CK_PRF_DATA_PARAM CK_PTR CK_PRF_DATA_PARAM_PTR; ++++ ++++typedef struct CK_SP800_108_COUNTER_FORMAT { ++++ CK_BBOOL bLittleEndian; ++++ CK_ULONG ulWidthInBits; ++++} CK_SP800_108_COUNTER_FORMAT; ++++ ++++typedef CK_SP800_108_COUNTER_FORMAT CK_PTR CK_SP800_108_COUNTER_FORMAT_PTR; ++++ ++++typedef CK_ULONG CK_SP800_108_DKM_LENGTH_METHOD; ++++ ++++/* ERRATA: PKCS#11 v3.0 Cryptographic Token Interface Current Mechanisms ++++ * defines that these constants exist, but doesn't specify values. pkcs11t.h ++++ * from PKCS#11 v3.0 Cryptographic Token Interface Base Specification doesn't ++++ * define these constants either. */ ++++#define CK_SP800_108_DKM_LENGTH_SUM_OF_KEYS 0x00000001UL ++++#define CK_SP800_108_DKM_LENGTH_SUM_OF_SEGMENTS 0x00000002UL ++++ ++++typedef struct CK_SP800_108_DKM_LENGTH_FORMAT { ++++ CK_SP800_108_DKM_LENGTH_METHOD dkmLengthMethod; ++++ CK_BBOOL bLittleEndian; ++++ CK_ULONG ulWidthInBits; ++++} CK_SP800_108_DKM_LENGTH_FORMAT; ++++ ++++typedef CK_SP800_108_DKM_LENGTH_FORMAT CK_PTR CK_SP800_108_DKM_LENGTH_FORMAT_PTR; ++++ ++++typedef struct CK_DERIVED_KEY { ++++ CK_ATTRIBUTE_PTR pTemplate; ++++ CK_ULONG ulAttributeCount; ++++ CK_OBJECT_HANDLE_PTR phKey; ++++} CK_DERIVED_KEY; ++++ ++++typedef CK_DERIVED_KEY CK_PTR CK_DERIVED_KEY_PTR; ++++ ++++/* UNFIXED ERRATA: NIST SP800-108 specifies that implementer can decide the ++++ * number of bits to take from each PRF invocation. However, all three forms ++++ * of the PKCS#11 v3.0 implementation lack a bitwidth for the PRF and only ++++ * allow the full-width mechanism varieties. Additionally, outside of the ++++ * base key (used as the key to the PRF), there is no way to pass any ++++ * additional, PRF-mechanism specific data. */ ++++ ++++typedef struct CK_SP800_108_KDF_PARAMS { ++++ CK_SP800_108_PRF_TYPE prfType; ++++ CK_ULONG ulNumberOfDataParams; ++++ CK_PRF_DATA_PARAM_PTR pDataParams; ++++ CK_ULONG ulAdditionalDerivedKeys; ++++ /* ERRATA: in PKCS#11 v3.0, pAdditionalDerivedKeys is typed as ++++ * CK_DERVIED_KEY; it needs to be of type CK_DERIVED_KEY_PTR. */ ++++ CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; ++++} CK_SP800_108_KDF_PARAMS; ++++ ++++typedef CK_SP800_108_KDF_PARAMS CK_PTR CK_SP800_108_KDF_PARAMS_PTR; ++++ ++++typedef struct CK_SP800_108_FEEDBACK_KDF_PARAMS { ++++ CK_SP800_108_PRF_TYPE prfType; ++++ CK_ULONG ulNumberOfDataParams; ++++ CK_PRF_DATA_PARAM_PTR pDataParams; ++++ CK_ULONG ulIVLen; ++++ CK_BYTE_PTR pIV; ++++ CK_ULONG ulAdditionalDerivedKeys; ++++ /* ERRATA: in PKCS#11 v3.0, pAdditionalDerivedKeys is typed as ++++ * CK_DERVIED_KEY; it needs to be of type CK_DERIVED_KEY_PTR. */ ++++ CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; ++++} CK_SP800_108_FEEDBACK_KDF_PARAMS; ++++ ++++typedef CK_SP800_108_FEEDBACK_KDF_PARAMS CK_PTR CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR; ++++ ++++/* CMS is new for version 2.20 */ +++ typedef struct CK_CMS_SIG_PARAMS { +++ CK_OBJECT_HANDLE certificateHandle; +++ CK_MECHANISM_PTR pSigningMechanism; +++ CK_MECHANISM_PTR pDigestMechanism; +++- CK_UTF8CHAR_PTR pContentType; +++- CK_BYTE_PTR pRequestedAttributes; +++- CK_ULONG ulRequestedAttributesLen; +++- CK_BYTE_PTR pRequiredAttributes; +++- CK_ULONG ulRequiredAttributesLen; ++++ CK_UTF8CHAR_PTR pContentType; ++++ CK_BYTE_PTR pRequestedAttributes; ++++ CK_ULONG ulRequestedAttributesLen; ++++ CK_BYTE_PTR pRequiredAttributes; ++++ CK_ULONG ulRequiredAttributesLen; +++ } CK_CMS_SIG_PARAMS; +++ +++ typedef CK_CMS_SIG_PARAMS CK_PTR CK_CMS_SIG_PARAMS_PTR; +++ +++ typedef struct CK_KEY_DERIVATION_STRING_DATA { +++ CK_BYTE_PTR pData; +++- CK_ULONG ulLen; ++++ CK_ULONG ulLen; +++ } CK_KEY_DERIVATION_STRING_DATA; +++ +++-typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \ +++- CK_KEY_DERIVATION_STRING_DATA_PTR; +++- ++++typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR ++++ CK_KEY_DERIVATION_STRING_DATA_PTR; +++ +++ /* The CK_EXTRACT_PARAMS is used for the +++ * CKM_EXTRACT_KEY_FROM_KEY mechanism. It specifies which bit +++ * of the base key should be used as the first bit of the +++- * derived key +++- */ ++++ * derived key */ ++++/* CK_EXTRACT_PARAMS is new for v2.0 */ +++ typedef CK_ULONG CK_EXTRACT_PARAMS; +++ +++ typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; +++ +++-/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to ++++/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10. ++++ * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to +++ * indicate the Pseudo-Random Function (PRF) used to generate +++- * key bits using PKCS #5 PBKDF2. +++- */ ++++ * key bits using PKCS #5 PBKDF2. */ +++ typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +++ +++-typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR \ +++- CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; ++++typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; +++ +++-#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001UL +++-#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411 0x00000002UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA224 0x00000003UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA256 0x00000004UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA384 0x00000005UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA512 0x00000006UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA512_224 0x00000007UL +++-#define CKP_PKCS5_PBKD2_HMAC_SHA512_256 0x00000008UL ++++/* The following PRFs are defined in PKCS #5 v2.1. */ ++++#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001UL ++++#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411 0x00000002UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA224 0x00000003UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA256 0x00000004UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA384 0x00000005UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA512 0x00000006UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA512_224 0x00000007UL ++++#define CKP_PKCS5_PBKD2_HMAC_SHA512_256 0x00000008UL +++ +++-/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the ++++/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10. ++++ * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the +++ * source of the salt value when deriving a key using PKCS #5 +++- * PBKDF2. +++- */ ++++ * PBKDF2. */ +++ typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +++ +++-typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR \ +++- CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; ++++typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; +++ +++ /* The following salt value sources are defined in PKCS #5 v2.0. */ +++-#define CKZ_SALT_SPECIFIED 0x00000001UL ++++#define CKZ_SALT_SPECIFIED 0x00000001UL +++ +++-/* CK_PKCS5_PBKD2_PARAMS is a structure that provides the +++- * parameters to the CKM_PKCS5_PBKD2 mechanism. +++- */ ++++/* CK_PKCS5_PBKD2_PARAMS is new for v2.10. ++++ * CK_PKCS5_PBKD2_PARAMS is a structure that provides the ++++ * parameters to the CKM_PKCS5_PBKD2 mechanism. */ ++++/* this structure is kept for compatibility. use _PARAMS2. */ +++ typedef struct CK_PKCS5_PBKD2_PARAMS { +++- CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; +++- CK_VOID_PTR pSaltSourceData; +++- CK_ULONG ulSaltSourceDataLen; +++- CK_ULONG iterations; ++++ CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; ++++ CK_VOID_PTR pSaltSourceData; ++++ CK_ULONG ulSaltSourceDataLen; ++++ CK_ULONG iterations; +++ CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; +++- CK_VOID_PTR pPrfData; +++- CK_ULONG ulPrfDataLen; +++- CK_UTF8CHAR_PTR pPassword; +++- CK_ULONG_PTR ulPasswordLen; ++++ CK_VOID_PTR pPrfData; ++++ CK_ULONG ulPrfDataLen; ++++ CK_UTF8CHAR_PTR pPassword; ++++ CK_ULONG_PTR ulPasswordLen; +++ } CK_PKCS5_PBKD2_PARAMS; +++ +++ typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR; +++ +++-/* CK_PKCS5_PBKD2_PARAMS2 is a corrected version of the CK_PKCS5_PBKD2_PARAMS +++- * structure that provides the parameters to the CKM_PKCS5_PBKD2 mechanism +++- * noting that the ulPasswordLen field is a CK_ULONG and not a CK_ULONG_PTR. +++- */ +++ typedef struct CK_PKCS5_PBKD2_PARAMS2 { +++- CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; +++- CK_VOID_PTR pSaltSourceData; +++- CK_ULONG ulSaltSourceDataLen; +++- CK_ULONG iterations; ++++ CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; ++++ CK_VOID_PTR pSaltSourceData; ++++ CK_ULONG ulSaltSourceDataLen; ++++ CK_ULONG iterations; +++ CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; +++- CK_VOID_PTR pPrfData; +++- CK_ULONG ulPrfDataLen; +++- CK_UTF8CHAR_PTR pPassword; +++- CK_ULONG ulPasswordLen; ++++ CK_VOID_PTR pPrfData; ++++ CK_ULONG ulPrfDataLen; ++++ CK_UTF8CHAR_PTR pPassword; ++++ CK_ULONG ulPasswordLen; +++ } CK_PKCS5_PBKD2_PARAMS2; +++ +++ typedef CK_PKCS5_PBKD2_PARAMS2 CK_PTR CK_PKCS5_PBKD2_PARAMS2_PTR; +++ ++++/* OTP is new in v2.40 */ +++ typedef CK_ULONG CK_OTP_PARAM_TYPE; +++-typedef CK_OTP_PARAM_TYPE CK_PARAM_TYPE; /* backward compatibility */ ++++#define CK_OTP_VALUE 0UL ++++#define CK_OTP_PIN 1UL ++++#define CK_OTP_CHALLENGE 2UL ++++#define CK_OTP_TIME 3UL ++++#define CK_OTP_COUNTER 4UL ++++#define CK_OTP_FLAGS 5UL ++++#define CK_OTP_OUTPUT_LENGTH 6UL ++++#define CK_OTP_OUTPUT_FORMAT 7UL +++ +++ typedef struct CK_OTP_PARAM { +++ CK_OTP_PARAM_TYPE type; +++- CK_VOID_PTR pValue; +++- CK_ULONG ulValueLen; ++++ CK_VOID_PTR pValue; ++++ CK_ULONG ulValueLen; +++ } CK_OTP_PARAM; +++ +++ typedef CK_OTP_PARAM CK_PTR CK_OTP_PARAM_PTR; +++ +++ typedef struct CK_OTP_PARAMS { +++ CK_OTP_PARAM_PTR pParams; +++- CK_ULONG ulCount; ++++ CK_ULONG ulCount; +++ } CK_OTP_PARAMS; +++ +++ typedef CK_OTP_PARAMS CK_PTR CK_OTP_PARAMS_PTR; +++ +++ typedef struct CK_OTP_SIGNATURE_INFO { +++ CK_OTP_PARAM_PTR pParams; +++- CK_ULONG ulCount; ++++ CK_ULONG ulCount; +++ } CK_OTP_SIGNATURE_INFO; +++ +++ typedef CK_OTP_SIGNATURE_INFO CK_PTR CK_OTP_SIGNATURE_INFO_PTR; +++ +++-#define CK_OTP_VALUE 0UL +++-#define CK_OTP_PIN 1UL +++-#define CK_OTP_CHALLENGE 2UL +++-#define CK_OTP_TIME 3UL +++-#define CK_OTP_COUNTER 4UL +++-#define CK_OTP_FLAGS 5UL +++-#define CK_OTP_OUTPUT_LENGTH 6UL +++-#define CK_OTP_OUTPUT_FORMAT 7UL +++- +++-#define CKF_NEXT_OTP 0x00000001UL +++-#define CKF_EXCLUDE_TIME 0x00000002UL +++-#define CKF_EXCLUDE_COUNTER 0x00000004UL ++++#define CKF_NEXT_OTP 0x00000001UL ++++#define CKF_EXCLUDE_TIME 0x00000002UL ++++#define CKF_EXCLUDE_COUNTER 0x00000004UL +++ #define CKF_EXCLUDE_CHALLENGE 0x00000008UL +++-#define CKF_EXCLUDE_PIN 0x00000010UL ++++#define CKF_EXCLUDE_PIN 0x00000010UL +++ #define CKF_USER_FRIENDLY_OTP 0x00000020UL +++ ++++/* KIP is new in v2.40 */ +++ typedef struct CK_KIP_PARAMS { +++ CK_MECHANISM_PTR pMechanism; +++ CK_OBJECT_HANDLE hKey; +++- CK_BYTE_PTR pSeed; +++- CK_ULONG ulSeedLen; ++++ CK_BYTE_PTR pSeed; ++++ CK_ULONG ulSeedLen; +++ } CK_KIP_PARAMS; +++ +++ typedef CK_KIP_PARAMS CK_PTR CK_KIP_PARAMS_PTR; +++ +++-typedef struct CK_AES_CTR_PARAMS { +++- CK_ULONG ulCounterBits; +++- CK_BYTE cb[16]; +++-} CK_AES_CTR_PARAMS; +++- +++-typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; +++- +++-typedef struct CK_GCM_PARAMS { +++- CK_BYTE_PTR pIv; +++- CK_ULONG ulIvLen; +++- CK_ULONG ulIvBits; +++- CK_BYTE_PTR pAAD; +++- CK_ULONG ulAADLen; +++- CK_ULONG ulTagBits; +++-} CK_GCM_PARAMS; +++- +++-typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; +++- +++-typedef CK_ULONG CK_GENERATOR_FUNCTION; +++-#define CKG_NO_GENERATE 0x00000000UL +++-#define CKG_GENERATE 0x00000001UL +++-#define CKG_GENERATE_COUNTER 0x00000002UL +++-#define CKG_GENERATE_RANDOM 0x00000003UL +++- +++-typedef struct CK_GCM_MESSAGE_PARAMS { +++- CK_BYTE_PTR pIv; +++- CK_ULONG ulIvLen; +++- CK_ULONG ulIvFixedBits; +++- CK_GENERATOR_FUNCTION ivGenerator; +++- CK_BYTE_PTR pTag; +++- CK_ULONG ulTagBits; +++-} CK_GCM_MESSAGE_PARAMS; +++- +++-typedef CK_GCM_MESSAGE_PARAMS CK_GCM_MESSAGE_PARAMS_PTR; +++- +++-typedef struct CK_CCM_PARAMS { +++- CK_ULONG ulDataLen; +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceLen; +++- CK_BYTE_PTR pAAD; +++- CK_ULONG ulAADLen; +++- CK_ULONG ulMACLen; +++-} CK_CCM_PARAMS; +++- +++-typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; +++- +++-typedef struct CK_CCM_MESSAGE_PARAMS { +++- CK_ULONG ulDataLen; /*plaintext or ciphertext*/ +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceLen; +++- CK_ULONG ulNonceFixedBits; +++- CK_GENERATOR_FUNCTION nonceGenerator; +++- CK_BYTE_PTR pMAC; +++- CK_ULONG ulMACLen; +++-} CK_CCM_MESSAGE_PARAMS; +++- +++-typedef CK_CCM_MESSAGE_PARAMS CK_CCM_MESSAGE_PARAMS_PTR; +++- +++-/* Deprecated. Use CK_GCM_PARAMS */ +++-typedef struct CK_AES_GCM_PARAMS { +++- CK_BYTE_PTR pIv; +++- CK_ULONG ulIvLen; +++- CK_ULONG ulIvBits; +++- CK_BYTE_PTR pAAD; +++- CK_ULONG ulAADLen; +++- CK_ULONG ulTagBits; +++-} CK_AES_GCM_PARAMS; +++- +++-typedef CK_AES_GCM_PARAMS CK_PTR CK_AES_GCM_PARAMS_PTR; +++- +++-/* Deprecated. Use CK_CCM_PARAMS */ +++-typedef struct CK_AES_CCM_PARAMS { +++- CK_ULONG ulDataLen; +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceLen; +++- CK_BYTE_PTR pAAD; +++- CK_ULONG ulAADLen; +++- CK_ULONG ulMACLen; +++-} CK_AES_CCM_PARAMS; +++- +++-typedef CK_AES_CCM_PARAMS CK_PTR CK_AES_CCM_PARAMS_PTR; +++- +++-typedef struct CK_CAMELLIA_CTR_PARAMS { +++- CK_ULONG ulCounterBits; +++- CK_BYTE cb[16]; +++-} CK_CAMELLIA_CTR_PARAMS; +++- +++-typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR; +++- +++-typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { +++- CK_BYTE iv[16]; +++- CK_BYTE_PTR pData; +++- CK_ULONG length; +++-} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +++- +++-typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ +++- CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR; +++- +++-typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { +++- CK_BYTE iv[16]; +++- CK_BYTE_PTR pData; +++- CK_ULONG length; +++-} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +++- +++-typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ +++- CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR; +++- ++++/* DSA Param Gen is new for v2.40 */ +++ typedef struct CK_DSA_PARAMETER_GEN_PARAM { +++ CK_MECHANISM_TYPE hash; +++- CK_BYTE_PTR pSeed; +++- CK_ULONG ulSeedLen; +++- CK_ULONG ulIndex; ++++ CK_BYTE_PTR pSeed; ++++ CK_ULONG ulSeedLen; ++++ CK_ULONG ulIndex; +++ } CK_DSA_PARAMETER_GEN_PARAM; +++ +++ typedef CK_DSA_PARAMETER_GEN_PARAM CK_PTR CK_DSA_PARAMETER_GEN_PARAM_PTR; +++ ++++/* XXXX_AES_KEY_WRAP is new for v2.40 */ +++ typedef struct CK_ECDH_AES_KEY_WRAP_PARAMS { +++- CK_ULONG ulAESKeyBits; ++++ CK_ULONG ulAESKeyBits; +++ CK_EC_KDF_TYPE kdf; +++- CK_ULONG ulSharedDataLen; +++- CK_BYTE_PTR pSharedData; ++++ CK_ULONG ulSharedDataLen; ++++ CK_BYTE_PTR pSharedData; +++ } CK_ECDH_AES_KEY_WRAP_PARAMS; +++ +++ typedef CK_ECDH_AES_KEY_WRAP_PARAMS CK_PTR CK_ECDH_AES_KEY_WRAP_PARAMS_PTR; +++ +++-typedef CK_ULONG CK_JAVA_MIDP_SECURITY_DOMAIN; +++- +++-typedef CK_ULONG CK_CERTIFICATE_CATEGORY; +++- +++ typedef struct CK_RSA_AES_KEY_WRAP_PARAMS { +++- CK_ULONG ulAESKeyBits; ++++ CK_ULONG ulAESKeyBits; +++ CK_RSA_PKCS_OAEP_PARAMS_PTR pOAEPParams; +++ } CK_RSA_AES_KEY_WRAP_PARAMS; +++ +++ typedef CK_RSA_AES_KEY_WRAP_PARAMS CK_PTR CK_RSA_AES_KEY_WRAP_PARAMS_PTR; +++ +++-typedef struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { +++- CK_SSL3_RANDOM_DATA RandomInfo; +++- CK_VERSION_PTR pVersion; +++- CK_MECHANISM_TYPE prfHashMechanism; +++-} CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +++- +++-typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR \ +++- CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR; +++- +++-typedef struct CK_TLS12_KEY_MAT_PARAMS { +++- CK_ULONG ulMacSizeInBits; +++- CK_ULONG ulKeySizeInBits; +++- CK_ULONG ulIVSizeInBits; +++- CK_BBOOL bIsExport; +++- CK_SSL3_RANDOM_DATA RandomInfo; +++- CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; +++- CK_MECHANISM_TYPE prfHashMechanism; +++-} CK_TLS12_KEY_MAT_PARAMS; +++- +++-typedef CK_TLS12_KEY_MAT_PARAMS CK_PTR CK_TLS12_KEY_MAT_PARAMS_PTR; +++- +++-typedef struct CK_TLS_KDF_PARAMS { +++- CK_MECHANISM_TYPE prfMechanism; +++- CK_BYTE_PTR pLabel; +++- CK_ULONG ulLabelLength; +++- CK_SSL3_RANDOM_DATA RandomInfo; +++- CK_BYTE_PTR pContextData; +++- CK_ULONG ulContextDataLength; +++-} CK_TLS_KDF_PARAMS; +++- +++-typedef CK_TLS_KDF_PARAMS CK_PTR CK_TLS_KDF_PARAMS_PTR; +++- +++-typedef struct CK_TLS_MAC_PARAMS { +++- CK_MECHANISM_TYPE prfHashMechanism; +++- CK_ULONG ulMacLength; +++- CK_ULONG ulServerOrClient; +++-} CK_TLS_MAC_PARAMS; +++- +++-typedef CK_TLS_MAC_PARAMS CK_PTR CK_TLS_MAC_PARAMS_PTR; +++- ++++/* GOSTR3410 is new for v2.40 */ +++ typedef struct CK_GOSTR3410_DERIVE_PARAMS { +++ CK_EC_KDF_TYPE kdf; +++- CK_BYTE_PTR pPublicData; +++- CK_ULONG ulPublicDataLen; +++- CK_BYTE_PTR pUKM; +++- CK_ULONG ulUKMLen; ++++ CK_BYTE_PTR pPublicData; ++++ CK_ULONG ulPublicDataLen; ++++ CK_BYTE_PTR pUKM; ++++ CK_ULONG ulUKMLen; +++ } CK_GOSTR3410_DERIVE_PARAMS; +++ +++ typedef CK_GOSTR3410_DERIVE_PARAMS CK_PTR CK_GOSTR3410_DERIVE_PARAMS_PTR; +++ +++ typedef struct CK_GOSTR3410_KEY_WRAP_PARAMS { +++- CK_BYTE_PTR pWrapOID; +++- CK_ULONG ulWrapOIDLen; +++- CK_BYTE_PTR pUKM; +++- CK_ULONG ulUKMLen; ++++ CK_BYTE_PTR pWrapOID; ++++ CK_ULONG ulWrapOIDLen; ++++ CK_BYTE_PTR pUKM; ++++ CK_ULONG ulUKMLen; +++ CK_OBJECT_HANDLE hKey; +++ } CK_GOSTR3410_KEY_WRAP_PARAMS; +++ +++ typedef CK_GOSTR3410_KEY_WRAP_PARAMS CK_PTR CK_GOSTR3410_KEY_WRAP_PARAMS_PTR; +++ +++-typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { +++- CK_BYTE iv[16]; +++- CK_BYTE_PTR pData; +++- CK_ULONG length; +++-} CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +++- +++-typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ +++- CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; +++- +++-/* +++- * New PKCS 11 v3.0 data structures. +++- */ +++- +++-typedef CK_ULONG CK_PROFILE_ID; +++-typedef CK_PROFILE_ID CK_PTR CK_PROFILE_ID_PTR; +++- +++-/* Typedefs for Flexible KDF */ +++-typedef CK_ULONG CK_PRF_DATA_TYPE; +++-typedef CK_MECHANISM_TYPE CK_SP800_108_PRF_TYPE; +++-#define CK_SP800_108_ITERATION_VARIABLE 0x00000001UL +++-#define CK_SP800_108_OPTIONAL_COUNTER 0x00000002UL +++-#define CK_SP800_108_DKM_LENGTH 0x00000003UL +++-#define CK_SP800_108_BYTE_ARRAY 0x00000004UL +++-#define CK_SP800_108_COUNTER CK_SP800_108_OPTIONAL_COUNTER +++- +++-typedef struct CK_PRF_DATA_PARAM +++-{ +++- CK_PRF_DATA_TYPE type; +++- CK_VOID_PTR pValue; +++- CK_ULONG ulValueLen; +++-} CK_PRF_DATA_PARAM; +++- +++-typedef CK_PRF_DATA_PARAM CK_PTR CK_PRF_DATA_PARAM_PTR; +++- +++- +++-typedef struct CK_SP800_108_COUNTER_FORMAT +++-{ +++- CK_BBOOL bLittleEndian; +++- CK_ULONG ulWidthInBits; +++-} CK_SP800_108_COUNTER_FORMAT; +++- +++-typedef CK_SP800_108_COUNTER_FORMAT CK_PTR CK_SP800_108_COUNTER_FORMAT_PTR; +++- +++-typedef CK_ULONG CK_SP800_108_DKM_LENGTH_METHOD; +++-#define CK_SP800_108_DKM_LENGTH_SUM_OF_KEYS 0x00000001UL +++-#define CK_SP800_108_DKM_LENGTH_SUM_OF_SEGMENTS 0x00000002UL +++- +++-typedef struct CK_SP800_108_DKM_LENGTH_FORMAT +++-{ +++- CK_SP800_108_DKM_LENGTH_METHOD dkmLengthMethod; +++- CK_BBOOL bLittleEndian; +++- CK_ULONG ulWidthInBits; +++-} CK_SP800_108_DKM_LENGTH_FORMAT; +++- +++-typedef CK_SP800_108_DKM_LENGTH_FORMAT \ +++- CK_PTR CK_SP800_108_DKM_LENGTH_FORMAT_PTR; +++- +++-typedef struct CK_DERIVED_KEY +++-{ +++- CK_ATTRIBUTE_PTR pTemplate; +++- CK_ULONG ulAttributeCount; +++- CK_OBJECT_HANDLE_PTR phKey; +++-} CK_DERIVED_KEY; +++- +++-typedef CK_DERIVED_KEY CK_PTR CK_DERIVED_KEY_PTR; +++- +++-typedef struct CK_SP800_108_KDF_PARAMS +++-{ +++- CK_SP800_108_PRF_TYPE prfType; +++- CK_ULONG ulNumberOfDataParams; +++- CK_PRF_DATA_PARAM_PTR pDataParams; +++- CK_ULONG ulAdditionalDerivedKeys; +++- CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; +++-} CK_SP800_108_KDF_PARAMS; +++- +++-typedef CK_SP800_108_KDF_PARAMS CK_PTR CK_SP800_108_KDF_PARAMS_PTR; +++- +++-typedef struct CK_SP800_108_FEEDBACK_KDF_PARAMS +++-{ +++- CK_SP800_108_PRF_TYPE prfType; +++- CK_ULONG ulNumberOfDataParams; +++- CK_PRF_DATA_PARAM_PTR pDataParams; +++- CK_ULONG ulIVLen; +++- CK_BYTE_PTR pIV; +++- CK_ULONG ulAdditionalDerivedKeys; +++- CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; +++-} CK_SP800_108_FEEDBACK_KDF_PARAMS; +++- +++-typedef CK_SP800_108_FEEDBACK_KDF_PARAMS \ +++- CK_PTR CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR; +++- +++-/* EDDSA */ ++++/* EDDSA and XEDDSA are new for v3.0 */ +++ typedef struct CK_EDDSA_PARAMS { +++- CK_BBOOL phFlag; +++- CK_ULONG ulContextDataLen; ++++ CK_BBOOL phFlag; ++++ CK_ULONG ulContextDataLen; +++ CK_BYTE_PTR pContextData; +++ } CK_EDDSA_PARAMS; ++++typedef CK_ULONG CK_XEDDSA_HASH_TYPE; ++++typedef CK_XEDDSA_HASH_TYPE CK_PTR CK_XEDDSA_HASH_TYPE_PTR; +++ +++-typedef CK_EDDSA_PARAMS CK_PTR CK_EDDSA_PARAMS_PTR; +++- +++-/* Extended ChaCha20/Salsa20 support*/ +++-typedef struct CK_CHACHA20_PARAMS { +++- CK_BYTE_PTR pBlockCounter; +++- CK_ULONG blockCounterBits; +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceBits; +++-} CK_CHACHA20_PARAMS; +++- +++-typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR; +++- +++-typedef struct CK_SALSA20_PARAMS { +++- CK_BYTE_PTR pBlockCounter; +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceBits; +++-} CK_SALSA20_PARAMS; +++- +++-typedef CK_SALSA20_PARAMS CK_PTR CK_SALSA20_PARAMS_PTR; +++- +++-typedef struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceLen; +++- CK_BYTE_PTR pAAD; +++- CK_ULONG ulAADLen; +++-} CK_SALSA20_CHACHA20_POLY1305_PARAMS; +++- +++-typedef CK_SALSA20_CHACHA20_POLY1305_PARAMS \ +++- CK_PTR CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR; +++- +++-typedef struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { +++- CK_BYTE_PTR pNonce; +++- CK_ULONG ulNonceLen; +++- CK_BYTE_PTR pTag; +++-} CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +++- +++-typedef CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS \ +++- CK_PTR CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR; ++++typedef struct CK_XEDDSA_PARAMS { ++++ CK_XEDDSA_HASH_TYPE hash; ++++} CK_XEDDSA_PARAMS; ++++typedef CK_XEDDSA_PARAMS CK_PTR CK_XEDDSA_PARAMS_PTR; +++ ++++/* X3DH and Ratchet are new in v3.0 */ +++ typedef CK_ULONG CK_X3DH_KDF_TYPE; +++ typedef CK_X3DH_KDF_TYPE CK_PTR CK_X3DH_KDF_TYPE_PTR; +++ +++-/* X3dh, ratchet */ +++ typedef struct CK_X3DH_INITIATE_PARAMS { +++ CK_X3DH_KDF_TYPE kdf; +++ CK_OBJECT_HANDLE pPeer_identity; +++ CK_OBJECT_HANDLE pPeer_prekey; +++- CK_BYTE_PTR pPrekey_signature; +++- CK_BYTE_PTR pOnetime_key; ++++ CK_BYTE_PTR pPrekey_signature; ++++ CK_BYTE_PTR pOnetime_key; +++ CK_OBJECT_HANDLE pOwn_identity; +++ CK_OBJECT_HANDLE pOwn_ephemeral; +++ } CK_X3DH_INITIATE_PARAMS; +++ +++ typedef struct CK_X3DH_RESPOND_PARAMS { +++ CK_X3DH_KDF_TYPE kdf; +++- CK_BYTE_PTR pIdentity_id; +++- CK_BYTE_PTR pPrekey_id; +++- CK_BYTE_PTR pOnetime_id; ++++ CK_BYTE_PTR pIdentity_id; ++++ CK_BYTE_PTR pPrekey_id; ++++ CK_BYTE_PTR pOnetime_id; +++ CK_OBJECT_HANDLE pInitiator_identity; +++- CK_BYTE_PTR pInitiator_ephemeral; ++++ CK_BYTE_PTR pInitiator_ephemeral; +++ } CK_X3DH_RESPOND_PARAMS; +++ +++ typedef CK_ULONG CK_X2RATCHET_KDF_TYPE; +++ typedef CK_X2RATCHET_KDF_TYPE CK_PTR CK_X2RATCHET_KDF_TYPE_PTR; +++ +++ typedef struct CK_X2RATCHET_INITIALIZE_PARAMS { +++- CK_BYTE_PTR sk; +++- CK_OBJECT_HANDLE peer_public_prekey; +++- CK_OBJECT_HANDLE peer_public_identity; +++- CK_OBJECT_HANDLE own_public_identity; +++- CK_BBOOL bEncryptedHeader; +++- CK_ULONG eCurve; +++- CK_MECHANISM_TYPE aeadMechanism; ++++ CK_BYTE_PTR sk; ++++ CK_OBJECT_HANDLE peer_public_prekey; ++++ CK_OBJECT_HANDLE peer_public_identity; ++++ CK_OBJECT_HANDLE own_public_identity; ++++ CK_BBOOL bEncryptedHeader; ++++ CK_ULONG eCurve; ++++ CK_MECHANISM_TYPE aeadMechanism; +++ CK_X2RATCHET_KDF_TYPE kdfMechanism; +++ } CK_X2RATCHET_INITIALIZE_PARAMS; +++ +++-typedef CK_X2RATCHET_INITIALIZE_PARAMS \ +++- CK_PTR CK_X2RATCHET_INITIALIZE_PARAMS_PTR; ++++typedef CK_X2RATCHET_INITIALIZE_PARAMS ++++ CK_PTR CK_X2RATCHET_INITIALIZE_PARAMS_PTR; +++ +++ typedef struct CK_X2RATCHET_RESPOND_PARAMS { +++- CK_BYTE_PTR sk; +++- CK_OBJECT_HANDLE own_prekey; +++- CK_OBJECT_HANDLE initiator_identity; +++- CK_OBJECT_HANDLE own_public_identity; +++- CK_BBOOL bEncryptedHeader; +++- CK_ULONG eCurve; +++- CK_MECHANISM_TYPE aeadMechanism; ++++ CK_BYTE_PTR sk; ++++ CK_OBJECT_HANDLE own_prekey; ++++ CK_OBJECT_HANDLE initiator_identity; ++++ CK_OBJECT_HANDLE own_public_identity; ++++ CK_BBOOL bEncryptedHeader; ++++ CK_ULONG eCurve; ++++ CK_MECHANISM_TYPE aeadMechanism; +++ CK_X2RATCHET_KDF_TYPE kdfMechanism; +++ } CK_X2RATCHET_RESPOND_PARAMS; +++-typedef CK_X2RATCHET_RESPOND_PARAMS \ +++- CK_PTR CK_X2RATCHET_RESPOND_PARAMS_PTR; ++++typedef CK_X2RATCHET_RESPOND_PARAMS ++++ CK_PTR CK_X2RATCHET_RESPOND_PARAMS_PTR; +++ +++-typedef CK_ULONG CK_XEDDSA_HASH_TYPE; +++-typedef CK_XEDDSA_HASH_TYPE CK_PTR CK_XEDDSA_HASH_TYPE_PTR; ++++/* NSS Specific defines */ ++++/* stuff that for historic reasons is in this header file but should have ++++ * been in pkcs11n.h */ ++++#define CKK_INVALID_KEY_TYPE 0xffffffffUL +++ +++-/* XEDDSA */ +++-typedef struct CK_XEDDSA_PARAMS { +++- CK_XEDDSA_HASH_TYPE hash; +++-} CK_XEDDSA_PARAMS; +++-typedef CK_XEDDSA_PARAMS CK_PTR CK_XEDDSA_PARAMS_PTR; ++++#include "pkcs11n.h" +++ +++-typedef struct CK_HKDF_PARAMS { +++- CK_BBOOL bExtract; +++- CK_BBOOL bExpand; +++- CK_MECHANISM_TYPE prfHashMechanism; +++- CK_ULONG ulSaltType; +++- CK_BYTE_PTR pSalt; +++- CK_ULONG ulSaltLen; +++- CK_OBJECT_HANDLE hSaltKey; +++- CK_BYTE_PTR pInfo; +++- CK_ULONG ulInfoLen; +++-} CK_HKDF_PARAMS; +++-typedef CK_HKDF_PARAMS CK_PTR CK_HKDF_PARAMS_PTR; +++- +++-#define CKF_HKDF_SALT_NULL 0x00000001UL +++-#define CKF_HKDF_SALT_DATA 0x00000002UL +++-#define CKF_HKDF_SALT_KEY 0x00000004UL +++- +++-#endif /* _PKCS11T_H_ */ ++++/* undo packing */ ++++#include "pkcs11u.h" +++ ++++#endif +++--- /dev/null ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11u.h +++@@ -0,0 +1,22 @@ ++++/* 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/. */ ++++/* ++++ * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document ++++ * is granted provided that it is identified as "RSA Security Inc. Public-Key ++++ * Cryptography Standards (PKCS)" in all material mentioning or referencing ++++ * this document. ++++ */ ++++/* ++++ * reset any packing set by pkcs11p.h ++++ */ ++++ ++++#if defined(_WIN32) || defined(_WINDOWS) ++++#ifdef __clang__ ++++#pragma clang diagnostic ignored "-Wpragma-pack" ++++#endif ++++#ifdef _MSC_VER ++++#pragma warning(disable : 4103) ++++#endif ++++#pragma pack(pop, cryptoki) ++++#endif +++--- /dev/null ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/prcpucfg.h +++@@ -0,0 +1,1319 @@ ++++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++++/* 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/. */ ++++ ++++/* ++++ * This file is used by not only Linux but also other glibc systems ++++ * such as GNU/Hurd and GNU/k*BSD. ++++ */ ++++ ++++#ifndef nspr_cpucfg___ ++++#define nspr_cpucfg___ ++++ ++++#ifndef XP_UNIX ++++#define XP_UNIX ++++#endif ++++ ++++#if !defined(LINUX) && defined(__linux__) ++++#define LINUX ++++#endif ++++ ++++#ifdef __FreeBSD_kernel__ ++++#define PR_AF_INET6 28 /* same as AF_INET6 */ ++++#elif defined(__GNU__) ++++#define PR_AF_INET6 26 /* same as AF_INET6 */ ++++#else ++++#define PR_AF_INET6 10 /* same as AF_INET6 */ ++++#endif ++++ ++++#ifdef __powerpc64__ ++++ ++++#ifdef __LITTLE_ENDIAN__ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#else ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++#endif ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__powerpc__) ++++ ++++#ifdef __LITTLE_ENDIAN__ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#else ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++#endif ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__alpha) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__ia64__) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__x86_64__) ++++ ++++#ifdef __ILP32__ ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#else ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#endif ++++ ++++#elif defined(__mc68000__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 2 ++++#define PR_ALIGN_OF_LONG 2 ++++#define PR_ALIGN_OF_INT64 2 ++++#define PR_ALIGN_OF_FLOAT 2 ++++#define PR_ALIGN_OF_DOUBLE 2 ++++#define PR_ALIGN_OF_POINTER 2 ++++#define PR_ALIGN_OF_WORD 2 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__sparc__) && defined (__arch64__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__sparc__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__i386__) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__mips__) ++++ ++++/* For _ABI64 */ ++++#include ++++ ++++#ifdef __MIPSEB__ ++++#define IS_BIG_ENDIAN 1 ++++#undef IS_LITTLE_ENDIAN ++++#elif defined(__MIPSEL__) ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#else ++++#error "Unknown MIPS endianness." ++++#endif ++++ ++++#if _MIPS_SIM == _ABI64 ++++ ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#else /* _ABI64 */ ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#endif /* _ABI64 */ ++++ ++++#elif defined(__arm__) ++++ ++++#ifdef __ARMEB__ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++#elif defined(__ARMEL__) ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#else ++++#error "Unknown ARM endianness." ++++#endif ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__aarch64__) ++++ ++++#ifdef __AARCH64EB__ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++#elif defined(__AARCH64EL__) ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#else ++++#error "Unknown Aarch64 endianness." ++++#endif ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__hppa__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__s390x__) ++++ ++++#define IS_BIG_ENDIAN 1 ++++#undef IS_LITTLE_ENDIAN ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__s390__) ++++ ++++#define IS_BIG_ENDIAN 1 ++++#undef IS_LITTLE_ENDIAN ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__sh__) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__avr32__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__m32r__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__or1k__) ++++ ++++#undef IS_LITTLE_ENDIAN ++++#define IS_BIG_ENDIAN 1 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__riscv) && (__riscv_xlen == 32) ++++ ++++#undef IS_BIG_ENDIAN ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__riscv) && (__riscv_xlen == 64) ++++ ++++#undef IS_BIG_ENDIAN ++++#define IS_LITTLE_ENDIAN 1 ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 8 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__arc__) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__nios2__) || defined(__microblaze__) || defined(__nds32__) || \ ++++ defined(__xtensa__) ++++ ++++#if defined(__microblaze__) && defined(__BIG_ENDIAN__) ++++#define IS_BIG_ENDIAN 1 ++++#undef IS_LITTLE_ENDIAN ++++#else ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++#endif ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 8 ++++#define PR_BYTES_PER_LONG 4 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 4 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 64 ++++#define PR_BITS_PER_LONG 32 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 32 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 6 ++++#define PR_BITS_PER_LONG_LOG2 5 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 5 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 4 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 4 ++++#define PR_ALIGN_OF_POINTER 4 ++++#define PR_ALIGN_OF_WORD 4 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 2 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#elif defined(__e2k__) ++++ ++++#define IS_LITTLE_ENDIAN 1 ++++#undef IS_BIG_ENDIAN ++++ ++++#define IS_64 ++++ ++++#define PR_BYTES_PER_BYTE 1 ++++#define PR_BYTES_PER_SHORT 2 ++++#define PR_BYTES_PER_INT 4 ++++#define PR_BYTES_PER_INT64 4 ++++#define PR_BYTES_PER_LONG 8 ++++#define PR_BYTES_PER_FLOAT 4 ++++#define PR_BYTES_PER_DOUBLE 8 ++++#define PR_BYTES_PER_WORD 8 ++++#define PR_BYTES_PER_DWORD 8 ++++ ++++#define PR_BITS_PER_BYTE 8 ++++#define PR_BITS_PER_SHORT 16 ++++#define PR_BITS_PER_INT 32 ++++#define PR_BITS_PER_INT64 32 ++++#define PR_BITS_PER_LONG 64 ++++#define PR_BITS_PER_FLOAT 32 ++++#define PR_BITS_PER_DOUBLE 64 ++++#define PR_BITS_PER_WORD 64 ++++ ++++#define PR_BITS_PER_BYTE_LOG2 3 ++++#define PR_BITS_PER_SHORT_LOG2 4 ++++#define PR_BITS_PER_INT_LOG2 5 ++++#define PR_BITS_PER_INT64_LOG2 5 ++++#define PR_BITS_PER_LONG_LOG2 6 ++++#define PR_BITS_PER_FLOAT_LOG2 5 ++++#define PR_BITS_PER_DOUBLE_LOG2 6 ++++#define PR_BITS_PER_WORD_LOG2 6 ++++ ++++#define PR_ALIGN_OF_SHORT 2 ++++#define PR_ALIGN_OF_INT 4 ++++#define PR_ALIGN_OF_LONG 8 ++++#define PR_ALIGN_OF_INT64 4 ++++#define PR_ALIGN_OF_FLOAT 4 ++++#define PR_ALIGN_OF_DOUBLE 8 ++++#define PR_ALIGN_OF_POINTER 8 ++++#define PR_ALIGN_OF_WORD 8 ++++ ++++#define PR_BYTES_PER_WORD_LOG2 3 ++++#define PR_BYTES_PER_DWORD_LOG2 3 ++++ ++++#else ++++ ++++#error "Unknown CPU architecture" ++++ ++++#endif ++++ ++++#ifndef HAVE_LONG_LONG ++++#define HAVE_LONG_LONG ++++#endif ++++#if PR_ALIGN_OF_DOUBLE == 8 ++++#define HAVE_ALIGNED_DOUBLES ++++#endif ++++#if PR_ALIGN_OF_INT64 == 8 ++++#define HAVE_ALIGNED_LONGLONGS ++++#endif ++++ ++++#ifndef NO_NSPR_10_SUPPORT ++++ ++++#define BYTES_PER_BYTE PR_BYTES_PER_BYTE ++++#define BYTES_PER_SHORT PR_BYTES_PER_SHORT ++++#define BYTES_PER_INT PR_BYTES_PER_INT ++++#define BYTES_PER_INT64 PR_BYTES_PER_INT64 ++++#define BYTES_PER_LONG PR_BYTES_PER_LONG ++++#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT ++++#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE ++++#define BYTES_PER_WORD PR_BYTES_PER_WORD ++++#define BYTES_PER_DWORD PR_BYTES_PER_DWORD ++++ ++++#define BITS_PER_BYTE PR_BITS_PER_BYTE ++++#define BITS_PER_SHORT PR_BITS_PER_SHORT ++++#define BITS_PER_INT PR_BITS_PER_INT ++++#define BITS_PER_INT64 PR_BITS_PER_INT64 ++++#define BITS_PER_LONG PR_BITS_PER_LONG ++++#define BITS_PER_FLOAT PR_BITS_PER_FLOAT ++++#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE ++++#define BITS_PER_WORD PR_BITS_PER_WORD ++++ ++++#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 ++++#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 ++++#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 ++++#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 ++++#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 ++++#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 ++++#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 ++++#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 ++++ ++++#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT ++++#define ALIGN_OF_INT PR_ALIGN_OF_INT ++++#define ALIGN_OF_LONG PR_ALIGN_OF_LONG ++++#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 ++++#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT ++++#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE ++++#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER ++++#define ALIGN_OF_WORD PR_ALIGN_OF_WORD ++++ ++++#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 ++++#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 ++++#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 ++++ ++++#endif /* NO_NSPR_10_SUPPORT */ ++++ ++++#endif /* nspr_cpucfg___ */ +++--- /dev/null ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/prtypes.h +++@@ -0,0 +1,520 @@ ++++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++++/* 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/. */ ++++ ++++/* ++++** File: prtypes.h ++++** Description: Definitions of NSPR's basic types ++++** ++++** Prototypes and macros used to make up for deficiencies that we have found ++++** in ANSI environments. ++++** ++++** Since we do not wrap and all the other standard headers, authors ++++** of portable code will not know in general that they need these definitions. ++++** Instead of requiring these authors to find the dependent uses in their code ++++** and take the following steps only in those C files, we take steps once here ++++** for all C files. ++++**/ ++++ ++++#ifndef prtypes_h___ ++++#define prtypes_h___ ++++ ++++#ifdef MDCPUCFG ++++#include MDCPUCFG ++++#else ++++#include "prcpucfg.h" ++++#endif ++++ ++++#include ++++ ++++/*********************************************************************** ++++** MACROS: PR_EXTERN ++++** PR_IMPLEMENT ++++** DESCRIPTION: ++++** These are only for externally visible routines and globals. For ++++** internal routines, just use "extern" for type checking and that ++++** will not export internal cross-file or forward-declared symbols. ++++** Define a macro for declaring procedures return types. We use this to ++++** deal with windoze specific type hackery for DLL definitions. Use ++++** PR_EXTERN when the prototype for the method is declared. Use ++++** PR_IMPLEMENT for the implementation of the method. ++++** ++++** Example: ++++** in dowhim.h ++++** PR_EXTERN( void ) DoWhatIMean( void ); ++++** in dowhim.c ++++** PR_IMPLEMENT( void ) DoWhatIMean( void ) { return; } ++++** ++++** ++++***********************************************************************/ ++++#if defined(WIN32) ++++ ++++#define PR_EXPORT(__type) extern __declspec(dllexport) __type ++++#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type ++++#define PR_IMPORT(__type) __declspec(dllimport) __type ++++#define PR_IMPORT_DATA(__type) __declspec(dllimport) __type ++++ ++++#define PR_EXTERN(__type) extern __declspec(dllexport) __type ++++#define PR_IMPLEMENT(__type) __declspec(dllexport) __type ++++#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type ++++#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type ++++ ++++#define PR_CALLBACK ++++#define PR_CALLBACK_DECL ++++#define PR_STATIC_CALLBACK(__x) static __x ++++ ++++#elif defined(XP_OS2) && defined(__declspec) ++++ ++++#define PR_EXPORT(__type) extern __declspec(dllexport) __type ++++#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type ++++#define PR_IMPORT(__type) extern __declspec(dllimport) __type ++++#define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type ++++ ++++#define PR_EXTERN(__type) extern __declspec(dllexport) __type ++++#define PR_IMPLEMENT(__type) __declspec(dllexport) __type ++++#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type ++++#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type ++++ ++++#define PR_CALLBACK ++++#define PR_CALLBACK_DECL ++++#define PR_STATIC_CALLBACK(__x) static __x ++++ ++++#else /* Unix */ ++++ ++++/* GCC 3.3 and later support the visibility attribute. */ ++++#if (__GNUC__ >= 4) || \ ++++ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) ++++#define PR_VISIBILITY_DEFAULT __attribute__((visibility("default"))) ++++#else ++++#define PR_VISIBILITY_DEFAULT ++++#endif ++++ ++++#define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type ++++#define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type ++++#define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type ++++#define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type ++++ ++++#define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type ++++#define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type ++++#define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type ++++#define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type ++++#define PR_CALLBACK ++++#define PR_CALLBACK_DECL ++++#define PR_STATIC_CALLBACK(__x) static __x ++++ ++++#endif ++++ ++++#if defined(_NSPR_BUILD_) ++++#define NSPR_API(__type) PR_EXPORT(__type) ++++#define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type) ++++#else ++++#define NSPR_API(__type) PR_IMPORT(__type) ++++#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type) ++++#endif ++++ ++++/*********************************************************************** ++++** MACROS: PR_BEGIN_MACRO ++++** PR_END_MACRO ++++** DESCRIPTION: ++++** Macro body brackets so that macros with compound statement definitions ++++** behave syntactically more like functions when called. ++++***********************************************************************/ ++++#define PR_BEGIN_MACRO do { ++++#define PR_END_MACRO } while (0) ++++ ++++/*********************************************************************** ++++** MACROS: PR_BEGIN_EXTERN_C ++++** PR_END_EXTERN_C ++++** DESCRIPTION: ++++** Macro shorthands for conditional C++ extern block delimiters. ++++***********************************************************************/ ++++#ifdef __cplusplus ++++#define PR_BEGIN_EXTERN_C extern "C" { ++++#define PR_END_EXTERN_C } ++++#else ++++#define PR_BEGIN_EXTERN_C ++++#define PR_END_EXTERN_C ++++#endif ++++ ++++/*********************************************************************** ++++** MACROS: PR_BIT ++++** PR_BITMASK ++++** DESCRIPTION: ++++** Bit masking macros. XXX n must be <= 31 to be portable ++++***********************************************************************/ ++++#define PR_BIT(n) ((PRUint32)1 << (n)) ++++#define PR_BITMASK(n) (PR_BIT(n) - 1) ++++ ++++/*********************************************************************** ++++** MACROS: PR_ROUNDUP ++++** PR_MIN ++++** PR_MAX ++++** PR_ABS ++++** DESCRIPTION: ++++** Commonly used macros for operations on compatible types. ++++***********************************************************************/ ++++#define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y)) ++++#define PR_MIN(x,y) ((x)<(y)?(x):(y)) ++++#define PR_MAX(x,y) ((x)>(y)?(x):(y)) ++++#define PR_ABS(x) ((x)<0?-(x):(x)) ++++ ++++/*********************************************************************** ++++** MACROS: PR_ARRAY_SIZE ++++** DESCRIPTION: ++++** The number of elements in an array. ++++***********************************************************************/ ++++#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) ++++ ++++PR_BEGIN_EXTERN_C ++++ ++++/* ++++** Starting in NSPR 4.9.5, NSPR's exact-width integer types should match ++++** the exact-width integer types defined in . This allows sloppy ++++** code to use PRInt{N} and int{N}_t interchangeably. ++++** ++++** The 8-bit and 16-bit integer types can only be defined using char and ++++** short. All platforms define the 32-bit integer types using int. So only ++++** the 64-bit integer types could be defined differently. ++++** ++++** NSPR's original strategy was to use the "shortest" 64-bit integer type: ++++** if long is 64-bit, then prefer it over long long. This strategy is also ++++** used by Linux/glibc, FreeBSD, and NetBSD. ++++** ++++** Other platforms use a different strategy: simply define the 64-bit ++++** integer types using long long. We define the PR_ALTERNATE_INT64_TYPEDEF ++++** macro on these platforms. Note that PR_ALTERNATE_INT64_TYPEDEF is for ++++** internal use by NSPR headers only. Do not define or test this macro in ++++** your code. ++++** ++++** NOTE: NSPR can't use because C99 requires C++ code to define ++++** __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS to make all the macros ++++** defined in available. This strange requirement is gone in ++++** C11. When most platforms ignore this C99 requirement, NSPR will be able ++++** to use . A patch to do that is in NSPR bug 634793. ++++*/ ++++ ++++#if defined(__APPLE__) || defined(__OpenBSD__) ++++#define PR_ALTERNATE_INT64_TYPEDEF ++++#endif ++++ ++++/************************************************************************ ++++** TYPES: PRUint8 ++++** PRInt8 ++++** DESCRIPTION: ++++** The int8 types are known to be 8 bits each. There is no type that ++++** is equivalent to a plain "char". ++++************************************************************************/ ++++#if PR_BYTES_PER_BYTE == 1 ++++typedef unsigned char PRUint8; ++++/* ++++** There are two scenarios that require us to define PRInt8 as type 'char'. ++++** (1) ++++** Some cfront-based C++ compilers do not like 'signed char' and ++++** issue the warning message: ++++** warning: "signed" not implemented (ignored) ++++** For these compilers, we have to define PRInt8 as plain 'char'. ++++** Make sure that plain 'char' is indeed signed under these compilers. ++++** (2) ++++** Mozilla C++ code expects the PRInt{N} and int{N}_t types to match (see bug ++++** 634793). If a platform defines int8_t as 'char', but NSPR defines it as ++++** 'signed char', it results in a type mismatch. ++++** On such platforms we define PRInt8 as 'char' to avoid the mismatch. ++++*/ ++++#if (defined(HPUX) && defined(__cplusplus) /* reason 1*/ \ ++++ && !defined(__GNUC__) && __cplusplus < 199707L) \ ++++ || (defined(SCO) && defined(__cplusplus) /* reason 1 */ \ ++++ && !defined(__GNUC__) && __cplusplus == 1L) \ ++++ || (defined(__sun) && defined(__cplusplus)) /* reason 2 */ ++++typedef char PRInt8; ++++#else ++++typedef signed char PRInt8; ++++#endif ++++#else ++++#error No suitable type for PRInt8/PRUint8 ++++#endif ++++ ++++/************************************************************************ ++++ * MACROS: PR_INT8_MAX ++++ * PR_INT8_MIN ++++ * PR_UINT8_MAX ++++ * DESCRIPTION: ++++ * The maximum and minimum values of a PRInt8 or PRUint8. ++++************************************************************************/ ++++ ++++#define PR_INT8_MAX 127 ++++#define PR_INT8_MIN (-128) ++++#define PR_UINT8_MAX 255U ++++ ++++/************************************************************************ ++++** TYPES: PRUint16 ++++** PRInt16 ++++** DESCRIPTION: ++++** The int16 types are known to be 16 bits each. ++++************************************************************************/ ++++#if PR_BYTES_PER_SHORT == 2 ++++typedef unsigned short PRUint16; ++++typedef short PRInt16; ++++#else ++++#error No suitable type for PRInt16/PRUint16 ++++#endif ++++ ++++/************************************************************************ ++++ * MACROS: PR_INT16_MAX ++++ * PR_INT16_MIN ++++ * PR_UINT16_MAX ++++ * DESCRIPTION: ++++ * The maximum and minimum values of a PRInt16 or PRUint16. ++++************************************************************************/ ++++ ++++#define PR_INT16_MAX 32767 ++++#define PR_INT16_MIN (-32768) ++++#define PR_UINT16_MAX 65535U ++++ ++++/************************************************************************ ++++** TYPES: PRUint32 ++++** PRInt32 ++++** DESCRIPTION: ++++** The int32 types are known to be 32 bits each. ++++************************************************************************/ ++++#if PR_BYTES_PER_INT == 4 ++++typedef unsigned int PRUint32; ++++typedef int PRInt32; ++++#define PR_INT32(x) x ++++#define PR_UINT32(x) x ## U ++++#elif PR_BYTES_PER_LONG == 4 ++++typedef unsigned long PRUint32; ++++typedef long PRInt32; ++++#define PR_INT32(x) x ## L ++++#define PR_UINT32(x) x ## UL ++++#else ++++#error No suitable type for PRInt32/PRUint32 ++++#endif ++++ ++++/************************************************************************ ++++ * MACROS: PR_INT32_MAX ++++ * PR_INT32_MIN ++++ * PR_UINT32_MAX ++++ * DESCRIPTION: ++++ * The maximum and minimum values of a PRInt32 or PRUint32. ++++************************************************************************/ ++++ ++++#define PR_INT32_MAX PR_INT32(2147483647) ++++#define PR_INT32_MIN (-PR_INT32_MAX - 1) ++++#define PR_UINT32_MAX PR_UINT32(4294967295) ++++ ++++/************************************************************************ ++++** TYPES: PRUint64 ++++** PRInt64 ++++** DESCRIPTION: ++++** The int64 types are known to be 64 bits each. Care must be used when ++++** declaring variables of type PRUint64 or PRInt64. Different hardware ++++** architectures and even different compilers have varying support for ++++** 64 bit values. The only guaranteed portability requires the use of ++++** the LL_ macros (see prlong.h). ++++** ++++** MACROS: PR_INT64 ++++** PR_UINT64 ++++** DESCRIPTION: ++++** The PR_INT64 and PR_UINT64 macros provide a portable way for ++++** specifying 64-bit integer constants. They can only be used if ++++** PRInt64 and PRUint64 are defined as compiler-supported 64-bit ++++** integer types (i.e., if HAVE_LONG_LONG is defined, which is true ++++** for all the supported compilers topday). If PRInt64 and PRUint64 ++++** are defined as structs, the LL_INIT macro defined in prlong.h has ++++** to be used. ++++** ++++** MACROS: PR_INT64_MAX ++++** PR_INT64_MIN ++++** PR_UINT64_MAX ++++** DESCRIPTION: ++++** The maximum and minimum values of a PRInt64 or PRUint64. ++++************************************************************************/ ++++#ifdef HAVE_LONG_LONG ++++/* Keep this in sync with prlong.h. */ ++++#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF) ++++typedef long PRInt64; ++++typedef unsigned long PRUint64; ++++#define PR_INT64(x) x ## L ++++#define PR_UINT64(x) x ## UL ++++#elif defined(WIN32) && !defined(__GNUC__) ++++typedef __int64 PRInt64; ++++typedef unsigned __int64 PRUint64; ++++#define PR_INT64(x) x ## i64 ++++#define PR_UINT64(x) x ## ui64 ++++#else ++++typedef long long PRInt64; ++++typedef unsigned long long PRUint64; ++++#define PR_INT64(x) x ## LL ++++#define PR_UINT64(x) x ## ULL ++++#endif /* PR_BYTES_PER_LONG == 8 */ ++++ ++++#define PR_INT64_MAX PR_INT64(0x7fffffffffffffff) ++++#define PR_INT64_MIN (-PR_INT64_MAX - 1) ++++#define PR_UINT64_MAX PR_UINT64(-1) ++++#else /* !HAVE_LONG_LONG */ ++++typedef struct { ++++#ifdef IS_LITTLE_ENDIAN ++++ PRUint32 lo, hi; ++++#else ++++ PRUint32 hi, lo; ++++#endif ++++} PRInt64; ++++typedef PRInt64 PRUint64; ++++ ++++#define PR_INT64_MAX (PRInt64){0x7fffffff, 0xffffffff} ++++#define PR_INT64_MIN (PRInt64){0xffffffff, 0xffffffff} ++++#define PR_UINT64_MAX (PRUint64){0xffffffff, 0xffffffff} ++++ ++++#endif /* !HAVE_LONG_LONG */ ++++ ++++/************************************************************************ ++++** TYPES: PRUintn ++++** PRIntn ++++** DESCRIPTION: ++++** The PRIntn types are most appropriate for automatic variables. They are ++++** guaranteed to be at least 16 bits, though various architectures may ++++** define them to be wider (e.g., 32 or even 64 bits). These types are ++++** never valid for fields of a structure. ++++************************************************************************/ ++++#if PR_BYTES_PER_INT >= 2 ++++typedef int PRIntn; ++++typedef unsigned int PRUintn; ++++#else ++++#error 'sizeof(int)' not sufficient for platform use ++++#endif ++++ ++++/************************************************************************ ++++** TYPES: PRFloat64 ++++** DESCRIPTION: ++++** NSPR's floating point type is always 64 bits. ++++************************************************************************/ ++++typedef double PRFloat64; ++++ ++++/************************************************************************ ++++** TYPES: PRSize ++++** DESCRIPTION: ++++** A type for representing the size of objects. ++++************************************************************************/ ++++typedef size_t PRSize; ++++ ++++ ++++/************************************************************************ ++++** TYPES: PROffset32, PROffset64 ++++** DESCRIPTION: ++++** A type for representing byte offsets from some location. ++++************************************************************************/ ++++typedef PRInt32 PROffset32; ++++typedef PRInt64 PROffset64; ++++ ++++/************************************************************************ ++++** TYPES: PRPtrDiff ++++** DESCRIPTION: ++++** A type for pointer difference. Variables of this type are suitable ++++** for storing a pointer or pointer subtraction. ++++************************************************************************/ ++++typedef ptrdiff_t PRPtrdiff; ++++ ++++/************************************************************************ ++++** TYPES: PRUptrdiff ++++** DESCRIPTION: ++++** A type for pointer difference. Variables of this type are suitable ++++** for storing a pointer or pointer sutraction. ++++************************************************************************/ ++++#ifdef _WIN64 ++++typedef PRUint64 PRUptrdiff; ++++#else ++++typedef unsigned long PRUptrdiff; ++++#endif ++++ ++++/************************************************************************ ++++** TYPES: PRBool ++++** DESCRIPTION: ++++** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE ++++** for clarity of target type in assignments and actual arguments. Use ++++** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans ++++** just as you would C int-valued conditions. ++++************************************************************************/ ++++typedef PRIntn PRBool; ++++#define PR_TRUE 1 ++++#define PR_FALSE 0 ++++ ++++/************************************************************************ ++++** TYPES: PRPackedBool ++++** DESCRIPTION: ++++** Use PRPackedBool within structs where bitfields are not desirable ++++** but minimum and consistant overhead matters. ++++************************************************************************/ ++++typedef PRUint8 PRPackedBool; ++++ ++++/* ++++** Status code used by some routines that have a single point of failure or ++++** special status return. ++++*/ ++++typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; ++++ ++++#ifndef __PRUNICHAR__ ++++#define __PRUNICHAR__ ++++#ifdef WIN32 ++++typedef wchar_t PRUnichar; ++++#else ++++typedef PRUint16 PRUnichar; ++++#endif ++++#endif ++++ ++++/* ++++** WARNING: The undocumented data types PRWord and PRUword are ++++** only used in the garbage collection and arena code. Do not ++++** use PRWord and PRUword in new code. ++++** ++++** A PRWord is an integer that is the same size as a void*. ++++** It implements the notion of a "word" in the Java Virtual ++++** Machine. (See Sec. 3.4 "Words", The Java Virtual Machine ++++** Specification, Addison-Wesley, September 1996. ++++** http://java.sun.com/docs/books/vmspec/index.html.) ++++*/ ++++#ifdef _WIN64 ++++typedef PRInt64 PRWord; ++++typedef PRUint64 PRUword; ++++#else ++++typedef long PRWord; ++++typedef unsigned long PRUword; ++++#endif ++++ ++++/* ++++ * PR_PRETEND_NORETURN, specified at the end of a function declaration, ++++ * indicates that for the purposes of static analysis, this function does not ++++ * return. (The function definition does not need to be annotated.) ++++ * ++++ * void PR_Assert(const char *s, const char *file, PRIntn ln) ++++ * PR_PRETEND_NORETURN; ++++ * ++++ * Some static analyzers, like scan-build from clang, can use this information ++++ * to eliminate false positives. From the upstream documentation of ++++ * scan-build: ++++ * This attribute is useful for annotating assertion handlers that actually ++++ * can return, but for the purpose of using the analyzer we want to pretend ++++ * that such functions do not return. ++++ */ ++++#ifdef __clang_analyzer__ ++++#if __has_extension(attribute_analyzer_noreturn) ++++#define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn)) ++++#endif ++++#endif ++++ ++++#ifndef PR_PRETEND_NORETURN ++++#define PR_PRETEND_NORETURN /* no support */ ++++#endif ++++ ++++/* ++++** Compile-time assert. "condition" must be a constant expression. ++++** The macro can be used only in places where an "extern" declaration is ++++** allowed. ++++*/ ++++#define PR_STATIC_ASSERT(condition) \ ++++ extern void pr_static_assert(int arg[(condition) ? 1 : -1]) ++++ ++++PR_END_EXTERN_C ++++ ++++#endif /* prtypes_h___ */ ++++ +++--- /dev/null ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11p.h +++@@ -0,0 +1,24 @@ ++++/* 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/. */ ++++/* ++++ * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document ++++ * is granted provided that it is identified as "RSA Security Inc. Public-Key ++++ * Cryptography Standards (PKCS)" in all material mentioning or referencing ++++ * this document. ++++ */ ++++/* these data types are platform/implementation dependent. */ ++++/* ++++ * Packing was removed from the shipped RSA header files, even ++++ * though it's still needed. put in a central file to help merging.. ++++ */ ++++ ++++#if defined(_WIN32) || defined(_WINDOWS) ++++#ifdef __clang__ ++++#pragma clang diagnostic ignored "-Wpragma-pack" ++++#endif ++++#ifdef _MSC_VER ++++#pragma warning(disable : 4103) ++++#endif ++++#pragma pack(push, cryptoki, 1) ++++#endif +++--- a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h ++++++ b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h +++@@ -63,11 +63,6 @@ +++ #ifndef _P11_MD_H +++ #define _P11_MD_H 1 +++ +++-#define CK_PTR * +++-#define CK_DEFINE_FUNCTION(returnType, name) returnType name +++-#define CK_DECLARE_FUNCTION(returnType, name) returnType name +++-#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name) +++-#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name) +++ #ifndef NULL_PTR +++ #define NULL_PTR 0 +++ #endif +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h +++@@ -172,8 +172,8 @@ +++ #define min(a, b) (((a) < (b)) ? (a) : (b)) +++ #endif +++ +++-#define ckBBoolToJBoolean(x) ((x == TRUE) ? JNI_TRUE : JNI_FALSE); +++-#define jBooleanToCKBBool(x) ((x == JNI_TRUE) ? TRUE : FALSE); ++++#define ckBBoolToJBoolean(x) ((x == CK_TRUE) ? JNI_TRUE : JNI_FALSE); ++++#define jBooleanToCKBBool(x) ((x == JNI_TRUE) ? CK_TRUE : CK_FALSE); +++ +++ #define ckByteToJByte(x) ((jbyte) x) +++ #define jByteToCKByte(x) ((CK_BYTE) x) +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c +++@@ -1543,7 +1543,9 @@ CK_VOID_PTR jMechParamToCKMechParamPtrSl +++ ckpParamPtr = jX942Dh2DeriveParamToCKX942Dh2DeriveParamPtr(env, jParam, ckpLength); +++ break; +++ // defined by pkcs11.h but we don't support ++++#if 0 +++ case CKM_KEA_DERIVE: // CK_KEA_DERIVE_PARAMS ++++#endif +++ case CKM_RC2_CBC: // CK_RC2_CBC_PARAMS +++ case CKM_RC2_MAC_GENERAL: // CK_RC2_MAC_GENERAL_PARAMS +++ case CKM_RC5_ECB: // CK_RC5_PARAMS +++--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c ++++++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c +++@@ -407,7 +407,9 @@ void freeCKMechanismPtr(CK_MECHANISM_PTR +++ case CKM_TLS_MAC: +++ case CKM_AES_CTR: +++ case CKM_RSA_PKCS_PSS: ++++#if 0 +++ case CKM_CAMELLIA_CTR: ++++#endif +++ // params do not contain pointers +++ break; +++ default: diff --cc debian/patches/pass-extra-flags.diff index 000000000,000000000,000000000..cbf36c553 new file mode 100644 --- /dev/null +++ b/debian/patches/pass-extra-flags.diff @@@@ -1,0 -1,0 -1,0 +1,25 @@@@ +++--- a/src/hotspot/make/linux/makefiles/jsig.make ++++++ b/src/hotspot/make/linux/makefiles/jsig.make +++@@ -54,7 +54,9 @@ endif +++ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) +++ @echo $(LOG_INFO) Making signal interposition lib... +++ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ +++- $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl ++++ $(LFLAGS_JSIG) $(EXTRA_LDFLAGS) \ ++++ $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) \ ++++ -o $@ $< -ldl +++ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) +++ $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) +++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ +++--- a/src/hotspot/make/linux/makefiles/vm.make ++++++ b/src/hotspot/make/linux/makefiles/vm.make +++@@ -118,7 +118,8 @@ CFLAGS += $(CFLAGS/NOEX) +++ +++ # Extra flags from gnumake's invocation or environment +++ CFLAGS += $(EXTRA_CFLAGS) +++-LFLAGS += $(EXTRA_CFLAGS) ++++CXXFLAGS += $(EXTRA_CXXFLAGS) ++++LFLAGS += $(EXTRA_LDFLAGS) +++ +++ # Don't set excutable bit on stack segment +++ # the same could be done by separate execstack command diff --cc debian/patches/reproducible-build-jmod.diff index 000000000,000000000,000000000..588aa7aa2 new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-build-jmod.diff @@@@ -1,0 -1,0 -1,0 +1,39 @@@@ +++Description: jlink: Hash of module differs to expected hash recorded in java.base +++ The cause is the use of dh_strip_nondeterminism late in the build +++ process. This reorganises the jmod files, which in turn changes their +++ SHA256 checksums. This would not be a problem, except that the +++ checksums are saved in java.base.jmod *before* the use of +++ dh_strip_nondeterminism. Performing this stripping immediately after +++ each jmod file is created results in the checksums being consistent +++ throughout. +++Author: Julian Gilbey +++Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944738 +++Forwarded: not-needed +++ +++--- a/make/CreateJmods.gmk ++++++ b/make/CreateJmods.gmk +++@@ -228,6 +228,15 @@ endif +++ +++ # Create jmods in the support dir and then move them into place to keep the +++ # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. ++++# strip-nondeterminism requires the same timestamp as ++++# dh_strip_nondeterminism uses, so we determine this first. ++++# Fall back to the original behavior if the tools are missing for backports ++++DSN_TIMESTAMP := $(shell perl -MDebian::Debhelper::Dh_Lib -e 'print get_source_date_epoch()' 2>/dev/null) ++++ifneq (,$(DSN_TIMESTAMP)) ++++ ifneq (,$(wildcard /bin/strip-nondeterminism /usr/bin/strip-nondeterminism)) ++++ use_strip_ndt = yes ++++ endif ++++endif +++ $(eval $(call SetupExecute, create_$(JMOD_FILE), \ +++ WARN := Creating $(INTERIM_MSG)$(JMOD_FILE), \ +++ DEPS := $(DEPS), \ +++@@ -239,7 +248,7 @@ $(eval $(call SetupExecute, create_$(JMO +++ --module-path $(JMODS_DIR) $(JMOD_FLAGS) \ +++ --date $(SOURCE_DATE_ISO_8601) \ +++ $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \ +++- POST_COMMAND := $(MV) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE) $(JMODS_DIR)/$(JMOD_FILE), \ ++++ POST_COMMAND := $(if $(use_strip_ndt),strip-nondeterminism --timestamp $(DSN_TIMESTAMP) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE) && )$(MV) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE) $(JMODS_DIR)/$(JMOD_FILE), \ +++ )) +++ +++ TARGETS += $(create_$(JMOD_FILE)) diff --cc debian/patches/reproducible-build-user.diff index 000000000,000000000,000000000..91bd71e5f new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-build-user.diff @@@@ -1,0 -1,0 -1,0 +1,14 @@@@ +++Description: Makes the build user invariant to improve the reproducibility (it appears in the interval VM version in libjvm.so) +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/make/autoconf/basic.m4 ++++++ b/make/autoconf/basic.m4 +++@@ -97,7 +97,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], +++ +++ # Setup username (for use in adhoc version strings etc) +++ # Outer [ ] to quote m4. +++- [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] ++++ [ USERNAME="unknown" ] +++ AC_SUBST(USERNAME) +++ ]) +++ diff --cc debian/patches/reproducible-character-data.diff index 000000000,000000000,000000000..f21557183 new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-character-data.diff @@@@ -1,0 -1,0 -1,0 +1,14 @@@@ +++Description: Makes the generated character data classes reproducible (removes a timestamp and trims a build path captured in the comments) +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java ++++++ b/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java +++@@ -1810,7 +1810,7 @@ +++ } +++ commentStart = (Csyntax ? "/*" : "//"); +++ commentEnd = (Csyntax ? " */" : ""); +++- commandLineDescription = desc.toString().replace("\\", "\\\\"); ++++ commandLineDescription = desc.toString().replace("\\", "\\\\").replace(System.getProperty("user.dir").replace("make/gensrc", ""), ""); +++ } +++ +++ private static void searchBins(long[] map, int binsOccupied) throws Exception { diff --cc debian/patches/reproducible-copyright-headers.diff index 000000000,000000000,000000000..bba2371d6 new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-copyright-headers.diff @@@@ -1,0 -1,0 -1,0 +1,64 @@@@ +++Description: Makes the generated copyright headers reproducible +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java ++++++ b/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java +++@@ -26,6 +26,7 @@ +++ package build.tools.cldrconverter; +++ +++ import java.util.Calendar; ++++import java.util.Date; +++ import java.util.GregorianCalendar; +++ import java.util.Locale; +++ import java.util.TimeZone; +++@@ -146,8 +147,14 @@ class CopyrightHeaders { +++ } +++ +++ private static int getYear() { +++- return new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"), +++- Locale.US).get(Calendar.YEAR); ++++ Date date = new Date(); ++++ if (System.getenv("SOURCE_DATE_EPOCH") != null) { ++++ date = new Date(1000 * Long.valueOf(System.getenv("SOURCE_DATE_EPOCH"))); ++++ } ++++ ++++ GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"), Locale.ENGLISH); ++++ calendar.setTime(date); ++++ return calendar.get(Calendar.YEAR); +++ } +++ +++ // no instantiation +++--- a/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java ++++++ b/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java +++@@ -34,9 +34,13 @@ import java.time.ZoneId; +++ import java.time.ZonedDateTime; +++ import java.util.ArrayList; +++ import java.util.Arrays; ++++import java.util.Calendar; ++++import java.util.Date; ++++import java.util.GregorianCalendar; +++ import java.util.List; +++ import java.util.Locale; +++ import java.util.Map; ++++import java.util.TimeZone; +++ import java.util.TreeMap; +++ import java.util.stream.Collectors; +++ +++@@ -246,8 +250,15 @@ public class EquivMapsGenerator { +++ + "}"; +++ +++ private static String getOpenJDKCopyright() { +++- int year = ZonedDateTime.now(ZoneId +++- .of("America/Los_Angeles")).getYear(); ++++ Date date = new Date(); ++++ if (System.getenv("SOURCE_DATE_EPOCH") != null) { ++++ date = new Date(1000 * Long.valueOf(System.getenv("SOURCE_DATE_EPOCH"))); ++++ } ++++ ++++ GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"), Locale.ENGLISH); ++++ calendar.setTime(date); ++++ ++++ int year = calendar.get(Calendar.YEAR); +++ return String.format(Locale.US, COPYRIGHT, year); +++ } +++ diff --cc debian/patches/reproducible-javadoc-timestamp.diff index 000000000,000000000,000000000..8cabed1f9 new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-javadoc-timestamp.diff @@@@ -1,0 -1,0 -1,0 +1,41 @@@@ +++Description: Makes the timestamp in the javadoc files reproducible when SOURCE_DATE_EPOCH is specified +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java ++++++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java +++@@ -239,6 +239,9 @@ public class Head { +++ */ +++ public Content toContent() { +++ Date now = showTimestamp ? calendar.getTime() : null; ++++ if (now != null && System.getenv("SOURCE_DATE_EPOCH") != null) { ++++ now = new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))); ++++ } +++ +++ HtmlTree tree = new HtmlTree(HtmlTag.HEAD); +++ tree.add(getGeneratedBy(showTimestamp, now)); +++@@ -250,6 +253,9 @@ public class Head { +++ +++ if (showTimestamp) { +++ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); ++++ if (System.getenv("SOURCE_DATE_EPOCH") != null) { ++++ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); ++++ } +++ tree.add(HtmlTree.META("dc.created", dateFormat.format(now))); +++ } +++ +++@@ -282,7 +288,14 @@ public class Head { +++ private Comment getGeneratedBy(boolean timestamp, Date now) { +++ String text = "Generated by javadoc"; // marker string, deliberately not localized +++ if (timestamp) { +++- text += " ("+ docletVersion + ") on " + now; ++++ text += " ("+ docletVersion + ") on "; ++++ if (System.getenv("SOURCE_DATE_EPOCH") == null) { ++++ text += now; ++++ } else { ++++ SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); ++++ fmt.setTimeZone(TimeZone.getTimeZone("UTC")); ++++ text += fmt.format(now); ++++ } +++ } +++ return new Comment(text); +++ } diff --cc debian/patches/reproducible-module-info.diff index 000000000,000000000,000000000..1d18991bc new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-module-info.diff @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++Description: Makes the generated module-info.java files reproducible (removes a captured build path) +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java ++++++ b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java +++@@ -156,9 +156,10 @@ +++ if (l.trim().startsWith("module ")) { +++ if (debug) { +++ // print URI rather than file path to avoid escape +++- writer.format(" // source file: %s%n", sourceFile.toUri()); ++++ String buildPath = System.getProperty("user.dir").replaceAll("make$", ""); ++++ writer.format(" // source file: %s%n", sourceFile.toUri().toString().replace(buildPath, "")); +++ for (Path file : extraFiles) { +++- writer.format(" // %s%n", file.toUri()); ++++ writer.format(" // %s%n", file.toUri().toString().replace(buildPath, "")); +++ } +++ } +++ break; diff --cc debian/patches/reproducible-properties-timestamp.diff index 000000000,000000000,000000000..7fe33aec5 new file mode 100644 --- /dev/null +++ b/debian/patches/reproducible-properties-timestamp.diff @@@@ -1,0 -1,0 -1,0 +1,49 @@@@ +++Description: Makes the timestamp in the properties files header reproducible when SOURCE_DATE_EPOCH is specified +++Author: Emmanuel Bourg +++Forwarded: no +++--- a/src/java.base/share/classes/java/util/Properties.java ++++++ b/src/java.base/share/classes/java/util/Properties.java +++@@ -41,6 +41,8 @@ +++ import java.nio.charset.Charset; +++ import java.nio.charset.IllegalCharsetNameException; +++ import java.nio.charset.UnsupportedCharsetException; ++++import java.security.AccessController; ++++import java.security.PrivilegedAction; +++ import java.util.concurrent.ConcurrentHashMap; +++ import java.util.function.BiConsumer; +++ import java.util.function.BiFunction; +++@@ -955,7 +957,7 @@ +++ if (sysPropVal != null && !sysPropVal.isEmpty()) { +++ writeComments(bw, sysPropVal); +++ } else { +++- bw.write("#" + new Date()); ++++ bw.write("#" + getFormattedTimestamp()); +++ bw.newLine(); +++ } +++ } +++@@ -1600,4 +1602,25 @@ +++ } +++ this.map = map; +++ } ++++ ++++ /** ++++ * Returns a formatted timestamp to be used in the properties file header. ++++ * The date used is the current date, unless the SOURCE_DATE_EPOCH ++++ * environment variable is specified. In this case the format used is ++++ * locale and timezone insensitive to ensure the output is reproducible. ++++ */ ++++ @SuppressWarnings("removal") ++++ private static String getFormattedTimestamp() { ++++ final String epoch = AccessController.doPrivileged( ++++ (PrivilegedAction)() -> System.getenv("SOURCE_DATE_EPOCH")); ++++ if (epoch == null) { ++++ return new Date().toString(); ++++ } else { ++++ // Use the SOURCE_DATE_EPOCH timestamp and make the format locale/timezone insensitive ++++ java.text.SimpleDateFormat fmt = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss z", java.util.Locale.ENGLISH); ++++ fmt.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); ++++ Date date = new Date(1000 * Long.parseLong(epoch)); ++++ return fmt.format(date); ++++ } ++++ } +++ } diff --cc debian/patches/riscv64.diff index 000000000,000000000,000000000..571cff6ef new file mode 100644 --- /dev/null +++ b/debian/patches/riscv64.diff @@@@ -1,0 -1,0 -1,0 +1,58 @@@@ +++# HG changeset patch +++# User enevill +++# Date 1521985117 -3600 +++# Sun Mar 25 14:38:37 2018 +0100 +++# Node ID 7d1ae835ef5194e7ae5b56b51f944029fe602d11 +++# Parent 1b1de4b263c81853719f6bb0385fe23bc4e35f6c +++8199138: Add RISC-V support to Zero +++Reviewed-by: aph, erikj, ehelin, ihse +++ +++--- a/make/autoconf/build-aux/config.guess ++++++ b/make/autoconf/build-aux/config.guess +++@@ -28,6 +28,13 @@ +++ # autoconf system (which might easily get lost in a future update), we wrap it +++ # and fix the broken property, if needed. +++ ++++machine=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown ++++if test $machine = riscv64; then ++++ # This is all we need to know for riscv64 ++++ echo riscv64-unknown-linux-gnu ++++ exit ++++fi ++++ +++ DIR=`dirname $0` +++ OUT=`. $DIR/autoconf-config.guess 2> /dev/null` +++ +++--- a/make/autoconf/build-aux/config.sub ++++++ b/make/autoconf/build-aux/config.sub +++@@ -53,8 +53,8 @@ +++ exit +++ fi +++ +++-# Filter out everything that doesn't begin with "aarch64-" +++-if ! echo $* | grep '^aarch64-' >/dev/null ; then ++++# First, filter out everything that doesn't begin with "aarch64-" or "riscv64-" ++++if ! echo $* | grep '^aarch64-\|^riscv64-' >/dev/null ; then +++ . $DIR/autoconf-config.sub "$@" +++ # autoconf-config.sub exits, so we never reach here, but just in +++ # case we do: +++@@ -69,6 +69,10 @@ +++ config=`echo $1 | sed 's/^aarch64-/arm-/'` +++ sub_args="$sub_args $config" +++ shift; ;; ++++ riscv64-* ) ++++ config=`echo $1 | sed 's/^riscv64-/x86-/'` ++++ sub_args="$sub_args $config" ++++ shift; ;; +++ - ) # Use stdin as input. +++ sub_args="$sub_args $1" +++ shift; break ;; +++@@ -81,7 +85,7 @@ +++ result=`. $DIR/autoconf-config.sub $sub_args "$@"` +++ exitcode=$? +++ +++-result=`echo $result | sed "s/^arm-/aarch64-/"` ++++result=`echo $result | sed "s/^arm-/aarch64-/" | sed "s/^x86-/riscv64-/"` +++ +++ echo $result +++ exit $exitcode diff --cc debian/patches/s390x-opt.diff index 000000000,000000000,000000000..e034d84b3 new file mode 100644 --- /dev/null +++ b/debian/patches/s390x-opt.diff @@@@ -1,0 -1,0 -1,0 +1,12 @@@@ +++--- a/make/autoconf/flags-cflags.m4 ++++++ b/make/autoconf/flags-cflags.m4 +++@@ -756,6 +756,9 @@ +++ fi +++ elif test "x$FLAGS_CPU" = xs390x; then +++ $1_CFLAGS_CPU="-mbackchain -march=z10" ++++ if test "x$VENDOR_FLAGS_CPU" != x; then ++++ $1_CFLAGS_CPU="-mbackchain $VENDOR_FLAGS_CPU" ++++ fi +++ fi +++ +++ if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then diff --cc debian/patches/series index 000000000,000000000,000000000..2c76294d8 new file mode 100644 --- /dev/null +++ b/debian/patches/series @@@@ -1,0 -1,0 -1,0 +1,48 @@@@ +++system-pcsclite.diff +++hotspot-mips-align.diff +++icc_loading_with_symlink.diff +++icedtea-override-redirect-compiz.diff +++#jexec.diff +++default-jvm-cfg.diff +++adlc-parser.diff +++multiple-pkcs11-library-init.diff +++s390x-opt.diff +++jdk-getAccessibleValue.diff +++#jtreg-location.diff FIXME +++jdk-i18n-pt_BR.diff +++machine-flag.diff +++zero-x32.diff +++atk-wrapper-security.diff +++# java-access-bridge-security.diff +++# jdk-pulseaudio.diff +++dnd-files.diff +++m68k-support.diff +++# reproducible-javadoc-timestamp.diff +++make-debug-print.diff +++Don-t-optimize-fdlibm-fork-for-Zero-on-linux-sparc-Z.patch +++reproducible-properties-timestamp.diff +++reproducible-character-data.diff +++reproducible-module-info.diff +++#reproducible-copyright-headers.diff +++#reproducible-build-user.diff +++#riscv64.diff +++reproducible-build-jmod.diff +++mips.diff +++#nspr+nss-headers.diff +++misalign-pointer-for-armhf.patch +++update-permission-test.patch +++ldap-timeout-test-use-ip.patch +++test-use-ip-address.patch +++arch-add-ports.diff +++compile-preview.diff +++jdk-8307977-proposed.patch +++warn-fontmanager.patch +++jdk-8318418.patch +++jdk-8295795.patch +++hsdis-fpic.patch +++jdk-8329983.patch +++jdk-8334502-proposed.patch +++jdk-8334895-proposed.patch +++jdk-8331541.patch +++jdk-8336529-proposed.patch +++jdk-8312488.patch diff --cc debian/patches/set-exec-name.diff index 000000000,000000000,000000000..d1fc39879 new file mode 100644 --- /dev/null +++ b/debian/patches/set-exec-name.diff @@@@ -1,0 -1,0 -1,0 +1,47 @@@@ +++--- a/src/jdk/src/solaris/bin/java_md.c.orig ++++++ b/src/jdk/src/solaris/bin/java_md.c +++@@ -688,8 +688,19 @@ +++ char buf[PATH_MAX+1]; +++ int len = readlink(self, buf, PATH_MAX); +++ if (len >= 0) { ++++ const char* prefixes[] = {"/cow/", "/persistmnt/", "/rofs/", "/rwfs/", "/squashmnt/", NULL}; ++++ const char **prefix; ++++ size_t prefix_len = 0; +++ buf[len] = '\0'; /* readlink doesn't nul terminate */ +++- exec_path = JLI_StringDup(buf); ++++ for (prefix = prefixes; *prefix; prefix++) { ++++ prefix_len = strlen(buf) < strlen(*prefix) ? strlen(buf) : strlen(*prefix); ++++ if (!strncmp(*prefix, buf, prefix_len)) { ++++ prefix_len--; ++++ break; ++++ } ++++ prefix_len = 0; ++++ } ++++ exec_path = JLI_StringDup(buf + prefix_len); +++ } +++ } +++ #else /* !__solaris__ && !__linux */ +++--- a/src/hotspot/src/os/posix/launcher/java_md.c.orig ++++++ b/src/hotspot/src/os/posix/launcher/java_md.c +++@@ -967,8 +967,19 @@ +++ char buf[PATH_MAX+1]; +++ int len = readlink(self, buf, PATH_MAX); +++ if (len >= 0) { +++- buf[len] = '\0'; /* readlink doesn't nul terminate */ +++- exec_path = JLI_StringDup(buf); ++++ buf[len] = '\0'; /* readlink doesn't nul terminate */ ++++ const char* prefixes[] = {"/cow/", "/persistmnt/", "/rofs/", "/rwfs/", "/squashmnt/", NULL}; ++++ const char **prefix; ++++ size_t prefix_len = 0; ++++ for (prefix = prefixes; *prefix; prefix++) { ++++ prefix_len = strlen(buf) < strlen(*prefix) ? strlen(buf) : strlen(*prefix); ++++ if (!strncmp(*prefix, buf, prefix_len)) { ++++ prefix_len--; ++++ break; ++++ } ++++ prefix_len = 0; ++++ } ++++ exec_path = JLI_StringDup(buf + prefix_len); +++ } +++ } +++ #else /* !__sun && !__linux */ diff --cc debian/patches/stack-direction.diff index 000000000,000000000,000000000..a4421ca35 new file mode 100644 --- /dev/null +++ b/debian/patches/stack-direction.diff @@@@ -1,0 -1,0 -1,0 +1,215 @@@@ +++--- a/src/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp.old 2010-01-06 16:30:02.000000000 +0100 ++++++ b/src/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp 2010-01-06 23:14:47.000000000 +0100 +++@@ -144,8 +144,13 @@ +++ address addr = (address) info->si_addr; +++ +++ // check if fault address is within thread stack ++++#ifdef __hppa__ ++++ if (addr > thread->stack_base() && ++++ addr <= thread->stack_base() + thread->stack_size()) { ++++#else +++ if (addr < thread->stack_base() && +++ addr >= thread->stack_base() - thread->stack_size()) { ++++#endif +++ // stack overflow +++ if (thread->in_stack_yellow_zone(addr)) { +++ thread->disable_stack_yellow_zone(); +++@@ -294,7 +299,11 @@ +++ if (res != 0) { +++ fatal1("pthread_attr_getstack failed with errno = %d", res); +++ } ++++#ifdef __hppa__ ++++ address stack_top = stack_bottom - stack_bytes; ++++#else +++ address stack_top = stack_bottom + stack_bytes; ++++#endif +++ +++ // The block of memory returned by pthread_attr_getstack() includes +++ // guard pages where present. We need to trim these off. +++@@ -321,7 +330,11 @@ +++ stack_bottom += (total_pages - guard_pages) / 2 * page_bytes; +++ #endif // IA64 +++ ++++#ifdef __hppa__ ++++ stack_bottom -= guard_bytes; ++++#else +++ stack_bottom += guard_bytes; ++++#endif +++ +++ pthread_attr_destroy(&attr); +++ +++@@ -329,19 +342,36 @@ +++ // by pthread_attr_getstack is the maximum size it could possibly +++ // be given what currently mapped. This can be huge, so we cap it. +++ if (os::Linux::is_initial_thread()) { ++++#ifdef __hppa__ ++++ stack_bytes = stack_bottom - stack_top; ++++#else +++ stack_bytes = stack_top - stack_bottom; ++++#endif +++ +++ if (stack_bytes > JavaThread::stack_size_at_create()) +++ stack_bytes = JavaThread::stack_size_at_create(); +++ ++++#ifdef __hppa__ ++++ stack_bottom = stack_top + stack_bytes; ++++#else +++ stack_bottom = stack_top - stack_bytes; ++++#endif +++ } +++ ++++#ifdef __hppa__ ++++ assert(os::current_stack_pointer() <= stack_bottom, "should do"); ++++ assert(os::current_stack_pointer() > stack_top, "should do"); ++++#else +++ assert(os::current_stack_pointer() >= stack_bottom, "should do"); +++ assert(os::current_stack_pointer() < stack_top, "should do"); ++++#endif +++ +++ *bottom = stack_bottom; ++++#ifdef __hppa__ ++++ *size = stack_bottom - stack_top; ++++#else +++ *size = stack_top - stack_bottom; ++++#endif +++ } +++ +++ address os::current_stack_base() { +++--- a/src/hotspot/src/share/vm/runtime/thread.cpp.old 2009-10-02 23:16:39.000000000 +0200 ++++++ b/src/hotspot/src/share/vm/runtime/thread.cpp 2010-01-06 23:31:24.000000000 +0100 +++@@ -713,8 +713,13 @@ +++ else if (is_ConcurrentGC_thread()) st->print("ConcurrentGCThread"); +++ else st->print("Thread"); +++ ++++#ifdef __hppa__ +++ st->print(" [stack: " PTR_FORMAT "," PTR_FORMAT "]", +++ _stack_base - _stack_size, _stack_base); ++++#else ++++ st->print(" [stack: " PTR_FORMAT "," PTR_FORMAT "]", ++++ _stack_base + _stack_size, _stack_base); ++++#endif +++ +++ if (osthread()) { +++ st->print(" [id=%d]", osthread()->thread_id()); +++@@ -792,7 +797,11 @@ +++ bool Thread::is_in_stack(address adr) const { +++ assert(Thread::current() == this, "is_in_stack can only be called from current thread"); +++ address end = os::current_stack_pointer(); ++++#ifdef __hppa__ ++++ if (stack_base() <= adr && adr <= end) return true; ++++#else +++ if (stack_base() >= adr && adr >= end) return true; ++++#endif +++ +++ return false; +++ } +++@@ -804,7 +813,11 @@ +++ // should be revisited, and they should be removed if possible. +++ +++ bool Thread::is_lock_owned(address adr) const { ++++#ifdef __hppa__ ++++ return (_stack_base <= adr && adr <= (_stack_base + _stack_size)); ++++#else +++ return (_stack_base >= adr && adr >= (_stack_base - _stack_size)); ++++#endif +++ } +++ +++ bool Thread::set_as_starting_thread() { +++@@ -2108,7 +2121,11 @@ +++ +++ void JavaThread::create_stack_guard_pages() { +++ if (! os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) return; ++++#ifdef __hppa__ ++++ address low_addr = stack_base(); ++++#else +++ address low_addr = stack_base() - stack_size(); ++++#endif +++ size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); +++ +++ int allocate = os::allocate_stack_guard_pages(); +++@@ -2131,7 +2148,11 @@ +++ +++ void JavaThread::remove_stack_guard_pages() { +++ if (_stack_guard_state == stack_guard_unused) return; ++++#ifdef __hppa__ ++++ address low_addr = stack_base(); ++++#else +++ address low_addr = stack_base() - stack_size(); ++++#endif +++ size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); +++ +++ if (os::allocate_stack_guard_pages()) { +++@@ -2156,10 +2177,17 @@ +++ +++ // The base notation is from the stacks point of view, growing downward. +++ // We need to adjust it to work correctly with guard_memory() ++++#ifdef __hppa__ ++++ address base = stack_yellow_zone_base() + stack_yellow_zone_size(); ++++ ++++ guarantee(base > stack_base(),"Error calculating stack yellow zone"); ++++ guarantee(base > os::current_stack_pointer(),"Error calculating stack yellow zone"); ++++#else +++ address base = stack_yellow_zone_base() - stack_yellow_zone_size(); +++ +++ guarantee(base < stack_base(),"Error calculating stack yellow zone"); +++ guarantee(base < os::current_stack_pointer(),"Error calculating stack yellow zone"); ++++#endif +++ +++ if (os::guard_memory((char *) base, stack_yellow_zone_size())) { +++ _stack_guard_state = stack_guard_enabled; +++@@ -2178,7 +2206,11 @@ +++ +++ // The base notation is from the stacks point of view, growing downward. +++ // We need to adjust it to work correctly with guard_memory() ++++#ifdef __hppa__ ++++ address base = stack_yellow_zone_base() + stack_yellow_zone_size(); ++++#else +++ address base = stack_yellow_zone_base() - stack_yellow_zone_size(); ++++#endif +++ +++ if (os::unguard_memory((char *)base, stack_yellow_zone_size())) { +++ _stack_guard_state = stack_guard_yellow_disabled; +++@@ -2192,10 +2224,17 @@ +++ // The base notation is from the stacks point of view, growing downward. +++ // We need to adjust it to work correctly with guard_memory() +++ assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); ++++#ifdef __hppa__ ++++ address base = stack_red_zone_base() + stack_red_zone_size(); ++++ ++++ guarantee(base > stack_base(),"Error calculating stack red zone"); ++++ guarantee(base > os::current_stack_pointer(),"Error calculating stack red zone"); ++++#else +++ address base = stack_red_zone_base() - stack_red_zone_size(); +++ +++ guarantee(base < stack_base(),"Error calculating stack red zone"); +++ guarantee(base < os::current_stack_pointer(),"Error calculating stack red zone"); ++++#endif +++ +++ if(!os::guard_memory((char *) base, stack_red_zone_size())) { +++ warning("Attempt to guard stack red zone failed."); +++@@ -2206,7 +2245,11 @@ +++ // The base notation is from the stacks point of view, growing downward. +++ // We need to adjust it to work correctly with guard_memory() +++ assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); ++++#ifdef __hppa__ ++++ address base = stack_red_zone_base() + stack_red_zone_size(); ++++#else +++ address base = stack_red_zone_base() - stack_red_zone_size(); ++++#endif +++ if (!os::unguard_memory((char *)base, stack_red_zone_size())) { +++ warning("Attempt to unguard stack red zone failed."); +++ } +++@@ -2451,8 +2494,13 @@ +++ if (osthread()) { +++ st->print(", id=%d", osthread()->thread_id()); +++ } ++++#ifdef __hppa__ ++++ st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")", ++++ _stack_base + _stack_size, _stack_base); ++++#else +++ st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")", +++ _stack_base - _stack_size, _stack_base); ++++#endif +++ st->print("]"); +++ return; +++ } diff --cc debian/patches/system-pcsclite.diff index 000000000,000000000,000000000..d3b970fb7 new file mode 100644 --- /dev/null +++ b/debian/patches/system-pcsclite.diff @@@@ -1,0 -1,0 -1,0 +1,196 @@@@ +++--- a/make/autoconf/lib-bundled.m4 ++++++ b/make/autoconf/lib-bundled.m4 +++@@ -41,6 +41,7 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS], +++ LIB_SETUP_ZLIB +++ LIB_SETUP_LCMS +++ LIB_SETUP_HARFBUZZ ++++ LIB_SETUP_PCSCLITE +++ ]) +++ +++ ################################################################################ +++@@ -309,3 +310,41 @@ AC_DEFUN_ONCE([LIB_SETUP_HARFBUZZ], +++ AC_SUBST(HARFBUZZ_CFLAGS) +++ AC_SUBST(HARFBUZZ_LIBS) +++ ]) ++++ ++++################################################################################ ++++# Setup pcsclite ++++################################################################################ ++++AC_DEFUN_ONCE([LIB_SETUP_PCSCLITE], ++++[ ++++ AC_ARG_WITH(pcsclite, [AS_HELP_STRING([--with-pcsclite], ++++ [use pcsclite from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) ++++ ++++ AC_MSG_CHECKING([for which pcsclite to use]) ++++ ++++ # default is bundled ++++ DEFAULT_PCSCLITE=bundled ++++ # if user didn't specify, use DEFAULT_PCSCLITE ++++ if test "x${with_pcsclite}" = "x"; then ++++ with_libpng=${DEFAULT_PCSCLITE} ++++ fi ++++ ++++ if test "x${with_pcsclite}" = "xbundled"; then ++++ USE_EXTERNAL_PCSCLITE=false ++++ AC_MSG_RESULT([bundled]) ++++ elif test "x${with_pcsclite}" = "xsystem"; then ++++ PKG_CHECK_MODULES(PCSCLITE, libpcsclite, ++++ [ PCSCLITE_FOUND=yes ], ++++ [ PCSCLITE_FOUND=no ]) ++++ if test "x${PCSCLITE_FOUND}" = "xyes"; then ++++ USE_EXTERNAL_PCSCLITE=true ++++ AC_MSG_RESULT([system]) ++++ else ++++ AC_MSG_RESULT([system not found]) ++++ AC_MSG_ERROR([--with-pcsclite=system specified, but no pcsclite found!]) ++++ fi ++++ else ++++ AC_MSG_ERROR([Invalid value of --with-pcsclite: ${with_pcsclite}, use 'system' or 'bundled']) ++++ fi ++++ ++++ AC_SUBST(USE_EXTERNAL_PCSCLITE) ++++]) +++--- a/make/modules/java.smartcardio/Lib.gmk ++++++ b/make/modules/java.smartcardio/Lib.gmk +++@@ -30,12 +30,12 @@ include LibCommon.gmk +++ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \ +++ NAME := j2pcsc, \ +++ CFLAGS := $(CFLAGS_JDKLIB), \ +++- CFLAGS_unix := -D__sun_jdk, \ +++- EXTRA_HEADER_DIRS := libj2pcsc/MUSCLE, \ ++++ CFLAGS_unix := -D__sun_jdk -DUSE_SYSTEM_LIBPCSCLITE, \ ++++ EXTRA_HEADER_DIRS := /usr/include/PCSC, \ +++ OPTIMIZATION := LOW, \ +++ LDFLAGS := $(LDFLAGS_JDKLIB) \ +++ $(call SET_SHARED_LIBRARY_ORIGIN), \ +++- LIBS_unix := $(LIBDL), \ ++++ LIBS_unix := -lpcsclite $(LIBDL), \ +++ LIBS_windows := winscard.lib, \ +++ )) +++ +++--- a/make/autoconf/spec.gmk.in ++++++ b/make/autoconf/spec.gmk.in +++@@ -805,6 +805,7 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TR +++ # Build setup +++ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ +++ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ ++++USE_EXTERNAL_LIBPCSCLITE:=@USE_EXTERNAL_LIBPCSCLITE@ +++ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ +++ LIBZ_CFLAGS:=@LIBZ_CFLAGS@ +++ LIBZ_LIBS:=@LIBZ_LIBS@ +++--- a/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.c ++++++ b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.c +++@@ -36,6 +36,7 @@ +++ +++ #include "pcsc_md.h" +++ ++++#ifndef USE_SYSTEM_LIBPCSCLITE +++ void *hModule; +++ FPTR_SCardEstablishContext scardEstablishContext; +++ FPTR_SCardConnect scardConnect; +++@@ -47,6 +48,7 @@ FPTR_SCardListReaders scardListReaders; +++ FPTR_SCardBeginTransaction scardBeginTransaction; +++ FPTR_SCardEndTransaction scardEndTransaction; +++ FPTR_SCardControl scardControl; ++++#endif +++ +++ /* +++ * Throws a Java Exception by name +++@@ -74,8 +76,9 @@ static void throwIOException(JNIEnv *env +++ { +++ throwByName(env, "java/io/IOException", msg); +++ } +++- ++++#ifndef USE_SYSTEM_LIBPCSCLITE +++ static void *findFunction(JNIEnv *env, void *hModule, char *functionName) { ++++ return NULL; +++ void *fAddress = dlsym(hModule, functionName); +++ if (fAddress == NULL) { +++ char errorMessage[256]; +++@@ -85,9 +88,11 @@ static void *findFunction(JNIEnv *env, v +++ } +++ return fAddress; +++ } ++++#endif +++ +++ JNIEXPORT void JNICALL Java_sun_security_smartcardio_PlatformPCSC_initialize +++ (JNIEnv *env, jclass thisClass, jstring jLibName) { ++++#ifndef USE_SYSTEM_LIBPCSCLITE +++ const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL); +++ if (libName == NULL) { +++ throwNullPointerException(env, "PCSC library name is null"); +++@@ -141,4 +146,5 @@ JNIEXPORT void JNICALL Java_sun_security +++ #else +++ scardControl = (FPTR_SCardControl) findFunction(env, hModule, "SCardControl132"); +++ #endif // __APPLE__ ++++#endif +++ } +++--- a/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h ++++++ b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h +++@@ -23,6 +23,8 @@ +++ * questions. +++ */ +++ ++++#ifndef USE_SYSTEM_LIBPCSCLITE ++++ +++ typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope, +++ LPCVOID pvReserved1, +++ LPCVOID pvReserved2, +++@@ -111,3 +113,41 @@ extern FPTR_SCardListReaders scardListRe +++ extern FPTR_SCardBeginTransaction scardBeginTransaction; +++ extern FPTR_SCardEndTransaction scardEndTransaction; +++ extern FPTR_SCardControl scardControl; ++++ ++++#else ++++ ++++#define CALL_SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext) \ ++++ (SCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext)) ++++ ++++#define CALL_SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols) \ ++++ (SCardConnect(hContext, szReader, dwSharedMode, dwPreferredProtocols, phCard, pdwActiveProtocols)) ++++ ++++#define CALL_SCardDisconnect(hCard, dwDisposition) \ ++++ (SCardDisconnect(hCard, dwDisposition)) ++++ ++++#define CALL_SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen) \ ++++ (SCardStatus(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen)) ++++ ++++#define CALL_SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders) \ ++++ (SCardGetStatusChange(hContext, dwTimeout, rgReaderStates, cReaders)) ++++ ++++#define CALL_SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \ ++++ pioRecvPci, pbRecvBuffer, pcbRecvLength) \ ++++ (SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, \ ++++ pioRecvPci, pbRecvBuffer, pcbRecvLength)) ++++ ++++#define CALL_SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders) \ ++++ (SCardListReaders(hContext, mszGroups, mszReaders, pcchReaders)) ++++ ++++#define CALL_SCardBeginTransaction(hCard) \ ++++ (SCardBeginTransaction(hCard)) ++++ ++++#define CALL_SCardEndTransaction(hCard, dwDisposition) \ ++++ (SCardEndTransaction(hCard, dwDisposition)) ++++ ++++#define CALL_SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \ ++++ pbRecvBuffer, pcbRecvLength, lpBytesReturned) \ ++++ (SCardControl(hCard, dwControlCode, pbSendBuffer, cbSendLength, \ ++++ pbRecvBuffer, pcbRecvLength, lpBytesReturned)) ++++ ++++#endif +++--- a/test/jdk/java/security/misc/Versions.java ++++++ b/test/jdk/java/security/misc/Versions.java +++@@ -55,12 +55,7 @@ public class Versions { +++ Pattern.compile("list/(?[0-9a-f]+)/public_suffix_list.dat"), +++ "src/java.base/share/legal/public_suffix.md", +++ Pattern.compile("list/(?[0-9a-f]+)/public_suffix_list.dat"), +++- "java.base/public_suffix.md"}, +++- {"src/java.smartcardio/unix/native/libj2pcsc/MUSCLE/pcsclite.h", +++- Pattern.compile("#define PCSCLITE_VERSION_NUMBER +\"(?[0-9\\.]+)\""), +++- "src/java.smartcardio/unix/legal/pcsclite.md", +++- Pattern.compile("## PC/SC Lite v(?[0-9\\.]+)"), +++- "java.smartcardio/pcsclite.md"} ++++ "java.base/public_suffix.md"} +++ }; +++ } +++ diff --cc debian/patches/test-use-ip-address.patch index 000000000,000000000,000000000..0ff6edd03 new file mode 100644 --- /dev/null +++ b/debian/patches/test-use-ip-address.patch @@@@ -1,0 -1,0 -1,0 +1,28 @@@@ +++Description: Use IP address in tests +++ Ubuntu build machines are not set up for dns. Use IP addresses to get correct test +++ outcomes. +++Author: Vladimir Petko +++Forwarded: not-needed +++Last-Update: 2023-03-27 +++--- a/test/jdk/java/net/InetAddress/IsReachableViaLoopbackTest.java ++++++ b/test/jdk/java/net/InetAddress/IsReachableViaLoopbackTest.java +++@@ -36,7 +36,7 @@ +++ public static void main(String[] args) { +++ try { +++ InetAddress addr = InetAddress.getByName("localhost"); +++- InetAddress remoteAddr = InetAddress.getByName("bugs.openjdk.org"); ++++ InetAddress remoteAddr = InetAddress.getByName("8.8.8.8"); +++ if (!addr.isReachable(10000)) +++ throw new RuntimeException("Localhost should always be reachable"); +++ NetworkInterface inf = NetworkInterface.getByInetAddress(addr); +++--- a/test/jdk/java/net/InetAddress/getOriginalHostName.java ++++++ b/test/jdk/java/net/InetAddress/getOriginalHostName.java +++@@ -39,7 +39,7 @@ +++ SharedSecrets.getJavaNetInetAddressAccess(); +++ +++ public static void main(String[] args) throws Exception { +++- final String HOST = "dummyserver.java.net"; ++++ final String HOST = "localhost"; +++ InetAddress ia = null; +++ ia = InetAddress.getByName(HOST); +++ testInetAddress(ia, HOST); diff --cc debian/patches/update-permission-test.patch index 000000000,000000000,000000000..59a28ab17 new file mode 100644 --- /dev/null +++ b/debian/patches/update-permission-test.patch @@@@ -1,0 -1,0 -1,0 +1,25 @@@@ +++Description: Add missing permissions for TestNG 7.7 +++ TestNG has added more configuration properties, allow them in the minimal policy +++Author: Vladimir Petko +++Last-Update: 2023-03-24 +++--- a/test/jdk/java/lang/ProcessHandle/PermissionTest.java ++++++ b/test/jdk/java/lang/ProcessHandle/PermissionTest.java +++@@ -219,6 +219,7 @@ +++ permissions.add(new PropertyPermission("testng.mode.dryrun", "read")); +++ permissions.add(new PropertyPermission("testng.report.xml.name", "read")); +++ permissions.add(new PropertyPermission("testng.timezone", "read")); ++++ permissions.add(new PropertyPermission("testng.default.verbose", "read")); +++ permissions.add(new ReflectPermission("suppressAccessChecks")); +++ permissions.add(new FilePermission("<>", "execute")); +++ } +++--- a/test/jdk/java/sql/testng/util/TestPolicy.java ++++++ b/test/jdk/java/sql/testng/util/TestPolicy.java +++@@ -114,6 +114,8 @@ +++ permissions.add(new PropertyPermission("testng.mode.dryrun", "read")); +++ permissions.add(new PropertyPermission("testng.report.xml.name", "read")); +++ permissions.add(new PropertyPermission("testng.timezone", "read")); ++++ permissions.add(new PropertyPermission("testng.default.verbose", "read")); ++++ permissions.add(new PropertyPermission("testng.ignore.callback.skip", "read")); +++ permissions.add(new ReflectPermission("suppressAccessChecks")); +++ permissions.add(new FilePermission("<>", +++ "read, write, delete")); diff --cc debian/patches/warn-fontmanager.patch index 000000000,000000000,000000000..7d8b9fdea new file mode 100644 --- /dev/null +++ b/debian/patches/warn-fontmanager.patch @@@@ -1,0 -1,0 -1,0 +1,25 @@@@ +++Description: print warning to install openjdk-*-jre package +++ fontmanager support was moved to recommends, warn user to +++ either install -jre package or recommended packages. +++ Forwarding is not needed as this is a Debian-only issue. +++Author: Vladimir Petko +++Forwarded: not-needed +++ +++--- a/src/java.desktop/share/classes/sun/font/FontManagerNativeLibrary.java ++++++ b/src/java.desktop/share/classes/sun/font/FontManagerNativeLibrary.java +++@@ -55,7 +55,14 @@ +++ shared library in order to avoid dependency. */ +++ System.loadLibrary("freetype"); +++ } +++- System.loadLibrary("fontmanager"); ++++ ++++ try { ++++ System.loadLibrary("fontmanager"); ++++ } catch (Throwable t) { ++++ System.err.println("Please install the openjdk-*-jre package or recommended packages for openjdk-*-jre-headless."); ++++ throw t; ++++ } ++++ +++ +++ return null; +++ } diff --cc debian/patches/zero-x32.diff index 000000000,000000000,000000000..d6387e446 new file mode 100644 --- /dev/null +++ b/debian/patches/zero-x32.diff @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++--- a/make/autoconf/platform.m4 ++++++ b/make/autoconf/platform.m4 +++@@ -41,6 +41,10 @@ +++ VAR_CPU_ARCH=x86 +++ VAR_CPU_BITS=64 +++ VAR_CPU_ENDIAN=little ++++ case "$host" in *x32) ++++ VAR_CPU=x32 ++++ VAR_CPU_BITS=32 ++++ esac +++ ;; +++ i?86) +++ VAR_CPU=x86 diff --cc debian/rules index 000000000,000000000,000000000..5aee31c0c new file mode 100755 --- /dev/null +++ b/debian/rules @@@@ -1,0 -1,0 -1,0 +1,2066 @@@@ +++#!/usr/bin/make -f +++# -*- makefile -*- +++ +++# Uncomment this to turn on verbose mode. +++#export DH_VERBOSE=1 +++include /usr/share/dpkg/buildflags.mk +++ +++unexport LANG LC_ALL +++ +++dh_version := $(shell dpkg-query -f '$${Version}\n' -W debhelper | sed -n 's/^\(.\).*/\1/p') +++ +++# using brace expansion and substring replacements (${var:0:2}). +++SHELL = /bin/bash +++ +++# use gnu time in verbose mode if available, otherwise default to the shell builtin +++ifneq (,$(wildcard /usr/bin/time)) +++ TIME = /usr/bin/time -v +++else +++ TIME = time +++endif +++ +++vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) +++ +++DPKG_VARS := $(shell dpkg-architecture) +++DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) +++DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) +++DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) +++DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH) +++DEB_HOST_ARCH_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_CPU) +++DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) +++ +++PATH := $(CURDIR)/bin:$(PATH) +++export PATH +++ +++CHANGELOG_VARS := $(shell dpkg-parsechangelog | sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p') +++PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source) +++PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version) +++PKGYEAR := $(shell echo $(call vafilt,$(CHANGELOG_VARS),Timestamp) | date --utc +%Y) +++ +++distribution := $(shell lsb_release --id --short) +++distrel := $(shell lsb_release --codename --short) +++derivative := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \ +++ elif dpkg-vendor --derives-from Debian; then echo Debian; \ +++ else echo Unknown; fi) +++ifeq ($(distrel),n/a) +++ distrel := sid +++endif +++ +++ifneq (,$(filter $(distrel),precise)) +++ OBJCOPY := objcopy +++ STRIP := strip +++else +++ OBJCOPY := $(DEB_HOST_GNU_TYPE)-objcopy +++ STRIP := $(DEB_HOST_GNU_TYPE)-strip +++endif +++ +++multiarch_dir = /$(DEB_HOST_MULTIARCH) +++ +++hotspot_archs = amd64 i386 arm64 armhf ppc64 ppc64el riscv64 s390x +++jtreg_archs = $(hotspot_archs) alpha ia64 powerpc ppc64 sh4 x32 +++jtreg_archs += armel loong64 mipsel mips64el +++jtreg_archs += riscv64 +++ +++# FIXME: use bootcycle builds for zero archs? +++bootcycle_build = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),yes) +++#bootcycle_build = $(if $(filter $(DEB_HOST_ARCH), amd64 i386),yes) +++#bootcycle_build = +++zbootcycle_build = +++zbootcycle_build = yes +++ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) +++ bootcycle_build = +++ zbootcycle_build = +++endif +++ifneq (,$(filter nobootcycle, $(DEB_BUILD_OPTIONS))) +++ bootcycle_build = +++ zbootcycle_build = +++endif +++ +++ifneq (,$(filter $(distrel),lucid precise quantal raring saucy trusty utopic vivid wily lenny etch squeeze wheezy jessie)) +++ is_default = no +++else +++ is_default = yes +++endif +++ +++is_upstream_release = yes +++is_upstream_release = +++ +++srcdir = . +++builddir = build +++zbuilddir = build-zero +++ +++VENDOR = openjdk +++Vendor = OpenJDK +++TOP = usr/lib/jvm +++origin = openjdk +++basename = openjdk-$(shortver) +++ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ priority = $(if $(filter yes, $(is_default)),2111,2109) +++ vm_name = Hotspot JIT +++else +++ priority = $(if $(filter yes, $(is_default)),2104,2103) +++ vm_name = Hotspot Zero +++endif +++jvmver = 1.21.0 +++shortver = 21 +++v_debian := $(shell echo $(PKGVERSION) | sed 's/ea//' | sed 's/\~us[[:digit:]]\+//') +++v_upstream := $(shell echo $(v_debian) | sed 's/-[^-][^-]*$$//') +++v_pkgrel := $(shell echo $(v_debian) | sed 's/^.*-//') +++ +++ifeq (yes,$(is_upstream_release)) +++ v_upbase := $(word 1, $(subst +, , $(v_upstream))) +++ v_upbuild := $(word 2, $(subst +, , $(v_upstream))) +++ ifneq ($(v_debian),$(v_upbase)+$(v_upbuild)-$(v_pkgrel)) +++ $(error wrong version: $(v_upbase)+$(v_upbuild)-$(v_pkgrel) should be: $(v_debian)) +++ endif +++else +++ v_upbase := $(word 1, $(subst ~, , $(v_upstream))) +++ v_upbuild := $(word 2, $(subst ~, , $(v_upstream))) +++ ifneq ($(v_debian),$(v_upbase)~$(v_upbuild)-$(v_pkgrel)) +++ $(error wrong version: $(v_upbase)~$(v_upbuild)-$(v_pkgrel) should be: $(v_debian)) +++ endif +++endif +++ +++ifneq (,$(DEB_HOST_MULTIARCH)) +++ jdirname = java-$(shortver)-$(origin)-$(DEB_HOST_ARCH) +++ jdiralias = java-$(jvmver)-$(origin)-$(DEB_HOST_ARCH) +++ basedir = $(TOP)/$(jdirname) +++ commonbasedir = $(TOP)/java-$(shortver)-$(origin)-common +++ commonbasedir = $(basedir) +++ etcdir = etc/java-$(shortver)-$(origin) +++ testsuitedir = $(basedir)/testsuite +++else +++ jdirname = java-$(shortver)-$(origin) +++ jdiralias = java-$(jvmver)-$(origin) +++ basedir = $(TOP)/$(jdirname) +++ commonbasedir = $(TOP)/java-$(shortver)-$(origin) +++ etcdir = etc/$(jdirname) +++ testsuitedir = $(basedir)/testsuite +++endif +++security = $(etcdir)/security +++ifeq ($(bootcycle_build),yes) +++ sdkimg = bootcycle-build/images/jdk +++ build_target = bootcycle-images test-image +++ testimg = images/test +++else +++ sdkimg = images/jdk +++ build_target = images test-image +++ testimg = images/test +++endif +++ifeq ($(zbootcycle_build),yes) +++ zsdkimg = bootcycle-build/images/jdk +++ zbuild_target = bootcycle-images test-image +++else +++ zsdkimg = images/jdk +++ zbuild_target = images test-image +++endif +++ +++# Support parallel= in DEB_BUILD_OPTIONS (see #209008) +++COMMA=, +++SPACE = $(EMPTY) $(EMPTY) +++ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +++ NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +++endif +++ +++ifneq (,$(filter $(distrel), sid bookworm bullseye)) +++ jtreg_pkg = jtreg# debian will have jtreg7 in jtreg package +++ testng_pkg = libtestng7-java +++else +++ jtreg_pkg = jtreg7 +++ testng_pkg = libtestng7-java +++endif +++ +++with_check = $(if $(findstring nocheck, $(DEB_BUILD_OPTIONS)),,yes) +++ifneq (,$(filter $(DEB_HOST_ARCH), alpha arc hppa armel ia64 loong64 mipsel mips64el powerpc riscv64 x32)) +++ with_check = disabled running check on $(DEB_HOST_ARCH) +++endif +++# no jtreg backport yet +++ifneq (,$(filter $(distrel), precise trusty xenial bionic bookworm bullseye)) +++ with_check = disabled for $(distrel), no $(jtreg_pkg) +++endif +++#with_check = disabled, more recent jtreg needed +++ +++with_docs = $(if $(findstring nodoc, $(DEB_BUILD_OPTIONS)),,yes) +++ifneq (,$(filter $(distrel), precise trusty)) +++ with_docs = +++endif +++#with_check = disabled for this upload +++ +++with_wqy_zenhai = $(if $(filter $(distrel),lenny),,yes) +++ +++arch_map := alpha=alpha arc=arc arm=arm armel=arm armhf=arm arm64=aarch64 amd64=amd64 hppa=parisc i386=i586 loong64=loong64 m68k=m68k mips=mips mipsel=mipsel mips64=mips64 mips64el=mips64el powerpc=ppc ppc64=ppc64 ppc64el=ppc64le riscv64=riscv64 sparc=sparc sparc64=sparcv9 sh4=sh s390x=s390x ia64=ia64 x32=x32 +++ +++jvmarch := $(strip $(patsubst $(DEB_HOST_ARCH_CPU)=%, %, \ +++ $(filter $(DEB_HOST_ARCH_CPU)=%, $(arch_map)))) +++ifeq ($(DEB_HOST_ARCH),x32) +++ jvmarch := x32 +++endif +++ +++default_vm = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),hotspot,zero) +++ +++any_archs = alpha amd64 arc armel armhf arm64 hppa i386 ia64 loong64 mips mipsel mips64 mips64el powerpc ppc64 ppc64el m68k riscv64 sh4 sparc sparc64 s390x x32 +++ +++altzero_archs = $(hotspot_archs) +++ifneq (,$(filter $(distrel),trusty)) +++ altzero_archs := $(filter-out arm64, $(altzero_archs)) +++endif +++ +++ifneq (,$(filter noaltzero, $(DEB_BUILD_OPTIONS))) +++ altzero_archs = +++else ifneq (,$(filter $(DEB_HOST_ARCH), $(altzero_archs))) +++ alternate_vms += zero +++ zero_dir = zero +++endif +++ +++# needed for the jexec build +++export DEBIAN_JDK_BASE_DIR := /$(basedir) +++ +++BOOTJDK_HOME := $(strip $(subst /bin/javac,, $(firstword $(wildcard \ +++ /usr/lib/jvm/java-21-openjdk-$(DEB_BUILD_ARCH)/bin/javac \ +++ /usr/lib/jvm/java-20-openjdk-$(DEB_BUILD_ARCH)/bin/javac \ +++ )))) +++ +++ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) +++ BUILDJDK_HOME = $(CURDIR)/$(builddir)/$(sdkimg) +++else +++ BUILDJDK_HOME = $(BOOTJDK_HOME) +++endif +++ +++ifneq (,$(filter $(distrel),saucy)) +++ export CC = gcc-4.8 +++ export CXX = g++-4.8 +++ bd_gcc = g++-4.8, +++else ifneq (,$(filter $(distrel),utopic vivid jessie)) +++ export CC = gcc-4.9 +++ export CXX = g++-4.9 +++ bd_gcc = g++-4.9, +++else ifneq (,$(filter $(distrel),wily)) +++ ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-5 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-5 +++ # FIXME: altzero seems to build with GCC 5 on i386, amd64, ppc64el ... +++ ifneq (,$(filter $(DEB_HOST_ARCH), arm64)) +++ ZERO_CC = $(DEB_HOST_GNU_TYPE)-gcc-4.9 +++ ZERO_CXX = $(DEB_HOST_GNU_TYPE)-g++-4.9 +++ endif +++ else +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-4.9 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-4.9 +++ endif +++ bd_gcc = g++-5 [$(hotspot_archs)], g++-4.9 [$(strip $(foreach a,$(hotspot_archs), !$(a)))], g++-4.9 [arm64], +++else ifneq (,$(filter $(distrel),stretch)) +++ # FIXME: still hotspot core dumps with GCC 6 +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-6 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-6 +++ bd_gcc = g++-6, +++else ifneq (,$(filter $(distrel),artful)) +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-7 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-7 +++ bd_gcc = g++-7, +++else ifneq (,$(filter $(distrel),buster precise trusty xenial bionic cosmic disco)) +++ # FIXME: ftbfs on armhf with the default GCC +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-8 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-8 +++ bd_gcc = g++-8, +++ ifneq (,$(filter $(distrel),buster bionic cosmic disco)) +++ bd_gcc = g++-8 , +++ endif +++else ifneq (,$(filter $(distrel),bullseye focal groovy hirsute)) +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-10 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-10 +++ bd_gcc = g++-10 , +++else ifneq (,$(filter $(distrel),bookworm jammy kinetic lunar)) +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-12 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-12 +++ bd_gcc = g++-12 , +++else ifneq (,$(filter $(distrel),mantic noble)) +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-13 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-13 +++ bd_gcc = g++-13 , +++else +++ export CC = $(DEB_HOST_GNU_TYPE)-gcc-14 +++ export CXX = $(DEB_HOST_GNU_TYPE)-g++-14 +++ bd_gcc = g++-14 , +++endif +++ +++# GCC 11 only +++ifeq (,$(findstring 11, $(bd_gcc))) +++ DEB_BUILD_MAINT_OPTIONS = optimize=-lto +++endif +++ +++# for Hotspot: hotspot/make/linux/makefiles/vm.make +++# Don't overwrite Hotspot opt level : +++# -O3 is already default option for hotspot +++ +++# FIXME: ftbfs with -Werror=format-security +++dpkg_buildflags_hs = \ +++ DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" \ +++ DEB_CFLAGS_MAINT_STRIP="-O2 -Werror=format-security" \ +++ DEB_CXXFLAGS_MAINT_STRIP="-O2 -Werror=format-security" \ +++ DEB_CFLAGS_MAINT_APPEND="-fno-stack-protector -Wno-deprecated-declarations" \ +++ DEB_CXXFLAGS_MAINT_APPEND="-fno-stack-protector -Wno-deprecated-declarations$(if $(filter $(DEB_HOST_ARCH), armel armhf), -fpermissive)" +++# jdk/make/CompileDemos.gmk (SetupJVMTIDemo) doesn't like commas in flags +++dpkg_buildflags_hs += \ +++ DEB_LDFLAGS_MAINT_STRIP="-Wl,-z,relro -Wl,-Bsymbolic-functions" \ +++ DEB_LDFLAGS_MAINT_APPEND="-Xlinker -z -Xlinker relro -Xlinker -Bsymbolic-functions -Xlinker --no-as-needed" +++dpkg_buildflags_hs += dpkg-buildflags +++export EXTRA_CPPFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CPPFLAGS) +++export EXTRA_CFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CFLAGS; $(dpkg_buildflags_hs) --get CPPFLAGS) +++export EXTRA_CXXFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CXXFLAGS) -Wno-deprecated-declarations +++export EXTRA_LDFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get LDFLAGS) +++ +++dpkg_buildflags_zero = \ +++ DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" \ +++ DEB_CFLAGS_MAINT_STRIP="-O2 -Werror=format-security -fstack-protector -fstack-protector-strong" \ +++ DEB_CXXFLAGS_MAINT_STRIP="-O2 -Werror=format-security -fstack-protector -fstack-protector-strong" \ +++ DEB_CFLAGS_MAINT_APPEND="-fno-stack-protector -Wno-deprecated-declarations" \ +++ DEB_CXXFLAGS_MAINT_APPEND="-fno-stack-protector -Wno-deprecated-declarations" +++# jdk/make/CompileDemos.gmk (SetupJVMTIDemo) doesn't like commas in flags +++dpkg_buildflags_zero += \ +++ DEB_LDFLAGS_MAINT_STRIP="-Wl,-z,relro -Wl,-Bsymbolic-functions" \ +++ DEB_LDFLAGS_MAINT_APPEND="-Xlinker -z -Xlinker relro -Xlinker -Bsymbolic-functions -Xlinker --no-as-needed" +++dpkg_buildflags_zero += dpkg-buildflags +++export EXTRA_CPPFLAGS_ZERO := $(shell $(dpkg_buildflags_zero) --get CPPFLAGS) +++export EXTRA_CFLAGS_ZERO := $(shell $(dpkg_buildflags_zero) --get CFLAGS; $(dpkg_buildflags_zero) --get CPPFLAGS) +++export EXTRA_CXXFLAGS_ZERO := $(shell $(dpkg_buildflags_zero) --get CXXFLAGS) +++export EXTRA_LDFLAGS_ZERO := $(shell $(dpkg_buildflags_zero) --get LDFLAGS) +++ +++ifeq ($(DEB_HOST_ARCH),alpha) +++ export EXTRA_LDFLAGS_ZERO += -Wl,--no-relax +++endif +++ +++ifneq (,$(filter $(distrel),squeeze lucid)) +++ with_bridge = bridge +++ with_jni_bridge = yes +++else +++ with_bridge = atk +++endif +++ +++with_nss = yes +++ +++on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes) +++ +++CONFIGURE_ARGS = +++ +++# there are problems --with-alt-jar=/usr/bin/fastjar, +++# see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=217 +++# only use it for zero ports except powerpc (which we assume as +++# fast enough to build. +++ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) ia64 powerpc)) +++ CONFIGURE_ARGS += --with-alt-jar=/usr/bin/fastjar +++endif +++ +++ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ CONFIGURE_ARGS += --enable-zero +++endif +++ +++ifeq (,$(filter $(DEB_BUILD_OPTIONS), terse)) +++ #EXTRA_BUILD_ENV += MAKE_VERBOSE=y QUIETLY= LOG=debug +++ EXTRA_BUILD_ENV += MAKE_VERBOSE=y QUIETLY= LOG=info,cmdlines +++endif +++ +++# timestamp skew on kFreeBSD +++EXTRA_BUILD_ENV += IGNORE_OLD_CONFIG=true +++ +++EXTRA_BUILD_ENV += LIBFFI_LIBS=-lffi_pic +++ +++EXTRA_BUILD_ENV += JOBS=$(NJOBS) +++ +++ifeq ($(derivative),Ubuntu) +++ ifeq ($(DEB_HOST_ARCH),s390x) +++ ifneq (,$(filter $(distrel), trusty xenial bionic eoan focal)) +++ export VENDOR_FLAGS_CPU = -march=zEC12 +++ else +++ export VENDOR_FLAGS_CPU = -march=z13 -mtune=z15 +++ endif +++ endif +++endif +++ +++CONFIGURE_ARGS += --enable-system-kerberos +++ +++ifeq ($(with_nss),yes) +++ CONFIGURE_ARGS += --enable-nss +++else ifeq ($(with_nss),no) +++ CONFIGURE_ARGS += --disable-nss +++endif +++ +++CONFIGURE_ARGS += --enable-dtrace +++ +++COMMON_CONFIGURE_ARGS = +++DEFAULT_CONFIGURE_ARGS = +++ZERO_CONFIGURE_ARGS = +++ +++COMMON_CONFIGURE_ARGS += --with-jni-libpath=/usr/lib/$(DEB_HOST_MULTIARCH)/jni:/lib/$(DEB_HOST_MULTIARCH):/usr/lib/$(DEB_HOST_MULTIARCH):/usr/lib/jni:/lib:/usr/lib +++ +++# FIXME: --with-jvm-variants=server,zero not supported upstream +++ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) +++ ifneq (,$(filter $(DEB_HOST_ARCH),i386)) +++ DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=client,server +++ else +++ DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=server +++ endif +++else +++ DEFAULT_CONFIGURE_ARGS += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) +++ DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=zero +++endif +++ZERO_CONFIGURE_ARGS += --with-jvm-variants=zero +++ +++DEFAULT_CONFIGURE_ARGS += --with-boot-jdk=$(BOOTJDK_HOME) +++ZERO_CONFIGURE_ARGS += --with-boot-jdk=$(BUILDJDK_HOME) +++ +++COMMON_CONFIGURE_ARGS += --disable-ccache +++ +++# FIXME: zero not ready for --disable-precompiled-headers +++#COMMON_CONFIGURE_ARGS += --disable-precompiled-headers +++ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) +++ DEFAULT_CONFIGURE_ARGS += --disable-precompiled-headers +++endif +++ +++ifneq (,$(filter $(DEB_HOST_ARCH), powerpc)) +++ DEFAULT_CONFIGURE_ARGS += --with-boot-jdk-jvmargs="-XX:ThreadStackSize=2240" +++endif +++ +++ifneq (,$(filter $(DEB_HOST_ARCH), ppc64 ppc64el)) +++ ZERO_CONFIGURE_ARGS += --with-boot-jdk-jvmargs="-XX:ThreadStackSize=2240" +++endif +++ +++ifeq ($(with_check),yes) +++ COMMON_CONFIGURE_ARGS += --with-jtreg=/usr/share/jtreg +++else +++ COMMON_CONFIGURE_ARGS += --without-jtreg --disable-jtreg-failure-handler +++endif +++ +++# openjdk provides java.lang.foreign.Linker implementation for +++# amd64 arm64 ppc64el riscv64 s390x. Other architectures use +++# a libffi-based linker. +++ifeq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 ppc64el riscv64 s390x)) +++ COMMON_CONFIGURE_ARGS += --enable-fallback-linker +++endif +++ +++COMMON_CONFIGURE_ARGS += --disable-warnings-as-errors +++ +++ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) +++ ifneq (,$(filter $(DEB_HOST_ARCH), amd64)) +++ jvm_features = zgc +++ endif +++ # not needed explicitly? +++ #jvm_features += shenandoahgc +++ DEFAULT_CONFIGURE_ARGS += --with-jvm-features=$(subst $(SPACE),$(COMMA),$(strip $(jvm_features))) +++endif +++ +++# enable hotspot disassembler +++enable_hsdis = +++ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ # binutils-dev 2.42 is the first binutils having libopcodes_pic.a and libbfd_pic.a +++ ifeq (,$(filter $(distrel), precise trusty xenial bionic focal jammy mantic bookworm bullseye)) +++ # keep it off for licensing reasons. binutils is GPLv3+ +++ #enable_hsdis = yes +++ endif +++endif +++ +++ifeq ($(enable_hsdis),yes) +++ DEFAULT_CONFIGURE_ARGS += --with-hsdis=binutils --with-binutils=system --enable-hsdis-bundling +++endif +++ +++vendor := $(shell dpkg-vendor --query Vendor) +++ifeq ($(vendor),Debian) +++ vendor_url = https://tracker.debian.org/pkg/$(basename) +++ vendor_bugs = https://bugs.debian.org/src:$(basename) +++else ifeq ($(vendor),Ubuntu) +++ vendor_url = https://launchpad.net/ubuntu/+source/$(basename) +++ vendor_bugs = https://bugs.launchpad.net/ubuntu/+source/$(basename) +++else +++ vendor_url = $(shell dpkg-vendor --query Vendor-URL) +++ vendor_bugs = $(shell dpkg-vendor --query Bugs) +++endif +++ +++ifneq (,$(vendor)) +++ COMMON_CONFIGURE_ARGS += \ +++ --with-vendor-name='$(vendor)' \ +++ --with-vendor-url='$(vendor_url)' \ +++ --with-vendor-bug-url='$(vendor_bugs)' \ +++ --with-vendor-vm-bug-url='$(vendor_bugs)' +++endif +++ +++# not sure if this is a good idea, might change parsing of java -version +++#COMMON_CONFIGURE_ARGS += \ +++# --with-vendor-version-string='$(PKGVERSION)' +++ +++ifeq ($(distribution),Debian) +++ COMMON_CONFIGURE_ARGS += \ +++ --with-vendor-name='$(distribution)' \ +++ --with-vendor-url='https://tracker.debian.org/$(basename)' \ +++ --with-vendor-bug-url='https://bugs.debian.org/$(basename)' \ +++ --with-vendor-vm-bug-url='https://bugs.debian.org/$(basename)' +++else ifeq ($(distribution),Ubuntu) +++ ppa_build := $(shell if echo '$(v_pkgrel)' | egrep '^[0-9]+(ubuntu[0-9]+)?(~[0-9.]+)?$$'; then echo no; else echo yes; fi) +++ ifeq ($(ppa_build),yes) +++ COMMON_CONFIGURE_ARGS += \ +++ --with-vendor-name='Private Build' \ +++ --with-vendor-url='Unknown' \ +++ --with-vendor-bug-url='Unknown' \ +++ --with-vendor-vm-bug-url='Unknown' +++ else +++ COMMON_CONFIGURE_ARGS += \ +++ --with-vendor-name='$(distribution)' \ +++ --with-vendor-url='https://ubuntu.com/' \ +++ --with-vendor-bug-url='https://bugs.launchpad.net/ubuntu/+source/$(basename)' \ +++ --with-vendor-vm-bug-url='https://bugs.launchpad.net/ubuntu/+source/$(basename)' +++ endif +++else +++ COMMON_CONFIGURE_ARGS += \ +++ --with-vendor-name='$(distribution)' \ +++ --with-vendor-url='Unknown' \ +++ --with-vendor-bug-url='Unknown' \ +++ --with-vendor-vm-bug-url='Unknown' +++endif +++ +++COMMON_CONFIGURE_ARGS += \ +++ --with-version-pre='$(if $(filter yes, $(is_upstream_release)),,ea)' \ +++ --with-version-build='$(v_upbuild)' \ +++ --with-version-opt='$(distribution)-$(v_pkgrel)' \ +++ --with-copyright-year=$(PKGYEAR) \ +++ +++COMMON_CONFIGURE_ARGS += \ +++ --with-debug-level=release \ +++ --with-native-debug-symbols=external \ +++ --enable-unlimited-crypto \ +++ --with-zlib=system \ +++ --with-giflib=system \ +++ --with-libpng=system \ +++ --with-libjpeg=system \ +++ --with-lcms=system \ +++ --with-pcsclite=system \ +++ --disable-warnings-as-errors \ +++ --disable-javac-server \ +++ --with-gtest=$(CURDIR)/googletest \ +++ +++ifeq (,$(filter $(distrel),jessie stretch precise trusty xenial)) +++ COMMON_CONFIGURE_ARGS += \ +++ --with-harfbuzz=system +++ with_system_hb = yes +++endif +++ +++ifneq (,$(filter $(distrel),precise trusty xenial)) +++ # building with a GCC from a PPA ... +++ COMMON_CONFIGURE_ARGS += \ +++ --with-stdc++lib=static +++else ifneq (,$(filter $(DEB_HOST_ARCH), ia64)) +++ # seen in 2023 on ia64: +++ # /usr/bin/ld: jvm-test-launcher: no symbol version section for versioned symbol `__cxa_pure_virtual@CXXABI_1.3' +++ # works when linking statically +++ COMMON_CONFIGURE_ARGS += \ +++ --with-stdc++lib=static +++else +++ COMMON_CONFIGURE_ARGS += \ +++ --with-stdc++lib=dynamic +++endif +++ +++ifneq (,$(NJOBS)) +++ COMMON_CONFIGURE_ARGS += --with-num-cores=$(NJOBS) +++endif +++ +++# FIXME: upstream says the extra flags are not designed for general purpose ... +++# http://mail.openjdk.java.net/pipermail/jdk8u-dev/2014-July/001389.html +++ +++# FIXME: demos fail to build with these ... +++# FIXME: zero ftbfs without -fpermissive +++#src/cpu/zero/vm/cppInterpreter_zero.cpp:732:30: error: invalid conversion from 'intptr_t {aka long int}' to 'const void*' [-fpermissive] +++# object = (oop) locals[0]; +++# ^ +++ +++#COMMON_CONFIGURE_ARGS += \ +++ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ +++ --with-extra-cxxflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CXXFLAGS_HS)' \ +++ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' +++ +++ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ DEFAULT_CONFIGURE_ARGS += \ +++ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ +++ --with-extra-cxxflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CXXFLAGS_HS)' \ +++ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' +++else +++ DEFAULT_CONFIGURE_ARGS += \ +++ --with-extra-cflags='$(EXTRA_CPPFLAGS_ZERO) $(EXTRA_CFLAGS_ZERO)' \ +++ --with-extra-cxxflags='$(EXTRA_CPPFLAGS_ZERO) $(EXTRA_CXXFLAGS_ZERO)' \ +++ --with-extra-ldflags='$(EXTRA_LDFLAGS_ZERO)' +++endif +++ +++ZERO_CONFIGURE_ARGS += \ +++ --with-extra-cflags='$(EXTRA_CPPFLAGS_ZERO) $(EXTRA_CFLAGS_ZERO)' \ +++ --with-extra-cxxflags='$(EXTRA_CPPFLAGS_ZERO) $(EXTRA_CXXFLAGS_ZERO)' \ +++ --with-extra-ldflags='$(EXTRA_LDFLAGS_ZERO)' +++ +++ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) +++ COMMON_CONFIGURE_ARGS += \ +++ --build=$(DEB_BUILD_GNU_TYPE) \ +++ --host=$(DEB_HOST_GNU_TYPE) \ +++ --target=$(DEB_HOST_GNU_TYPE) \ +++ BUILD_CC=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CC)) \ +++ BUILD_LD=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CC)) \ +++ BUILD_CXX=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CXX)) \ +++ +++endif +++ +++# (most) jre and jdk tools handled by the alternatives system. +++# dups in heimdal-clients, krb5-user: kinit, klist, ktab, no alternatives +++# have jrunscript in the jdk packages +++ +++all_tools = jar jarsigner java javac javadoc javap jcmd \ +++ jconsole jdb jdeprscan jdeps jfr jimage jinfo jlink jmap \ +++ jmod jpackage jps jrunscript jshell jstack jstat jstatd jwebserver \ +++ keytool rmiregistry serialver +++ +++jdk_hl_tools = jar jarsigner javac javadoc javap jcmd jdb \ +++ jdeprscan jdeps jfr jimage jinfo jlink jmap jmod jps \ +++ jrunscript jshell jstack jstat jstatd jwebserver serialver +++ifeq (,$(filter $(DEB_HOST_ARCH), alpha armel armhf ia64 loong64 m68k mips mipsel mips64el powerpc s390x sh4 sparc64 x32)) +++ all_tools += jhsdb +++ jdk_hl_tools += jhsdb +++endif +++ +++ifeq ($(DEB_HOST_ARCH),armhf) +++ ifneq (,$(filter armhf,$(hotspot_archs))) +++ all_tools += jhsdb +++ jdk_hl_tools += jhsdb +++ endif +++endif +++ +++jdk_tools = jconsole +++ +++all_jre_tools = $(filter-out $(jdk_hl_tools) $(jdk_tools), $(all_tools)) +++# no tools in $(p_jre) +++jre_tools = +++jre_hl_tools := $(filter-out $(jre_tools), $(all_jre_tools)) +++ +++# build dependencies +++ifneq (,$(filter $(distrel),precise)) +++ bd_bootstrap = openjdk-20-jdk-headless | openjdk-21-jdk-headless, +++else ifneq (,$(filter $(distrel),stretch buster bullseye bookworm trusty xenial bionic focal jammy)) +++ bd_bootstrap = openjdk-20-jdk-headless:native | openjdk-21-jdk-headless:native, +++else +++ bd_bootstrap = openjdk-21-jdk-headless:native | openjdk-20-jdk-headless:native, +++endif +++ +++ifeq (,$(filter $(distrel),squeeze wheezy jessie precise trusty xenial)) +++ bd_cross += \ +++ $(basename)-jdk-headless , +++else +++ bd_cross += \ +++ file, +++endif +++ +++ifneq (,$(filter $(distrel),squeeze wheezy jessie precise trusty)) +++ old_debhelper = veryold +++ bd_debhelper = debhelper (>= 9), +++else ifneq (,$(filter $(distrel), stretch xenial)) +++ old_debhelper = old +++ bd_debhelper = debhelper (>= 9.20141010), dpkg-dev (>= 1.17.14), +++else +++ bd_debhelper = debhelper (>= 11), +++endif +++ +++ifneq (,$(filter $(distrel),precise)) +++ bd_autotools = autoconf2.69, automake, autotools-dev, +++else ifneq (,$(filter $(old_debhelper), old veryold)) +++ bd_autotools = autoconf, automake, autotools-dev, +++else +++ bd_autotools = autoconf, automake, +++endif +++ +++ifneq (,$(filter $(distrel),precise)) +++ bd_syslibs = zlib1g-dev, libattr1-dev, +++else +++ bd_syslibs = zlib1g-dev:native, zlib1g-dev, libattr1-dev, +++endif +++ifneq (,$(filter $(distrel),squeeze lucid)) +++ bd_syslibs += libpng12-dev, libjpeg62-dev, +++else ifneq (,$(filter $(distrel),wheezy precise quantal raring saucy)) +++ bd_syslibs += libpng-dev, libjpeg8-dev, +++else +++ bd_syslibs += libpng-dev, libjpeg-dev, +++endif +++bd_syslibs += \ +++ libgif-dev, +++bd_openjdk = \ +++ libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, \ +++ libasound2-dev, liblcms2-dev, \ +++ libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libxrandr-dev, \ +++ libelf-dev, +++ifeq ($(enable_hsdis),yes) +++ bd_openjdk += binutils-dev, libiberty-dev, +++endif +++# not needed? +++#bd_openjdk += libgtk-3-0, +++#bd_openjdk += libgtk-3-0t64, +++ifneq (,$(filter $(distrel),jessie stretch buster precise trusty xenial bionic focal)) +++ bd_openjdk += libfontconfig1-dev, +++else +++ bd_openjdk += libfontconfig-dev, +++endif +++ifneq (,$(filter $(distrel),jessie stretch buster precise trusty xenial bionic)) +++ bd_openjdk += libfreetype6-dev, +++else +++ bd_openjdk += libfreetype-dev, +++endif +++ifeq ($(with_system_hb),yes) +++ bd_openjdk += libharfbuzz-dev, +++endif +++ +++ifeq (,$(filter $(distrel),precise)) +++ bd_zero = libffi-dev, libffi-dev:native, +++else +++ bd_zero = libffi-dev, +++endif +++ +++bd_ant = ant, ant-optional, +++ +++bd_fastjar = fastjar (>= 2:0.96-0ubuntu2), +++ +++ifneq (,$(filter $(distrel), wheezy jessie stretch buster bullseye bionic focal jammy)) +++ bd_pkgconf = pkg-config, +++else +++ bd_pkgconf = pkgconf, +++endif +++ +++ifeq ($(with_nss),yes) +++ ifneq (,$(filter $(distrel),squeeze lucid precise quantal)) +++ bd_nss = libnss3-dev (>= 3.12.3), +++ else ifneq (,$(filter $(distrel),wheezy raring saucy trusty)) +++ bd_nss = libnss3-dev (>= 2:3.12.3), +++ else +++ bd_nss = libnss3-dev (>= 2:3.17.1), +++ endif +++endif +++bd_systemtap = systemtap-sdt-dev [!sh4], +++ +++ifeq (,$(filter $(distrel),jessie stretch buster precise trusty xenial bionic focal groovy)) +++ with_debugedit = yes +++ bd_debugedit = debugedit (>= 4.16), +++ build_id_seed = $(PKGSOURCE)-$(PKGVERSION) +++endif +++ +++ifeq (,$(filter $(distrel),jessie stretch buster precise trusty xenial bionic)) +++ bd_strip_ndt = strip-nondeterminism, +++endif +++ +++ifeq (,$(filter $(distrel),precise)) +++ nocheck_profile = $(EMPTY) +++endif +++ +++# look at all TEST.ROOT for the required jtreg version, sorted by newest +++min_jtreg_version := $(shell find test/ -name TEST.ROOT -exec grep -hr "^requiredVersion=" {} \; | sed -e 's:^requiredVersion=::' -e 's:$$:~:' | sort -uVr | head -n1 | tr ' ' '-') +++ +++jtreg_dep := $(jtreg_pkg) (>= $(min_jtreg_version)) +++testng_dep := $(testng_pkg) +++ +++ifeq ($(with_check),yes) +++ bd_check = \ +++ $(jtreg_dep)$(nocheck_profile), $(testng_dep)$(nocheck_profile), \ +++ xvfb$(nocheck_profile), xauth$(nocheck_profile), \ +++ xfonts-base$(nocheck_profile), libgl1-mesa-dri [!x32]$(nocheck_profile), \ +++ xfwm4$(nocheck_profile), x11-xkb-utils$(nocheck_profile), \ +++ dbus-x11$(nocheck_profile), libasmtools-java$(nocheck_profile), \ +++ xvfb $(nocheck_profile), +++else +++ bd_check = file, +++endif +++ +++dlopen_hl_depends = +++dlopen_hl_recommends = +++ +++ifeq (,$(filter $(distrel),squeeze wheezy jessie stretch buster bullseye bookworm lucid precise trusty xenial bionic focal jammy lunar mantic)) +++ t64_suffix = t64 +++endif +++dlopen_hl_recommends += libcups2$(t64_suffix), +++dlopen_hl_depends += liblcms2-2, +++ +++ifeq ($(derivative),Ubuntu) +++ ifneq (,$(filter $(distrel),lucid)) +++ dlopen_hl_depends += libjpeg62, +++ else +++ dlopen_hl_depends += libjpeg8, +++ endif +++else +++ ifneq (,$(filter $(distrel),squeeze)) +++ dlopen_hl_depends += libjpeg62, +++ else +++ dlopen_hl_depends += libjpeg62-turbo, +++ endif +++endif +++dlopen_hl_recommends += libfontconfig1, +++ifneq ($(with_nss),no) +++ ifneq (,$(filter $(distrel),squeeze lucid precise)) +++ dlopen_hl_depends += , libnss3-1d (>= 3.12.3) +++ else ifneq (,$(filter $(distrel),wheezy quantal raring saucy trusty)) +++ dlopen_hl_depends += , libnss3 (>= 2:3.12.3) +++ else +++ dlopen_hl_depends += , libnss3 (>= 2:3.17.1) +++ endif +++endif +++ +++dlopen_jre_depends = +++dlopen_jre_recommends = +++dlopen_jre_depends += libglib2.0-0$(t64_suffix), +++dlopen_jre_depends += libgtk-3-0$(t64_suffix), +++dlopen_jre_depends += libxrandr2, libxinerama1, +++ifneq (,$(filter $(distrel),squeeze wheezy jessie stretch lucid precise xenial)) +++ dlopen_jre_depends += libgl1-mesa-glx | libgl1, +++else +++ dlopen_jre_depends += libgl1, +++endif +++ifeq ($(with_system_hb),yes) +++ dlopen_jre_depends += libharfbuzz0b, +++endif +++ifeq (,$(findstring libcups, $(dlopen_hl_depends))) +++ dlopen_jre_depends += libcups2$(t64_suffix), +++endif +++ifeq (,$(findstring libfontconfig, $(dlopen_hl_depends))) +++ dlopen_jre_depends += libfontconfig1, +++endif +++ +++# .desktop files need to be multiarch installable +++java_launcher = /$(basedir)/bin/java +++java_launcher = /usr/bin/java +++ifeq ($(derivative),Ubuntu) +++ java_launcher = cautious-launcher %f /$(basedir)/bin/java +++ java_launcher = cautious-launcher %f /usr/bin/java +++endif +++ +++ifneq (,$(filter $(distrel),squeeze wheezy lucid precise quantal raring)) +++ core_fonts = ttf-dejavu-extra +++else +++ core_fonts = fonts-dejavu-extra +++endif +++ifneq (,$(filter $(distrel),squeeze lucid)) +++ cjk_fonts = ttf-baekmuk | ttf-unfonts | ttf-unfonts-core, +++ cjk_fonts += ttf-sazanami-gothic | ttf-kochi-gothic, +++ cjk_fonts += ttf-sazanami-mincho | ttf-kochi-mincho, +++else +++ cfk_fonts = fonts-nanum, +++ cjk_fonts += fonts-ipafont-gothic, fonts-ipafont-mincho, +++endif +++cjk_fonts += $(if $(with_wqy_zenhai),fonts-wqy-microhei | fonts-wqy-zenhei,fonts-arphic-uming), +++ifneq (,$(filter $(distrel),squeeze wheezy)) +++ cjk_fonts += ttf-indic-fonts, +++else ifneq (,$(filter $(distrel), lucid maverick natty oneiric precise quantal raring saucy trusty)) +++ cjk_fonts += ttf-indic-fonts-core, ttf-telugu-fonts, ttf-oriya-fonts, +++ cjk_fonts += ttf-kannada-fonts, ttf-bengali-fonts, +++else +++ cjk_fonts += fonts-indic, +++endif +++ +++jrehl_breaks = clojure1.8 (<= 1.8.0-7ubuntu1~), +++ifneq (,$(filter $(distrel),buster sid bionic cosmic disco eoan)) +++ jrehl_breaks += \ +++ jetty9 (<< 9.4.15-1~), netbeans (<< 10.0-3~), visualvm (<< 1.4.2-2~), \ +++ eclipse-platform (<< 3.8.1-11), eclipse-rcp (<< 3.8.1-11), \ +++ libequinox-osgi-java (<< 3.9.1), +++endif +++ifneq (,$(filter $(distrel),bionic cosmic disco eoan)) +++ jrehl_breaks += \ +++ tomcat8 (<< 8.5.39-1ubuntu1~), +++endif +++ifneq (,$(filter $(distrel),buster sid)) +++ jrehl_breaks += \ +++ libreoffice-core (<< 1:6.1.5-2~), +++else ifneq (,$(filter $(distrel),disco)) +++ jrehl_breaks += \ +++ libreoffice-core (<< 1:6.2.2-0ubuntu2), +++endif +++ +++p_jre = $(basename)-jre +++p_jrehl = $(basename)-jre-headless +++p_jrez = $(basename)-jre-zero +++p_jdkhl = $(basename)-jdk-headless +++p_jdk = $(basename)-jdk +++p_demo = $(basename)-demo +++p_src = $(basename)-source +++p_doc = $(basename)-doc +++p_dbg = $(basename)-dbg +++p_test = $(basename)-testsupport +++ +++d = debian/tmp +++d_jre = debian/$(p_jre) +++d_jrehl = debian/$(p_jrehl) +++d_jrez = debian/$(p_jrez) +++d_jdkhl = debian/$(p_jdkhl) +++d_jdk = debian/$(p_jdk) +++d_demo = debian/$(p_demo) +++d_src = debian/$(p_src) +++d_doc = debian/$(p_doc) +++d_dbg = debian/$(p_dbg) +++d_test = debian/$(p_test) +++ +++control_vars = \ +++ '-Vvm:Name=$(vm_name)' \ +++ '-Vvm:Version=$(shortver)' \ +++ '-Vdlopenhl:Depends=$(dlopen_hl_depends)' \ +++ '-Vdlopenhl:Recommends=$(dlopen_hl_recommends)' \ +++ '-Vdlopenjre:Depends=$(dlopen_jre_depends)' \ +++ '-Vdlopenjre:Recommends=$(dlopen_jre_recommends)' \ +++ +++ifeq ($(with_bridge),atk) +++ control_vars += '-Vbridge:Recommends=libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2)' +++else ifeq ($(with_bridge),yes) +++ ifneq (,$(DEB_HOST_MULTIARCH)) +++ control_vars += '-Vbridge:Recommends=libaccess-bridge-java-jni (>= 1.26.2-6)' +++ else ifeq ($(with_jni_bridge),yes) +++ control_vars += '-Vbridge:Recommends=libaccess-bridge-java-jni' +++ else +++ control_vars += '-Vbridge:Recommends=libaccess-bridge-java' +++ endif +++endif +++ +++ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ control_vars += '-Vdefaultvm:Provides=$(p_jre)-zero' +++endif +++ +++pkg_certs = ca-certificates-java +++ifneq (,$(filter $(distrel), squeeze wheezy jessie stretch precise trusty xenial bionic cosmic disco)) +++ control_vars += '-Vcacert:Depends=$(pkg_certs)' +++else +++ control_vars += '-Vcacert:Depends=$(pkg_certs) (>= 20190405~)' +++endif +++ +++ifneq (,$(filter $(distrel), squeeze wheezy jessie lucid precise quantal raring saucy trusty utopic vivid)) +++ control_vars += '-Vmountpoint:Depends=initscripts' +++else +++ control_vars += '-Vmountpoint:Depends=util-linux (>= 2.26.2-4)' +++endif +++ +++pkg_jcommon = java-common (>= 0.28) +++control_vars += '-Vjcommon:Depends=$(pkg_jcommon)' +++ +++control_vars += '-Vjrehl:Breaks=$(jrehl_breaks)' +++ +++ifneq ($(with_debugedit),yes) +++ control_vars += '-Vdbg:Conflicts=openjdk-11-dbg, openjdk-12-dbg, openjdk-13-dbg, openjdk-14-dbg, openjdk-15-dbg, openjdk-16-dbg' +++endif +++ +++debian/control: debian/control.in debian/tests/control debian/rules debian/watch +++ @cp -p debian/control debian/control.old +++ sed \ +++ -e 's/@basename@/$(basename)/g' \ +++ -e 's/@bd_autotools@/$(bd_autotools)/g' \ +++ -e 's/@bd_bootstrap@/$(strip $(bd_bootstrap))/g' \ +++ -e 's/@bd_cross@/$(strip $(bd_cross))/g' \ +++ -e 's/@bd_debhelper@/$(strip $(bd_debhelper))/g' \ +++ -e 's/@bd_openjdk@/$(bd_openjdk)/g' \ +++ -e 's/@bd_zero@/$(bd_zero)/g' \ +++ -e 's/@bd_gcc@/$(bd_gcc)/g' \ +++ -e 's/@bd_syslibs@/$(bd_syslibs)/g' \ +++ -e 's/@bd_pkgconf@/$(bd_pkgconf)/g' \ +++ -e 's/@bd_fastjar@/$(bd_fastjar)/g' \ +++ -e 's/@bd_nss@/$(bd_nss)/g' \ +++ -e 's/@bd_systemtap@/$(bd_systemtap)/g' \ +++ -e 's/@bd_ant@/$(bd_ant)/g' \ +++ -e 's/@bd_debugedit@/$(bd_debugedit)/g' \ +++ -e 's/@bd_strip_ndt@/$(bd_strip_ndt)/g' \ +++ -e 's/@bd_check@/$(bd_check)/g' \ +++ -e 's/@jtreg_dep@/$(jtreg_dep)/g' \ +++ -e 's/@testng_dep@/$(testng_dep)/g' \ +++ -e 's/@core_fonts@/$(core_fonts)/g' \ +++ -e 's/@cjk_fonts@/$(cjk_fonts)/g' \ +++ -e 's/@any_archs@/$(any_archs)/g' \ +++ -e 's/@hotspot_archs@/$(hotspot_archs)/g' \ +++ -e 's/@altzero_archs@/$(altzero_archs)/g' \ +++ debian/control.in \ +++ $(if $(altzero_archs), debian/control.zero-jre) \ +++ $(if $(DEB_HOST_MULTIARCH),,| grep -v '^Multi-Arch') \ +++ > debian/control +++ sed -i 's/[[:blank:]]*$$//' debian/control +++ @if cmp -s debian/control debian/control.old; then \ +++ rm -f debian/control.old; \ +++ else \ +++ diff -u debian/control.old debian/control | wdiff -d -; \ +++ echo "debian/control did change, please restart the build"; \ +++ rm -f debian/control.old; \ +++ exit 1; \ +++ fi +++ +++debian/tests/control: debian/tests/control.in debian/rules +++ sed \ +++ -e 's/@jtreg_dep@/$(jtreg_dep)/g' \ +++ -e 's/@testng_dep@/$(testng_dep)/g' \ +++ -e 's/@basename@/$(basename)/g' \ +++ $< > $@; +++ +++debian/tests/%.sh: debian/tests/%.in debian/rules +++ sed \ +++ -e 's/@basename@/$(basename)/g' \ +++ -e 's,@JDK_DIR@,/$(basedir),g' \ +++ -e 's,@jtreg_pkg@,$(jtreg_pkg),g' \ +++ -e 's/@jtreg_archs@/$(jtreg_archs)/g' \ +++ -e 's:@doc_dir@:/usr/share/doc/$(p_jrehl)/:g' \ +++ $< > $@; +++ chmod +x $@ +++ +++gen-autopkgtests: debian/tests/jtdiff-autopkgtest.sh \ +++ debian/tests/jtreg-autopkgtest.sh \ +++ debian/tests/jdk-autopkgtest.sh \ +++ debian/tests/hotspot-autopkgtest.sh \ +++ debian/tests/dependencies.sh \ +++ debian/tests/write-problems.sh +++ +++packaging-files: +++ for f in debian/*.in; do \ +++ case "$$f" in debian/control.in|debian/watch.in) continue; esac; \ +++ f2=$$(echo $$f | sed 's/JB/$(basename)/;s/\.in$$//'); \ +++ sed -e 's/@JRE@/$(p_jre)/g' \ +++ -e 's/@JDK@/$(p_jdk)/g' \ +++ -e 's/@vendor@/$(Vendor)/g' \ +++ -e 's/@RELEASE@/$(shortver)/g' \ +++ -e 's/@basename@/$(basename)/g' \ +++ -e 's,@TOP@,$(TOP),g' \ +++ -e 's,@basedir@,$(basedir),g' \ +++ -e 's,@etcdir@,$(etcdir),g' \ +++ -e 's,@jdiralias@,$(jdiralias),g' \ +++ -e 's,@jdirname@,$(jdirname),g' \ +++ -e 's/@srcname@/$(srcname)/g' \ +++ -e 's/@jvmarch@/$(jvmarch)/g' \ +++ -e 's/@tag@/$(tag)/g' \ +++ -e 's/@priority@/$(priority)/g' \ +++ -e 's/@mantag@/$(mantag)/g' \ +++ -e 's/@multiarch@/$(DEB_HOST_MULTIARCH)/g' \ +++ -e 's/@jre_hl_tools@/$(jre_hl_tools)/g' \ +++ -e 's/@jre_tools@/$(jre_tools)/g' \ +++ -e 's/@jdk_hl_tools@/$(jdk_hl_tools)/g' \ +++ -e 's/@jdk_tools@/$(jdk_tools)/g' \ +++ -e 's/@corba_tools@/$(corba_tools)/g' \ +++ -e 's,@j2se_lib@,$(j2se_lib),g' \ +++ -e 's,@j2se_share@,$(j2se_share),g' \ +++ -e 's,@java_launcher@,$(java_launcher),g' \ +++ -e 's/@cjk_fonts@/$(cjk_fonts)/g' \ +++ $$f > $$f2; \ +++ done +++ +++configure: stamps/configure +++stamps/configure: stamps/unpack +++ @echo '========== $@ ==========' +++ @echo "Build options: $(DEB_BUILD_OPTIONS), Processors: $$(nproc)" +++ @echo '========== $@ ==========' +++ -cat /proc/meminfo |egrep '^(Mem|Swap)' +++ @echo '========== $@ ==========' +++ -cat /etc/hosts +++ @echo '========== $@ ==========' +++ -cat /etc/fstab +++ @echo '========== $@ ==========' +++ -cat /etc/mtab +++ @echo '========== $@ ==========' +++ -cat /proc/mounts +++ @echo '========== $@ ==========' +++ +++ mkdir -p bin +++ifeq (0,1) +++ifeq (,$(filter $(DEB_HOST_ARCH), alpha arc amd64 arm64 hppa ia64 loong64 m68k mips64 mips64el ppc64 ppc64el s390x sparc64 x32)) +++ ( \ +++ echo '#! /bin/sh'; \ +++ echo 'if [ -x /usr/bin/linux32 ]; then'; \ +++ echo ' exec /usr/bin/linux32 /bin/uname "$$@"'; \ +++ echo 'else'; \ +++ echo ' exec /bin/uname "$$@"'; \ +++ echo 'fi'; \ +++ ) > bin/uname +++ chmod +x bin/uname +++ echo "UNAME checks" +++ uname -a +++endif +++endif +++ifneq (,$(filter $(distrel),precise)) +++ for i in autoreconf autoheader autoupdate autoscan autom4te ifnames autoconf; do \ +++ ln -sf /usr/bin/$${i}2.69 bin/$${i}; \ +++ done +++endif +++ command -v autoconf +++ /bin/uname -a +++ lsb_release -a +++ +++ -cat /proc/sys/kernel/random/entropy_avail +++ +++ mkdir -p stamps +++ rm -rf $(builddir) +++ mkdir -p $(builddir) +++# bash make/autoconf/autogen.sh +++ cd $(builddir) && $(EXTRA_BUILD_ENV) bash ../configure \ +++ $(DEFAULT_CONFIGURE_ARGS) \ +++ $(COMMON_CONFIGURE_ARGS) +++ +++ touch $@ +++ +++stamps/zero-configure: stamps/build stamps/unpack +++ @echo '========== $@ ==========' +++ mkdir -p stamps +++ rm -rf $(zbuilddir) +++ mkdir -p $(zbuilddir) +++ $(if $(ZERO_CC), export CC=$(ZERO_CC); export CXX=$(ZERO_CXX);) \ +++ cd $(zbuilddir) && $(EXTRA_BUILD_ENV) bash ../configure \ +++ $(ZERO_CONFIGURE_ARGS) \ +++ $(COMMON_CONFIGURE_ARGS) +++ +++ touch $@ +++ +++stamps/unpack: +++ : # apply some architecture specific patches ... +++#ifeq ($(DEB_HOST_ARCH),alpha) +++# patch -p1 < debian/patches/alpha-float-const.diff +++#endif +++ +++ $(MAKE) -f debian/rules packaging-files +++ +++ mkdir -p stamps +++ touch $@ +++ +++ifeq ($(with_check),yes) +++ ifneq (,$(filter $(DEB_HOST_ARCH), $(jtreg_archs))) +++ with_jtreg_check = $(default_vm) +++ endif +++ +++ ifneq (,$(filter zero, $(alternate_vms))) +++ ifneq (,$(filter $(DEB_HOST_ARCH), arm64 amd64 i386)) +++ # only activate after testing; hangs several tests. +++ with_jtreg_check += zero +++ endif +++ endif +++endif +++ +++build_stamps = \ +++ stamps/build \ +++ $(if $(filter $(DEB_HOST_ARCH),$(altzero_archs)),stamps/zero-build) +++ +++build_stamps += stamps/jtreg-check-default +++ +++pre-build: +++ifeq ($(with_check),yes) +++ jtreg_version="$$(dpkg-query -f '$${Version}\n' -W $(jtreg_pkg))"; \ +++ if ! dpkg --compare-versions $(min_jtreg_version) le $$jtreg_version; then \ +++ echo "Error: testsuite requires jtreg $(min_jtreg_version) but $$jtreg_version is installed"; \ +++ echo "Please update the jtreg dependency and regenerate debian/control"; \ +++ false; \ +++ fi +++endif +++ifneq (,$(filter $(DEB_HOST_ARCH),s390)) +++ @echo explicitely fail the build for $(DEB_HOST_ARCH), patches not updated +++#else ifneq (,$(filter $(DEB_HOST_ARCH),armel)) +++# @echo explicitely fail the build for $(DEB_HOST_ARCH), ARM assembler interpreter not yet ported +++ false +++endif +++ +++build-arch: build +++build-indep: build stamps/build-docs +++build: pre-build $(build_stamps) +++ if [ -f buildwatch.pid ]; then \ +++ pid=$$(cat buildwatch.pid); \ +++ kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \ +++ fi +++ rm -f buildwatch.pid +++ +++stamps/build: stamps/configure +++ @echo '========== $@ ==========' +++ifneq (,$(filter $(DEB_HOST_ARCH), alpha armel armhf ia64 loong64 m68k mips mipsel mips64 mips64el powerpc riscv64 s390x sh4 sparc sparc64)) +++ sh -c 'sh debian/buildwatch.sh $(CURDIR)/$(builddir) &' +++endif +++ if $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(builddir) $(build_target); then \ +++ : ; \ +++ else \ +++ if [ -f buildwatch.pid ]; then \ +++ pid=$$(cat buildwatch.pid); \ +++ kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \ +++ fi; \ +++ false; \ +++ fi +++ +++ touch $@ +++ +++stamps/zero-build: stamps/zero-configure +++ @echo '========== $@ ==========' +++ : # FIXME: build using the just built jdk, and build the vm only +++ $(EXTRA_BUILD_ENV) $(MAKE) --no-print-directory -C $(zbuilddir) $(zbuild_target) +++ rm -rf $(builddir)/$(sdkimg)/lib/zero +++ cp -a $(zbuilddir)/$(zsdkimg)/lib/zero \ +++ $(builddir)/$(sdkimg)/lib/. +++ touch $@ +++ +++stamps/build-docs: stamps/build +++ @echo '========== $@ ==========' +++ mkdir -p $(builddir)/images/docs +++ echo ' ' > $(builddir)/images/docs/index.html +++ifeq ($(with_docs),yes) +++ LOG=trace $(MAKE) -C $(builddir) docs +++endif +++ touch $@ +++ +++stamps/jtreg-check-default: stamps/build +++ $(MAKE) -f debian/rules jtreg-run-check VMNAME=$(default_vm) VMARGS= \ +++ $(if $(filter $(default_vm),hotspot),TEST_SUITES='hotspot langtools jaxp jdk',TEST_SUITES='hotspot langtools jaxp') +++# TEST_SUITES='hotspot langtools jaxp' +++ touch $@ +++ +++stamps/jtreg-check-zero: stamps/build +++ $(MAKE) -f debian/rules jtreg-run-check VMNAME=zero VMARGS='-vmoption:-zero' \ +++ TEST_SUITES='hotspot langtools jaxp' +++ touch $@ +++ +++jtreg-run-check: +++ mkdir -p jtreg-test-output +++ifneq (,$(filter $(VMNAME), $(with_jtreg_check))) +++ if [ ! -f $(builddir)/$(sdkimg)/conf/security/java.security.install ]; then \ +++ fgrep -v 'sun.security.pkcs11' $(builddir)/$(sdkimg)/conf/security/java.security \ +++ > $(builddir)/$(sdkimg)/conf/security/java.security.test; \ +++ mv $(builddir)/$(sdkimg)/conf/security/java.security \ +++ $(builddir)/$(sdkimg)/conf/security/java.security.install; \ +++ mv $(builddir)/$(sdkimg)/conf/security/java.security.test \ +++ $(builddir)/$(sdkimg)/conf/security/java.security; \ +++ fi +++ +++ @echo "BEGIN jtreg" +++ $(TIME) $(MAKE) -f debian/rules -k jtregcheck \ +++ $(if $(TEST_SUITES),TEST_SUITES="$(TEST_SUITES)") \ +++ JTREG_OPTIONS='$(VMARGS)' \ +++ 2>&1 | tee jtreg-test-output/jtreg_output-$(VMNAME) +++ @echo "END jtreg" +++ +++ if [ -f $(builddir)/$(sdkimg)/conf/security/java.security.install ]; then \ +++ mv $(builddir)/$(sdkimg)/conf/security/java.security.install \ +++ $(builddir)/$(sdkimg)/conf/security/java.security; \ +++ fi +++ +++ for i in check-hotspot.log check-jaxp.log check-jdk.log check-langtools.log jtreg-summary.log; do \ +++ if [ -f jtreg-test-output/$$i ]; then \ +++ mv jtreg-test-output/$$i jtreg-test-output/$${i%*.log}-$(VMNAME).log; \ +++ else \ +++ mkdir -p jtreg-test-output; \ +++ fi; \ +++ done +++ +++ @echo "BEGIN jtreg-summary-$(VMNAME)" +++ -cat jtreg-test-output/jtreg-summary-$(VMNAME).log +++ @echo "END jtreg-summary-$(VMNAME)" +++ +++ -for i in hotspot langtools jaxp jdk; do \ +++ find jtreg-test-output/$$i/JTwork/ -name '*.jtr'; \ +++ done | sort -u > jtreg-test-output/failed_tests-$(VMNAME).list; \ +++ GZIP=-9vn tar --ignore-failed-read -C . -c -z -f jtreg-test-output/failed_tests-$(VMNAME).tar.gz -T jtreg-test-output/failed_tests-$(VMNAME).list +++ GZIP=-9vn tar -C . -c -z -f jtreg-test-output/jtreport-$(VMNAME).tar.gz $$(find jtreg-test-output -name JTreport) +++else +++ echo "jtreg harness not run for this build" > jtreg-test-output/jtreg_output-$(VMNAME) +++endif +++ +++# ---------------------------------------------------------------------------- +++# jtreg targets taken from IcedTea +++ +++TESTS_TO_RUN = $(addprefix check-,$(TEST_SUITES)) +++ +++check-hotspot: stamps/build +++ @echo '===== START $@ =====' +++ mkdir -p jtreg-test-output/hotspot +++ BOOTJDK_HOME=$(BOOTJDK_HOME) JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ +++ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ +++ $(TIME) debian/tests/hotspot | tee jtreg-test-output/$@.log +++ @echo '===== END $@ =====' +++ +++check-langtools: stamps/build +++ @echo '===== START $@ =====' +++ mkdir -p jtreg-test-output/langtools +++ BOOTJDK_HOME=$(BOOTJDK_HOME) JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ +++ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ +++ $(TIME) debian/tests/langtools | tee jtreg-test-output/$@.log +++ @echo '===== END $@ =====' +++ +++check-jaxp: stamps/build +++ @echo '===== START $@ =====' +++ mkdir -p jtreg-test-output/jaxp +++ BOOTJDK_HOME=$(BOOTJDK_HOME) JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ +++ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ +++ $(TIME) debian/tests/jaxp | tee jtreg-test-output/$@.log +++ @echo '===== END $@ =====' +++ +++check-jdk: stamps/build +++ @echo '===== START $@ =====' +++ mkdir -p jtreg-test-output/jdk +++ BOOTJDK_HOME=$(BOOTJDK_HOME) JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ +++ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ +++ $(TIME) debian/tests/jdk | tee jtreg-test-output/$@.log +++ @echo '===== END $@ =====' +++ +++jtregcheck: $(TESTS_TO_RUN) +++ for i in $(TEST_SUITES); do \ +++ echo "--------------- jtreg console summary for $$i ---------------"; \ +++ egrep -v '^(Passed:|Directory|Re[a-z]+\ written\ to)' jtreg-test-output/check-$$i.log; \ +++ done | tee jtreg-test-output/jtreg-summary.log +++ +++# ---------------------------------------------------------------------------- +++ +++clean: debian-clean +++ dh_testdir +++ dh_testroot +++ rm -rf stamps build build-* jtreg-test-output +++ rm -rf autom4te.cache +++ rm -f bin/{jtreg.tmwrc,my-jtreg-run,my-xvfb-run,auto*,ifnames} +++ rm -f buildwatch.pid +++ rm -f config.log configure.log +++ dh_clean +++ +++debian-clean: +++ dh_testdir +++ dh_testroot +++ dh_prep +++ for f in debian/*.in; do \ +++ f2=$$(echo $$f | sed 's/JB/$(basename)/;s/\.in$$//'); \ +++ case "$$f2" in debian/control|debian/watch) continue; esac; \ +++ rm -f $$f2; \ +++ done +++ rm -f debian/*.install debian/*.links debian/*.debhelper.log +++ +++lib_ext_dirs = common $(sort $(foreach arch,$(arch_map),$(firstword $(subst =,$(SPACE),$(arch))))) +++ifeq ($(derivative),Ubuntu) +++ lib_ext_dirs := $(filter-out arm hppa m68k mips% s390% sh%, $(lib_ext_dirs)) +++else +++ lib_ext_dirs := $(filter-out arm hppa, $(lib_ext_dirs)) +++endif +++ +++install: packaging-files +++ dh_testdir +++ dh_testroot +++ dh_prep || dh_clean -k +++ rm -f debian/*.install debian/*.links +++ dh_installdirs +++ +++ @echo "all_jre_tools: $(all_jre_tools)" +++ @echo "jre_tools: $(jre_tools)" +++ @echo "jre_hl_tools: $(jre_hl_tools)" +++ @echo "all_jdk_tools: $(all_jdk_tools)" +++ @echo "jdk_tools: $(jdk_tools)" +++ +++ : # install into temporary location +++ mkdir -p $(d)/$(basedir) +++ cp -a $(builddir)/$(sdkimg)/* $(d)/$(basedir)/ +++ +++# copy jtreg tests +++ mkdir -p $(d)/$(testsuitedir) +++ cp -a $(builddir)/$(testimg)/* $(d)/$(testsuitedir) +++ rm -rf $(d)/$(testsuitedir)/jdk/demos +++ rm $(d)/$(testsuitedir)/build-info.properties +++ rm $(d)/$(testsuitedir)/Readme.txt +++ find $(d)/$(testsuitedir) -name .gitignore -delete +++ +++ chmod -R u+w $(d) +++ +++ : # use javaws from icedtea-netx +++ find $(d) -name 'javaws*' | xargs -r rm -f +++ +++ : # install default jvm config file +++ ls -l $(d)/$(basedir)/lib +++ cp debian/jvm.cfg-default $(d)/$(basedir)/lib/. +++ +++ : # compress manpages +++ find $(d)/$(basedir)/man -type f ! -type l | xargs gzip -9v -n +++ +++ifeq ($(with_debugedit),yes) +++ : # rewrite build-id +++ for i in $$(find $(d)/$(basedir) -type f | xargs -r file | sed -n '/ELF/s/:.*//p'); do \ +++ debugedit --build-id --build-id-seed='$(build_id_seed)' $$i; \ +++ done +++endif +++ +++ mkdir -p $(d)/$(etcdir)/security +++ mkdir -p $(d)/$(etcdir)/security/policy/limited +++ mkdir -p $(d)/$(etcdir)/security/policy/unlimited +++ mkdir -p $(d)/$(etcdir)/management +++ mkdir -p $(d)/$(etcdir)/jfr +++ +++ifeq (0,1) +++ : # rename templates (comments only) to config files, +++ : # and move to /$(etcdir) +++ for i in \ +++ conf/management/jmxremote.password \ +++ conf/management/snmp.acl \ +++ conf/sdp/sdp.conf; \ +++ do \ +++ mv $(d)/$(basedir)/$$i.template $(d)/$(etcdir)/$$i; \ +++ done +++else +++ : # FIXME: what to do about these? +++ for i in \ +++ conf/management/jmxremote.password \ +++ conf/management/snmp.acl \ +++ conf/sdp/sdp.conf; \ +++ do \ +++ rm -f $(d)/$(basedir)/$$i.template; \ +++ done +++endif +++ +++ifeq ($(with_bridge),atk) +++# only add releases that are known to work with atk +++# by default leave atk disabled +++# ifneq (,$(filter $(distrel),)) +++# cp -p debian/accessibility-atk.properties.enabled \ +++ $(d)/$(basedir)/conf/accessibility.properties +++# else +++ cp -p debian/accessibility-atk.properties.disabled \ +++ $(d)/$(basedir)/conf/accessibility.properties +++# endif +++else +++ cp -p debian/accessibility.properties $(d)/$(basedir)/conf/ +++endif +++ cp -p debian/swing.properties $(d)/$(basedir)/conf/ +++ +++ifneq (,$(pkg_certs)) +++ rm -f $(d)/$(basedir)/lib/security/cacerts +++endif +++ +++ : # FIXME: merge nss changes from IcedTea +++ cp debian/nss.cfg $(d)/$(basedir)/conf/security/nss.cfg +++ +++ : # move config files to $(etcdir) and symlink them. +++ rm -f $(d_jrehl).links +++ for i in \ +++ conf/accessibility.properties \ +++ conf/jaxp.properties \ +++ conf/logging.properties \ +++ conf/sound.properties \ +++ conf/net.properties \ +++ lib/psfontj2d.properties \ +++ lib/psfont.properties.ja \ +++ lib/jfr/default.jfc \ +++ lib/jfr/profile.jfc \ +++ conf/swing.properties \ +++ conf/management/jmxremote.access \ +++ conf/management/management.properties \ +++ conf/security/java.policy \ +++ conf/security/java.security \ +++ conf/security/policy/limited/default_local.policy \ +++ conf/security/policy/limited/exempt_local.policy \ +++ conf/security/policy/limited/default_US_export.policy \ +++ conf/security/policy/unlimited/default_local.policy \ +++ conf/security/policy/unlimited/default_US_export.policy \ +++ conf/security/policy/README.txt \ +++ $$([ -f $(d)/$(basedir)/conf/security/nss.cfg ] && echo conf/security/nss.cfg) \ +++ $(if $(findstring ca-cert,$(pkg_certs)),,lib/security/cacerts) \ +++ lib/security/default.policy \ +++ lib/security/blocked.certs \ +++ lib/security/public_suffix_list.dat; \ +++ do \ +++ dest=$$(echo $$i | sed 's,^[^/]*/,,'); \ +++ mv $(d)/$(basedir)/$$i $(d)/$(etcdir)/$$dest; \ +++ echo "$(etcdir)/$$dest $(basedir)/$$i" >> $(d_jrehl).links; \ +++ done +++ mv $(d)/$(basedir)/lib/jvm.cfg \ +++ $(d)/$(etcdir)/ +++ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) +++ printf -- '-zero KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg +++else +++ printf -- '-zero KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg +++ printf -- '-server ALIASED_TO -zero\n' >> $(d)/$(etcdir)/jvm.cfg +++endif +++ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386)) +++ printf -- '-dcevm KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg +++endif +++ +++ : # remove files which we do not want to distribute +++ +++ : # remove empty directories +++ +++ : # FIXME: fix, move and install tapset files +++ rm -rf $(d)/$(basedir)/tapset +++ +++ : # TODO: why do we provide a custom font.properties.ja? +++ : # cp -p debian/font.properties.ja $(d_jbin)/$(etcdir)/. +++# cp debian/font.properties.wqy_zenhai \ +++# $(d)/$(etcdir)/font.properties.ja +++ +++ +++ : # now move things to the packages. it is so ****** to create +++ : # .install files first. dh_movefiles did do the job perfectly +++ +++ : # $(p_jrehl).install / $(p_jre).install +++ ( \ +++ echo 'etc'; \ +++ echo '$(basedir)/lib/$(if $(filter $(DEB_HOST_ARCH),$(hotspot_archs)),server,zero)'; \ +++ echo '$(basedir)/lib/jvm.cfg-default'; \ +++ echo '$(basedir)/lib/libjli.so'; \ +++ echo '$(basedir)/lib/jexec'; \ +++ echo '$(basedir)/lib/jspawnhelper'; \ +++ echo '$(basedir)/lib/jrt-fs.jar'; \ +++ echo '$(basedir)/release'; \ +++ echo '$(basedir)/lib/tzdb.dat'; \ +++ echo '$(basedir)/lib/classlist'; \ +++ echo '$(basedir)/lib/modules'; \ +++ ) > debian/$(p_jrehl).install +++ifneq (,$(filter $(DEB_HOST_ARCH),i386)) +++ ifneq (,$(findstring --with-jvm-variants=client,$(DEFAULT_CONFIGURE_ARGS))) +++ echo '$(basedir)/lib/client' >> debian/$(p_jrehl).install +++ endif +++endif +++ifeq ($(derivative),Ubuntu) +++ ( \ +++ echo 'usr/share/apport/package-hooks'; \ +++ ) >> debian/$(p_jrehl).install +++endif +++ +++ $(RM) debian/$(p_jre).install +++ +++ : # jre binaries and man pages +++ for i in $(jre_hl_tools); do \ +++ case "$$i" in \ +++ *policytool*) p=debian/$(p_jre).install;; \ +++ *) p=debian/$(p_jrehl).install; \ +++ esac; \ +++ echo $(basedir)/bin/$$i >> $$p; \ +++ if [ -f $(d)/$(basedir)/man/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/man1/$$i.1.gz >> $$p; \ +++ fi; \ +++ if [ -f $(d)/$(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz >> $$p; \ +++ fi; \ +++ done +++ +++ cd $(CURDIR)/$(d); \ +++ for i in $(basedir)/lib/*.so; do \ +++ case "$$i" in \ +++ */libawt_xawt.so|*/libjawt.so|*/libsplashscreen.so|*/xawt) echo $$i >> ../$(p_jre).install;; \ +++ */hsdis*.so) ;; \ +++ */zero) echo $$i >> ../$(p_jrez).install;; \ +++ *) echo $$i >> ../$(p_jrehl).install; \ +++ esac; \ +++ done +++ +++ @echo XXXXX $(alternate_vms) +++ifneq (,$(filter zero, $(alternate_vms))) +++ echo '$(basedir)/lib/zero' >> debian/$(p_jrez).install +++endif +++ +++ : # $(p_jrehl).install +++ ( \ +++ echo '$(basedir)/legal'; \ +++ if [ -d $(d)/$(basedir)/man/ja ]; then \ +++ echo '$(basedir)/man/ja'; \ +++ fi; \ +++ ) >> debian/$(p_jrehl).install +++ +++ : # $(p_jdkhl).install +++ ( \ +++ for i in $(jdk_hl_tools); do \ +++ echo $(basedir)/bin/$$i; \ +++ if [ -f $(d)/$(basedir)/man/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/man1/$$i.1.gz; \ +++ fi; \ +++ if [ -f $(d)/$(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz; \ +++ fi; \ +++ done; \ +++ cd $(d); \ +++ for i in $(basedir)/include/*.h; do \ +++ case $$i in */jawt.h|*/jawt_md.h) continue; esac; \ +++ [ -h $$i ] && continue; \ +++ echo $$i; \ +++ done; \ +++ echo '$(basedir)/include/*/jni_md.h'; \ +++ echo '$(basedir)/jmods'; \ +++ echo '$(basedir)/lib/ct.sym'; \ +++ ) > debian/$(p_jdkhl).install +++ +++ : # $(p_jdk).install +++ ( \ +++ echo '$(basedir)/include/jawt.h'; \ +++ echo '$(basedir)/include/*/jawt_md.h'; \ +++ for i in $(jdk_tools); do \ +++ echo $(basedir)/bin/$$i; \ +++ if [ -f $(d)/$(basedir)/man/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/man1/$$i.1.gz; \ +++ fi; \ +++ if [ -f $(d)/$(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz ]; then \ +++ echo $(basedir)/man/ja_JP.UTF-8/man1/$$i.1.gz; \ +++ fi; \ +++ done; \ +++ ) > debian/$(p_jdk).install +++ +++ : # $(p_src).install +++ ( \ +++ echo '$(basedir)/lib/src.zip $(TOP)/$(basename)/lib'; \ +++ ) > debian/$(p_src).install +++ +++ : # copy apport hook +++ifeq ($(derivative),Ubuntu) +++ mkdir -p $(d)/usr/share/apport/package-hooks/ +++ cp debian/apport-hook.py $(d)/usr/share/apport/package-hooks/source_$(basename).py +++endif +++ +++ : # move demos and samples, create symlinks for $(p_demo) +++ mkdir -p $(d)/usr/share/doc/$(p_jrehl)/demo +++ for i in $(d)/$(basedir)/demo/*; do \ +++ b=$$(basename $$i); \ +++ case "$$i" in \ +++ */jvmti) \ +++ echo $(basedir)/demo/$$b usr/share/doc/$(p_jrehl)/demo/$$b >> $(d_demo).links;; \ +++ *) \ +++ mv $$i $(d)/usr/share/doc/$(p_jrehl)/demo/$$b; \ +++ echo usr/share/doc/$(p_jrehl)/demo/$$b $(basedir)/demo/$$b >> $(d_demo).links;; \ +++ esac; \ +++ done +++ echo usr/share/doc/$(p_jre) usr/share/doc/$(p_demo) >> $(d_demo).links +++ +++ : # $(p_demo).install +++ ( \ +++ echo '$(basedir)/demo'; \ +++ echo 'usr/share/doc/$(p_jrehl)/demo'; \ +++ ) > debian/$(p_demo).install +++ +++ : # $(p_test).install +++ ( \ +++ echo '$(testsuitedir)'; \ +++ ) > debian/$(p_test).install +++ +++ : # $(p_dbg).install +++ifneq (,$(wildcard $(builddir)/$(sdkimg)/lib/*.diz)) +++ ( \ +++ echo '$(basedir)/lib/*.diz'; \ +++ echo '$(basedir)/lib/*/*.diz'; \ +++ ) > debian/$(p_dbg).install +++endif +++ +++# the logic here -> move external debuginfo files into usr/lib/debug +++# check binaries and if the debuginfo is found, check if the binary has build id +++# debug information with build ids is moved under usr/lib/debug/.build-id +++# since we rewrite the build id with_debugedit=yes, patch the build id inside +++# the debug symbols file +++# otherwise (no buildid) just lib debuginfo file where it is +++ mkdir -p $(d)/usr/lib/debug +++ (cd $(d) && find . -path './$(basedir)/*' -name '*.debuginfo' | cpio -pdm usr/lib/debug/) +++ find $(d)/$(basedir)/ -name '*.debuginfo' -exec rm {} \; +++ echo > debian/$(p_dbg).install +++ for binary in `(cd $(d) && find . -path './$(basedir)/*' -print)`; do \ +++ dir=`dirname $$binary`; \ +++ base=`basename $$binary .so`; \ +++ debuginfo=usr/lib/debug/$$dir/$$base.debuginfo; \ +++ [ -f $(d)/$$debuginfo ] || continue; \ +++ $(OBJCOPY) --compress-debug-sections $(d)/$$debuginfo; \ +++ b_id=$$(LC_ALL=C readelf -n $(d)/$$binary | sed -n 's/ *Build ID: *\([0-9a-f][0-9a-f]*\)/\1/p'); \ +++ if [ -z "$$b_id" ]; then \ +++ echo $$debuginfo >> debian/$(p_dbg).install; \ +++ else \ +++ debugdir=usr/lib/debug/.build-id/$${b_id:0:2}; \ +++ f=$${b_id:2}.debug; \ +++ mkdir -p $(d)/$$debugdir; \ +++ mv $(d)/$$debuginfo $(d)/$$debugdir/$$f; \ +++ chmod 644 $(d)/$$debugdir/$$f; \ +++ echo $$debugdir/$$f >> debian/$(p_dbg).install; \ +++ notes=$$(mktemp); \ +++ $(OBJCOPY) --dump-section=.note.gnu.build-id=$$notes $(d)/$$binary; \ +++ $(OBJCOPY) --update-section=.note.gnu.build-id=$$notes $(d)/$$debugdir/$$f; \ +++ rm $$notes; \ +++ fi; \ +++ if [[ "$(DEB_BUILD_OPTIONS)" != *nostrip* ]]; then \ +++ $(OBJCOPY) --remove-section=.comment --remove-section=.note $(d)/$$binary; \ +++ if [[ "$$binary" != *.so ]]; then \ +++ $(STRIP) --strip-unneeded $(d)/$$binary; \ +++ fi; \ +++ fi; \ +++ done; +++ find $(d)/usr/lib/debug/ -type d -empty -delete +++ +++# add hsdis if we've built it to the -dbg package +++ifeq ($(enable_hsdis),yes) +++ echo $(basedir)/lib/hsdis-*.so >> debian/$(p_dbg).install +++endif +++ +++# : # FIXME: the targets are not installed ... +++# rm -rfv $(d)/$(basedir)/lib/jfr +++ +++ dh_install --sourcedir=debian/tmp -XLICENSE +++ifeq (,$(findstring old, $(old_debhelper))) +++ dh_missing --sourcedir=debian/tmp --fail-missing -XLICENSE +++endif +++ +++ find $(d_jrehl) $(d_jre) $(d_jrez) \ +++ \( -name '*.debuginfo' -o -name '*.diz' \) -print | xargs -r rm -f +++ +++ifeq (0,1) +++# FIXME: ext no longer supported +++ : # give all permissions to cross-VM extension directory +++ sed -i \ +++ -e '/permission java\.security\.AllPermission;/,/};/c\' \ +++ -e ' permission java.security.AllPermission;\' \ +++ -e '};\' \ +++ -e '\' \ +++ $(if $(DEB_HOST_MULTIARCH),$(foreach i, $(lib_ext_dirs), \ +++ -e 'grant codeBase "file:/$(TOP)/java-$(shortver)-$(origin)-$(i)/lib/ext/*" {\' \ +++ -e ' permission java.security.AllPermission;\' \ +++ -e '};\')) \ +++ -e '\' \ +++ -e '// Comment this out if you want to give all permissions to the\' \ +++ -e '// Debian Java repository too:\' \ +++ -e '//grant codeBase "file:/usr/share/java/repository/-" {\' \ +++ -e '// permission java.security.AllPermission;\' \ +++ -e '//};\' \ +++ -e '' \ +++ $(d_jrehl)/$(security)/java.policy +++# 'make Emacs Makefile mode happy +++endif +++ +++ dh_installdirs -p$(p_jrehl) \ +++ usr/share/doc/$(p_jrehl) \ +++ usr/share/binfmts +++ +++ dh_installdirs -p$(p_jre) \ +++ usr/share/applications \ +++ usr/share/application-registry \ +++ usr/share/mime-info \ +++ usr/share/pixmaps +++ +++ : # add GNOME stuff +++ifneq (,$(findstring cautious-launcher, $(java_launcher))) +++ cp -p debian/$(basename)-java.desktop \ +++ $(d_jre)/usr/share/applications/ +++endif +++ +++ for i in archive; do \ +++ cp debian/$(basename)-$$i.applications \ +++ $(d_jre)/usr/share/application-registry/; \ +++ cp debian/$(basename)-$$i.keys $(d_jre)/usr/share/mime-info/; \ +++ cp debian/$(basename)-$$i.mime $(d_jre)/usr/share/mime-info/; \ +++ done +++ +++ cp -p debian/sun_java.xpm \ +++ $(d_jre)/usr/share/pixmaps/$(basename).xpm +++ +++ mkdir -p $(d_demo)/usr/share/pixmaps +++ cp -p debian/sun_java_app.xpm \ +++ $(d_demo)/usr/share/pixmaps/$(basename)-app.xpm +++ +++ : # install icons +++ for i in 16 24 32 48; do \ +++ install -D -m 644 -p src/java.desktop/unix/classes/sun/awt/X11/java-icon$${i}.png \ +++ $(d_jre)/usr/share/icons/hicolor/$${i}x$${i}/apps/$(basename).png; \ +++ done +++ +++ : # create docdir symlinks for $(p_jrehl) +++ ( \ +++ echo usr/share/doc/$(p_jrehl) $(basedir)/docs; \ +++ ) >> $(d_jrehl).links +++ +++ : # create docdir symlinks for $(p_jre) +++ ( \ +++ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jre); \ +++ ) > $(d_jre).links +++ +++ifneq (,$(filter zero, $(alternate_vms))) +++ : # create docdir symlinks for $(p_jrez) +++ ( \ +++ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jrez); \ +++ ) > $(d_jrez).links +++endif +++ +++ : # create docdir symlinks for $(p_src) +++ ( \ +++ echo usr/share/doc/$(p_jdk) usr/share/doc/$(p_src); \ +++ ) > $(d_src).links +++ +++ : # create docdir symlinks for $(p_jdkhl) +++ ( \ +++ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jdkhl); \ +++ ) > $(d_jdkhl).links +++ +++ : # create docdir symlinks for $(p_jdk) +++ ( \ +++ echo usr/share/doc/$(p_jre) usr/share/doc/$(p_jdk); \ +++ echo $(TOP)/$(basename)/lib/src.zip $(TOP)/$(basename)/src.zip; \ +++ ) > $(d_jdk).links +++# doesn't work, no package dependency +++ifneq (,$(DEB_HOST_MULTIARCH)) +++ echo '$(TOP)/$(basename)/src.zip $(basedir)/lib/src.zip' >> $(d_jdkhl).links +++ echo '$(TOP)/$(basename)/lib/src.zip $(basedir)/lib/src.zip' >> $(d_jdkhl).links +++endif +++ +++ : # create docdir symlinks for $(p_dbg) +++ ( \ +++ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_dbg); \ +++ ) > $(d_dbg).links +++ +++ : # create docdir symlinks for $(p_test) +++ ( \ +++ echo usr/share/doc/$(p_jdk) usr/share/doc/$(p_test); \ +++ ) > $(d_test).links +++ +++ : # OpenJDK Stack Unwinder and Frame Decorator +++ifneq (,$(filter $(DEB_HOST_ARCH),amd64)) +++ mkdir -p $(d_jrehl)/usr/share/gdb/auto-load/$(basedir)/jre/lib/server +++ cp debian/dbg.py \ +++ $(d_jrehl)/usr/share/gdb/auto-load/$(basedir)/jre/lib/server/libjvm.so-gdb.py +++ ifneq (,$(filter zero, $(alternate_vms))) +++ mkdir -p $(d_jrez)/usr/share/gdb/auto-load/$(basedir)/jre/lib/zero +++ ln -sf ../server/libjvm.so-gdb.py \ +++ $(d_jrez)/usr/share/gdb/auto-load/$(basedir)/jre/lib/zero/libjvm.so +++ endif +++endif +++ +++ifeq ($(with_bridge),atk) +++ : # create links for the atk wrapper +++ ifeq (0,1) +++ # FIXME: ext no longer supported +++ echo "usr/share/java/java-atk-wrapper.jar $(basedir)/lib/ext/java-atk-wrapper.jar" \ +++ >> $(d_jre).links +++ endif +++ echo "usr/lib$(multiarch_dir)/jni/libatk-wrapper.so $(basedir)/lib/libatk-wrapper.so" \ +++ >> $(d_jre).links +++else ifeq ($(with_bridge),yes) +++ ifeq (0,1) +++# FIXME: ext no longer supported +++ : # create links for the gnome accessibility bridge +++ echo "usr/share/java/gnome-java-bridge.jar $(basedir)/lib/ext/gnome-java-bridge.jar" \ +++ >> $(d_jre).links +++ ifeq ($(with_jni_bridge),yes) +++ echo "usr/lib$(multiarch_dir)/jni/libjava-access-bridge-jni.so $(basedir)/lib/libjava-access-bridge-jni.so" \ +++ >> $(d_jre).links +++ endif +++ endif +++endif +++ +++ : # create links for the config/lib files +++# note: $(d_jrehl).links already created when moving files to the etcdir +++ifneq (,$(DEB_HOST_MULTIARCH)) +++ mv $(d_jrehl)/$(etcdir)/jvm.cfg \ +++ $(d_jrehl)/$(etcdir)/jvm-$(DEB_HOST_ARCH).cfg +++ ( \ +++ echo "$(etcdir)/jvm-$(DEB_HOST_ARCH).cfg $(basedir)/lib/jvm.cfg"; \ +++ ) >> $(d_jrehl).links +++else +++ ( \ +++ echo "$(etcdir)/jvm.cfg $(basedir)/lib/jvm.cfg"; \ +++ ) >> $(d_jrehl).links +++endif +++ifneq (,$(pkg_certs)) +++ echo "etc/ssl/certs/java/cacerts $(basedir)/lib/security/cacerts" \ +++ >> $(d_jrehl).links +++endif +++ +++ @echo JRE_HL_TOOLS: $(jre_hl_tools) jexec +++ @echo JRE_TOOLS: $(jre_tools) +++ @echo JDK_HL_TOOLS: $(jdk_hl_tools) +++ @echo JDK_TOOLS: $(jdk_tools) +++ ( \ +++ echo 'name=$(jdirname)'; \ +++ echo 'alias=$(jdiralias)'; \ +++ echo 'priority=$(priority)'; \ +++ echo 'section=main'; \ +++ echo ''; \ +++ for i in $(jre_hl_tools); do \ +++ echo "hl $$i /$(basedir)/bin/$$i"; \ +++ done; \ +++ echo "hl jexec /$(basedir)/lib/jexec"; \ +++ for i in $(jre_tools); do \ +++ echo "jre $$i /$(basedir)/bin/$$i"; \ +++ done; \ +++ for i in $(jdk_hl_tools); do \ +++ echo "jdkhl $$i /$(basedir)/bin/$$i"; \ +++ done; \ +++ for i in $(jdk_tools); do \ +++ echo "jdk $$i /$(basedir)/bin/$$i"; \ +++ done; \ +++ ) > $(d_jrehl)/$(TOP)/.$(jdiralias).jinfo +++ +++ ( \ +++ echo 'package $(basename)'; \ +++ echo 'interpreter /usr/bin/jexec'; \ +++ echo 'magic PK\x03\x04'; \ +++ ) > $(d_jrehl)/$(basedir)/lib/jar.binfmt +++ +++ : # another jvm symlink +++ ln -sf $(jdirname) $(d_jrehl)/usr/lib/jvm/$(jdiralias) +++ : # the debug link only needed for debhelper << 9 +++ mkdir -p $(d_jrehl)/usr/lib/debug/usr/lib/jvm/$(jdirname) +++ ln -sf $(jdirname) $(d_jrehl)/usr/lib/debug/usr/lib/jvm/$(jdiralias) +++ +++ +++ : # install lintian overrides +++ for FILE in debian/*.overrides; do \ +++ PKG=`basename $$FILE .overrides`; \ +++ install -D -m644 $$FILE debian/$$PKG/usr/share/lintian/overrides/$$PKG; \ +++ done +++ +++nodocs = $(if $(findstring nodoc, $(DEB_BUILD_OPTIONS)),-N$(p_doc)) +++nojrez = $(if $(filter zero, $(alternate_vms)),,-N$(p_jrez)) +++ +++# Build architecture independant packages +++binary-indep: build-indep install +++ dh_testdir +++ dh_testroot +++ifeq ($(with_docs),yes) +++ dh_installchangelogs -p$(p_doc) +++ dh_installdocs -p$(p_doc) +++ mkdir -p $(d_doc)/usr/share/doc/$(p_jrehl) +++ for i in $(builddir)/images/docs/*; do \ +++ [ -e $$i ] || continue; \ +++ b=$$(basename $$i); \ +++ cp -a $$i $(d_doc)/usr/share/doc/$(p_jrehl)/; \ +++ ln -sf ../$(p_jrehl)/$$b $(d_doc)/usr/share/doc/$(p_doc)/$$b; \ +++ done +++ rm -v $(d_doc)/usr/share/doc/$(p_jrehl)/api/script-dir/{jquery-3.7.1.min.js,jquery-ui.min.css,jquery-ui.min.js} +++ dh_link -p$(p_doc) \ +++ /usr/share/javascript/jquery/jquery.min.js \ +++ /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-3.6.1.min.js +++ +++endif +++# FIXME: desktop and menu files not ready for multiarch. #658321 +++ifeq (,$(DEB_HOST_MULTIARCH)) +++ dh_installmenu -i $(nodocs) +++endif +++ -dh_icons -i $(nodocs) || dh_iconcache -i $(nodocs) +++# dh_installdebconf -i $(nodocs) +++ dh_link -i $(nodocs) +++ set -e; if command -v dh_strip_nondeterminism >/dev/null; then \ +++ dh_strip_nondeterminism -i $(nodocs); \ +++ fi +++ dh_compress -i $(nodocs) -Xexamples -Xdemo -Xpackage-list -Xelement-list +++ dh_fixperms -i $(nodocs) +++ dh_installdeb -i $(nodocs) +++ dh_gencontrol -i $(nodocs) -- $(control_vars) +++ dh_md5sums -i $(nodocs) +++ dh_builddeb -i $(nodocs) $(bd_options) +++ +++absarchdir = $(CURDIR)/$(d_jrehl)/$(basedir)/lib +++shlibdeps_ld_path =$(absarchdir):$(absarchdir)/client:$(absarchdir)/server:$(absarchdir)/native_threads +++ +++# pass vm name as first argument +++define install_test_results +++ mkdir -p $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH) +++ -cp jtreg-test-output/jtreg_output-$(1) \ +++ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/jtreg_output-$(1).log +++ -cp jtreg-test-output/jtreg-summary-$(1).log jtreg-test-output/check-*-$(1).log \ +++ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/ +++ -cp jtreg-test-output/failed_tests-$(1).tar.gz \ +++ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/failed_tests-$(1).tar.gz +++ -cp jtreg-test-output/jtreport-$(1).tar.gz \ +++ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/jtreport-$(1).tar.gz +++endef +++ +++# Build architecture dependant packages +++binary-arch: build install +++ dh_testdir +++ dh_testroot +++ +++ dh_installchangelogs -p$(p_jrehl) +++ dh_installdocs -p$(p_jrehl) \ +++ debian/JAVA_HOME \ +++ debian/README.alternatives \ +++ debian/README.Debian \ +++ debian/README.testsuite +++ $(call install_test_results,$(default_vm)) +++ +++ifneq (,$(filter zero, $(alternate_vms))) +++ $(call install_test_results,zero) +++endif +++# FIXME: desktop and menu files not ready for multiarch. #658321 +++ifeq (,$(DEB_HOST_MULTIARCH)) +++ dh_installmenu -a $(nodemo) $(nojrez) +++endif +++ -dh_icons -a $(nodemo) $(nojrez) \ +++ || dh_iconcache -a $(nodemo) $(nojrez) +++# dh_installdebconf -a $(nodemo) $(nojrez) +++ dh_link -a $(nodemo) $(nojrez) +++ set -e; if command -v dh_strip_nondeterminism >/dev/null; then \ +++ dh_strip_nondeterminism -a $(nodemo) $(nojrez); \ +++ fi +++# The strip operation is performed manually, because the build packages +++# external debug symbols (so that native libraries are included in the modules) +++# This step would override the actual debug symbols with the empty sections +++# dh_strip -v -a $(nodemo) $(nojrez) \ +++# -Xlibjvm.so -X.debuginfo --dbg-package=$(p_dbg) +++ +++ dh_compress -a $(nodemo) $(nojrez) -Xexamples -Xdemo -Xpackage-list +++ dh_fixperms -a $(nodemo) $(nojrez) +++ dh_makeshlibs -p$(p_jrehl) -p$(p_jre) +++ dh_shlibdeps -a $(nodemo) $(nojrez) -L $(p_jrehl) \ +++ -Xlibfontmanager -Xlibjsound \ +++ -l$(shlibdeps_ld_path) \ +++ -- +++ dpkg-shlibdeps -pfontmanager -dRecommends -T$(d_jrehl).substvars \ +++ $(d_jrehl)/$(basedir)/lib/libfontmanager.so +++ dpkg-shlibdeps -pfontmanager -T$(d_jre).substvars \ +++ $(d_jrehl)/$(basedir)/lib/libfontmanager.so +++ dpkg-shlibdeps -pjsound -dRecommends -T$(d_jrehl).substvars \ +++ $(d_jrehl)/$(basedir)/lib/libjsound.so +++ dpkg-shlibdeps -pjsound -T$(d_jre).substvars \ +++ $(d_jrehl)/$(basedir)/lib/libjsound.so +++ +++ find $(d_jrehl) $(d_jre) $(d_jrez) -type f -name '*.debuginfo' +++ dh_installdeb -a $(nodemo) $(nojrez) +++ dh_gencontrol -a $(nodemo) $(nojrez) \ +++ -- $(control_vars) +++ dh_md5sums -a $(nodemo) $(nojrez) +++ : # FIXME: something seems to hang here ... +++ -ps afx +++ NO_PKG_MANGLE=1 \ +++ dh_builddeb -a $(nodemo) $(nojrez) #$(bd_options) +++ +++git_project = jdk21u +++git_tag = jdk-21.0.5+6 +++package_version = $(shell echo $(PKGVERSION) | sed 's/-[^-][^-]*$$//') +++ifneq ($(is_upstream_release),yes) +++ package_version := $(subst +,~,$(package_version)) +++endif +++git_url = https://github.com/openjdk/$(git_project) +++origdir = ../$(basename)-$(package_version).orig +++topdir = $(basename)-$(package_version) +++gtest_repo = https://github.com/google/googletest +++gtest_tag = 1.14.0 +++gtestdir = ../$(basename)-$(package_version)-googletest.orig +++ +++debian/watch: debian/watch.in debian/rules +++ sed \ +++ -e 's|@git_url@|$(git_url)/tags|g' \ +++ -e 's|@gtest_repo@|$(gtest_repo)/tags|g' \ +++ -e 's|@gtest_tag@|$(gtest_tag)|g' \ +++ -e 's|@shortver@|$(shortver)|g' \ +++ debian/watch.in > debian/watch +++# disable version mangling for the release version +++ifeq ($(is_upstream_release),yes) +++ sed -i 's|repack.*\\|repack,\\|g' debian/watch +++endif +++ +++get-gtest: +++ rm -rf $(gtestdir) || true +++ mkdir $(gtestdir) +++ wget -O $(gtestdir)/googletest.tar.gz $(gtest_repo)/archive/refs/tags/v$(gtest_tag).tar.gz +++ set -ex; \ +++ repo=googletest; \ +++ d=$$(tar tf $(gtestdir)/$$repo.tar.gz | head -1 | sed 's,/.*,,'); \ +++ tar xf $(gtestdir)/$$repo.tar.gz; \ +++ XZ_OPT=-9v tar cfJ ../$(basename)_$(package_version).orig-$$repo.tar.xz googletest-${gtest_tag}; \ +++ rm -rf $(gtestdir) +++ rm -rf googletest-${gtest_tag} +++ +++get-orig: get-gtest +++ rm -rf $(origdir) || true +++ mkdir $(origdir) +++ wget -O $(origdir)/jdk.tar.gz $(git_url)/archive/$(git_tag).tar.gz +++ +++ set -ex; \ +++ repo=jdk; \ +++ d=$$(tar tf $(origdir)/$$repo.tar.gz | head -1 | sed 's,/.*,,'); \ +++ tar xf $(origdir)/$$repo.tar.gz; \ +++ case $$repo in jdk) \ +++ rm -v -rf $$d/src/java.base/share/native/libzip/zlib; \ +++ find $$d/src/java.desktop/share/native/libjavajpeg \ +++ ! -name imageioJPEG.c ! -name jpegdecoder.c ! -name jinclude.h \ +++ -type f -print -delete; \ +++ rm -v -rf $$d/src/java.desktop/share/native/libsplashscreen/giflib; \ +++ rm -v -rf $$d/src/java.desktop/share/native/libsplashscreen/libpng; \ +++ rm -v -rf $$d/src/java.smartcardio/unix/native/libj2pcsc/MUSCLE; \ +++ esac; \ +++ mv $$d $(topdir); \ +++ chmod +x $(topdir)/configure; \ +++ rm -f $(topdir)/.hgtags; \ +++ rm -f $(topdir)/.gitattributes; \ +++ rm -rf $(topdir)/.github; \ +++ XZ_OPT=-9v tar cfJ ../$(basename)_$(package_version).orig.tar.xz $(topdir); \ +++ rm -rf $(topdir) +++ +++# keep these in the tarball, older lcms are not supported +++# rm -v -f $$d/src/java.desktop/share/native/liblcms/cms*.c; \ +++# rm -v -f $$d/src/java.desktop/share/native/liblcms/lcms2*.h; \ +++ +++ rm -rf $(origdir) +++ +++binary: binary-arch binary-indep +++.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install packaging-files diff --cc debian/series index 000000000,000000000,000000000..024cad794 new file mode 100644 --- /dev/null +++ b/debian/series @@@@ -1,0 -1,0 -1,0 +1,26 @@@@ +++autoconf-select.diff +++system-pcsclite.diff +++hotspot-mips-align.diff +++icc_loading_with_symlink.diff +++icedtea-override-redirect-compiz.patch +++jdk-freetypeScaler-crash.diff +++libpcsclite-dlopen.diff +++jexec.diff +++default-jvm-cfg.diff +++workaround_expand_exec_shield_cs_limit.diff +++adlc-parser.patch +++multiple-pkcs11-library-init.patch +++applet-hole.patch +++m68k-support.diff +++s390x-thread-stack-size.diff +++jdk-getAccessibleValue.diff +++zero-x32.diff +++jtreg-location.diff +++jdk-i18n-pt_BR.diff +++mips-sigset.diff +++disable-doclint-by-default.diff +++hotspot-disable-exec-shield-workaround.diff +++atk-wrapper-security.patch +++dnd-files.patch +++hotspot-powerpcspe.diff +++hotspot-libpath.diff diff --cc debian/sharedmimeinfo index 000000000,000000000,000000000..78604fdbe new file mode 100644 --- /dev/null +++ b/debian/sharedmimeinfo @@@@ -1,0 -1,0 -1,0 +1,12 @@@@ +++ +++ +++ +++ Java Archive +++ +++ +++ +++ +++ Java Web Start application +++ +++ +++ diff --cc debian/source/format index 000000000,000000000,000000000..163aaf8d8 new file mode 100644 --- /dev/null +++ b/debian/source/format @@@@ -1,0 -1,0 -1,0 +1,1 @@@@ +++3.0 (quilt) diff --cc debian/source/lintian-overrides index 000000000,000000000,000000000..205be5902 new file mode 100644 --- /dev/null +++ b/debian/source/lintian-overrides @@@@ -1,0 -1,0 -1,0 +1,24 @@@@ +++# parts of the test suite, not installed +++openjdk-21 source: source-is-missing +++ +++# openjdk packages use old standards version as they need to support +++# backports +++openjdk-21 source: newer-standards-version +++openjdk-21 source: uses-debhelper-compat-file +++openjdk-21 source: package-uses-old-debhelper-compat-version +++ +++# suppress warnings about experimental patches +++openjdk-21 source: patch-file-present-but-not-mentioned-in-series +++ +++# jtreg test suite contains pre-built jars +++openjdk-21 source: source-contains-prebuilt-java-object +++ +++# upstream code formatting +++openjdk-21 source: very-long-line-length-in-source-file +++ +++# false positive, jtreg tests contain example/ directories +++openjdk-21 source: package-does-not-install-examples +++ +++# chromium and firefox snaps are unable to load scripts from /usr/share/javascript +++# LP: 2032992 +++openjdk-21 source: source-contains-prebuilt-javascript-object diff --cc debian/sun_java.xpm index 000000000,000000000,000000000..00db1b68c new file mode 100644 --- /dev/null +++ b/debian/sun_java.xpm @@@@ -1,0 -1,0 -1,0 +1,194 @@@@ +++/* XPM */ +++static char *sun_java[] = { +++/* columns rows colors chars-per-pixel */ +++"32 32 156 2", +++" c #34479E", +++". c #4152A3", +++"X c #4153A2", +++"o c #4153A3", +++"O c #4D5EA8", +++"+ c #4D5EA9", +++"@ c #4E5EA9", +++"# c #5A69AD", +++"$ c #5A69AE", +++"% c #5A69AF", +++"& c #5A6AAD", +++"* c #6675B3", +++"= c #6775B2", +++"- c #6775B3", +++"; c #6776B3", +++": c #6775B5", +++"> c #6776B4", +++", c #7480B7", +++"< c #7380B8", +++"1 c #7381B8", +++"2 c #7380BA", +++"3 c #7481B8", +++"4 c #D12124", +++"5 c #D42F31", +++"6 c #D73D3E", +++"7 c #D94A4A", +++"8 c #D94A4B", +++"9 c #DA4A4A", +++"0 c #DA4B4B", +++"q c #DC5957", +++"w c #DC5858", +++"e c #DD5859", +++"r c #DD5959", +++"t c #DF6664", +++"y c #E06664", +++"u c #E27471", +++"i c #E27570", +++"p c #E27472", +++"a c #E37472", +++"s c #E27574", +++"d c #E37474", +++"f c #E5827E", +++"g c #E5837F", +++"h c #818BBD", +++"j c #818CBC", +++"k c #808CBE", +++"l c #818DC0", +++"z c #8D97C2", +++"x c #8D97C3", +++"c c #8D97C5", +++"v c #8E98C5", +++"b c #99A2C7", +++"n c #99A3C7", +++"m c #99A2C8", +++"M c #99A3C8", +++"N c #99A2CA", +++"B c #99A2CB", +++"V c #A6AECD", +++"C c #A5AED2", +++"Z c #A6AED0", +++"A c #B3B9D3", +++"S c #B2B9D4", +++"D c #B3B9D5", +++"F c #B2B9D6", +++"G c #B3BAD5", +++"H c #BFC4D6", +++"J c #BFC5D7", +++"K c #BFC5D8", +++"L c #BFC5D9", +++"P c #BFC5DA", +++"I c #BFC5DB", +++"U c #BFC5DC", +++"Y c #BFC5DD", +++"T c #E58381", +++"R c #E68380", +++"E c #E88F89", +++"W c #E88F8B", +++"Q c #E8908A", +++"! c #EB9D99", +++"~ c #EB9D9A", +++"^ c #EB9D9D", +++"/ c #EDABA2", +++"( c #EEABA6", +++") c #EDACA6", +++"_ c #F0B9B1", +++"` c #F1B9B1", +++"' c #F0B9B6", +++"] c #F3C7BD", +++"[ c #CCD0DA", +++"{ c #CCD1DA", +++"} c #CDD0DA", +++"| c #CCD0DC", +++" . c #CCD0DD", +++".. c #CCD1DD", +++"X. c #CCD0DE", +++"o. c #CCD1DE", +++"O. c #CCD1DF", +++"+. c #D8DBDF", +++"@. c #CCD0E0", +++"#. c #D8DCE1", +++"$. c #D9DCE1", +++"%. c #D9DCE3", +++"&. c #D9DCE4", +++"*. c #D9DCE5", +++"=. c #D9DCE6", +++"-. c #D9DCE7", +++";. c #D9DCE8", +++":. c #F6D5CB", +++">. c #F6D5CD", +++",. c #F6D5D3", +++"<. c #F9E3D7", +++"1. c #F9E3DA", +++"2. c #F9E3DB", +++"3. c #E6E7E7", +++"4. c #E5E7E9", +++"5. c #E5E7EC", +++"6. c #E5E8E8", +++"7. c #E6E8E9", +++"8. c #E6E8EA", +++"9. c #E6E8EB", +++"0. c #E5E8EC", +++"q. c #E6E8EC", +++"w. c #F9E3E1", +++"e. c #F2F3EC", +++"r. c #FCF0E1", +++"t. c #FCF0E3", +++"y. c #FCF1E5", +++"u. c #FCF0E7", +++"i. c #FCF1E6", +++"p. c #FCF1E7", +++"a. c #FCF1E8", +++"s. c #FFFEED", +++"d. c #FFFEEE", +++"f. c #FFFEEF", +++"g. c #F2F3F0", +++"h. c #F2F3F1", +++"j. c #F2F3F2", +++"k. c #F2F3F4", +++"l. c #FFFEF0", +++"z. c #FFFEF1", +++"x. c #FFFEF2", +++"c. c #FFFEF3", +++"v. c #FFFFF3", +++"b. c #FFFFF4", +++"n. c #FFFFF5", +++"m. c #FFFFF6", +++"M. c #FFFFF7", +++"N. c #FFFFF8", +++"B. c #FFFFF9", +++"V. c #FFFFFA", +++"C. c #FFFFFB", +++"Z. c #FFFFFC", +++"A. c #FFFFFD", +++"S. c #FFFFFE", +++"D. c gray100", +++"F. c None", +++/* pixels */ +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.w.~ F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.r F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.' q F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.M.q u F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.M.M.! 4 1.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.M.M.f 4 E M.M.F.w.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.M.i.t 4 i x.1.g u ,.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.M.>.7 4 f r.f 5 ! C.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.1.5 4 / r.7 5 >.M.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.M.q 4 E d.i 4 >.M.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.M.4 5 d.d.4 6 x.x.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.7 7 d.d.4 4 :.M.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.M./ 4 <.x.q 4 7 i.F.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.M.u t x.] 4 4 ) M.F.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.u.7 _ x.E 4 ! M.M.F.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.h.@.4.M.i.u i._ 5 i.M.F.-.N : c @.M.F.F.F.F.F.", +++"F.F.F.F.F.F.k.B O h P x.x.M.x.i.a :.x.M.9.L @.L O c M.F.F.F.F.", +++"F.F.F.F.F.F.> X c n b n n n n h = & X v M.M.M.8. M.F.F.F.F.", +++"F.F.F.F.F.F.F.+...N n n n N N n J ..4.M.M.M.x.M.M. M.F.F.F.F.", +++"F.F.F.F.F.F.F.M.+.O ..x.d.x.d.x.x.3.L 8.M.M.M.x. . X M.F.F.F.F.", +++"F.F.F.F.F.F.F.M.F X = = = = O 8.M.M.h.& S M.F.F.F.F.", +++"F.F.F.F.F.F.F.M.M...z = = = = = j V %.x.F.M.9.% S M.F.F.F.F.F.", +++"F.F.F.F.F.F.F.M.M.4.n d.d.d.d.x.d.x.M.M.M.S X l 5.F.M.F.F.F.F.F.", +++"F.F.F.F.F.F.M.M.x.= O = = = = o = -.-.S h.M.F.M.F.F.F.F.F.F.", +++"F.F.F.F.F.M.-.{ { %., , A x.M.M.M.M.M.F.F.F.F.F.F.F.", +++"F.F.F.F.F O , J e.x.d.d.{ { { +.x.x.x.M.M.M.M.M.=.Y F.F.F.F.F.F.", +++"F.F.F.F. O z H %.d.x.x.d.d.d.d.x.x.x.x...K N O C C.F.F.F.F.F.", +++"F.F.F.F.N O # = = = = = O O L C.F.F.F.F.F.F.", +++"F.F.F.F.M.M.%.V > & O = N =.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.M.M.M.M.x.x.M.M.M.M.M.M.M.M.M.F.F.F.F.F.F.F.F.F.F.", +++"F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F." +++}; diff --cc debian/sun_java_app.xpm index 000000000,000000000,000000000..7a0f9414e new file mode 100644 --- /dev/null +++ b/debian/sun_java_app.xpm @@@@ -1,0 -1,0 -1,0 +1,199 @@@@ +++/* XPM */ +++static char * dukejre_xpm[] = { +++"32 32 164 2", +++" c None", +++". c #000000", +++"+ c #2D2D2D", +++"@ c #363636", +++"# c #313131", +++"$ c #3E3E3E", +++"% c #3D3D3D", +++"& c #2B2B2B", +++"* c #444444", +++"= c #494949", +++"- c #373737", +++"; c #1C1C1C", +++"> c #545454", +++", c #434343", +++"' c #272727", +++") c #0B0B0B", +++"! c #414141", +++"~ c #5C5C5C", +++"{ c #4F4F4F", +++"] c #141414", +++"^ c #3A3A3A", +++"/ c #585858", +++"( c #403A3A", +++"_ c #32201F", +++": c #090202", +++"< c #4F4E4E", +++"[ c #833D3E", +++"} c #BE3432", +++"| c #D63736", +++"1 c #79201F", +++"2 c #040101", +++"3 c #251313", +++"4 c #212121", +++"5 c #9A5857", +++"6 c #EBB9B9", +++"7 c #E03A38", +++"8 c #CA3430", +++"9 c #862221", +++"0 c #251211", +++"a c #774C35", +++"b c #CC5213", +++"c c #A25151", +++"d c #B23D3C", +++"e c #AC2B29", +++"f c #8F2422", +++"g c #691A19", +++"h c #321D1E", +++"i c #7E3D20", +++"j c #D55A0D", +++"k c #8E3F10", +++"l c #250F0F", +++"m c #5D1615", +++"n c #631817", +++"o c #661918", +++"p c #501313", +++"q c #200909", +++"r c #3D3A39", +++"s c #6D341B", +++"t c #AE4F14", +++"u c #CC5515", +++"v c #44403F", +++"w c #381414", +++"x c #310C0C", +++"y c #220908", +++"z c #1F0B0B", +++"A c #413939", +++"B c #525252", +++"C c #9B6343", +++"D c #D96319", +++"E c #D3A88C", +++"F c #D7D7D7", +++"G c #868383", +++"H c #797777", +++"I c #898989", +++"J c #A3A3A3", +++"K c #DBDBDB", +++"L c #E27626", +++"M c #DE6F21", +++"N c #E9E8E7", +++"O c #EDEDED", +++"P c #F8F8F8", +++"Q c #FFFFFF", +++"R c #EC7A20", +++"S c #E27728", +++"T c #ED7C21", +++"U c #E5E1DE", +++"V c #EEEEEE", +++"W c #F6F6F6", +++"X c #FDFDFD", +++"Y c #B76D3E", +++"Z c #E5711D", +++"` c #F0851E", +++" . c #ED7D24", +++".. c #F18B1D", +++"+. c #C75810", +++"@. c #CC5616", +++"#. c #E36F1D", +++"$. c #F2911A", +++"%. c #FBFBFB", +++"&. c #F9F6F2", +++"*. c #F9AA14", +++"=. c #F08A1D", +++"-. c #D35E13", +++";. c #E16D1C", +++">. c #F49B18", +++",. c #B9B9B9", +++"'. c #FAFAFA", +++"). c #F49818", +++"!. c #E3701D", +++"~. c #A1480F", +++"{. c #E06B1C", +++"]. c #FCFCFC", +++"^. c #E26D1C", +++"/. c #0F0F0F", +++"(. c #DE691B", +++"_. c #F6A016", +++":. c #E97E1C", +++"<. c #F7A117", +++"[. c #EB7A20", +++"}. c #E4701D", +++"|. c #837B77", +++"1. c #A0938A", +++"2. c #717171", +++"3. c #959595", +++"4. c #E1A27A", +++"5. c #DB844B", +++"6. c #D6671F", +++"7. c #D56318", +++"8. c #D6671B", +++"9. c #DB6616", +++"0. c #DE6614", +++"a. c #D96B1C", +++"b. c #D66A21", +++"c. c #D7996D", +++"d. c #C0BFBF", +++"e. c #393939", +++"f. c #686868", +++"g. c #8F8F8F", +++"h. c #D3D3D3", +++"i. c #D1D1D1", +++"j. c #CFCFCF", +++"k. c #DCDCDC", +++"l. c #D8D8D8", +++"m. c #C0C0C0", +++"n. c #C3C3C3", +++"o. c #333333", +++"p. c #696969", +++"q. c #606060", +++"r. c #E6E6E6", +++"s. c #A0A0A0", +++"t. c #8A8A8A", +++"u. c #5F5F5F", +++"v. c #8C8C8C", +++"w. c #B6B6B6", +++"x. c #BDBDBD", +++"y. c #262626", +++"z. c #7C7C7C", +++"A. c #C2C2C2", +++"B. c #C1C1C1", +++"C. c #B5B5B5", +++"D. c #6E6E6E", +++"E. c #868686", +++"F. c #ABABAB", +++"G. c #292929", +++" ", +++" . . ", +++" . . . . ", +++" . . . . ", +++" + . . . . . . ", +++" @ # . . . . . . . ", +++" $ % & . . . . . . ", +++" * = - ; . . . . . ", +++" * > , ' ) . . . . . . ", +++" ! ~ { # ] . . . . ", +++" ^ / / ( _ : . . . ", +++" # < [ } | 1 2 . ", +++" 3 4 5 6 7 8 9 0 a b . ", +++" 3 3 c d e f g h i j . ", +++" k l m n o p q r s j . ", +++" t u v w x y z A B C j . ", +++" $ . D E F G H I J K j L . ", +++" $ . M j N O P Q Q Q j R j ", +++" $ $ . S T j U V W X j T T j Y ", +++" $ . . Z ` T j j j j j ...T j +. ", +++" . . @.#.$.%.%.%.%.%.%.&.*.=.j -. ", +++" . . @.;.>.%.%.,.. '.%.%.*.).!.j ~. ", +++" . . @.{.*.%.%.%.. ].].%.*.*.^.j j ", +++" /.. j (.*.%.'.%.. '.%.%.*._.^.j j ", +++" . . . j :.%.'.%.%.'.'.%.<.[.}.j |. ", +++" . . # . . j j j T T T T T T T j 1.2. ", +++" . ^ 3.O 4.5.6.7.8.9.0.a.b.c.d.e.f. ", +++" ] . g.O h.i.j.j.h.h.h.k.l.m.n.o.p. ", +++" q.O O r.s.t.$ $ $ u.v.3.w.x.y.u. ", +++" z.A.B.C.D.$ $ $ $ u.E.F.& u. ", +++" # F.F.D.$ $ $ $ ' G.e.u. ", +++" $ $ $ $ $ $ $ "}; diff --cc debian/swing.properties index 000000000,000000000,000000000..0f55df0c5 new file mode 100644 --- /dev/null +++ b/debian/swing.properties @@@@ -1,0 -1,0 -1,0 +1,2 @@@@ +++# uncomment to set the default look and feel to GTK +++#swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel diff --cc debian/tests/control index 000000000,000000000,000000000..fc07c82c9 new file mode 100644 --- /dev/null +++ b/debian/tests/control @@@@ -1,0 -1,0 -1,0 +1,19 @@@@ +++Test-Command: java --version +++Depends: openjdk-21-jre-headless +++Restrictions: allow-stderr, superficial +++ +++Test-Command: javac --version +++Depends: openjdk-21-jdk-headless +++Restrictions: allow-stderr, superficial +++ +++Tests: hotspot-autopkgtest.sh +++Depends: @, jtreg7 (>= 7.3.1+1~), libtestng7-java, build-essential, bash, lsb-release, xfwm4, xvfb, xauth, dbus-x11, libatk-wrapper-java, libatk-wrapper-java-jni +++Restrictions: allow-stderr, skippable, flaky, rw-build-tree +++ +++Tests: jdk-autopkgtest.sh +++Depends: @, jtreg7 (>= 7.3.1+1~), libtestng7-java, build-essential, bash, lsb-release, xfwm4, xvfb, xauth, dbus-x11, libatk-wrapper-java, libatk-wrapper-java-jni +++Restrictions: allow-stderr, skippable, flaky, rw-build-tree +++ +++Tests: dependencies.sh +++Depends: @, build-essential, bash +++Restrictions: allow-stderr, skippable, flaky diff --cc debian/tests/control.in index 000000000,000000000,000000000..00faaba98 new file mode 100644 --- /dev/null +++ b/debian/tests/control.in @@@@ -1,0 -1,0 -1,0 +1,19 @@@@ +++Test-Command: java --version +++Depends: openjdk-21-jre-headless +++Restrictions: allow-stderr, superficial +++ +++Test-Command: javac --version +++Depends: openjdk-21-jdk-headless +++Restrictions: allow-stderr, superficial +++ +++Tests: hotspot-autopkgtest.sh +++Depends: @, @jtreg_dep@, @testng_dep@, build-essential, bash, lsb-release, xfwm4, xvfb, xauth, dbus-x11, libatk-wrapper-java, libatk-wrapper-java-jni +++Restrictions: allow-stderr, skippable, flaky, rw-build-tree +++ +++Tests: jdk-autopkgtest.sh +++Depends: @, @jtreg_dep@, @testng_dep@, build-essential, bash, lsb-release, xfwm4, xvfb, xauth, dbus-x11, libatk-wrapper-java, libatk-wrapper-java-jni +++Restrictions: allow-stderr, skippable, flaky, rw-build-tree +++ +++Tests: dependencies.sh +++Depends: @, build-essential, bash +++Restrictions: allow-stderr, skippable, flaky diff --cc debian/tests/dependencies.in index 000000000,000000000,000000000..6aa140f72 new file mode 100755 --- /dev/null +++ b/debian/tests/dependencies.in @@@@ -1,0 -1,0 -1,0 +1,36 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo @JDK_DIR@ | sed "s/-[^-]*$/-$host_arch/") +++ +++ +++echo Check that PC/SC support can be loaded +++cat < ${AUTOPKGTEST_TMP}/Test.java +++import java.util.List; +++import javax.smartcardio.CardTerminal; +++import javax.smartcardio.CardTerminals; +++import javax.smartcardio.TerminalFactory; +++ +++public class Test { +++ public static void main(String[] args ) throws Throwable { +++ TerminalFactory factory = TerminalFactory.getDefault(); +++ List terminals = factory.terminals().list(); +++ System.out.println("Terminals: " + terminals); +++ } +++} +++EOF +++ +++${jdk_path}/bin/java -Djava.security.debug=all \ +++ -cp . ${AUTOPKGTEST_TMP}/Test.java > ${AUTOPKGTEST_TMP}/dependencies-pcsc.log 2>&1 +++ +++if grep "pcsc: Using PC/SC library" ${AUTOPKGTEST_TMP}/dependencies-pcsc.log; then +++ echo "Test passed." +++else +++ cat ${AUTOPKGTEST_TMP}/dependencies-pcsc.log +++ echo "PC/SC library can not be loaded" +++ exit 1 +++fi diff --cc debian/tests/dependencies.sh index 000000000,000000000,000000000..eb3f0558f new file mode 100755 --- /dev/null +++ b/debian/tests/dependencies.sh @@@@ -1,0 -1,0 -1,0 +1,36 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo /usr/lib/jvm/java-21-openjdk-amd64 | sed "s/-[^-]*$/-$host_arch/") +++ +++ +++echo Check that PC/SC support can be loaded +++cat < ${AUTOPKGTEST_TMP}/Test.java +++import java.util.List; +++import javax.smartcardio.CardTerminal; +++import javax.smartcardio.CardTerminals; +++import javax.smartcardio.TerminalFactory; +++ +++public class Test { +++ public static void main(String[] args ) throws Throwable { +++ TerminalFactory factory = TerminalFactory.getDefault(); +++ List terminals = factory.terminals().list(); +++ System.out.println("Terminals: " + terminals); +++ } +++} +++EOF +++ +++${jdk_path}/bin/java -Djava.security.debug=all \ +++ -cp . ${AUTOPKGTEST_TMP}/Test.java > ${AUTOPKGTEST_TMP}/dependencies-pcsc.log 2>&1 +++ +++if grep "pcsc: Using PC/SC library" ${AUTOPKGTEST_TMP}/dependencies-pcsc.log; then +++ echo "Test passed." +++else +++ cat ${AUTOPKGTEST_TMP}/dependencies-pcsc.log +++ echo "PC/SC library can not be loaded" +++ exit 1 +++fi diff --cc debian/tests/hotspot index 000000000,000000000,000000000..6930531e4 new file mode 100755 --- /dev/null +++ b/debian/tests/hotspot @@@@ -1,0 -1,0 -1,0 +1,18 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} test/hotspot/jtreg/ProblemList.txt hotspot +++ +++native_path=$(pwd)/build/images/test/hotspot/jtreg/native +++debian/tests/jtreg-autopkgtest.sh hotspot \ +++ -exclude:${problem_list} \ +++ -dir:test/hotspot/jtreg \ +++ -nativepath:${native_path} \ +++ -k:!stress \ +++ :tier1 :tier2 +++ +++debian/tests/jtdiff-autopkgtest.sh hotspot diff --cc debian/tests/hotspot-autopkgtest.in index 000000000,000000000,000000000..46db50351 new file mode 100644 --- /dev/null +++ b/debian/tests/hotspot-autopkgtest.in @@@@ -1,0 -1,0 -1,0 +1,33 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo @JDK_DIR@ | sed "s/-[^-]*$/-$host_arch/") +++ +++if ! $jdk_path/bin/java -version 2>/dev/null; then +++ echo >&2 "error: $jdk_path/bin/java not found" +++ exit 1 +++fi +++ +++if $jdk_path/bin/java -version 2>/dev/null | grep -F --quiet Zero ; then +++ echo >&2 "skipping tests with the Zero interpreter" +++ exit 77 +++fi +++ +++HOTSPOT_JTREG_PATH=test/hotspot/jtreg +++HOTSPOT_JTREG_NATIVE_PATH=${jdk_path}/testsuite/hotspot/jtreg/native +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} ${HOTSPOT_JTREG_PATH}/ProblemList.txt hotspot +++ +++ARGS="$*" +++JT_DEFAULT_ARGS="-exclude:${problem_list} -k:!stress :tier1" +++JT_ARGS=${ARGS:-$JT_DEFAULT_ARGS} +++ +++debian/tests/jtreg-autopkgtest.sh hotspot \ +++ -dir:${HOTSPOT_JTREG_PATH} \ +++ -nativepath:${HOTSPOT_JTREG_NATIVE_PATH} \ +++ $JT_ARGS diff --cc debian/tests/hotspot-autopkgtest.sh index 000000000,000000000,000000000..02fdd22fe new file mode 100755 --- /dev/null +++ b/debian/tests/hotspot-autopkgtest.sh @@@@ -1,0 -1,0 -1,0 +1,33 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo /usr/lib/jvm/java-21-openjdk-amd64 | sed "s/-[^-]*$/-$host_arch/") +++ +++if ! $jdk_path/bin/java -version 2>/dev/null; then +++ echo >&2 "error: $jdk_path/bin/java not found" +++ exit 1 +++fi +++ +++if $jdk_path/bin/java -version 2>/dev/null | grep -F --quiet Zero ; then +++ echo >&2 "skipping tests with the Zero interpreter" +++ exit 77 +++fi +++ +++HOTSPOT_JTREG_PATH=test/hotspot/jtreg +++HOTSPOT_JTREG_NATIVE_PATH=${jdk_path}/testsuite/hotspot/jtreg/native +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} ${HOTSPOT_JTREG_PATH}/ProblemList.txt hotspot +++ +++ARGS="$*" +++JT_DEFAULT_ARGS="-exclude:${problem_list} -k:!stress :tier1" +++JT_ARGS=${ARGS:-$JT_DEFAULT_ARGS} +++ +++debian/tests/jtreg-autopkgtest.sh hotspot \ +++ -dir:${HOTSPOT_JTREG_PATH} \ +++ -nativepath:${HOTSPOT_JTREG_NATIVE_PATH} \ +++ $JT_ARGS diff --cc debian/tests/jaxp index 000000000,000000000,000000000..219bc8507 new file mode 100755 --- /dev/null +++ b/debian/tests/jaxp @@@@ -1,0 -1,0 -1,0 +1,16 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} test/jaxp/ProblemList.txt jaxp +++ +++debian/tests/jtreg-autopkgtest.sh jaxp \ +++ -exclude:${problem_list} \ +++ -dir:test/jaxp \ +++ -k:!stress \ +++ :tier1 :tier2 +++debian/tests/jtdiff-autopkgtest.sh jaxp diff --cc debian/tests/jdk index 000000000,000000000,000000000..266976e77 new file mode 100755 --- /dev/null +++ b/debian/tests/jdk @@@@ -1,0 -1,0 -1,0 +1,39 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++ +++cleanup() { +++ # kill window manager to clean up (rest will exit automatically) +++ pid="$(jobs -p)" +++ if [ -n "$pid" ]; then +++ xvfbpid="$(pgrep -l -P ${pid} | grep xvfb-run | cut -d' ' -f1)" +++ if [ -n "$xvfbpid" ]; then +++ pgrep -l -P ${xvfbpid} | grep xfwm4 | cut -d' ' -f1 | xargs kill -9 +++ fi +++ fi +++} +++ +++for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done +++trap cleanup EXIT +++ +++export HOME="${AUTOPKGTEST_TMP}" +++export XAUTHORITY="${AUTOPKGTEST_TMP}/.Xauthority" +++export DISPLAY=:10 +++debian/tests/start-xvfb.sh 10 & +++sleep 3 +++ +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} test/jdk/ProblemList.txt jdk +++ +++native_path=$(pwd)/build/images/test/jdk/jtreg/native +++debian/tests/jtreg-autopkgtest.sh jdk \ +++ -exclude:${problem_list} \ +++ -dir:test/jdk \ +++ -nativepath:${native_path} \ +++ -k:!stress \ +++ :tier1 :tier2 +++debian/tests/jtdiff-autopkgtest.sh jdk diff --cc debian/tests/jdk-autopkgtest.in index 000000000,000000000,000000000..63b7ac96b new file mode 100644 --- /dev/null +++ b/debian/tests/jdk-autopkgtest.in @@@@ -1,0 -1,0 -1,0 +1,54 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo @JDK_DIR@ | sed "s/-[^-]*$/-$host_arch/") +++ +++if ! $jdk_path/bin/java -version 2>/dev/null; then +++ echo >&2 "error: $jdk_path/bin/java not found" +++ exit 1 +++fi +++ +++if $jdk_path/bin/java -version 2>/dev/null | grep -F --quiet Zero ; then +++ echo >&2 "skipping tests with the Zero interpreter" +++ exit 77 +++fi +++ +++cleanup() { +++ # kill window manager to clean up (rest will exit automatically) +++ pid="$(jobs -p)" +++ if [ -n "$pid" ]; then +++ xvfbpid="$(pgrep -l -P ${pid} | grep xvfb-run | cut -d' ' -f1)" +++ if [ -n "$xvfbpid" ]; then +++ pgrep -l -P ${xvfbpid} | grep xfwm4 | cut -d' ' -f1 | xargs kill -9 +++ fi +++ fi +++} +++ +++for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done +++trap cleanup EXIT +++ +++export HOME="${AUTOPKGTEST_TMP}" +++export XAUTHORITY="${AUTOPKGTEST_TMP}/.Xauthority" +++export DISPLAY=:10 +++debian/tests/start-xvfb.sh 10 & +++sleep 3 +++ +++JDK_JTREG_PATH=test/jdk +++JDK_JTREG_NATIVE_PATH=${jdk_path}/testsuite/jdk/jtreg/native +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++ +++debian/tests/write-problems.sh ${problem_list} ${JDK_JTREG_PATH}/ProblemList.txt jdk +++ +++ARGS="$*" +++JT_DEFAULT_ARGS="-exclude:${problem_list} -k:!stress :tier1" +++JT_ARGS=${ARGS:-$JT_DEFAULT_ARGS} +++ +++debian/tests/jtreg-autopkgtest.sh jdk \ +++ -dir:${JDK_JTREG_PATH} \ +++ -nativepath:${JDK_JTREG_NATIVE_PATH} \ +++ $JT_ARGS diff --cc debian/tests/jdk-autopkgtest.sh index 000000000,000000000,000000000..da6c96ebe new file mode 100755 --- /dev/null +++ b/debian/tests/jdk-autopkgtest.sh @@@@ -1,0 -1,0 -1,0 +1,54 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++jdk_path=$(echo /usr/lib/jvm/java-21-openjdk-amd64 | sed "s/-[^-]*$/-$host_arch/") +++ +++if ! $jdk_path/bin/java -version 2>/dev/null; then +++ echo >&2 "error: $jdk_path/bin/java not found" +++ exit 1 +++fi +++ +++if $jdk_path/bin/java -version 2>/dev/null | grep -F --quiet Zero ; then +++ echo >&2 "skipping tests with the Zero interpreter" +++ exit 77 +++fi +++ +++cleanup() { +++ # kill window manager to clean up (rest will exit automatically) +++ pid="$(jobs -p)" +++ if [ -n "$pid" ]; then +++ xvfbpid="$(pgrep -l -P ${pid} | grep xvfb-run | cut -d' ' -f1)" +++ if [ -n "$xvfbpid" ]; then +++ pgrep -l -P ${xvfbpid} | grep xfwm4 | cut -d' ' -f1 | xargs kill -9 +++ fi +++ fi +++} +++ +++for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done +++trap cleanup EXIT +++ +++export HOME="${AUTOPKGTEST_TMP}" +++export XAUTHORITY="${AUTOPKGTEST_TMP}/.Xauthority" +++export DISPLAY=:10 +++debian/tests/start-xvfb.sh 10 & +++sleep 3 +++ +++JDK_JTREG_PATH=test/jdk +++JDK_JTREG_NATIVE_PATH=${jdk_path}/testsuite/jdk/jtreg/native +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++ +++debian/tests/write-problems.sh ${problem_list} ${JDK_JTREG_PATH}/ProblemList.txt jdk +++ +++ARGS="$*" +++JT_DEFAULT_ARGS="-exclude:${problem_list} -k:!stress :tier1" +++JT_ARGS=${ARGS:-$JT_DEFAULT_ARGS} +++ +++debian/tests/jtreg-autopkgtest.sh jdk \ +++ -dir:${JDK_JTREG_PATH} \ +++ -nativepath:${JDK_JTREG_NATIVE_PATH} \ +++ $JT_ARGS diff --cc debian/tests/jtdiff-autopkgtest.in index 000000000,000000000,000000000..9f076f5e2 new file mode 100644 --- /dev/null +++ b/debian/tests/jtdiff-autopkgtest.in @@@@ -1,0 -1,0 -1,0 +1,58 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++testsuite=$1 +++shift +++ +++if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then +++ echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2 +++ exit 1 +++fi +++ +++host_arch=${DEB_HOST_ARCH:-$(dpkg --print-architecture)} +++ +++if grep -q -w "${host_arch}" debian/tests/hotspot-archs; then +++ default_vm=hotspot +++else +++ default_vm=zero +++fi +++ +++vmname=${VMNAME:-${default_vm}} +++ +++jt_report_tb="@doc_dir@/test-${host_arch}/jtreport-${vmname}.tar.gz" +++ +++if [ ! -f "${jt_report_tb}" ]; then +++ echo "Unable to compare jtreg results: no build jtreport found for ${vmname}/${host_arch}." +++ echo "Reason: '${jt_report_tb}' does not exist." +++ exit 77 +++fi +++ +++# create directories to hold the results +++mkdir -p "${AUTOPKGTEST_ARTIFACTS}/${testsuite}" +++mkdir -p "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report" +++ +++current_report_dir="${AUTOPKGTEST_ARTIFACTS}/${testsuite}" +++previous_report_dir="${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report/${testsuite}" +++ +++# extract testsuite results from openjdk package +++[ -d "${previous_report_dir}" ] || \ +++ tar -xf "${jt_report_tb}" --strip-components=1 -C "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report" +++ +++ +++jtdiff -o "${current_report_dir}/jtdiff.html" "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" || true +++jtdiff "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" | tee "${current_report_dir}/jtdiff.txt" || true +++ +++# create jdiff super-diff structure +++jtdiff_dir="${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/${host_arch}" +++mkdir -p "${jtdiff_dir}/"{1,2} "${current_report_dir}/jtdiff-super" +++ln -sf "${previous_report_dir}/"[0-9] "${jtdiff_dir}/1/" +++ln -sf "${current_report_dir}/"[0-9] "${jtdiff_dir}/2/" +++ +++# run jtdiff super-diff +++jtdiff -o "${current_report_dir}/jtdiff-super/" -s "${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/" || true +++ +++# fail if we detect a regression +++if egrep '^(pass|---) +(fail|error)' "${current_report_dir}/jtdiff.txt"; then exit 1; else exit 0; fi diff --cc debian/tests/jtdiff-autopkgtest.sh index 000000000,000000000,000000000..80b4178bf new file mode 100755 --- /dev/null +++ b/debian/tests/jtdiff-autopkgtest.sh @@@@ -1,0 -1,0 -1,0 +1,58 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++testsuite=$1 +++shift +++ +++if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then +++ echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2 +++ exit 1 +++fi +++ +++host_arch=${DEB_HOST_ARCH:-$(dpkg --print-architecture)} +++ +++if grep -q -w "${host_arch}" debian/tests/hotspot-archs; then +++ default_vm=hotspot +++else +++ default_vm=zero +++fi +++ +++vmname=${VMNAME:-${default_vm}} +++ +++jt_report_tb="/usr/share/doc/openjdk-21-jre-headless//test-${host_arch}/jtreport-${vmname}.tar.gz" +++ +++if [ ! -f "${jt_report_tb}" ]; then +++ echo "Unable to compare jtreg results: no build jtreport found for ${vmname}/${host_arch}." +++ echo "Reason: '${jt_report_tb}' does not exist." +++ exit 77 +++fi +++ +++# create directories to hold the results +++mkdir -p "${AUTOPKGTEST_ARTIFACTS}/${testsuite}" +++mkdir -p "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report" +++ +++current_report_dir="${AUTOPKGTEST_ARTIFACTS}/${testsuite}" +++previous_report_dir="${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report/${testsuite}" +++ +++# extract testsuite results from openjdk package +++[ -d "${previous_report_dir}" ] || \ +++ tar -xf "${jt_report_tb}" --strip-components=1 -C "${AUTOPKGTEST_TMP}/openjdk-pkg-jtreg-report" +++ +++ +++jtdiff -o "${current_report_dir}/jtdiff.html" "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" || true +++jtdiff "${previous_report_dir}/JTreport" "${current_report_dir}/JTreport" | tee "${current_report_dir}/jtdiff.txt" || true +++ +++# create jdiff super-diff structure +++jtdiff_dir="${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/${host_arch}" +++mkdir -p "${jtdiff_dir}/"{1,2} "${current_report_dir}/jtdiff-super" +++ln -sf "${previous_report_dir}/"[0-9] "${jtdiff_dir}/1/" +++ln -sf "${current_report_dir}/"[0-9] "${jtdiff_dir}/2/" +++ +++# run jtdiff super-diff +++jtdiff -o "${current_report_dir}/jtdiff-super/" -s "${AUTOPKGTEST_TMP}/jtdiff-${testsuite}/" || true +++ +++# fail if we detect a regression +++if egrep '^(pass|---) +(fail|error)' "${current_report_dir}/jtdiff.txt"; then exit 1; else exit 0; fi diff --cc debian/tests/jtreg-autopkgtest.in index 000000000,000000000,000000000..6c4c3c317 new file mode 100755 --- /dev/null +++ b/debian/tests/jtreg-autopkgtest.in @@@@ -1,0 -1,0 -1,0 +1,148 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++testsuite=$1 +++shift +++ +++if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then +++ echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2 +++ exit 1 +++fi +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++ +++if [ -z "${JDK_TO_TEST+x}" ]; then +++ JDK_TO_TEST=$(echo @JDK_DIR@ | sed "s/-[^-]*$/-$host_arch/") +++fi +++ +++if [ -z "${BOOTJDK_HOME+x}" ]; then +++ BOOTJDK_HOME=${JDK_TO_TEST} +++fi +++ +++jtreg_version="$(dpkg-query -W @jtreg_pkg@ | cut -f2)" +++ +++# set additional jtreg options +++jt_options="${JTREG_OPTIONS:-}" +++if [[ "armel" == *"${host_arch}"* ]]; then +++ jt_options+=" -Xmx256M" +++fi +++if dpkg --compare-versions ${jtreg_version} ge 4.2; then +++ jt_options+=" -conc:auto" +++fi +++ +++# check java binary +++if [ ! -x "${JDK_TO_TEST}/bin/java" ]; then +++ echo "Error: JDK_TO_TEST: '${JDK_TO_TEST}/bin/java' is not an executable." >&2 +++ exit 1 +++fi +++ +++if [ ! -x "${BOOTJDK_HOME}/bin/java" ]; then +++ echo "Error: BOOTJDK_HOME: '${BOOTJDK_HOME}/bin/java' is not an executable." >&2 +++ exit 1 +++fi +++ +++# restrict the tests to a few archs (set from debian/rules) +++if ! echo "${host_arch}" | grep -qE "^($(echo @jtreg_archs@ | tr ' ' '|'))$"; then +++ echo "Error: ${host_arch} is not on the jtreg_archs list, ignoring it." +++ exit 77 +++fi +++ +++jtreg_processes() { +++ ps x -ww -o pid,ppid,args \ +++ | awk '$2 == 1 && $3 ~ /^\/scratch/' \ +++ | sed "s,${JDK_TO_TEST},,g;s,$(pwd),,g" +++} +++ +++jtreg_pids() { +++ ps x --no-headers -ww -o pid,ppid,args \ +++ | awk "\$2 == 1 && \$3 ~ /^${JDK_TO_TEST//\//\\/}/ {print \$1}" +++} +++ +++cleanup() { +++ # kill testsuite processes still hanging +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] killing processes..." +++ jtreg_processes +++ kill -1 $pids +++ sleep 2 +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] try harder..." +++ jtreg_processes +++ kill -9 $pids +++ sleep 2 +++ fi +++ else +++ echo "[$0] nothing to cleanup" +++ fi +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] leftover processes..." +++ $(jtreg_processes) +++ fi +++} +++ +++trap "cleanup" EXIT INT TERM ERR +++ +++jtwork_dir="${AUTOPKGTEST_TMP}/${testsuite}/JTwork" +++output_dir="${AUTOPKGTEST_ARTIFACTS}/${testsuite}/" +++ +++# retry tests with "fail" or "error" status at most 3 times +++for i in 0 1 2; do +++ # save each try under its own folder to preserve history +++ report_path="${i}/JTreport" +++ report_dir="${output_dir}/${report_path}" +++# see make/RunTests.gmk for a set of good options +++ jtreg ${jt_options} \ +++ -verbose:summary \ +++ -automatic \ +++ -retain:none \ +++ -ignore:quiet \ +++ -agentvm \ +++ -timeout:10 \ +++ -workDir:"${jtwork_dir}" \ +++ -reportDir:"${report_dir}" \ +++ -jdk:${JDK_TO_TEST} \ +++ -vmoption:-Dtest.boot.jdk=${BOOTJDK_HOME} \ +++ -vmoption:-XX:MaxRAMPercentage=25 \ +++ -vmoption:-Duser.home=${AUTOPKGTEST_TMP} \ +++ -vmoption:-Djava.io.tmpdir=${AUTOPKGTEST_TMP} \ +++ -e:NSS_DEFAULT_DB_TYPE=sql \ +++ ${on_retry:-} $@ \ +++ && exit_code=0 || exit_code=$? +++ +++ # copy .jtr files from failed tests for latter debugging +++ find "${jtwork_dir}" -name '*.jtr' -exec egrep -q '^execStatus=[^Pass]' {} \; -printf "%P\n" \ +++ | while IF= read -r jtr; do +++ jtr_dir=$(dirname "${output_dir}/JTwork/${jtr}") +++ mkdir -p "${jtr_dir}" +++ cp --update --preserve --backup=numbered "${jtwork_dir}/${jtr}" "${output_dir}/JTwork/${jtr}" +++ # copy all generated hs_err_pid log into the jtr's directory to easy debugging +++ if grep -qhE 'hs_err_pid[0-9]+\.log' "${output_dir}/JTwork/${jtr}"; then +++ grep -hEo '/[^ ]*/hs_err_pid[0-9]+\.log' "${output_dir}/JTwork/${jtr}" \ +++ | xargs cp --update --preserve --backup=numbered -t "${jtr_dir}" \ +++ || echo "Warning: unable to find hs_err log for ${jtr}" +++ fi +++ done +++ +++ # break if jtdiff reports no difference from previous run +++ # also deletes the just created JTreport +++ # DISABLED: don't use it for now as flaky tests could still pass given more retries +++ #jtdiff "${output_dir}/JTreport" "$report_dir" >/dev/null 2>&1 \ +++ # && rm -rf "${report_dir}" && break +++ +++ # link latest JTreport to output_dir +++ ln -sf -t "${output_dir}" "${report_path}" +++ +++ # if all test passed there is not need for a retry +++ if [ "x${exit_code}" == "x0" ]; then break; fi +++ +++ # only retry tests with fail/error status +++ on_retry="-status:fail,error" +++done +++ +++exit $exit_code diff --cc debian/tests/jtreg-autopkgtest.sh index 000000000,000000000,000000000..0eb71281c new file mode 100755 --- /dev/null +++ b/debian/tests/jtreg-autopkgtest.sh @@@@ -1,0 -1,0 -1,0 +1,148 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++testsuite=$1 +++shift +++ +++if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then +++ echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2 +++ exit 1 +++fi +++ +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++ +++if [ -z "${JDK_TO_TEST+x}" ]; then +++ JDK_TO_TEST=$(echo /usr/lib/jvm/java-21-openjdk-amd64 | sed "s/-[^-]*$/-$host_arch/") +++fi +++ +++if [ -z "${BOOTJDK_HOME+x}" ]; then +++ BOOTJDK_HOME=${JDK_TO_TEST} +++fi +++ +++jtreg_version="$(dpkg-query -W jtreg7 | cut -f2)" +++ +++# set additional jtreg options +++jt_options="${JTREG_OPTIONS:-}" +++if [[ "armel" == *"${host_arch}"* ]]; then +++ jt_options+=" -Xmx256M" +++fi +++if dpkg --compare-versions ${jtreg_version} ge 4.2; then +++ jt_options+=" -conc:auto" +++fi +++ +++# check java binary +++if [ ! -x "${JDK_TO_TEST}/bin/java" ]; then +++ echo "Error: JDK_TO_TEST: '${JDK_TO_TEST}/bin/java' is not an executable." >&2 +++ exit 1 +++fi +++ +++if [ ! -x "${BOOTJDK_HOME}/bin/java" ]; then +++ echo "Error: BOOTJDK_HOME: '${BOOTJDK_HOME}/bin/java' is not an executable." >&2 +++ exit 1 +++fi +++ +++# restrict the tests to a few archs (set from debian/rules) +++if ! echo "${host_arch}" | grep -qE "^($(echo amd64 i386 arm64 armhf ppc64 ppc64el riscv64 s390x alpha ia64 powerpc ppc64 sh4 x32 armel loong64 mipsel mips64el riscv64 | tr ' ' '|'))$"; then +++ echo "Error: ${host_arch} is not on the jtreg_archs list, ignoring it." +++ exit 77 +++fi +++ +++jtreg_processes() { +++ ps x -ww -o pid,ppid,args \ +++ | awk '$2 == 1 && $3 ~ /^\/scratch/' \ +++ | sed "s,${JDK_TO_TEST},,g;s,$(pwd),,g" +++} +++ +++jtreg_pids() { +++ ps x --no-headers -ww -o pid,ppid,args \ +++ | awk "\$2 == 1 && \$3 ~ /^${JDK_TO_TEST//\//\\/}/ {print \$1}" +++} +++ +++cleanup() { +++ # kill testsuite processes still hanging +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] killing processes..." +++ jtreg_processes +++ kill -1 $pids +++ sleep 2 +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] try harder..." +++ jtreg_processes +++ kill -9 $pids +++ sleep 2 +++ fi +++ else +++ echo "[$0] nothing to cleanup" +++ fi +++ pids="$(jtreg_pids)" +++ if [ -n "$pids" ]; then +++ echo "[$0] leftover processes..." +++ $(jtreg_processes) +++ fi +++} +++ +++trap "cleanup" EXIT INT TERM ERR +++ +++jtwork_dir="${AUTOPKGTEST_TMP}/${testsuite}/JTwork" +++output_dir="${AUTOPKGTEST_ARTIFACTS}/${testsuite}/" +++ +++# retry tests with "fail" or "error" status at most 3 times +++for i in 0 1 2; do +++ # save each try under its own folder to preserve history +++ report_path="${i}/JTreport" +++ report_dir="${output_dir}/${report_path}" +++# see make/RunTests.gmk for a set of good options +++ jtreg ${jt_options} \ +++ -verbose:summary \ +++ -automatic \ +++ -retain:none \ +++ -ignore:quiet \ +++ -agentvm \ +++ -timeout:10 \ +++ -workDir:"${jtwork_dir}" \ +++ -reportDir:"${report_dir}" \ +++ -jdk:${JDK_TO_TEST} \ +++ -vmoption:-Dtest.boot.jdk=${BOOTJDK_HOME} \ +++ -vmoption:-XX:MaxRAMPercentage=25 \ +++ -vmoption:-Duser.home=${AUTOPKGTEST_TMP} \ +++ -vmoption:-Djava.io.tmpdir=${AUTOPKGTEST_TMP} \ +++ -e:NSS_DEFAULT_DB_TYPE=sql \ +++ ${on_retry:-} $@ \ +++ && exit_code=0 || exit_code=$? +++ +++ # copy .jtr files from failed tests for latter debugging +++ find "${jtwork_dir}" -name '*.jtr' -exec egrep -q '^execStatus=[^Pass]' {} \; -printf "%P\n" \ +++ | while IF= read -r jtr; do +++ jtr_dir=$(dirname "${output_dir}/JTwork/${jtr}") +++ mkdir -p "${jtr_dir}" +++ cp --update --preserve --backup=numbered "${jtwork_dir}/${jtr}" "${output_dir}/JTwork/${jtr}" +++ # copy all generated hs_err_pid log into the jtr's directory to easy debugging +++ if grep -qhE 'hs_err_pid[0-9]+\.log' "${output_dir}/JTwork/${jtr}"; then +++ grep -hEo '/[^ ]*/hs_err_pid[0-9]+\.log' "${output_dir}/JTwork/${jtr}" \ +++ | xargs cp --update --preserve --backup=numbered -t "${jtr_dir}" \ +++ || echo "Warning: unable to find hs_err log for ${jtr}" +++ fi +++ done +++ +++ # break if jtdiff reports no difference from previous run +++ # also deletes the just created JTreport +++ # DISABLED: don't use it for now as flaky tests could still pass given more retries +++ #jtdiff "${output_dir}/JTreport" "$report_dir" >/dev/null 2>&1 \ +++ # && rm -rf "${report_dir}" && break +++ +++ # link latest JTreport to output_dir +++ ln -sf -t "${output_dir}" "${report_path}" +++ +++ # if all test passed there is not need for a retry +++ if [ "x${exit_code}" == "x0" ]; then break; fi +++ +++ # only retry tests with fail/error status +++ on_retry="-status:fail,error" +++done +++ +++exit $exit_code diff --cc debian/tests/langtools index 000000000,000000000,000000000..def751688 new file mode 100755 --- /dev/null +++ b/debian/tests/langtools @@@@ -1,0 -1,0 -1,0 +1,15 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++problem_list=${AUTOPKGTEST_TMP}/problems.txt +++debian/tests/write-problems.sh ${problem_list} test/langtools/ProblemList.txt langtools +++ +++debian/tests/jtreg-autopkgtest.sh langtools \ +++ -exclude:${problem_list} \ +++ -dir:test/langtools \ +++ -k:!stress \ +++ :tier1 :tier2 +++debian/tests/jtdiff-autopkgtest.sh langtools diff --cc debian/tests/problems.csv index 000000000,000000000,000000000..332d54a93 new file mode 100644 --- /dev/null +++ b/debian/tests/problems.csv @@@@ -1,0 -1,0 -1,0 +1,84 @@@@ +++Test,Bug,Comment,Packages,Arch,Release +++Error: runtime/Unsafe/InternalErrorTest.java,JDK-8335238,"To investigate, not critical for security release – JDK-22 will expire before OO release",:openjdk-22,i386,:release-all +++Error: serviceability/jvmti/vthread/SuspendResume1/SuspendResume1.java#default,,"Deadlock, new failure, not critical – JDK-22 will expire before OO release",:openjdk-22,ppc64el,:release-all +++FAILED: compiler/arguments/CheckCICompilerCount.java,,"Existing failure (exit code 0, expected 1)",:openjdk-17:openjdk-21:openjdk-22,i386,:release-all +++FAILED: compiler/codecache/MHIntrinsicAllocFailureTest.java,JDK-8298947,The issue only happens on armhf platform. ,:openjdk-17:openjdk-21,armhf,:release-all +++FAILED: gtest/GTestWrapper.java,,"17:UninitializedDoubleElementWorkerDataArrayTest.print_summary_on_test_vm, ",:openjdk-17:openjdk-21,i386,:release-all +++FAILED: java/foreign/critical/TestCritical.java,,"SEGSEGV in test, submit bug, not critical for security release",:openjdk-22,s390x,:release-all +++FAILED: java/foreign/StdLibTest.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestAddressDereference.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestIllegalLink.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestLinker.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestSegments.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestUpcallHighArity.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/foreign/TestUpcallStructScope.java,,Ignore test failure in the preview api,:openjdk-21,:i386,:release-all +++FAILED: java/io/File/createTempFile/TargetDirectory.java,JDK-8166162,Container issue,:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/io/File/GetXSpace.java,,"Container issue, disk space size exceeds 32 bit integer",:openjdk-17:openjdk-21:openjdk-22,:i386:armhf,:release-all +++FAILED: java/nio/channels/FileChannel/directio/DirectIOTest.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/channels/FileChannel/directio/PreadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/channels/FileChannel/directio/PwriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/channels/FileChannel/directio/ReadDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/channels/FileChannel/directio/WriteDirect.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/attribute/AclFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java,JDK-8166162,Container issue,:openjdk-22,i386,:release-all +++FAILED: java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/attribute/DosFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/attribute/PosixFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/CheckPermissions.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/CopyAndMove.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/CopyMoveVariations.java,JDK-8166162,Container issue,:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/FileAttributes.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/InterruptCopy.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/Misc.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/Files/TemporaryFiles.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: java/nio/file/FileStore/Basic.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11::openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java,,flaky test (?) existing comment,:openjdk-17,:arch-all,:release-all +++FAILED: runtime/cds/appcds/jcmd/JCmdTestFileSafety.java,,flaky test (?) existing comment,:openjdk-17,i386:arm64:amd64:ppc64el,:release-all +++FAILED: runtime/cds/appcds/jcmd/JCmdTestStaticDump.java,,flaky test (?) existing comment,:openjdk-17,:arch-all,:release-all +++FAILED: runtime/ErrorHandling/MachCodeFramesInErrorFile.java,,java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code at java.base/java.lang.Long.toHexString(Long.java:309) at,:openjdk-17:openjdk-21,armhf,:release-all +++FAILED: runtime/jni/nativeStack/TestNativeStack.java,JDK-8312016,"Backport fix (do not add patch, the fix just disables the test)",:openjdk-lts:openjdk-11:openjdk-17,armhf,:release-all +++FAILED: runtime/LoadClass/LongBCP.java,JDK-8166162,Container issue,:openjdk-lts:openjdk-11:openjdk-17:openjdk-21:openjdk-22,:arch-all,:release-all +++FAILED: runtime/Monitor/ConcurrentDeflation.java,,LockingMode == 0 (LM_MONITOR) is not fully implemented on this architectureError: Could not create the Java Virtual Machine.,:openjdk-21,armhf,:release-all +++FAILED: runtime/NMT/VirtualAllocCommitMerge.java,JDK-8309698,P4 bug (existing issue),:openjdk-21:openjdk-22,s390x,:release-all +++FAILED: serviceability/AsyncGetCallTrace/MyPackage/ASGCTBaseTest.java,JDK-8303168,Existing bug,:openjdk-21,armhf,:release-all +++FAILED: tools/jlink/JLinkTest.java,JDK-8240349,Bugfix failed for i386 (P4 bug),:openjdk-17:openjdk-21:openjdk-22,i386,:release-all +++FAILED: jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/T6735320/T6735320.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testBadHtml/TestBadHtml.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testLinkOption/TestLinkOption.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testSeeTag/TestSeeTag.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testStylesheet/TestStylesheet.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testSupplementary/TestSupplementary.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testValueTag/TestValueTag.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/doclet/testWarnings/TestWarnings.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/tool/doclint/DocLintTest.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: jdk/javadoc/tool/modules/Modules.java,,tests failing due to disable-doclint-by-default.diff (reproducible build maintainer patch),:openjdk-lts:openjdk-11,:arch-all,:release-all +++FAILED: sun/security/ec/TestEC.java,,"New failure in CI, passes locally",:openjdk-lts:openjdk-11,:amd64:arm64,:release-all +++FAILED: runtime/NMT/SafepointPollingPages.java,,ThreadLocalHandshakes not yet supported on this platform. Disable test,:openjdk-lts:openjdk-11,:armhf,:release-all +++FAILED: serviceability/attach/ConcAttachTest.java,,java.lang.RuntimeException: Process is still alive. Can't get its output.,:openjdk-lts:openjdk-11,:armhf,:release-all +++FAILED: serviceability/attach/RemovingUnixDomainSocketTest.java,,java.lang.RuntimeException: Process is still alive. Can't get its output.,:openjdk-lts:openjdk-11,:armhf,:release-all +++FAILED: runtime/cds/appcds/jcmd/JCmdTestStaticDump.java,,Lingered App not found (CI),:openjdk-17,:amd64,:release-all +++FAILED: runtime/appcds/sharedStrings/LargePages.java,, passes locally. class not found JarBuilder. I have seen it several times - the class file that is being produced in compilation step can not be read from disk in CI. ,:openjdk-lts:openjdk-11,:arm64,:focal +++FAILED: runtime/appcds/sharedStrings/IncompatibleOptions.java,, passes locally. NoClassDefFound: TestCommon. Same as above.,:openjdk-lts:openjdk-11,:arm64,:focal +++FAILED: java/foreign/StdLibTest.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestIllegalLink.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestDowncallStack.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestDowncallScope.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestSegments.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestLinker.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestAddressDereference.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestUpcallHighArity.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestUpcallStructScope.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestUpcallScope.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestUpcallAsync.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestUpcallStack.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: java/foreign/TestVarArgs.java,, asserts due to the invalid structure size. Ignore as this is a preview API and the issue does not occur in openjdk-22. I will add it to the problemlist.,:openjdk-21,:armhf,:release-all +++FAILED: runtime/os/TestTrimNative.java#trimNative,, java.lang.RuntimeException: We found fewer (periodic) trim lines in UL log than expected (expected at least 13 found 11). This looks like a flaky test - it asserts number of lines from the periodic trimmer e.g. src/hotspot/share/runtime/trimNativeHeap.hpp:56 which causes the test to fail due to the slow VM. Test passes locally.,:openjdk-21,:armhf,:release-all diff --cc debian/tests/start-xvfb.sh index 000000000,000000000,000000000..8c5fe4bed new file mode 100755 --- /dev/null +++ b/debian/tests/start-xvfb.sh @@@@ -1,0 -1,0 -1,0 +1,21 @@@@ +++#!/bin/bash +++set -o errexit +++set -o errtrace +++set -o pipefail +++set -o nounset +++ +++if [ -z "${AUTOPKGTEST_TMP+x}" ] || [ -z "${AUTOPKGTEST_ARTIFACTS+x}" ]; then +++ echo "Environment variables AUTOPKGTEST_TMP and AUTOPKGTEST_ARTIFACTS must be set" >&2 +++ exit 1 +++fi +++export XAUTHORITY="${AUTOPKGTEST_TMP}/.Xauthority" +++export XDG_CACHE_HOME="${AUTOPKGTEST_TMP}" +++export XDG_DATA_HOME="${AUTOPKGTEST_TMP}" +++export XDG_CONFIG_HOME="${AUTOPKGTEST_TMP}" +++export XDG_RUNTIME_DIR=`mktemp -d` +++ +++exec dbus-run-session xvfb-run --server-num=${1:-10} \ +++ --error-file="${AUTOPKGTEST_ARTIFACTS}/xvfb-run.log" \ +++ --auth-file=${XAUTHORITY} \ +++ --server-args="-fbdir ${AUTOPKGTEST_TMP} -pixdepths 8 16 24 32 -extension GLX -screen 0 1600x900x24" \ +++ xfwm4 diff --cc debian/tests/write-problems.in index 000000000,000000000,000000000..945d5e3c5 new file mode 100644 --- /dev/null +++ b/debian/tests/write-problems.in @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++#!/bin/bash +++ +++problem_list=$1 +++upstream_problems=$2 +++ +++cat ${upstream_problems} > ${problem_list} +++distrel=`lsb_release --codename --short` +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++ +++grep -e ${host_arch} -e "arch-all" debian/tests/problems.csv | \ +++ grep -e ${distrel} -e "release-all" | \ +++ grep -e "@basename@" | \ +++ awk -F',|:' '{gsub(/ /, "", $2); print $2" 000000 generic-all" }' >> ${problem_list} diff --cc debian/tests/write-problems.sh index 000000000,000000000,000000000..3674ed940 new file mode 100755 --- /dev/null +++ b/debian/tests/write-problems.sh @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++#!/bin/bash +++ +++problem_list=$1 +++upstream_problems=$2 +++ +++cat ${upstream_problems} > ${problem_list} +++distrel=`lsb_release --codename --short` +++host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +++ +++grep -e ${host_arch} -e "arch-all" debian/tests/problems.csv | \ +++ grep -e ${distrel} -e "release-all" | \ +++ grep -e "openjdk-21" | \ +++ awk -F',|:' '{gsub(/ /, "", $2); print $2" 000000 generic-all" }' >> ${problem_list} diff --cc debian/update-hgrev.sh index 000000000,000000000,000000000..8df65cf0d new file mode 100644 --- /dev/null +++ b/debian/update-hgrev.sh @@@@ -1,0 -1,0 -1,0 +1,29 @@@@ +++#!/bin/bash +++ +++tarballs=(corba.tar.gz hotspot.tar.gz jaxp.tar.gz jaxws.tar.gz jdk-dfsg.tar.gz langtools-dfsg.tar.gz openjdk.tar.gz) +++varhgchange=(CORBA_CHANGESET HOTSPOT_CHANGESET JAXP_CHANGESET JAXWS_CHANGESET JDK_CHANGESET LANGTOOLS_CHANGESET OPENJDK_CHANGESET) +++tarballdir=. +++ +++makefile1=Makefile.am +++ +++function update_var() { +++ varname=$1 +++ newsum=$2 +++ +++ echo "$varname: ${newsum}" +++ if [ -f $makefile1 ]; then +++ sed -i "s/\(^$varname\)\(..*$\)/\1 = ${newsum}/" $makefile1 +++ fi +++} +++ +++function actual_tar_rev() { +++ tar=$1 +++ +++ revision=$(tar tf $tar | head -1 | sed 's,/.*,,' | sed 's,.*-,,') +++} +++ +++# For all modules +++for (( i = 0 ; i < ${#varhgchange[@]} ; i++ )); do +++ actual_tar_rev $tarballdir/${tarballs[$i]} +++ update_var ${varhgchange[$i]} $revision +++done diff --cc debian/update-shasum.sh index 000000000,000000000,000000000..af38b9247 new file mode 100644 --- /dev/null +++ b/debian/update-shasum.sh @@@@ -1,0 -1,0 -1,0 +1,23 @@@@ +++#!/bin/bash +++ +++tarballs=(jdk-dfsg.tar.gz langtools-dfsg.tar.gz) +++varshasum=(JDK_SHA256SUM LANGTOOLS_SHA256SUM) +++tarballdir=. +++ +++makefile1=Makefile.am +++ +++function update_var() { +++ varname=$1 +++ newsum=$2 +++ +++ echo "$varname: ${newsum}" +++ if [ -f $makefile1 ]; then +++ sed -i "s/\(^$varname\)\(..*$\)/\1 = ${newsum}/" $makefile1 +++ fi +++} +++ +++# For all modules +++for (( i = 0 ; i < ${#tarballs[@]} ; i++ )); do +++ newsum=$(sha256sum $tarballdir/${tarballs[$i]} | cut -f 1 -d ' ') +++ update_var ${varshasum[$i]} $newsum +++done diff --cc debian/watch index 000000000,000000000,000000000..e7fc7d810 new file mode 100644 --- /dev/null +++ b/debian/watch @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++version=4 +++opts=\ +++repack,repacksuffix=ea,oversionmangle=s/\+(\d+)/\~$1/,dversionmangle=s/\~(\d*)ea$/\+$1/,\ +++compression=xz, \ +++ https://github.com/openjdk/jdk21u/tags \ +++ (?:.*?/)?jdk-(21[\+\.\d]*)\.tar\.gz +++ +++opts=\ +++component=googletest,\ +++repack,\ +++compression=xz \ +++ https://github.com/google/googletest/tags \ +++ (?:.*?/)?v(1.14.0)\.tar\.gz 1.14.0 diff --cc debian/watch.in index 000000000,000000000,000000000..032eae7ee new file mode 100644 --- /dev/null +++ b/debian/watch.in @@@@ -1,0 -1,0 -1,0 +1,13 @@@@ +++version=4 +++opts=\ +++repack,repacksuffix=ea,oversionmangle=s/\+(\d+)/\~$1/,dversionmangle=s/\~(\d*)ea$/\+$1/,\ +++compression=xz, \ +++ @git_url@ \ +++ (?:.*?/)?jdk-(@shortver@[\+\.\d]*)\.tar\.gz +++ +++opts=\ +++component=googletest,\ +++repack,\ +++compression=xz \ +++ @gtest_repo@ \ +++ (?:.*?/)?v(@gtest_tag@)\.tar\.gz @gtest_tag@ diff --cc googletest/.clang-format index 000000000,000000000,000000000..5b9bfe6d2 new file mode 100644 --- /dev/null +++ b/googletest/.clang-format @@@@ -1,0 -1,0 -1,0 +1,4 @@@@ +++# Run manually to reformat a file: +++# clang-format -i --style=file +++Language: Cpp +++BasedOnStyle: Google diff --cc googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml index 000000000,000000000,000000000..586779ad2 new file mode 100644 --- /dev/null +++ b/googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml @@@@ -1,0 -1,0 -1,0 +1,53 @@@@ +++name: Bug Report +++description: Let us know that something does not work as expected. +++title: "[Bug]: Please title this bug report" +++body: +++ - type: textarea +++ id: what-happened +++ attributes: +++ label: Describe the issue +++ description: What happened, and what did you expect to happen? +++ validations: +++ required: true +++ - type: textarea +++ id: steps +++ attributes: +++ label: Steps to reproduce the problem +++ description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful. +++ validations: +++ required: true +++ - type: textarea +++ id: version +++ attributes: +++ label: What version of GoogleTest are you using? +++ description: Please include the output of `git rev-parse HEAD` or the GoogleTest release version number that you are using. +++ validations: +++ required: true +++ - type: textarea +++ id: os +++ attributes: +++ label: What operating system and version are you using? +++ description: If you are using a Linux distribution please include the name and version of the distribution as well. +++ validations: +++ required: true +++ - type: textarea +++ id: compiler +++ attributes: +++ label: What compiler and version are you using? +++ description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler. +++ validations: +++ required: true +++ - type: textarea +++ id: buildsystem +++ attributes: +++ label: What build system are you using? +++ description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system. +++ validations: +++ required: true +++ - type: textarea +++ id: additional +++ attributes: +++ label: Additional context +++ description: Add any other context about the problem here. +++ validations: +++ required: false diff --cc googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml index 000000000,000000000,000000000..f3bbc091e new file mode 100644 --- /dev/null +++ b/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml @@@@ -1,0 -1,0 -1,0 +1,33 @@@@ +++name: Feature request +++description: Propose a new feature. +++title: "[FR]: Please title this feature request" +++labels: "enhancement" +++body: +++ - type: textarea +++ id: version +++ attributes: +++ label: Does the feature exist in the most recent commit? +++ description: We recommend using the latest commit from GitHub in your projects. +++ validations: +++ required: true +++ - type: textarea +++ id: why +++ attributes: +++ label: Why do we need this feature? +++ description: Ideally, explain why a combination of existing features cannot be used instead. +++ validations: +++ required: true +++ - type: textarea +++ id: proposal +++ attributes: +++ label: Describe the proposal. +++ description: Include a detailed description of the feature, with usage examples. +++ validations: +++ required: true +++ - type: textarea +++ id: platform +++ attributes: +++ label: Is the feature specific to an operating system, compiler, or build system version? +++ description: If it is, please specify which versions. +++ validations: +++ required: true diff --cc googletest/.github/ISSUE_TEMPLATE/config.yml index 000000000,000000000,000000000..65170d10a new file mode 100644 --- /dev/null +++ b/googletest/.github/ISSUE_TEMPLATE/config.yml @@@@ -1,0 -1,0 -1,0 +1,5 @@@@ +++blank_issues_enabled: false +++contact_links: +++ - name: Get Help +++ url: https://github.com/google/googletest/discussions +++ about: Please ask and answer questions here. diff --cc googletest/.github/workflows/gtest-ci.yml index 000000000,000000000,000000000..03a8cc5e2 new file mode 100644 --- /dev/null +++ b/googletest/.github/workflows/gtest-ci.yml @@@@ -1,0 -1,0 -1,0 +1,43 @@@@ +++name: ci +++ +++on: +++ push: +++ pull_request: +++ +++env: +++ BAZEL_CXXOPTS: -std=c++14 +++ +++jobs: +++ Linux: +++ runs-on: ubuntu-latest +++ steps: +++ +++ - uses: actions/checkout@v3 +++ with: +++ fetch-depth: 0 +++ +++ - name: Tests +++ run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... +++ +++ macOS: +++ runs-on: macos-latest +++ steps: +++ +++ - uses: actions/checkout@v3 +++ with: +++ fetch-depth: 0 +++ +++ - name: Tests +++ run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... +++ +++ +++ Windows: +++ runs-on: windows-latest +++ steps: +++ +++ - uses: actions/checkout@v3 +++ with: +++ fetch-depth: 0 +++ +++ - name: Tests +++ run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ... diff --cc googletest/.gitignore index 000000000,000000000,000000000..fede02f65 new file mode 100644 --- /dev/null +++ b/googletest/.gitignore @@@@ -1,0 -1,0 -1,0 +1,88 @@@@ +++# Ignore CI build directory +++build/ +++xcuserdata +++cmake-build-debug/ +++.idea/ +++bazel-bin +++bazel-genfiles +++bazel-googletest +++bazel-out +++bazel-testlogs +++# python +++*.pyc +++ +++# Visual Studio files +++.vs +++*.sdf +++*.opensdf +++*.VC.opendb +++*.suo +++*.user +++_ReSharper.Caches/ +++Win32-Debug/ +++Win32-Release/ +++x64-Debug/ +++x64-Release/ +++ +++# VSCode files +++.cache/ +++cmake-variants.yaml +++ +++# Ignore autoconf / automake files +++Makefile.in +++aclocal.m4 +++configure +++build-aux/ +++autom4te.cache/ +++googletest/m4/libtool.m4 +++googletest/m4/ltoptions.m4 +++googletest/m4/ltsugar.m4 +++googletest/m4/ltversion.m4 +++googletest/m4/lt~obsolete.m4 +++googlemock/m4 +++ +++# Ignore generated directories. +++googlemock/fused-src/ +++googletest/fused-src/ +++ +++# macOS files +++.DS_Store +++googletest/.DS_Store +++googletest/xcode/.DS_Store +++ +++# Ignore cmake generated directories and files. +++CMakeFiles +++CTestTestfile.cmake +++Makefile +++cmake_install.cmake +++googlemock/CMakeFiles +++googlemock/CTestTestfile.cmake +++googlemock/Makefile +++googlemock/cmake_install.cmake +++googlemock/gtest +++/bin +++/googlemock/gmock.dir +++/googlemock/gmock_main.dir +++/googlemock/RUN_TESTS.vcxproj.filters +++/googlemock/RUN_TESTS.vcxproj +++/googlemock/INSTALL.vcxproj.filters +++/googlemock/INSTALL.vcxproj +++/googlemock/gmock_main.vcxproj.filters +++/googlemock/gmock_main.vcxproj +++/googlemock/gmock.vcxproj.filters +++/googlemock/gmock.vcxproj +++/googlemock/gmock.sln +++/googlemock/ALL_BUILD.vcxproj.filters +++/googlemock/ALL_BUILD.vcxproj +++/lib +++/Win32 +++/ZERO_CHECK.vcxproj.filters +++/ZERO_CHECK.vcxproj +++/RUN_TESTS.vcxproj.filters +++/RUN_TESTS.vcxproj +++/INSTALL.vcxproj.filters +++/INSTALL.vcxproj +++/googletest-distribution.sln +++/CMakeCache.txt +++/ALL_BUILD.vcxproj.filters +++/ALL_BUILD.vcxproj diff --cc googletest/BUILD.bazel index 000000000,000000000,000000000..b1e3b7fba new file mode 100644 --- /dev/null +++ b/googletest/BUILD.bazel @@@@ -1,0 -1,0 -1,0 +1,219 @@@@ +++# Copyright 2017 Google Inc. +++# All Rights Reserved. +++# +++# +++# Redistribution and use in source and binary forms, with or without +++# modification, are permitted provided that the following conditions are +++# met: +++# +++# * Redistributions of source code must retain the above copyright +++# notice, this list of conditions and the following disclaimer. +++# * Redistributions in binary form must reproduce the above +++# copyright notice, this list of conditions and the following disclaimer +++# in the documentation and/or other materials provided with the +++# distribution. +++# * Neither the name of Google Inc. nor the names of its +++# contributors may be used to endorse or promote products derived from +++# this software without specific prior written permission. +++# +++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++# +++# Bazel Build for Google C++ Testing Framework(Google Test) +++ +++package(default_visibility = ["//visibility:public"]) +++ +++licenses(["notice"]) +++ +++exports_files(["LICENSE"]) +++ +++config_setting( +++ name = "qnx", +++ constraint_values = ["@platforms//os:qnx"], +++) +++ +++config_setting( +++ name = "windows", +++ constraint_values = ["@platforms//os:windows"], +++) +++ +++config_setting( +++ name = "freebsd", +++ constraint_values = ["@platforms//os:freebsd"], +++) +++ +++config_setting( +++ name = "openbsd", +++ constraint_values = ["@platforms//os:openbsd"], +++) +++ +++config_setting( +++ name = "msvc_compiler", +++ flag_values = { +++ "@bazel_tools//tools/cpp:compiler": "msvc-cl", +++ }, +++ visibility = [":__subpackages__"], +++) +++ +++config_setting( +++ name = "has_absl", +++ values = {"define": "absl=1"}, +++) +++ +++# Library that defines the FRIEND_TEST macro. +++cc_library( +++ name = "gtest_prod", +++ hdrs = ["googletest/include/gtest/gtest_prod.h"], +++ includes = ["googletest/include"], +++) +++ +++# Google Test including Google Mock +++cc_library( +++ name = "gtest", +++ srcs = glob( +++ include = [ +++ "googletest/src/*.cc", +++ "googletest/src/*.h", +++ "googletest/include/gtest/**/*.h", +++ "googlemock/src/*.cc", +++ "googlemock/include/gmock/**/*.h", +++ ], +++ exclude = [ +++ "googletest/src/gtest-all.cc", +++ "googletest/src/gtest_main.cc", +++ "googlemock/src/gmock-all.cc", +++ "googlemock/src/gmock_main.cc", +++ ], +++ ), +++ hdrs = glob([ +++ "googletest/include/gtest/*.h", +++ "googlemock/include/gmock/*.h", +++ ]), +++ copts = select({ +++ ":qnx": [], +++ ":windows": [], +++ "//conditions:default": ["-pthread"], +++ }), +++ defines = select({ +++ ":has_absl": ["GTEST_HAS_ABSL=1"], +++ "//conditions:default": [], +++ }), +++ features = select({ +++ ":windows": ["windows_export_all_symbols"], +++ "//conditions:default": [], +++ }), +++ includes = [ +++ "googlemock", +++ "googlemock/include", +++ "googletest", +++ "googletest/include", +++ ], +++ linkopts = select({ +++ ":qnx": ["-lregex"], +++ ":windows": [], +++ ":freebsd": [ +++ "-lm", +++ "-pthread", +++ ], +++ ":openbsd": [ +++ "-lm", +++ "-pthread", +++ ], +++ "//conditions:default": ["-pthread"], +++ }), +++ deps = select({ +++ ":has_absl": [ +++ "@com_google_absl//absl/container:flat_hash_set", +++ "@com_google_absl//absl/debugging:failure_signal_handler", +++ "@com_google_absl//absl/debugging:stacktrace", +++ "@com_google_absl//absl/debugging:symbolize", +++ "@com_google_absl//absl/flags:flag", +++ "@com_google_absl//absl/flags:parse", +++ "@com_google_absl//absl/flags:reflection", +++ "@com_google_absl//absl/flags:usage", +++ "@com_google_absl//absl/strings", +++ "@com_google_absl//absl/types:any", +++ "@com_google_absl//absl/types:optional", +++ "@com_google_absl//absl/types:variant", +++ "@com_googlesource_code_re2//:re2", +++ ], +++ "//conditions:default": [], +++ }), +++) +++ +++cc_library( +++ name = "gtest_main", +++ srcs = ["googlemock/src/gmock_main.cc"], +++ features = select({ +++ ":windows": ["windows_export_all_symbols"], +++ "//conditions:default": [], +++ }), +++ deps = [":gtest"], +++) +++ +++# The following rules build samples of how to use gTest. +++cc_library( +++ name = "gtest_sample_lib", +++ srcs = [ +++ "googletest/samples/sample1.cc", +++ "googletest/samples/sample2.cc", +++ "googletest/samples/sample4.cc", +++ ], +++ hdrs = [ +++ "googletest/samples/prime_tables.h", +++ "googletest/samples/sample1.h", +++ "googletest/samples/sample2.h", +++ "googletest/samples/sample3-inl.h", +++ "googletest/samples/sample4.h", +++ ], +++ features = select({ +++ ":windows": ["windows_export_all_symbols"], +++ "//conditions:default": [], +++ }), +++) +++ +++cc_test( +++ name = "gtest_samples", +++ size = "small", +++ # All Samples except: +++ # sample9 (main) +++ # sample10 (main and takes a command line option and needs to be separate) +++ srcs = [ +++ "googletest/samples/sample1_unittest.cc", +++ "googletest/samples/sample2_unittest.cc", +++ "googletest/samples/sample3_unittest.cc", +++ "googletest/samples/sample4_unittest.cc", +++ "googletest/samples/sample5_unittest.cc", +++ "googletest/samples/sample6_unittest.cc", +++ "googletest/samples/sample7_unittest.cc", +++ "googletest/samples/sample8_unittest.cc", +++ ], +++ linkstatic = 0, +++ deps = [ +++ "gtest_sample_lib", +++ ":gtest_main", +++ ], +++) +++ +++cc_test( +++ name = "sample9_unittest", +++ size = "small", +++ srcs = ["googletest/samples/sample9_unittest.cc"], +++ deps = [":gtest"], +++) +++ +++cc_test( +++ name = "sample10_unittest", +++ size = "small", +++ srcs = ["googletest/samples/sample10_unittest.cc"], +++ deps = [":gtest"], +++) diff --cc googletest/CMakeLists.txt index 000000000,caafa8c76,000000000..089ac987f mode 000000,100644,000000..100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@@@ -1,0 -1,330 -1,0 +1,27 @@@@ - ######################################################################## + +# Note: CMake support is community-based. The maintainers do not use CMake + +# internally. - # - # CMake build script for Google Test. - # - # To run the tests for Google Test itself on Linux, use 'make test' or - # ctest. You can select which tests to run using 'ctest -R regex'. - # For more options, run 'ctest --help'. - - # When other libraries are using a shared version of runtime libraries, - # Google Test also has to use one. - option( - gtest_force_shared_crt - "Use shared (DLL) run-time lib even when Google Test is built as static lib." - OFF) - - option(gtest_build_tests "Build all of gtest's own tests." OFF) - - option(gtest_build_samples "Build gtest's sample programs." OFF) - - option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF) - - option( - gtest_hide_internal_symbols - "Build gtest with internal symbols hidden in shared libraries." - OFF) - - # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). - include(cmake/hermetic_build.cmake OPTIONAL) - - if (COMMAND pre_project_set_up_hermetic_build) - pre_project_set_up_hermetic_build() - endif() - - ######################################################################## - # - # Project-wide settings - - # Name of the project. - # - # CMake files in this project can refer to the root source directory - # as ${gtest_SOURCE_DIR} and to the root binary directory as - # ${gtest_BINARY_DIR}. - # Language "C" is required for find_package(Threads). - - # Project version: + + + +cmake_minimum_required(VERSION 3.13) - project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) - - if (COMMAND set_up_hermetic_build) - set_up_hermetic_build() - endif() - - # These commands only run if this is the main project - if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution") - - # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to - # make it prominent in the GUI. - option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) - - else() - - mark_as_advanced( - gtest_force_shared_crt - gtest_build_tests - gtest_build_samples - gtest_disable_pthreads - gtest_hide_internal_symbols) - - endif() - - - if (gtest_hide_internal_symbols) - set(CMAKE_CXX_VISIBILITY_PRESET hidden) - set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) - endif() - - # Define helper functions and macros used by Google Test. - include(cmake/internal_utils.cmake) - - config_compiler_and_linker() # Defined in internal_utils.cmake. - - # Needed to set the namespace for both the export targets and the - # alias libraries - set(cmake_package_name GTest CACHE INTERNAL "") - - # Create the CMake package file descriptors. - if (INSTALL_GTEST) - include(CMakePackageConfigHelpers) - set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "") - set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "") - set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}") - set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake") - write_basic_package_version_file(${version_file} VERSION ${GOOGLETEST_VERSION} COMPATIBILITY AnyNewerVersion) - install(EXPORT ${targets_export_name} - COMPONENT "${PROJECT_NAME}" - NAMESPACE ${cmake_package_name}:: - DESTINATION ${cmake_files_install_dir}) - set(config_file "${generated_dir}/${cmake_package_name}Config.cmake") - configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in" - "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir}) - install(FILES ${version_file} ${config_file} - COMPONENT "${PROJECT_NAME}" - DESTINATION ${cmake_files_install_dir}) - endif() - - # Where Google Test's .h files can be found. - set(gtest_build_include_dirs - "${gtest_SOURCE_DIR}/include" - "${gtest_SOURCE_DIR}") - include_directories(${gtest_build_include_dirs}) + + - ######################################################################## - # - # Defines the gtest & gtest_main libraries. User tests should link - # with one of them. +++project(googletest-distribution) +++set(GOOGLETEST_VERSION 1.14.0) + + - # Google Test libraries. We build them using more strict warnings than what - # are used for other targets, to ensure that gtest can be compiled by a user - # aggressive about warnings. - cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) - set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION}) - if(GTEST_HAS_ABSL) - target_compile_definitions(gtest PUBLIC GTEST_HAS_ABSL=1) - target_link_libraries(gtest PUBLIC - absl::failure_signal_handler - absl::stacktrace - absl::symbolize - absl::flags_parse - absl::flags_reflection - absl::flags_usage - absl::strings - absl::any - absl::optional - absl::variant - re2::re2 - ) +++if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) +++ set(CMAKE_CXX_EXTENSIONS OFF) + +endif() - cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) - set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) - string(REPLACE ";" "$" dirs "${gtest_build_include_dirs}") - target_include_directories(gtest SYSTEM INTERFACE - "$" - "$/${CMAKE_INSTALL_INCLUDEDIR}>") - target_include_directories(gtest_main SYSTEM INTERFACE - "$" - "$/${CMAKE_INSTALL_INCLUDEDIR}>") - if(CMAKE_SYSTEM_NAME MATCHES "QNX") - target_link_libraries(gtest PUBLIC regex) - endif() - target_link_libraries(gtest_main PUBLIC gtest) - - ######################################################################## - # - # Install rules - install_project(gtest gtest_main) - - ######################################################################## - # - # Samples on how to link user tests with gtest or gtest_main. - # - # They are not built by default. To build them, set the - # gtest_build_samples option to ON. You can do it by running ccmake - # or specifying the -Dgtest_build_samples=ON flag when running cmake. - - if (gtest_build_samples) - cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc) - cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc) - cxx_executable(sample3_unittest samples gtest_main) - cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc) - cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc) - cxx_executable(sample6_unittest samples gtest_main) - cxx_executable(sample7_unittest samples gtest_main) - cxx_executable(sample8_unittest samples gtest_main) - cxx_executable(sample9_unittest samples gtest) - cxx_executable(sample10_unittest samples gtest) - endif() - - ######################################################################## - # - # Google Test's own tests. - # - # You can skip this section if you aren't interested in testing - # Google Test itself. - # - # The tests are not built by default. To build them, set the - # gtest_build_tests option to ON. You can do it by running ccmake - # or specifying the -Dgtest_build_tests=ON flag when running cmake. - - if (gtest_build_tests) - # This must be set in the root directory for the tests to be run by - # 'make test' or ctest. - enable_testing() - - ############################################################ - # C++ tests built with standard compiler flags. - - cxx_test(googletest-death-test-test gtest_main) - cxx_test(gtest_environment_test gtest) - cxx_test(googletest-filepath-test gtest_main) - cxx_test(googletest-listener-test gtest_main) - cxx_test(gtest_main_unittest gtest_main) - cxx_test(googletest-message-test gtest_main) - cxx_test(gtest_no_test_unittest gtest) - cxx_test(googletest-options-test gtest_main) - cxx_test(googletest-param-test-test gtest - test/googletest-param-test2-test.cc) - cxx_test(googletest-port-test gtest_main) - cxx_test(gtest_pred_impl_unittest gtest_main) - cxx_test(gtest_premature_exit_test gtest - test/gtest_premature_exit_test.cc) - cxx_test(googletest-printers-test gtest_main) - cxx_test(gtest_prod_test gtest_main - test/production.cc) - cxx_test(gtest_repeat_test gtest) - cxx_test(gtest_sole_header_test gtest_main) - cxx_test(gtest_stress_test gtest) - cxx_test(googletest-test-part-test gtest_main) - cxx_test(gtest_throw_on_failure_ex_test gtest) - cxx_test(gtest-typed-test_test gtest_main - test/gtest-typed-test2_test.cc) - cxx_test(gtest_unittest gtest_main) - cxx_test(gtest-unittest-api_test gtest) - cxx_test(gtest_skip_in_environment_setup_test gtest_main) - cxx_test(gtest_skip_test gtest_main) - - ############################################################ - # C++ tests built with non-standard compiler flags. - - # MSVC 7.1 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) - cxx_library(gtest_no_exception "${cxx_no_exception}" - src/gtest-all.cc) - cxx_library(gtest_main_no_exception "${cxx_no_exception}" - src/gtest-all.cc src/gtest_main.cc) - endif() - cxx_library(gtest_main_no_rtti "${cxx_no_rtti}" - src/gtest-all.cc src/gtest_main.cc) - - cxx_test_with_flags(gtest-death-test_ex_nocatch_test - "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0" - gtest test/googletest-death-test_ex_test.cc) - cxx_test_with_flags(gtest-death-test_ex_catch_test - "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1" - gtest test/googletest-death-test_ex_test.cc) - - cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" - gtest_main_no_rtti test/gtest_unittest.cc) - - cxx_shared_library(gtest_dll "${cxx_default}" - src/gtest-all.cc src/gtest_main.cc) - - cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}" - gtest_dll test/gtest_all_test.cc) - set_target_properties(gtest_dll_test_ - PROPERTIES - COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") + + - ############################################################ - # Python tests. +++enable_testing() + + - cxx_executable(googletest-break-on-failure-unittest_ test gtest) - py_test(googletest-break-on-failure-unittest) +++include(CMakeDependentOption) +++include(GNUInstallDirs) + + - py_test(gtest_skip_check_output_test) - py_test(gtest_skip_environment_check_output_test) +++#Note that googlemock target already builds googletest +++option(BUILD_GMOCK "Builds the googlemock subproject" ON) +++option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) +++option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) + + - # Visual Studio .NET 2003 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003 - cxx_executable_with_flags( - googletest-catch-exceptions-no-ex-test_ - "${cxx_no_exception}" - gtest_main_no_exception - test/googletest-catch-exceptions-test_.cc) - endif() - - cxx_executable_with_flags( - googletest-catch-exceptions-ex-test_ - "${cxx_exception}" - gtest_main - test/googletest-catch-exceptions-test_.cc) - py_test(googletest-catch-exceptions-test) - - cxx_executable(googletest-color-test_ test gtest) - py_test(googletest-color-test) - - cxx_executable(googletest-env-var-test_ test gtest) - py_test(googletest-env-var-test) - - cxx_executable(googletest-filter-unittest_ test gtest) - py_test(googletest-filter-unittest) - - cxx_executable(gtest_help_test_ test gtest_main) - py_test(gtest_help_test) - - cxx_executable(googletest-list-tests-unittest_ test gtest) - py_test(googletest-list-tests-unittest) - - cxx_executable(googletest-output-test_ test gtest) - py_test(googletest-output-test --no_stacktrace_support) - - cxx_executable(googletest-shuffle-test_ test gtest) - py_test(googletest-shuffle-test) - - # MSVC 7.1 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) - cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception) - set_target_properties(googletest-throw-on-failure-test_ - PROPERTIES - COMPILE_FLAGS "${cxx_no_exception}") - py_test(googletest-throw-on-failure-test) - endif() - - cxx_executable(googletest-uninitialized-test_ test gtest) - py_test(googletest-uninitialized-test) - - cxx_executable(gtest_list_output_unittest_ test gtest) - py_test(gtest_list_output_unittest) - - cxx_executable(gtest_xml_outfile1_test_ test gtest_main) - cxx_executable(gtest_xml_outfile2_test_ test gtest_main) - py_test(gtest_xml_outfiles_test) - py_test(googletest-json-outfiles-test) - - cxx_executable(gtest_xml_output_unittest_ test gtest) - py_test(gtest_xml_output_unittest --no_stacktrace_support) - py_test(googletest-json-output-unittest --no_stacktrace_support) +++if(BUILD_GMOCK) +++ add_subdirectory( googlemock ) +++else() +++ add_subdirectory( googletest ) + +endif() diff --cc googletest/CONTRIBUTING.md index 000000000,000000000,000000000..8bed14b26 new file mode 100644 --- /dev/null +++ b/googletest/CONTRIBUTING.md @@@@ -1,0 -1,0 -1,0 +1,141 @@@@ +++# How to become a contributor and submit your own code +++ +++## Contributor License Agreements +++ +++We'd love to accept your patches! Before we can take them, we have to jump a +++couple of legal hurdles. +++ +++Please fill out either the individual or corporate Contributor License Agreement +++(CLA). +++ +++* If you are an individual writing original source code and you're sure you +++ own the intellectual property, then you'll need to sign an +++ [individual CLA](https://developers.google.com/open-source/cla/individual). +++* If you work for a company that wants to allow you to contribute your work, +++ then you'll need to sign a +++ [corporate CLA](https://developers.google.com/open-source/cla/corporate). +++ +++Follow either of the two links above to access the appropriate CLA and +++instructions for how to sign and return it. Once we receive it, we'll be able to +++accept your pull requests. +++ +++## Are you a Googler? +++ +++If you are a Googler, please make an attempt to submit an internal contribution +++rather than a GitHub Pull Request. If you are not able to submit internally, a +++PR is acceptable as an alternative. +++ +++## Contributing A Patch +++ +++1. Submit an issue describing your proposed change to the +++ [issue tracker](https://github.com/google/googletest/issues). +++2. Please don't mix more than one logical change per submittal, because it +++ makes the history hard to follow. If you want to make a change that doesn't +++ have a corresponding issue in the issue tracker, please create one. +++3. Also, coordinate with team members that are listed on the issue in question. +++ This ensures that work isn't being duplicated and communicating your plan +++ early also generally leads to better patches. +++4. If your proposed change is accepted, and you haven't already done so, sign a +++ Contributor License Agreement +++ ([see details above](#contributor-license-agreements)). +++5. Fork the desired repo, develop and test your code changes. +++6. Ensure that your code adheres to the existing style in the sample to which +++ you are contributing. +++7. Ensure that your code has an appropriate set of unit tests which all pass. +++8. Submit a pull request. +++ +++## The Google Test and Google Mock Communities +++ +++The Google Test community exists primarily through the +++[discussion group](http://groups.google.com/group/googletestframework) and the +++GitHub repository. Likewise, the Google Mock community exists primarily through +++their own [discussion group](http://groups.google.com/group/googlemock). You are +++definitely encouraged to contribute to the discussion and you can also help us +++to keep the effectiveness of the group high by following and promoting the +++guidelines listed here. +++ +++### Please Be Friendly +++ +++Showing courtesy and respect to others is a vital part of the Google culture, +++and we strongly encourage everyone participating in Google Test development to +++join us in accepting nothing less. Of course, being courteous is not the same as +++failing to constructively disagree with each other, but it does mean that we +++should be respectful of each other when enumerating the 42 technical reasons +++that a particular proposal may not be the best choice. There's never a reason to +++be antagonistic or dismissive toward anyone who is sincerely trying to +++contribute to a discussion. +++ +++Sure, C++ testing is serious business and all that, but it's also a lot of fun. +++Let's keep it that way. Let's strive to be one of the friendliest communities in +++all of open source. +++ +++As always, discuss Google Test in the official GoogleTest discussion group. You +++don't have to actually submit code in order to sign up. Your participation +++itself is a valuable contribution. +++ +++## Style +++ +++To keep the source consistent, readable, diffable and easy to merge, we use a +++fairly rigid coding style, as defined by the +++[google-styleguide](https://github.com/google/styleguide) project. All patches +++will be expected to conform to the style outlined +++[here](https://google.github.io/styleguide/cppguide.html). Use +++[.clang-format](https://github.com/google/googletest/blob/main/.clang-format) to +++check your formatting. +++ +++## Requirements for Contributors +++ +++If you plan to contribute a patch, you need to build Google Test, Google Mock, +++and their own tests from a git checkout, which has further requirements: +++ +++* [Python](https://www.python.org/) v3.6 or newer (for running some of the +++ tests and re-generating certain source files from templates) +++* [CMake](https://cmake.org/) v2.8.12 or newer +++ +++## Developing Google Test and Google Mock +++ +++This section discusses how to make your own changes to the Google Test project. +++ +++### Testing Google Test and Google Mock Themselves +++ +++To make sure your changes work as intended and don't break existing +++functionality, you'll want to compile and run Google Test and GoogleMock's own +++tests. For that you can use CMake: +++ +++``` +++mkdir mybuild +++cd mybuild +++cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR} +++``` +++ +++To choose between building only Google Test or Google Mock, you may modify your +++cmake command to be one of each +++ +++``` +++cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests +++cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests +++``` +++ +++Make sure you have Python installed, as some of Google Test's tests are written +++in Python. If the cmake command complains about not being able to find Python +++(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it +++explicitly where your Python executable can be found: +++ +++``` +++cmake -DPYTHON_EXECUTABLE=path/to/python ... +++``` +++ +++Next, you can build Google Test and / or Google Mock and all desired tests. On +++\*nix, this is usually done by +++ +++``` +++make +++``` +++ +++To run the tests, do +++ +++``` +++make test +++``` +++ +++All tests should pass. diff --cc googletest/CONTRIBUTORS index 000000000,000000000,000000000..77397a5b5 new file mode 100644 --- /dev/null +++ b/googletest/CONTRIBUTORS @@@@ -1,0 -1,0 -1,0 +1,65 @@@@ +++# This file contains a list of people who've made non-trivial +++# contribution to the Google C++ Testing Framework project. People +++# who commit code to the project are encouraged to add their names +++# here. Please keep the list sorted by first names. +++ +++Ajay Joshi +++Balázs Dán +++Benoit Sigoure +++Bharat Mediratta +++Bogdan Piloca +++Chandler Carruth +++Chris Prince +++Chris Taylor +++Dan Egnor +++Dave MacLachlan +++David Anderson +++Dean Sturtevant +++Eric Roman +++Gene Volovich +++Hady Zalek +++Hal Burch +++Jeffrey Yasskin +++Jim Keller +++Joe Walnes +++Jon Wray +++Jói Sigurðsson +++Keir Mierle +++Keith Ray +++Kenton Varda +++Kostya Serebryany +++Krystian Kuzniarek +++Lev Makhlis +++Manuel Klimek +++Mario Tanev +++Mark Paskin +++Markus Heule +++Martijn Vels +++Matthew Simmons +++Mika Raento +++Mike Bland +++Miklós Fazekas +++Neal Norwitz +++Nermin Ozkiranartli +++Owen Carlsen +++Paneendra Ba +++Pasi Valminen +++Patrick Hanna +++Patrick Riley +++Paul Menage +++Peter Kaminski +++Piotr Kaminski +++Preston Jackson +++Rainer Klaffenboeck +++Russ Cox +++Russ Rufer +++Sean Mcafee +++Sigurður Ásgeirsson +++Sverre Sundsdal +++Szymon Sobik +++Takeshi Yoshino +++Tracy Bialik +++Vadim Berman +++Vlad Losev +++Wolfgang Klier +++Zhanyong Wan diff --cc googletest/LICENSE index 000000000,000000000,000000000..1941a11f8 new file mode 100644 --- /dev/null +++ b/googletest/LICENSE @@@@ -1,0 -1,0 -1,0 +1,28 @@@@ +++Copyright 2008, Google Inc. +++All rights reserved. +++ +++Redistribution and use in source and binary forms, with or without +++modification, are permitted provided that the following conditions are +++met: +++ +++ * Redistributions of source code must retain the above copyright +++notice, this list of conditions and the following disclaimer. +++ * Redistributions in binary form must reproduce the above +++copyright notice, this list of conditions and the following disclaimer +++in the documentation and/or other materials provided with the +++distribution. +++ * Neither the name of Google Inc. nor the names of its +++contributors may be used to endorse or promote products derived from +++this software without specific prior written permission. +++ +++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --cc googletest/README.md index 000000000,815f3fc02,000000000..443e02069 mode 000000,100644,000000..100644 --- a/googletest/README.md +++ b/googletest/README.md @@@@ -1,0 -1,231 -1,0 +1,146 @@@@ - ### Generic Build Instructions - - #### Setup - - To build GoogleTest and your tests that use it, you need to tell your build - system where to find its headers and source files. The exact way to do it - depends on which build system you use, and is usually straightforward. - - ### Build with CMake - - GoogleTest comes with a CMake build script - ([CMakeLists.txt](https://github.com/google/googletest/blob/main/CMakeLists.txt)) - that can be used on a wide range of platforms ("C" stands for cross-platform.). - If you don't have CMake installed already, you can download it for free from - . - - CMake works by generating native makefiles or build projects that can be used in - the compiler environment of your choice. You can either build GoogleTest as a - standalone project or it can be incorporated into an existing CMake build for - another project. - - #### Standalone CMake Project - - When building GoogleTest as a standalone project, the typical workflow starts - with - - ``` - git clone https://github.com/google/googletest.git -b v1.13.0 - cd googletest # Main directory of the cloned repository. - mkdir build # Create a directory to hold the build output. - cd build - cmake .. # Generate native build scripts for GoogleTest. - ``` - - The above command also includes GoogleMock by default. And so, if you want to - build only GoogleTest, you should replace the last command with - - ``` - cmake .. -DBUILD_GMOCK=OFF - ``` - - If you are on a \*nix system, you should now see a Makefile in the current - directory. Just type `make` to build GoogleTest. And then you can simply install - GoogleTest if you are a system administrator. - - ``` - make - sudo make install # Install in /usr/local/ by default - ``` - - If you use Windows and have Visual Studio installed, a `gtest.sln` file and - several `.vcproj` files will be created. You can then build them using Visual - Studio. - - On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated. - - #### Incorporating Into An Existing CMake Project - - If you want to use GoogleTest in a project which already uses CMake, the easiest - way is to get installed libraries and headers. - - * Import GoogleTest by using `find_package` (or `pkg_check_modules`). For - example, if `find_package(GTest CONFIG REQUIRED)` succeeds, you can use the - libraries as `GTest::gtest`, `GTest::gmock`. - - And a more robust and flexible approach is to build GoogleTest as part of that - project directly. This is done by making the GoogleTest source code available to - the main build and adding it using CMake's `add_subdirectory()` command. This - has the significant advantage that the same compiler and linker settings are - used between GoogleTest and the rest of your project, so issues associated with - using incompatible libraries (eg debug/release), etc. are avoided. This is - particularly useful on Windows. Making GoogleTest's source code available to the - main build can be done a few different ways: - - * Download the GoogleTest source code manually and place it at a known - location. This is the least flexible approach and can make it more difficult - to use with continuous integration systems, etc. - * Embed the GoogleTest source code as a direct copy in the main project's - source tree. This is often the simplest approach, but is also the hardest to - keep up to date. Some organizations may not permit this method. - * Add GoogleTest as a git submodule or equivalent. This may not always be - possible or appropriate. Git submodules, for example, have their own set of - advantages and drawbacks. - * Use CMake to download GoogleTest as part of the build's configure step. This - approach doesn't have the limitations of the other methods. - - The last of the above methods is implemented with a small piece of CMake code - that downloads and pulls the GoogleTest code into the main build. - - Just add to your `CMakeLists.txt`: - - ```cmake - include(FetchContent) - FetchContent_Declare( - googletest - # Specify the commit you depend on and update it regularly. - URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip - ) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - FetchContent_MakeAvailable(googletest) - - # Now simply link against gtest or gtest_main as needed. Eg - add_executable(example example.cpp) - target_link_libraries(example gtest_main) - add_test(NAME example_test COMMAND example) - ``` - - Note that this approach requires CMake 3.14 or later due to its use of the - `FetchContent_MakeAvailable()` command. - - ##### Visual Studio Dynamic vs Static Runtimes - - By default, new Visual Studio projects link the C runtimes dynamically but - GoogleTest links them statically. This will generate an error that looks - something like the following: gtest.lib(gtest-all.obj) : error LNK2038: mismatch - detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value - 'MDd_DynamicDebug' in main.obj - - GoogleTest already has a CMake option for this: `gtest_force_shared_crt` - - Enabling this option will make gtest link the runtimes dynamically too, and - match the project in which it is included. - - #### C++ Standard Version - - An environment that supports C++14 is required in order to successfully build - GoogleTest. One way to ensure this is to specify the standard in the top-level - project, for example by using the `set(CMAKE_CXX_STANDARD 14)` command along - with `set(CMAKE_CXX_STANDARD_REQUIRED ON)`. If this is not feasible, for example - in a C project using GoogleTest for validation, then it can be specified by - adding it to the options for cmake via the`-DCMAKE_CXX_FLAGS` option. - - ### Tweaking GoogleTest - - GoogleTest can be used in diverse environments. The default configuration may - not work (or may not work well) out of the box in some environments. However, - you can easily tweak GoogleTest by defining control macros on the compiler - command line. Generally, these macros are named like `GTEST_XYZ` and you define - them to either 1 or 0 to enable or disable a certain feature. - - We list the most frequently used macros below. For a complete list, see file - [include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/main/googletest/include/gtest/internal/gtest-port.h). - - ### Multi-threaded Tests - - GoogleTest is thread-safe where the pthread library is available. After - `#include `, you can check the - `GTEST_IS_THREADSAFE` macro to see whether this is the case (yes if the macro is - `#defined` to 1, no if it's undefined.). - - If GoogleTest doesn't correctly detect whether pthread is available in your - environment, you can force it with - - ``` - -DGTEST_HAS_PTHREAD=1 - ``` - - or - - ``` - -DGTEST_HAS_PTHREAD=0 - ``` - - When GoogleTest uses pthread, you may need to add flags to your compiler and/or - linker to select the pthread library, or you'll get link errors. If you use the - CMake script, this is taken care of for you. If you use your own build script, - you'll need to read your compiler and linker's manual to figure out what flags - to add. - - ### As a Shared Library (DLL) - - GoogleTest is compact, so most users can build and link it as a static library - for the simplicity. You can choose to use GoogleTest as a shared library (known - as a DLL on Windows) if you prefer. - - To compile *gtest* as a shared library, add - - ``` - -DGTEST_CREATE_SHARED_LIBRARY=1 - ``` - - to the compiler flags. You'll also need to tell the linker to produce a shared - library instead - consult your linker's manual for how to do it. - - To compile your *tests* that use the gtest shared library, add - - ``` - -DGTEST_LINKED_AS_SHARED_LIBRARY=1 - ``` - - to the compiler flags. - - Note: while the above steps aren't technically necessary today when using some - compilers (e.g. GCC), they may become necessary in the future, if we decide to - improve the speed of loading the library (see - for details). Therefore you are - recommended to always add the above flags when using GoogleTest as a shared - library. Otherwise a future release of GoogleTest may break your build script. - - ### Avoiding Macro Name Clashes - - In C++, macros don't obey namespaces. Therefore two libraries that both define a - macro of the same name will clash if you `#include` both definitions. In case a - GoogleTest macro clashes with another library, you can force GoogleTest to - rename its macro to avoid the conflict. - - Specifically, if both GoogleTest and some other code define macro FOO, you can - add - - ``` - -DGTEST_DONT_DEFINE_FOO=1 - ``` - - to the compiler flags to tell GoogleTest to change the macro's name from `FOO` - to `GTEST_FOO`. Currently `FOO` can be `ASSERT_EQ`, `ASSERT_FALSE`, `ASSERT_GE`, - `ASSERT_GT`, `ASSERT_LE`, `ASSERT_LT`, `ASSERT_NE`, `ASSERT_TRUE`, - `EXPECT_FALSE`, `EXPECT_TRUE`, `FAIL`, `SUCCEED`, `TEST`, or `TEST_F`. For - example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write - - ``` - GTEST_TEST(SomeTest, DoesThis) { ... } - ``` - - instead of - - ``` - TEST(SomeTest, DoesThis) { ... } - ``` - - in order to define a test. +++# GoogleTest +++ +++### Announcements +++ +++#### Live at Head +++ +++GoogleTest now follows the +++[Abseil Live at Head philosophy](https://abseil.io/about/philosophy#upgrade-support). +++We recommend +++[updating to the latest commit in the `main` branch as often as possible](https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#what-is-live-at-head-and-how-do-i-do-it). +++We do publish occasional semantic versions, tagged with +++`v${major}.${minor}.${patch}` (e.g. `v1.13.0`). +++ +++#### Documentation Updates +++ +++Our documentation is now live on GitHub Pages at +++https://google.github.io/googletest/. We recommend browsing the documentation on +++GitHub Pages rather than directly in the repository. +++ +++#### Release 1.13.0 +++ +++[Release 1.13.0](https://github.com/google/googletest/releases/tag/v1.13.0) is +++now available. +++ +++The 1.13.x branch requires at least C++14. +++ +++#### Continuous Integration +++ +++We use Google's internal systems for continuous integration. \ +++GitHub Actions were added for the convenience of open-source contributors. They +++are exclusively maintained by the open-source community and not used by the +++GoogleTest team. +++ +++#### Coming Soon +++ +++* We are planning to take a dependency on +++ [Abseil](https://github.com/abseil/abseil-cpp). +++* More documentation improvements are planned. +++ +++## Welcome to **GoogleTest**, Google's C++ test framework! +++ +++This repository is a merger of the formerly separate GoogleTest and GoogleMock +++projects. These were so closely related that it makes sense to maintain and +++release them together. +++ +++### Getting Started +++ +++See the [GoogleTest User's Guide](https://google.github.io/googletest/) for +++documentation. We recommend starting with the +++[GoogleTest Primer](https://google.github.io/googletest/primer.html). +++ +++More information about building GoogleTest can be found at +++[googletest/README.md](googletest/README.md). +++ +++## Features +++ +++* xUnit test framework: \ +++ Googletest is based on the [xUnit](https://en.wikipedia.org/wiki/XUnit) +++ testing framework, a popular architecture for unit testing +++* Test discovery: \ +++ Googletest automatically discovers and runs your tests, eliminating the need +++ to manually register your tests +++* Rich set of assertions: \ +++ Googletest provides a variety of assertions, such as equality, inequality, +++ exceptions, and more, making it easy to test your code +++* User-defined assertions: \ +++ You can define your own assertions with Googletest, making it simple to +++ write tests that are specific to your code +++* Death tests: \ +++ Googletest supports death tests, which verify that your code exits in a +++ certain way, making it useful for testing error-handling code +++* Fatal and non-fatal failures: \ +++ You can specify whether a test failure should be treated as fatal or +++ non-fatal with Googletest, allowing tests to continue running even if a +++ failure occurs +++* Value-parameterized tests: \ +++ Googletest supports value-parameterized tests, which run multiple times with +++ different input values, making it useful for testing functions that take +++ different inputs +++* Type-parameterized tests: \ +++ Googletest also supports type-parameterized tests, which run with different +++ data types, making it useful for testing functions that work with different +++ data types +++* Various options for running tests: \ +++ Googletest provides many options for running tests including running +++ individual tests, running tests in a specific order and running tests in +++ parallel +++ +++## Supported Platforms +++ +++GoogleTest follows Google's +++[Foundational C++ Support Policy](https://opensource.google/documentation/policies/cplusplus-support). +++See +++[this table](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) +++for a list of currently supported versions of compilers, platforms, and build +++tools. +++ +++## Who Is Using GoogleTest? +++ +++In addition to many internal projects at Google, GoogleTest is also used by the +++following notable projects: +++ +++* The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser +++ and Chrome OS). +++* The [LLVM](http://llvm.org/) compiler. +++* [Protocol Buffers](https://github.com/google/protobuf), Google's data +++ interchange format. +++* The [OpenCV](http://opencv.org/) computer vision library. +++ +++## Related Open Source Projects +++ +++[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based +++automated test-runner and Graphical User Interface with powerful features for +++Windows and Linux platforms. +++ +++[GoogleTest UI](https://github.com/ospector/gtest-gbar) is a test runner that +++runs your test binary, allows you to track its progress via a progress bar, and +++displays a list of test failures. Clicking on one shows failure text. GoogleTest +++UI is written in C#. +++ +++[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event +++listener for GoogleTest that implements the +++[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test +++result output. If your test runner understands TAP, you may find it useful. +++ +++[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that +++runs tests from your binary in parallel to provide significant speed-up. +++ +++[GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter) +++is a VS Code extension allowing to view GoogleTest in a tree view and run/debug +++your tests. +++ +++[C++ TestMate](https://github.com/matepek/vscode-catch2-test-adapter) is a VS +++Code extension allowing to view GoogleTest in a tree view and run/debug your +++tests. +++ +++[Cornichon](https://pypi.org/project/cornichon/) is a small Gherkin DSL parser +++that generates stub code for GoogleTest. +++ +++## Contributing Changes +++ +++Please read +++[`CONTRIBUTING.md`](https://github.com/google/googletest/blob/main/CONTRIBUTING.md) +++for details on how to contribute to this project. +++ +++Happy testing! diff --cc googletest/WORKSPACE index 000000000,000000000,000000000..f819ffe61 new file mode 100644 --- /dev/null +++ b/googletest/WORKSPACE @@@@ -1,0 -1,0 -1,0 +1,27 @@@@ +++workspace(name = "com_google_googletest") +++ +++load("//:googletest_deps.bzl", "googletest_deps") +++googletest_deps() +++ +++load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +++ +++http_archive( +++ name = "rules_python", # 2023-07-31T20:39:27Z +++ sha256 = "1250b59a33c591a1c4ba68c62e95fc88a84c334ec35a2e23f46cbc1b9a5a8b55", +++ strip_prefix = "rules_python-e355becc30275939d87116a4ec83dad4bb50d9e1", +++ urls = ["https://github.com/bazelbuild/rules_python/archive/e355becc30275939d87116a4ec83dad4bb50d9e1.zip"], +++) +++ +++http_archive( +++ name = "bazel_skylib", # 2023-05-31T19:24:07Z +++ sha256 = "08c0386f45821ce246bbbf77503c973246ed6ee5c3463e41efc197fa9bc3a7f4", +++ strip_prefix = "bazel-skylib-288731ef9f7f688932bd50e704a91a45ec185f9b", +++ urls = ["https://github.com/bazelbuild/bazel-skylib/archive/288731ef9f7f688932bd50e704a91a45ec185f9b.zip"], +++) +++ +++http_archive( +++ name = "platforms", # 2023-07-28T19:44:27Z +++ sha256 = "40eb313613ff00a5c03eed20aba58890046f4d38dec7344f00bb9a8867853526", +++ strip_prefix = "platforms-4ad40ef271da8176d4fc0194d2089b8a76e19d7b", +++ urls = ["https://github.com/bazelbuild/platforms/archive/4ad40ef271da8176d4fc0194d2089b8a76e19d7b.zip"], +++) diff --cc googletest/ci/linux-presubmit.sh index 000000000,000000000,000000000..6bac88787 new file mode 100644 --- /dev/null +++ b/googletest/ci/linux-presubmit.sh @@@@ -1,0 -1,0 -1,0 +1,137 @@@@ +++#!/bin/bash +++# +++# Copyright 2020, Google Inc. +++# All rights reserved. +++# +++# Redistribution and use in source and binary forms, with or without +++# modification, are permitted provided that the following conditions are +++# met: +++# +++# * Redistributions of source code must retain the above copyright +++# notice, this list of conditions and the following disclaimer. +++# * Redistributions in binary form must reproduce the above +++# copyright notice, this list of conditions and the following disclaimer +++# in the documentation and/or other materials provided with the +++# distribution. +++# * Neither the name of Google Inc. nor the names of its +++# contributors may be used to endorse or promote products derived from +++# this software without specific prior written permission. +++# +++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++set -euox pipefail +++ +++readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20230217" +++readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20230120" +++ +++if [[ -z ${GTEST_ROOT:-} ]]; then +++ GTEST_ROOT="$(realpath $(dirname ${0})/..)" +++fi +++ +++if [[ -z ${STD:-} ]]; then +++ STD="c++14 c++17 c++20" +++fi +++ +++# Test the CMake build +++for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do +++ for cmake_off_on in OFF ON; do +++ time docker run \ +++ --volume="${GTEST_ROOT}:/src:ro" \ +++ --tmpfs="/build:exec" \ +++ --workdir="/build" \ +++ --rm \ +++ --env="CC=${cc}" \ +++ --env=CXXFLAGS="-Werror -Wdeprecated" \ +++ ${LINUX_LATEST_CONTAINER} \ +++ /bin/bash -c " +++ cmake /src \ +++ -DCMAKE_CXX_STANDARD=14 \ +++ -Dgtest_build_samples=ON \ +++ -Dgtest_build_tests=ON \ +++ -Dgmock_build_tests=ON \ +++ -Dcxx_no_exception=${cmake_off_on} \ +++ -Dcxx_no_rtti=${cmake_off_on} && \ +++ make -j$(nproc) && \ +++ ctest -j$(nproc) --output-on-failure" +++ done +++done +++ +++# Do one test with an older version of GCC +++time docker run \ +++ --volume="${GTEST_ROOT}:/src:ro" \ +++ --workdir="/src" \ +++ --rm \ +++ --env="CC=/usr/local/bin/gcc" \ +++ --env="BAZEL_CXXOPTS=-std=c++14" \ +++ ${LINUX_GCC_FLOOR_CONTAINER} \ +++ /usr/local/bin/bazel test ... \ +++ --copt="-Wall" \ +++ --copt="-Werror" \ +++ --copt="-Wuninitialized" \ +++ --copt="-Wundef" \ +++ --copt="-Wno-error=pragmas" \ +++ --distdir="/bazel-distdir" \ +++ --features=external_include_paths \ +++ --keep_going \ +++ --show_timestamps \ +++ --test_output=errors +++ +++# Test GCC +++for std in ${STD}; do +++ for absl in 0 1; do +++ time docker run \ +++ --volume="${GTEST_ROOT}:/src:ro" \ +++ --workdir="/src" \ +++ --rm \ +++ --env="CC=/usr/local/bin/gcc" \ +++ --env="BAZEL_CXXOPTS=-std=${std}" \ +++ ${LINUX_LATEST_CONTAINER} \ +++ /usr/local/bin/bazel test ... \ +++ --copt="-Wall" \ +++ --copt="-Werror" \ +++ --copt="-Wuninitialized" \ +++ --copt="-Wundef" \ +++ --define="absl=${absl}" \ +++ --distdir="/bazel-distdir" \ +++ --features=external_include_paths \ +++ --keep_going \ +++ --show_timestamps \ +++ --test_output=errors +++ done +++done +++ +++# Test Clang +++for std in ${STD}; do +++ for absl in 0 1; do +++ time docker run \ +++ --volume="${GTEST_ROOT}:/src:ro" \ +++ --workdir="/src" \ +++ --rm \ +++ --env="CC=/opt/llvm/clang/bin/clang" \ +++ --env="BAZEL_CXXOPTS=-std=${std}" \ +++ ${LINUX_LATEST_CONTAINER} \ +++ /usr/local/bin/bazel test ... \ +++ --copt="--gcc-toolchain=/usr/local" \ +++ --copt="-Wall" \ +++ --copt="-Werror" \ +++ --copt="-Wuninitialized" \ +++ --copt="-Wundef" \ +++ --define="absl=${absl}" \ +++ --distdir="/bazel-distdir" \ +++ --features=external_include_paths \ +++ --keep_going \ +++ --linkopt="--gcc-toolchain=/usr/local" \ +++ --show_timestamps \ +++ --test_output=errors +++ done +++done diff --cc googletest/ci/macos-presubmit.sh index 000000000,000000000,000000000..681ebc2a9 new file mode 100644 --- /dev/null +++ b/googletest/ci/macos-presubmit.sh @@@@ -1,0 -1,0 -1,0 +1,76 @@@@ +++#!/bin/bash +++# +++# Copyright 2020, Google Inc. +++# All rights reserved. +++# +++# Redistribution and use in source and binary forms, with or without +++# modification, are permitted provided that the following conditions are +++# met: +++# +++# * Redistributions of source code must retain the above copyright +++# notice, this list of conditions and the following disclaimer. +++# * Redistributions in binary form must reproduce the above +++# copyright notice, this list of conditions and the following disclaimer +++# in the documentation and/or other materials provided with the +++# distribution. +++# * Neither the name of Google Inc. nor the names of its +++# contributors may be used to endorse or promote products derived from +++# this software without specific prior written permission. +++# +++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++set -euox pipefail +++ +++if [[ -z ${GTEST_ROOT:-} ]]; then +++ GTEST_ROOT="$(realpath $(dirname ${0})/..)" +++fi +++ +++# Test the CMake build +++for cmake_off_on in OFF ON; do +++ BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX) +++ cd ${BUILD_DIR} +++ time cmake ${GTEST_ROOT} \ +++ -DCMAKE_CXX_STANDARD=14 \ +++ -Dgtest_build_samples=ON \ +++ -Dgtest_build_tests=ON \ +++ -Dgmock_build_tests=ON \ +++ -Dcxx_no_exception=${cmake_off_on} \ +++ -Dcxx_no_rtti=${cmake_off_on} +++ time make +++ time ctest -j$(nproc) --output-on-failure +++done +++ +++# Test the Bazel build +++ +++# If we are running on Kokoro, check for a versioned Bazel binary. +++KOKORO_GFILE_BAZEL_BIN="bazel-5.1.1-darwin-x86_64" +++if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then +++ BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}" +++ chmod +x ${BAZEL_BIN} +++else +++ BAZEL_BIN="bazel" +++fi +++ +++cd ${GTEST_ROOT} +++for absl in 0 1; do +++ ${BAZEL_BIN} test ... \ +++ --copt="-Wall" \ +++ --copt="-Werror" \ +++ --copt="-Wundef" \ +++ --cxxopt="-std=c++14" \ +++ --define="absl=${absl}" \ +++ --features=external_include_paths \ +++ --keep_going \ +++ --show_timestamps \ +++ --test_output=errors +++done diff --cc googletest/ci/windows-presubmit.bat index 000000000,000000000,000000000..48962eb9e new file mode 100644 --- /dev/null +++ b/googletest/ci/windows-presubmit.bat @@@@ -1,0 -1,0 -1,0 +1,58 @@@@ +++SETLOCAL ENABLEDELAYEDEXPANSION +++ +++SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe +++ +++SET PATH=C:\Python34;%PATH% +++SET BAZEL_PYTHON=C:\python34\python.exe +++SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe +++SET CMAKE_BIN="cmake.exe" +++SET CTEST_BIN="ctest.exe" +++SET CTEST_OUTPUT_ON_FAILURE=1 +++SET CMAKE_BUILD_PARALLEL_LEVEL=16 +++SET CTEST_PARALLEL_LEVEL=16 +++ +++IF EXIST git\googletest ( +++ CD git\googletest +++) ELSE IF EXIST github\googletest ( +++ CD github\googletest +++) +++ +++IF %errorlevel% neq 0 EXIT /B 1 +++ +++:: ---------------------------------------------------------------------------- +++:: CMake +++MKDIR cmake_msvc2022 +++CD cmake_msvc2022 +++ +++%CMAKE_BIN% .. ^ +++ -G "Visual Studio 17 2022" ^ +++ -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ +++ -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ +++ -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ +++ -Dgtest_build_samples=ON ^ +++ -Dgtest_build_tests=ON ^ +++ -Dgmock_build_tests=ON +++IF %errorlevel% neq 0 EXIT /B 1 +++ +++%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount +++IF %errorlevel% neq 0 EXIT /B 1 +++ +++%CTEST_BIN% -C Debug --timeout 600 +++IF %errorlevel% neq 0 EXIT /B 1 +++ +++CD .. +++RMDIR /S /Q cmake_msvc2022 +++ +++:: ---------------------------------------------------------------------------- +++:: Bazel +++ +++SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community +++%BAZEL_EXE% test ... ^ +++ --compilation_mode=dbg ^ +++ --copt=/std:c++14 ^ +++ --copt=/WX ^ +++ --features=external_include_paths ^ +++ --keep_going ^ +++ --test_output=errors ^ +++ --test_tag_filters=-no_test_msvc2017 +++IF %errorlevel% neq 0 EXIT /B 1 diff --cc googletest/docs/_config.yml index 000000000,000000000,000000000..d12867eab new file mode 100644 --- /dev/null +++ b/googletest/docs/_config.yml @@@@ -1,0 -1,0 -1,0 +1,1 @@@@ +++title: GoogleTest diff --cc googletest/docs/_data/navigation.yml index 000000000,000000000,000000000..9f3332708 new file mode 100644 --- /dev/null +++ b/googletest/docs/_data/navigation.yml @@@@ -1,0 -1,0 -1,0 +1,43 @@@@ +++nav: +++- section: "Get Started" +++ items: +++ - title: "Supported Platforms" +++ url: "/platforms.html" +++ - title: "Quickstart: Bazel" +++ url: "/quickstart-bazel.html" +++ - title: "Quickstart: CMake" +++ url: "/quickstart-cmake.html" +++- section: "Guides" +++ items: +++ - title: "GoogleTest Primer" +++ url: "/primer.html" +++ - title: "Advanced Topics" +++ url: "/advanced.html" +++ - title: "Mocking for Dummies" +++ url: "/gmock_for_dummies.html" +++ - title: "Mocking Cookbook" +++ url: "/gmock_cook_book.html" +++ - title: "Mocking Cheat Sheet" +++ url: "/gmock_cheat_sheet.html" +++- section: "References" +++ items: +++ - title: "Testing Reference" +++ url: "/reference/testing.html" +++ - title: "Mocking Reference" +++ url: "/reference/mocking.html" +++ - title: "Assertions" +++ url: "/reference/assertions.html" +++ - title: "Matchers" +++ url: "/reference/matchers.html" +++ - title: "Actions" +++ url: "/reference/actions.html" +++ - title: "Testing FAQ" +++ url: "/faq.html" +++ - title: "Mocking FAQ" +++ url: "/gmock_faq.html" +++ - title: "Code Samples" +++ url: "/samples.html" +++ - title: "Using pkg-config" +++ url: "/pkgconfig.html" +++ - title: "Community Documentation" +++ url: "/community_created_documentation.html" diff --cc googletest/docs/_layouts/default.html index 000000000,000000000,000000000..c7f331b87 new file mode 100644 --- /dev/null +++ b/googletest/docs/_layouts/default.html @@@@ -1,0 -1,0 -1,0 +1,58 @@@@ +++ +++ +++ +++ +++ +++ +++ +++{% seo %} +++ +++ +++ +++ +++ +++ +++
+++
+++ {{ content }} +++
+++ +++
+++ +++ +++ +++ diff --cc googletest/docs/_sass/main.scss index 000000000,000000000,000000000..92edc877a new file mode 100644 --- /dev/null +++ b/googletest/docs/_sass/main.scss @@@@ -1,0 -1,0 -1,0 +1,200 @@@@ +++// Styles for GoogleTest docs website on GitHub Pages. +++// Color variables are defined in +++// https://github.com/pages-themes/primer/tree/master/_sass/primer-support/lib/variables +++ +++$sidebar-width: 260px; +++ +++body { +++ display: flex; +++ margin: 0; +++} +++ +++.sidebar { +++ background: $black; +++ color: $text-white; +++ flex-shrink: 0; +++ height: 100vh; +++ overflow: auto; +++ position: sticky; +++ top: 0; +++ width: $sidebar-width; +++} +++ +++.sidebar h1 { +++ font-size: 1.5em; +++} +++ +++.sidebar h2 { +++ color: $gray-light; +++ font-size: 0.8em; +++ font-weight: normal; +++ margin-bottom: 0.8em; +++ padding-left: 2.5em; +++ text-transform: uppercase; +++} +++ +++.sidebar .header { +++ background: $black; +++ padding: 2em; +++ position: sticky; +++ top: 0; +++ width: 100%; +++} +++ +++.sidebar .header a { +++ color: $text-white; +++ text-decoration: none; +++} +++ +++.sidebar .nav-toggle { +++ display: none; +++} +++ +++.sidebar .expander { +++ cursor: pointer; +++ display: none; +++ height: 3em; +++ position: absolute; +++ right: 1em; +++ top: 1.5em; +++ width: 3em; +++} +++ +++.sidebar .expander .arrow { +++ border: solid $white; +++ border-width: 0 3px 3px 0; +++ display: block; +++ height: 0.7em; +++ margin: 1em auto; +++ transform: rotate(45deg); +++ transition: transform 0.5s; +++ width: 0.7em; +++} +++ +++.sidebar nav { +++ width: 100%; +++} +++ +++.sidebar nav ul { +++ list-style-type: none; +++ margin-bottom: 1em; +++ padding: 0; +++ +++ &:last-child { +++ margin-bottom: 2em; +++ } +++ +++ a { +++ text-decoration: none; +++ } +++ +++ li { +++ color: $text-white; +++ padding-left: 2em; +++ text-decoration: none; +++ } +++ +++ li.active { +++ background: $border-gray-darker; +++ font-weight: bold; +++ } +++ +++ li:hover { +++ background: $border-gray-darker; +++ } +++} +++ +++.main { +++ background-color: $bg-gray; +++ width: calc(100% - #{$sidebar-width}); +++} +++ +++.main .main-inner { +++ background-color: $white; +++ padding: 2em; +++} +++ +++.main .footer { +++ margin: 0; +++ padding: 2em; +++} +++ +++.main table th { +++ text-align: left; +++} +++ +++.main .callout { +++ border-left: 0.25em solid $white; +++ padding: 1em; +++ +++ a { +++ text-decoration: underline; +++ } +++ +++ &.important { +++ background-color: $bg-yellow-light; +++ border-color: $bg-yellow; +++ color: $black; +++ } +++ +++ &.note { +++ background-color: $bg-blue-light; +++ border-color: $text-blue; +++ color: $text-blue; +++ } +++ +++ &.tip { +++ background-color: $green-000; +++ border-color: $green-700; +++ color: $green-700; +++ } +++ +++ &.warning { +++ background-color: $red-000; +++ border-color: $text-red; +++ color: $text-red; +++ } +++} +++ +++.main .good pre { +++ background-color: $bg-green-light; +++} +++ +++.main .bad pre { +++ background-color: $red-000; +++} +++ +++@media all and (max-width: 768px) { +++ body { +++ flex-direction: column; +++ } +++ +++ .sidebar { +++ height: auto; +++ position: relative; +++ width: 100%; +++ } +++ +++ .sidebar .expander { +++ display: block; +++ } +++ +++ .sidebar nav { +++ height: 0; +++ overflow: hidden; +++ } +++ +++ .sidebar .nav-toggle:checked { +++ & ~ nav { +++ height: auto; +++ } +++ +++ & + .expander .arrow { +++ transform: rotate(-135deg); +++ } +++ } +++ +++ .main { +++ width: 100%; +++ } +++} diff --cc googletest/docs/advanced.md index 000000000,000000000,000000000..3871db13b new file mode 100644 --- /dev/null +++ b/googletest/docs/advanced.md @@@@ -1,0 -1,0 -1,0 +1,2436 @@@@ +++# Advanced GoogleTest Topics +++ +++## Introduction +++ +++Now that you have read the [GoogleTest Primer](primer.md) and learned how to +++write tests using GoogleTest, it's time to learn some new tricks. This document +++will show you more assertions as well as how to construct complex failure +++messages, propagate fatal failures, reuse and speed up your test fixtures, and +++use various flags with your tests. +++ +++## More Assertions +++ +++This section covers some less frequently used, but still significant, +++assertions. +++ +++### Explicit Success and Failure +++ +++See [Explicit Success and Failure](reference/assertions.md#success-failure) in +++the Assertions Reference. +++ +++### Exception Assertions +++ +++See [Exception Assertions](reference/assertions.md#exceptions) in the Assertions +++Reference. +++ +++### Predicate Assertions for Better Error Messages +++ +++Even though GoogleTest has a rich set of assertions, they can never be complete, +++as it's impossible (nor a good idea) to anticipate all scenarios a user might +++run into. Therefore, sometimes a user has to use `EXPECT_TRUE()` to check a +++complex expression, for lack of a better macro. This has the problem of not +++showing you the values of the parts of the expression, making it hard to +++understand what went wrong. As a workaround, some users choose to construct the +++failure message by themselves, streaming it into `EXPECT_TRUE()`. However, this +++is awkward especially when the expression has side-effects or is expensive to +++evaluate. +++ +++GoogleTest gives you three different options to solve this problem: +++ +++#### Using an Existing Boolean Function +++ +++If you already have a function or functor that returns `bool` (or a type that +++can be implicitly converted to `bool`), you can use it in a *predicate +++assertion* to get the function arguments printed for free. See +++[`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) in the Assertions +++Reference for details. +++ +++#### Using a Function That Returns an AssertionResult +++ +++While `EXPECT_PRED*()` and friends are handy for a quick job, the syntax is not +++satisfactory: you have to use different macros for different arities, and it +++feels more like Lisp than C++. The `::testing::AssertionResult` class solves +++this problem. +++ +++An `AssertionResult` object represents the result of an assertion (whether it's +++a success or a failure, and an associated message). You can create an +++`AssertionResult` using one of these factory functions: +++ +++```c++ +++namespace testing { +++ +++// Returns an AssertionResult object to indicate that an assertion has +++// succeeded. +++AssertionResult AssertionSuccess(); +++ +++// Returns an AssertionResult object to indicate that an assertion has +++// failed. +++AssertionResult AssertionFailure(); +++ +++} +++``` +++ +++You can then use the `<<` operator to stream messages to the `AssertionResult` +++object. +++ +++To provide more readable messages in Boolean assertions (e.g. `EXPECT_TRUE()`), +++write a predicate function that returns `AssertionResult` instead of `bool`. For +++example, if you define `IsEven()` as: +++ +++```c++ +++testing::AssertionResult IsEven(int n) { +++ if ((n % 2) == 0) +++ return testing::AssertionSuccess(); +++ else +++ return testing::AssertionFailure() << n << " is odd"; +++} +++``` +++ +++instead of: +++ +++```c++ +++bool IsEven(int n) { +++ return (n % 2) == 0; +++} +++``` +++ +++the failed assertion `EXPECT_TRUE(IsEven(Fib(4)))` will print: +++ +++```none +++Value of: IsEven(Fib(4)) +++ Actual: false (3 is odd) +++Expected: true +++``` +++ +++instead of a more opaque +++ +++```none +++Value of: IsEven(Fib(4)) +++ Actual: false +++Expected: true +++``` +++ +++If you want informative messages in `EXPECT_FALSE` and `ASSERT_FALSE` as well +++(one third of Boolean assertions in the Google code base are negative ones), and +++are fine with making the predicate slower in the success case, you can supply a +++success message: +++ +++```c++ +++testing::AssertionResult IsEven(int n) { +++ if ((n % 2) == 0) +++ return testing::AssertionSuccess() << n << " is even"; +++ else +++ return testing::AssertionFailure() << n << " is odd"; +++} +++``` +++ +++Then the statement `EXPECT_FALSE(IsEven(Fib(6)))` will print +++ +++```none +++ Value of: IsEven(Fib(6)) +++ Actual: true (8 is even) +++ Expected: false +++``` +++ +++#### Using a Predicate-Formatter +++ +++If you find the default message generated by +++[`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) and +++[`EXPECT_TRUE`](reference/assertions.md#EXPECT_TRUE) unsatisfactory, or some +++arguments to your predicate do not support streaming to `ostream`, you can +++instead use *predicate-formatter assertions* to *fully* customize how the +++message is formatted. See +++[`EXPECT_PRED_FORMAT*`](reference/assertions.md#EXPECT_PRED_FORMAT) in the +++Assertions Reference for details. +++ +++### Floating-Point Comparison +++ +++See [Floating-Point Comparison](reference/assertions.md#floating-point) in the +++Assertions Reference. +++ +++#### Floating-Point Predicate-Format Functions +++ +++Some floating-point operations are useful, but not that often used. In order to +++avoid an explosion of new macros, we provide them as predicate-format functions +++that can be used in the predicate assertion macro +++[`EXPECT_PRED_FORMAT2`](reference/assertions.md#EXPECT_PRED_FORMAT), for +++example: +++ +++```c++ +++using ::testing::FloatLE; +++using ::testing::DoubleLE; +++... +++EXPECT_PRED_FORMAT2(FloatLE, val1, val2); +++EXPECT_PRED_FORMAT2(DoubleLE, val1, val2); +++``` +++ +++The above code verifies that `val1` is less than, or approximately equal to, +++`val2`. +++ +++### Asserting Using gMock Matchers +++ +++See [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) in the Assertions +++Reference. +++ +++### More String Assertions +++ +++(Please read the [previous](#asserting-using-gmock-matchers) section first if +++you haven't.) +++ +++You can use the gMock [string matchers](reference/matchers.md#string-matchers) +++with [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) to do more string +++comparison tricks (sub-string, prefix, suffix, regular expression, and etc). For +++example, +++ +++```c++ +++using ::testing::HasSubstr; +++using ::testing::MatchesRegex; +++... +++ ASSERT_THAT(foo_string, HasSubstr("needle")); +++ EXPECT_THAT(bar_string, MatchesRegex("\\w*\\d+")); +++``` +++ +++### Windows HRESULT assertions +++ +++See [Windows HRESULT Assertions](reference/assertions.md#HRESULT) in the +++Assertions Reference. +++ +++### Type Assertions +++ +++You can call the function +++ +++```c++ +++::testing::StaticAssertTypeEq(); +++``` +++ +++to assert that types `T1` and `T2` are the same. The function does nothing if +++the assertion is satisfied. If the types are different, the function call will +++fail to compile, the compiler error message will say that `T1 and T2 are not the +++same type` and most likely (depending on the compiler) show you the actual +++values of `T1` and `T2`. This is mainly useful inside template code. +++ +++**Caveat**: When used inside a member function of a class template or a function +++template, `StaticAssertTypeEq()` is effective only if the function is +++instantiated. For example, given: +++ +++```c++ +++template class Foo { +++ public: +++ void Bar() { testing::StaticAssertTypeEq(); } +++}; +++``` +++ +++the code: +++ +++```c++ +++void Test1() { Foo foo; } +++``` +++ +++will not generate a compiler error, as `Foo::Bar()` is never actually +++instantiated. Instead, you need: +++ +++```c++ +++void Test2() { Foo foo; foo.Bar(); } +++``` +++ +++to cause a compiler error. +++ +++### Assertion Placement +++ +++You can use assertions in any C++ function. In particular, it doesn't have to be +++a method of the test fixture class. The one constraint is that assertions that +++generate a fatal failure (`FAIL*` and `ASSERT_*`) can only be used in +++void-returning functions. This is a consequence of Google's not using +++exceptions. By placing it in a non-void function you'll get a confusing compile +++error like `"error: void value not ignored as it ought to be"` or `"cannot +++initialize return object of type 'bool' with an rvalue of type 'void'"` or +++`"error: no viable conversion from 'void' to 'string'"`. +++ +++If you need to use fatal assertions in a function that returns non-void, one +++option is to make the function return the value in an out parameter instead. For +++example, you can rewrite `T2 Foo(T1 x)` to `void Foo(T1 x, T2* result)`. You +++need to make sure that `*result` contains some sensible value even when the +++function returns prematurely. As the function now returns `void`, you can use +++any assertion inside of it. +++ +++If changing the function's type is not an option, you should just use assertions +++that generate non-fatal failures, such as `ADD_FAILURE*` and `EXPECT_*`. +++ +++{: .callout .note} +++NOTE: Constructors and destructors are not considered void-returning functions, +++according to the C++ language specification, and so you may not use fatal +++assertions in them; you'll get a compilation error if you try. Instead, either +++call `abort` and crash the entire test executable, or put the fatal assertion in +++a `SetUp`/`TearDown` function; see +++[constructor/destructor vs. `SetUp`/`TearDown`](faq.md#CtorVsSetUp) +++ +++{: .callout .warning} +++WARNING: A fatal assertion in a helper function (private void-returning method) +++called from a constructor or destructor does not terminate the current test, as +++your intuition might suggest: it merely returns from the constructor or +++destructor early, possibly leaving your object in a partially-constructed or +++partially-destructed state! You almost certainly want to `abort` or use +++`SetUp`/`TearDown` instead. +++ +++## Skipping test execution +++ +++Related to the assertions `SUCCEED()` and `FAIL()`, you can prevent further test +++execution at runtime with the `GTEST_SKIP()` macro. This is useful when you need +++to check for preconditions of the system under test during runtime and skip +++tests in a meaningful way. +++ +++`GTEST_SKIP()` can be used in individual test cases or in the `SetUp()` methods +++of classes derived from either `::testing::Environment` or `::testing::Test`. +++For example: +++ +++```c++ +++TEST(SkipTest, DoesSkip) { +++ GTEST_SKIP() << "Skipping single test"; +++ EXPECT_EQ(0, 1); // Won't fail; it won't be executed +++} +++ +++class SkipFixture : public ::testing::Test { +++ protected: +++ void SetUp() override { +++ GTEST_SKIP() << "Skipping all tests for this fixture"; +++ } +++}; +++ +++// Tests for SkipFixture won't be executed. +++TEST_F(SkipFixture, SkipsOneTest) { +++ EXPECT_EQ(5, 7); // Won't fail +++} +++``` +++ +++As with assertion macros, you can stream a custom message into `GTEST_SKIP()`. +++ +++## Teaching GoogleTest How to Print Your Values +++ +++When a test assertion such as `EXPECT_EQ` fails, GoogleTest prints the argument +++values to help you debug. It does this using a user-extensible value printer. +++ +++This printer knows how to print built-in C++ types, native arrays, STL +++containers, and any type that supports the `<<` operator. For other types, it +++prints the raw bytes in the value and hopes that you the user can figure it out. +++ +++As mentioned earlier, the printer is *extensible*. That means you can teach it +++to do a better job at printing your particular type than to dump the bytes. To +++do that, define an `AbslStringify()` overload as a `friend` function template +++for your type: +++ +++```cpp +++namespace foo { +++ +++class Point { // We want GoogleTest to be able to print instances of this. +++ ... +++ // Provide a friend overload. +++ template +++ friend void AbslStringify(Sink& sink, const Point& point) { +++ absl::Format(&sink, "(%d, %d)", point.x, point.y); +++ } +++ +++ int x; +++ int y; +++}; +++ +++// If you can't declare the function in the class it's important that the +++// AbslStringify overload is defined in the SAME namespace that defines Point. +++// C++'s look-up rules rely on that. +++enum class EnumWithStringify { kMany = 0, kChoices = 1 }; +++ +++template +++void AbslStringify(Sink& sink, EnumWithStringify e) { +++ absl::Format(&sink, "%s", e == EnumWithStringify::kMany ? "Many" : "Choices"); +++} +++ +++} // namespace foo +++``` +++ +++{: .callout .note} +++Note: `AbslStringify()` utilizes a generic "sink" buffer to construct its +++string. For more information about supported operations on `AbslStringify()`'s +++sink, see go/abslstringify. +++ +++`AbslStringify()` can also use `absl::StrFormat`'s catch-all `%v` type specifier +++within its own format strings to perform type deduction. `Point` above could be +++formatted as `"(%v, %v)"` for example, and deduce the `int` values as `%d`. +++ +++Sometimes, `AbslStringify()` might not be an option: your team may wish to print +++types with extra debugging information for testing purposes only. If so, you can +++instead define a `PrintTo()` function like this: +++ +++```c++ +++#include +++ +++namespace foo { +++ +++class Point { +++ ... +++ friend void PrintTo(const Point& point, std::ostream* os) { +++ *os << "(" << point.x << "," << point.y << ")"; +++ } +++ +++ int x; +++ int y; +++}; +++ +++// If you can't declare the function in the class it's important that PrintTo() +++// is defined in the SAME namespace that defines Point. C++'s look-up rules +++// rely on that. +++void PrintTo(const Point& point, std::ostream* os) { +++ *os << "(" << point.x << "," << point.y << ")"; +++} +++ +++} // namespace foo +++``` +++ +++If you have defined both `AbslStringify()` and `PrintTo()`, the latter will be +++used by GoogleTest. This allows you to customize how the value appears in +++GoogleTest's output without affecting code that relies on the behavior of +++`AbslStringify()`. +++ +++If you have an existing `<<` operator and would like to define an +++`AbslStringify()`, the latter will be used for GoogleTest printing. +++ +++If you want to print a value `x` using GoogleTest's value printer yourself, just +++call `::testing::PrintToString(x)`, which returns an `std::string`: +++ +++```c++ +++vector > point_ints = GetPointIntVector(); +++ +++EXPECT_TRUE(IsCorrectPointIntVector(point_ints)) +++ << "point_ints = " << testing::PrintToString(point_ints); +++``` +++ +++For more details regarding `AbslStringify()` and its integration with other +++libraries, see go/abslstringify. +++ +++## Death Tests +++ +++In many applications, there are assertions that can cause application failure if +++a condition is not met. These consistency checks, which ensure that the program +++is in a known good state, are there to fail at the earliest possible time after +++some program state is corrupted. If the assertion checks the wrong condition, +++then the program may proceed in an erroneous state, which could lead to memory +++corruption, security holes, or worse. Hence it is vitally important to test that +++such assertion statements work as expected. +++ +++Since these precondition checks cause the processes to die, we call such tests +++_death tests_. More generally, any test that checks that a program terminates +++(except by throwing an exception) in an expected fashion is also a death test. +++ +++Note that if a piece of code throws an exception, we don't consider it "death" +++for the purpose of death tests, as the caller of the code could catch the +++exception and avoid the crash. If you want to verify exceptions thrown by your +++code, see [Exception Assertions](#ExceptionAssertions). +++ +++If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see +++["Catching" Failures](#catching-failures). +++ +++### How to Write a Death Test +++ +++GoogleTest provides assertion macros to support death tests. See +++[Death Assertions](reference/assertions.md#death) in the Assertions Reference +++for details. +++ +++To write a death test, simply use one of the macros inside your test function. +++For example, +++ +++```c++ +++TEST(MyDeathTest, Foo) { +++ // This death test uses a compound statement. +++ ASSERT_DEATH({ +++ int n = 5; +++ Foo(&n); +++ }, "Error on line .* of Foo()"); +++} +++ +++TEST(MyDeathTest, NormalExit) { +++ EXPECT_EXIT(NormalExit(), testing::ExitedWithCode(0), "Success"); +++} +++ +++TEST(MyDeathTest, KillProcess) { +++ EXPECT_EXIT(KillProcess(), testing::KilledBySignal(SIGKILL), +++ "Sending myself unblockable signal"); +++} +++``` +++ +++verifies that: +++ +++* calling `Foo(5)` causes the process to die with the given error message, +++* calling `NormalExit()` causes the process to print `"Success"` to stderr and +++ exit with exit code 0, and +++* calling `KillProcess()` kills the process with signal `SIGKILL`. +++ +++The test function body may contain other assertions and statements as well, if +++necessary. +++ +++Note that a death test only cares about three things: +++ +++1. does `statement` abort or exit the process? +++2. (in the case of `ASSERT_EXIT` and `EXPECT_EXIT`) does the exit status +++ satisfy `predicate`? Or (in the case of `ASSERT_DEATH` and `EXPECT_DEATH`) +++ is the exit status non-zero? And +++3. does the stderr output match `matcher`? +++ +++In particular, if `statement` generates an `ASSERT_*` or `EXPECT_*` failure, it +++will **not** cause the death test to fail, as GoogleTest assertions don't abort +++the process. +++ +++### Death Test Naming +++ +++{: .callout .important} +++IMPORTANT: We strongly recommend you to follow the convention of naming your +++**test suite** (not test) `*DeathTest` when it contains a death test, as +++demonstrated in the above example. The +++[Death Tests And Threads](#death-tests-and-threads) section below explains why. +++ +++If a test fixture class is shared by normal tests and death tests, you can use +++`using` or `typedef` to introduce an alias for the fixture class and avoid +++duplicating its code: +++ +++```c++ +++class FooTest : public testing::Test { ... }; +++ +++using FooDeathTest = FooTest; +++ +++TEST_F(FooTest, DoesThis) { +++ // normal test +++} +++ +++TEST_F(FooDeathTest, DoesThat) { +++ // death test +++} +++``` +++ +++### Regular Expression Syntax +++ +++When built with Bazel and using Abseil, GoogleTest uses the +++[RE2](https://github.com/google/re2/wiki/Syntax) syntax. Otherwise, for POSIX +++systems (Linux, Cygwin, Mac), GoogleTest uses the +++[POSIX extended regular expression](http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04) +++syntax. To learn about POSIX syntax, you may want to read this +++[Wikipedia entry](http://en.wikipedia.org/wiki/Regular_expression#POSIX_extended). +++ +++On Windows, GoogleTest uses its own simple regular expression implementation. It +++lacks many features. For example, we don't support union (`"x|y"`), grouping +++(`"(xy)"`), brackets (`"[xy]"`), and repetition count (`"x{5,7}"`), among +++others. Below is what we do support (`A` denotes a literal character, period +++(`.`), or a single `\\ ` escape sequence; `x` and `y` denote regular +++expressions.): +++ +++Expression | Meaning +++---------- | -------------------------------------------------------------- +++`c` | matches any literal character `c` +++`\\d` | matches any decimal digit +++`\\D` | matches any character that's not a decimal digit +++`\\f` | matches `\f` +++`\\n` | matches `\n` +++`\\r` | matches `\r` +++`\\s` | matches any ASCII whitespace, including `\n` +++`\\S` | matches any character that's not a whitespace +++`\\t` | matches `\t` +++`\\v` | matches `\v` +++`\\w` | matches any letter, `_`, or decimal digit +++`\\W` | matches any character that `\\w` doesn't match +++`\\c` | matches any literal character `c`, which must be a punctuation +++`.` | matches any single character except `\n` +++`A?` | matches 0 or 1 occurrences of `A` +++`A*` | matches 0 or many occurrences of `A` +++`A+` | matches 1 or many occurrences of `A` +++`^` | matches the beginning of a string (not that of each line) +++`$` | matches the end of a string (not that of each line) +++`xy` | matches `x` followed by `y` +++ +++To help you determine which capability is available on your system, GoogleTest +++defines macros to govern which regular expression it is using. The macros are: +++`GTEST_USES_SIMPLE_RE=1` or `GTEST_USES_POSIX_RE=1`. If you want your death +++tests to work in all cases, you can either `#if` on these macros or use the more +++limited syntax only. +++ +++### How It Works +++ +++See [Death Assertions](reference/assertions.md#death) in the Assertions +++Reference. +++ +++### Death Tests And Threads +++ +++The reason for the two death test styles has to do with thread safety. Due to +++well-known problems with forking in the presence of threads, death tests should +++be run in a single-threaded context. Sometimes, however, it isn't feasible to +++arrange that kind of environment. For example, statically-initialized modules +++may start threads before main is ever reached. Once threads have been created, +++it may be difficult or impossible to clean them up. +++ +++GoogleTest has three features intended to raise awareness of threading issues. +++ +++1. A warning is emitted if multiple threads are running when a death test is +++ encountered. +++2. Test suites with a name ending in "DeathTest" are run before all other +++ tests. +++3. It uses `clone()` instead of `fork()` to spawn the child process on Linux +++ (`clone()` is not available on Cygwin and Mac), as `fork()` is more likely +++ to cause the child to hang when the parent process has multiple threads. +++ +++It's perfectly fine to create threads inside a death test statement; they are +++executed in a separate process and cannot affect the parent. +++ +++### Death Test Styles +++ +++The "threadsafe" death test style was introduced in order to help mitigate the +++risks of testing in a possibly multithreaded environment. It trades increased +++test execution time (potentially dramatically so) for improved thread safety. +++ +++The automated testing framework does not set the style flag. You can choose a +++particular style of death tests by setting the flag programmatically: +++ +++```c++ +++GTEST_FLAG_SET(death_test_style, "threadsafe"); +++``` +++ +++You can do this in `main()` to set the style for all death tests in the binary, +++or in individual tests. Recall that flags are saved before running each test and +++restored afterwards, so you need not do that yourself. For example: +++ +++```c++ +++int main(int argc, char** argv) { +++ testing::InitGoogleTest(&argc, argv); +++ GTEST_FLAG_SET(death_test_style, "fast"); +++ return RUN_ALL_TESTS(); +++} +++ +++TEST(MyDeathTest, TestOne) { +++ GTEST_FLAG_SET(death_test_style, "threadsafe"); +++ // This test is run in the "threadsafe" style: +++ ASSERT_DEATH(ThisShouldDie(), ""); +++} +++ +++TEST(MyDeathTest, TestTwo) { +++ // This test is run in the "fast" style: +++ ASSERT_DEATH(ThisShouldDie(), ""); +++} +++``` +++ +++### Caveats +++ +++The `statement` argument of `ASSERT_EXIT()` can be any valid C++ statement. If +++it leaves the current function via a `return` statement or by throwing an +++exception, the death test is considered to have failed. Some GoogleTest macros +++may return from the current function (e.g. `ASSERT_TRUE()`), so be sure to avoid +++them in `statement`. +++ +++Since `statement` runs in the child process, any in-memory side effect (e.g. +++modifying a variable, releasing memory, etc) it causes will *not* be observable +++in the parent process. In particular, if you release memory in a death test, +++your program will fail the heap check as the parent process will never see the +++memory reclaimed. To solve this problem, you can +++ +++1. try not to free memory in a death test; +++2. free the memory again in the parent process; or +++3. do not use the heap checker in your program. +++ +++Due to an implementation detail, you cannot place multiple death test assertions +++on the same line; otherwise, compilation will fail with an unobvious error +++message. +++ +++Despite the improved thread safety afforded by the "threadsafe" style of death +++test, thread problems such as deadlock are still possible in the presence of +++handlers registered with `pthread_atfork(3)`. +++ +++## Using Assertions in Sub-routines +++ +++{: .callout .note} +++Note: If you want to put a series of test assertions in a subroutine to check +++for a complex condition, consider using +++[a custom GMock matcher](gmock_cook_book.md#NewMatchers) instead. This lets you +++provide a more readable error message in case of failure and avoid all of the +++issues described below. +++ +++### Adding Traces to Assertions +++ +++If a test sub-routine is called from several places, when an assertion inside it +++fails, it can be hard to tell which invocation of the sub-routine the failure is +++from. You can alleviate this problem using extra logging or custom failure +++messages, but that usually clutters up your tests. A better solution is to use +++the `SCOPED_TRACE` macro or the `ScopedTrace` utility: +++ +++```c++ +++SCOPED_TRACE(message); +++``` +++ +++```c++ +++ScopedTrace trace("file_path", line_number, message); +++``` +++ +++where `message` can be anything streamable to `std::ostream`. `SCOPED_TRACE` +++macro will cause the current file name, line number, and the given message to be +++added in every failure message. `ScopedTrace` accepts explicit file name and +++line number in arguments, which is useful for writing test helpers. The effect +++will be undone when the control leaves the current lexical scope. +++ +++For example, +++ +++```c++ +++10: void Sub1(int n) { +++11: EXPECT_EQ(Bar(n), 1); +++12: EXPECT_EQ(Bar(n + 1), 2); +++13: } +++14: +++15: TEST(FooTest, Bar) { +++16: { +++17: SCOPED_TRACE("A"); // This trace point will be included in +++18: // every failure in this scope. +++19: Sub1(1); +++20: } +++21: // Now it won't. +++22: Sub1(9); +++23: } +++``` +++ +++could result in messages like these: +++ +++```none +++path/to/foo_test.cc:11: Failure +++Value of: Bar(n) +++Expected: 1 +++ Actual: 2 +++Google Test trace: +++path/to/foo_test.cc:17: A +++ +++path/to/foo_test.cc:12: Failure +++Value of: Bar(n + 1) +++Expected: 2 +++ Actual: 3 +++``` +++ +++Without the trace, it would've been difficult to know which invocation of +++`Sub1()` the two failures come from respectively. (You could add an extra +++message to each assertion in `Sub1()` to indicate the value of `n`, but that's +++tedious.) +++ +++Some tips on using `SCOPED_TRACE`: +++ +++1. With a suitable message, it's often enough to use `SCOPED_TRACE` at the +++ beginning of a sub-routine, instead of at each call site. +++2. When calling sub-routines inside a loop, make the loop iterator part of the +++ message in `SCOPED_TRACE` such that you can know which iteration the failure +++ is from. +++3. Sometimes the line number of the trace point is enough for identifying the +++ particular invocation of a sub-routine. In this case, you don't have to +++ choose a unique message for `SCOPED_TRACE`. You can simply use `""`. +++4. You can use `SCOPED_TRACE` in an inner scope when there is one in the outer +++ scope. In this case, all active trace points will be included in the failure +++ messages, in reverse order they are encountered. +++5. The trace dump is clickable in Emacs - hit `return` on a line number and +++ you'll be taken to that line in the source file! +++ +++### Propagating Fatal Failures +++ +++A common pitfall when using `ASSERT_*` and `FAIL*` is not understanding that +++when they fail they only abort the _current function_, not the entire test. For +++example, the following test will segfault: +++ +++```c++ +++void Subroutine() { +++ // Generates a fatal failure and aborts the current function. +++ ASSERT_EQ(1, 2); +++ +++ // The following won't be executed. +++ ... +++} +++ +++TEST(FooTest, Bar) { +++ Subroutine(); // The intended behavior is for the fatal failure +++ // in Subroutine() to abort the entire test. +++ +++ // The actual behavior: the function goes on after Subroutine() returns. +++ int* p = nullptr; +++ *p = 3; // Segfault! +++} +++``` +++ +++To alleviate this, GoogleTest provides three different solutions. You could use +++either exceptions, the `(ASSERT|EXPECT)_NO_FATAL_FAILURE` assertions or the +++`HasFatalFailure()` function. They are described in the following two +++subsections. +++ +++#### Asserting on Subroutines with an exception +++ +++The following code can turn ASSERT-failure into an exception: +++ +++```c++ +++class ThrowListener : public testing::EmptyTestEventListener { +++ void OnTestPartResult(const testing::TestPartResult& result) override { +++ if (result.type() == testing::TestPartResult::kFatalFailure) { +++ throw testing::AssertionException(result); +++ } +++ } +++}; +++int main(int argc, char** argv) { +++ ... +++ testing::UnitTest::GetInstance()->listeners().Append(new ThrowListener); +++ return RUN_ALL_TESTS(); +++} +++``` +++ +++This listener should be added after other listeners if you have any, otherwise +++they won't see failed `OnTestPartResult`. +++ +++#### Asserting on Subroutines +++ +++As shown above, if your test calls a subroutine that has an `ASSERT_*` failure +++in it, the test will continue after the subroutine returns. This may not be what +++you want. +++ +++Often people want fatal failures to propagate like exceptions. For that +++GoogleTest offers the following macros: +++ +++Fatal assertion | Nonfatal assertion | Verifies +++------------------------------------- | ------------------------------------- | -------- +++`ASSERT_NO_FATAL_FAILURE(statement);` | `EXPECT_NO_FATAL_FAILURE(statement);` | `statement` doesn't generate any new fatal failures in the current thread. +++ +++Only failures in the thread that executes the assertion are checked to determine +++the result of this type of assertions. If `statement` creates new threads, +++failures in these threads are ignored. +++ +++Examples: +++ +++```c++ +++ASSERT_NO_FATAL_FAILURE(Foo()); +++ +++int i; +++EXPECT_NO_FATAL_FAILURE({ +++ i = Bar(); +++}); +++``` +++ +++Assertions from multiple threads are currently not supported on Windows. +++ +++#### Checking for Failures in the Current Test +++ +++`HasFatalFailure()` in the `::testing::Test` class returns `true` if an +++assertion in the current test has suffered a fatal failure. This allows +++functions to catch fatal failures in a sub-routine and return early. +++ +++```c++ +++class Test { +++ public: +++ ... +++ static bool HasFatalFailure(); +++}; +++``` +++ +++The typical usage, which basically simulates the behavior of a thrown exception, +++is: +++ +++```c++ +++TEST(FooTest, Bar) { +++ Subroutine(); +++ // Aborts if Subroutine() had a fatal failure. +++ if (HasFatalFailure()) return; +++ +++ // The following won't be executed. +++ ... +++} +++``` +++ +++If `HasFatalFailure()` is used outside of `TEST()` , `TEST_F()` , or a test +++fixture, you must add the `::testing::Test::` prefix, as in: +++ +++```c++ +++if (testing::Test::HasFatalFailure()) return; +++``` +++ +++Similarly, `HasNonfatalFailure()` returns `true` if the current test has at +++least one non-fatal failure, and `HasFailure()` returns `true` if the current +++test has at least one failure of either kind. +++ +++## Logging Additional Information +++ +++In your test code, you can call `RecordProperty("key", value)` to log additional +++information, where `value` can be either a string or an `int`. The *last* value +++recorded for a key will be emitted to the +++[XML output](#generating-an-xml-report) if you specify one. For example, the +++test +++ +++```c++ +++TEST_F(WidgetUsageTest, MinAndMaxWidgets) { +++ RecordProperty("MaximumWidgets", ComputeMaxUsage()); +++ RecordProperty("MinimumWidgets", ComputeMinUsage()); +++} +++``` +++ +++will output XML like this: +++ +++```xml +++ ... +++ +++ ... +++``` +++ +++{: .callout .note} +++> NOTE: +++> +++> * `RecordProperty()` is a static member of the `Test` class. Therefore it +++> needs to be prefixed with `::testing::Test::` if used outside of the +++> `TEST` body and the test fixture class. +++> * *`key`* must be a valid XML attribute name, and cannot conflict with the +++> ones already used by GoogleTest (`name`, `status`, `time`, `classname`, +++> `type_param`, and `value_param`). +++> * Calling `RecordProperty()` outside of the lifespan of a test is allowed. +++> If it's called outside of a test but between a test suite's +++> `SetUpTestSuite()` and `TearDownTestSuite()` methods, it will be +++> attributed to the XML element for the test suite. If it's called outside +++> of all test suites (e.g. in a test environment), it will be attributed to +++> the top-level XML element. +++ +++## Sharing Resources Between Tests in the Same Test Suite +++ +++GoogleTest creates a new test fixture object for each test in order to make +++tests independent and easier to debug. However, sometimes tests use resources +++that are expensive to set up, making the one-copy-per-test model prohibitively +++expensive. +++ +++If the tests don't change the resource, there's no harm in their sharing a +++single resource copy. So, in addition to per-test set-up/tear-down, GoogleTest +++also supports per-test-suite set-up/tear-down. To use it: +++ +++1. In your test fixture class (say `FooTest` ), declare as `static` some member +++ variables to hold the shared resources. +++2. Outside your test fixture class (typically just below it), define those +++ member variables, optionally giving them initial values. +++3. In the same test fixture class, define a `static void SetUpTestSuite()` +++ function (remember not to spell it as **`SetupTestSuite`** with a small +++ `u`!) to set up the shared resources and a `static void TearDownTestSuite()` +++ function to tear them down. +++ +++That's it! GoogleTest automatically calls `SetUpTestSuite()` before running the +++*first test* in the `FooTest` test suite (i.e. before creating the first +++`FooTest` object), and calls `TearDownTestSuite()` after running the *last test* +++in it (i.e. after deleting the last `FooTest` object). In between, the tests can +++use the shared resources. +++ +++Remember that the test order is undefined, so your code can't depend on a test +++preceding or following another. Also, the tests must either not modify the state +++of any shared resource, or, if they do modify the state, they must restore the +++state to its original value before passing control to the next test. +++ +++Note that `SetUpTestSuite()` may be called multiple times for a test fixture +++class that has derived classes, so you should not expect code in the function +++body to be run only once. Also, derived classes still have access to shared +++resources defined as static members, so careful consideration is needed when +++managing shared resources to avoid memory leaks if shared resources are not +++properly cleaned up in `TearDownTestSuite()`. +++ +++Here's an example of per-test-suite set-up and tear-down: +++ +++```c++ +++class FooTest : public testing::Test { +++ protected: +++ // Per-test-suite set-up. +++ // Called before the first test in this test suite. +++ // Can be omitted if not needed. +++ static void SetUpTestSuite() { +++ shared_resource_ = new ...; +++ +++ // If `shared_resource_` is **not deleted** in `TearDownTestSuite()`, +++ // reallocation should be prevented because `SetUpTestSuite()` may be called +++ // in subclasses of FooTest and lead to memory leak. +++ // +++ // if (shared_resource_ == nullptr) { +++ // shared_resource_ = new ...; +++ // } +++ } +++ +++ // Per-test-suite tear-down. +++ // Called after the last test in this test suite. +++ // Can be omitted if not needed. +++ static void TearDownTestSuite() { +++ delete shared_resource_; +++ shared_resource_ = nullptr; +++ } +++ +++ // You can define per-test set-up logic as usual. +++ void SetUp() override { ... } +++ +++ // You can define per-test tear-down logic as usual. +++ void TearDown() override { ... } +++ +++ // Some expensive resource shared by all tests. +++ static T* shared_resource_; +++}; +++ +++T* FooTest::shared_resource_ = nullptr; +++ +++TEST_F(FooTest, Test1) { +++ ... you can refer to shared_resource_ here ... +++} +++ +++TEST_F(FooTest, Test2) { +++ ... you can refer to shared_resource_ here ... +++} +++``` +++ +++{: .callout .note} +++NOTE: Though the above code declares `SetUpTestSuite()` protected, it may +++sometimes be necessary to declare it public, such as when using it with +++`TEST_P`. +++ +++## Global Set-Up and Tear-Down +++ +++Just as you can do set-up and tear-down at the test level and the test suite +++level, you can also do it at the test program level. Here's how. +++ +++First, you subclass the `::testing::Environment` class to define a test +++environment, which knows how to set-up and tear-down: +++ +++```c++ +++class Environment : public ::testing::Environment { +++ public: +++ ~Environment() override {} +++ +++ // Override this to define how to set up the environment. +++ void SetUp() override {} +++ +++ // Override this to define how to tear down the environment. +++ void TearDown() override {} +++}; +++``` +++ +++Then, you register an instance of your environment class with GoogleTest by +++calling the `::testing::AddGlobalTestEnvironment()` function: +++ +++```c++ +++Environment* AddGlobalTestEnvironment(Environment* env); +++``` +++ +++Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of +++each environment object, then runs the tests if none of the environments +++reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` +++always calls `TearDown()` with each environment object, regardless of whether or +++not the tests were run. +++ +++It's OK to register multiple environment objects. In this suite, their `SetUp()` +++will be called in the order they are registered, and their `TearDown()` will be +++called in the reverse order. +++ +++Note that GoogleTest takes ownership of the registered environment objects. +++Therefore **do not delete them** by yourself. +++ +++You should call `AddGlobalTestEnvironment()` before `RUN_ALL_TESTS()` is called, +++probably in `main()`. If you use `gtest_main`, you need to call this before +++`main()` starts for it to take effect. One way to do this is to define a global +++variable like this: +++ +++```c++ +++testing::Environment* const foo_env = +++ testing::AddGlobalTestEnvironment(new FooEnvironment); +++``` +++ +++However, we strongly recommend you to write your own `main()` and call +++`AddGlobalTestEnvironment()` there, as relying on initialization of global +++variables makes the code harder to read and may cause problems when you register +++multiple environments from different translation units and the environments have +++dependencies among them (remember that the compiler doesn't guarantee the order +++in which global variables from different translation units are initialized). +++ +++## Value-Parameterized Tests +++ +++*Value-parameterized tests* allow you to test your code with different +++parameters without writing multiple copies of the same test. This is useful in a +++number of situations, for example: +++ +++* You have a piece of code whose behavior is affected by one or more +++ command-line flags. You want to make sure your code performs correctly for +++ various values of those flags. +++* You want to test different implementations of an OO interface. +++* You want to test your code over various inputs (a.k.a. data-driven testing). +++ This feature is easy to abuse, so please exercise your good sense when doing +++ it! +++ +++### How to Write Value-Parameterized Tests +++ +++To write value-parameterized tests, first you should define a fixture class. It +++must be derived from both `testing::Test` and `testing::WithParamInterface` +++(the latter is a pure interface), where `T` is the type of your parameter +++values. For convenience, you can just derive the fixture class from +++`testing::TestWithParam`, which itself is derived from both `testing::Test` +++and `testing::WithParamInterface`. `T` can be any copyable type. If it's a +++raw pointer, you are responsible for managing the lifespan of the pointed +++values. +++ +++{: .callout .note} +++NOTE: If your test fixture defines `SetUpTestSuite()` or `TearDownTestSuite()` +++they must be declared **public** rather than **protected** in order to use +++`TEST_P`. +++ +++```c++ +++class FooTest : +++ public testing::TestWithParam { +++ // You can implement all the usual fixture class members here. +++ // To access the test parameter, call GetParam() from class +++ // TestWithParam. +++}; +++ +++// Or, when you want to add parameters to a pre-existing fixture class: +++class BaseTest : public testing::Test { +++ ... +++}; +++class BarTest : public BaseTest, +++ public testing::WithParamInterface { +++ ... +++}; +++``` +++ +++Then, use the `TEST_P` macro to define as many test patterns using this fixture +++as you want. The `_P` suffix is for "parameterized" or "pattern", whichever you +++prefer to think. +++ +++```c++ +++TEST_P(FooTest, DoesBlah) { +++ // Inside a test, access the test parameter with the GetParam() method +++ // of the TestWithParam class: +++ EXPECT_TRUE(foo.Blah(GetParam())); +++ ... +++} +++ +++TEST_P(FooTest, HasBlahBlah) { +++ ... +++} +++``` +++ +++Finally, you can use the `INSTANTIATE_TEST_SUITE_P` macro to instantiate the +++test suite with any set of parameters you want. GoogleTest defines a number of +++functions for generating test parameters—see details at +++[`INSTANTIATE_TEST_SUITE_P`](reference/testing.md#INSTANTIATE_TEST_SUITE_P) in +++the Testing Reference. +++ +++For example, the following statement will instantiate tests from the `FooTest` +++test suite each with parameter values `"meeny"`, `"miny"`, and `"moe"` using the +++[`Values`](reference/testing.md#param-generators) parameter generator: +++ +++```c++ +++INSTANTIATE_TEST_SUITE_P(MeenyMinyMoe, +++ FooTest, +++ testing::Values("meeny", "miny", "moe")); +++``` +++ +++{: .callout .note} +++NOTE: The code above must be placed at global or namespace scope, not at +++function scope. +++ +++The first argument to `INSTANTIATE_TEST_SUITE_P` is a unique name for the +++instantiation of the test suite. The next argument is the name of the test +++pattern, and the last is the +++[parameter generator](reference/testing.md#param-generators). +++ +++The parameter generator expression is not evaluated until GoogleTest is +++initialized (via `InitGoogleTest()`). Any prior initialization done in the +++`main` function will be accessible from the parameter generator, for example, +++the results of flag parsing. +++ +++You can instantiate a test pattern more than once, so to distinguish different +++instances of the pattern, the instantiation name is added as a prefix to the +++actual test suite name. Remember to pick unique prefixes for different +++instantiations. The tests from the instantiation above will have these names: +++ +++* `MeenyMinyMoe/FooTest.DoesBlah/0` for `"meeny"` +++* `MeenyMinyMoe/FooTest.DoesBlah/1` for `"miny"` +++* `MeenyMinyMoe/FooTest.DoesBlah/2` for `"moe"` +++* `MeenyMinyMoe/FooTest.HasBlahBlah/0` for `"meeny"` +++* `MeenyMinyMoe/FooTest.HasBlahBlah/1` for `"miny"` +++* `MeenyMinyMoe/FooTest.HasBlahBlah/2` for `"moe"` +++ +++You can use these names in [`--gtest_filter`](#running-a-subset-of-the-tests). +++ +++The following statement will instantiate all tests from `FooTest` again, each +++with parameter values `"cat"` and `"dog"` using the +++[`ValuesIn`](reference/testing.md#param-generators) parameter generator: +++ +++```c++ +++constexpr absl::string_view kPets[] = {"cat", "dog"}; +++INSTANTIATE_TEST_SUITE_P(Pets, FooTest, testing::ValuesIn(kPets)); +++``` +++ +++The tests from the instantiation above will have these names: +++ +++* `Pets/FooTest.DoesBlah/0` for `"cat"` +++* `Pets/FooTest.DoesBlah/1` for `"dog"` +++* `Pets/FooTest.HasBlahBlah/0` for `"cat"` +++* `Pets/FooTest.HasBlahBlah/1` for `"dog"` +++ +++Please note that `INSTANTIATE_TEST_SUITE_P` will instantiate *all* tests in the +++given test suite, whether their definitions come before or *after* the +++`INSTANTIATE_TEST_SUITE_P` statement. +++ +++Additionally, by default, every `TEST_P` without a corresponding +++`INSTANTIATE_TEST_SUITE_P` causes a failing test in test suite +++`GoogleTestVerification`. If you have a test suite where that omission is not an +++error, for example it is in a library that may be linked in for other reasons or +++where the list of test cases is dynamic and may be empty, then this check can be +++suppressed by tagging the test suite: +++ +++```c++ +++GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(FooTest); +++``` +++ +++You can see [sample7_unittest.cc] and [sample8_unittest.cc] for more examples. +++ +++[sample7_unittest.cc]: https://github.com/google/googletest/blob/main/googletest/samples/sample7_unittest.cc "Parameterized Test example" +++[sample8_unittest.cc]: https://github.com/google/googletest/blob/main/googletest/samples/sample8_unittest.cc "Parameterized Test example with multiple parameters" +++ +++### Creating Value-Parameterized Abstract Tests +++ +++In the above, we define and instantiate `FooTest` in the *same* source file. +++Sometimes you may want to define value-parameterized tests in a library and let +++other people instantiate them later. This pattern is known as *abstract tests*. +++As an example of its application, when you are designing an interface you can +++write a standard suite of abstract tests (perhaps using a factory function as +++the test parameter) that all implementations of the interface are expected to +++pass. When someone implements the interface, they can instantiate your suite to +++get all the interface-conformance tests for free. +++ +++To define abstract tests, you should organize your code like this: +++ +++1. Put the definition of the parameterized test fixture class (e.g. `FooTest`) +++ in a header file, say `foo_param_test.h`. Think of this as *declaring* your +++ abstract tests. +++2. Put the `TEST_P` definitions in `foo_param_test.cc`, which includes +++ `foo_param_test.h`. Think of this as *implementing* your abstract tests. +++ +++Once they are defined, you can instantiate them by including `foo_param_test.h`, +++invoking `INSTANTIATE_TEST_SUITE_P()`, and depending on the library target that +++contains `foo_param_test.cc`. You can instantiate the same abstract test suite +++multiple times, possibly in different source files. +++ +++### Specifying Names for Value-Parameterized Test Parameters +++ +++The optional last argument to `INSTANTIATE_TEST_SUITE_P()` allows the user to +++specify a function or functor that generates custom test name suffixes based on +++the test parameters. The function should accept one argument of type +++`testing::TestParamInfo`, and return `std::string`. +++ +++`testing::PrintToStringParamName` is a builtin test suffix generator that +++returns the value of `testing::PrintToString(GetParam())`. It does not work for +++`std::string` or C strings. +++ +++{: .callout .note} +++NOTE: test names must be non-empty, unique, and may only contain ASCII +++alphanumeric characters. In particular, they +++[should not contain underscores](faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore) +++ +++```c++ +++class MyTestSuite : public testing::TestWithParam {}; +++ +++TEST_P(MyTestSuite, MyTest) +++{ +++ std::cout << "Example Test Param: " << GetParam() << std::endl; +++} +++ +++INSTANTIATE_TEST_SUITE_P(MyGroup, MyTestSuite, testing::Range(0, 10), +++ testing::PrintToStringParamName()); +++``` +++ +++Providing a custom functor allows for more control over test parameter name +++generation, especially for types where the automatic conversion does not +++generate helpful parameter names (e.g. strings as demonstrated above). The +++following example illustrates this for multiple parameters, an enumeration type +++and a string, and also demonstrates how to combine generators. It uses a lambda +++for conciseness: +++ +++```c++ +++enum class MyType { MY_FOO = 0, MY_BAR = 1 }; +++ +++class MyTestSuite : public testing::TestWithParam> { +++}; +++ +++INSTANTIATE_TEST_SUITE_P( +++ MyGroup, MyTestSuite, +++ testing::Combine( +++ testing::Values(MyType::MY_FOO, MyType::MY_BAR), +++ testing::Values("A", "B")), +++ [](const testing::TestParamInfo& info) { +++ std::string name = absl::StrCat( +++ std::get<0>(info.param) == MyType::MY_FOO ? "Foo" : "Bar", +++ std::get<1>(info.param)); +++ absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_'); +++ return name; +++ }); +++``` +++ +++## Typed Tests +++ +++Suppose you have multiple implementations of the same interface and want to make +++sure that all of them satisfy some common requirements. Or, you may have defined +++several types that are supposed to conform to the same "concept" and you want to +++verify it. In both cases, you want the same test logic repeated for different +++types. +++ +++While you can write one `TEST` or `TEST_F` for each type you want to test (and +++you may even factor the test logic into a function template that you invoke from +++the `TEST`), it's tedious and doesn't scale: if you want `m` tests over `n` +++types, you'll end up writing `m*n` `TEST`s. +++ +++*Typed tests* allow you to repeat the same test logic over a list of types. You +++only need to write the test logic once, although you must know the type list +++when writing typed tests. Here's how you do it: +++ +++First, define a fixture class template. It should be parameterized by a type. +++Remember to derive it from `::testing::Test`: +++ +++```c++ +++template +++class FooTest : public testing::Test { +++ public: +++ ... +++ using List = std::list; +++ static T shared_; +++ T value_; +++}; +++``` +++ +++Next, associate a list of types with the test suite, which will be repeated for +++each type in the list: +++ +++```c++ +++using MyTypes = ::testing::Types; +++TYPED_TEST_SUITE(FooTest, MyTypes); +++``` +++ +++The type alias (`using` or `typedef`) is necessary for the `TYPED_TEST_SUITE` +++macro to parse correctly. Otherwise the compiler will think that each comma in +++the type list introduces a new macro argument. +++ +++Then, use `TYPED_TEST()` instead of `TEST_F()` to define a typed test for this +++test suite. You can repeat this as many times as you want: +++ +++```c++ +++TYPED_TEST(FooTest, DoesBlah) { +++ // Inside a test, refer to the special name TypeParam to get the type +++ // parameter. Since we are inside a derived class template, C++ requires +++ // us to visit the members of FooTest via 'this'. +++ TypeParam n = this->value_; +++ +++ // To visit static members of the fixture, add the 'TestFixture::' +++ // prefix. +++ n += TestFixture::shared_; +++ +++ // To refer to typedefs in the fixture, add the 'typename TestFixture::' +++ // prefix. The 'typename' is required to satisfy the compiler. +++ typename TestFixture::List values; +++ +++ values.push_back(n); +++ ... +++} +++ +++TYPED_TEST(FooTest, HasPropertyA) { ... } +++``` +++ +++You can see [sample6_unittest.cc] for a complete example. +++ +++[sample6_unittest.cc]: https://github.com/google/googletest/blob/main/googletest/samples/sample6_unittest.cc "Typed Test example" +++ +++## Type-Parameterized Tests +++ +++*Type-parameterized tests* are like typed tests, except that they don't require +++you to know the list of types ahead of time. Instead, you can define the test +++logic first and instantiate it with different type lists later. You can even +++instantiate it more than once in the same program. +++ +++If you are designing an interface or concept, you can define a suite of +++type-parameterized tests to verify properties that any valid implementation of +++the interface/concept should have. Then, the author of each implementation can +++just instantiate the test suite with their type to verify that it conforms to +++the requirements, without having to write similar tests repeatedly. Here's an +++example: +++ +++First, define a fixture class template, as we did with typed tests: +++ +++```c++ +++template +++class FooTest : public testing::Test { +++ void DoSomethingInteresting(); +++ ... +++}; +++``` +++ +++Next, declare that you will define a type-parameterized test suite: +++ +++```c++ +++TYPED_TEST_SUITE_P(FooTest); +++``` +++ +++Then, use `TYPED_TEST_P()` to define a type-parameterized test. You can repeat +++this as many times as you want: +++ +++```c++ +++TYPED_TEST_P(FooTest, DoesBlah) { +++ // Inside a test, refer to TypeParam to get the type parameter. +++ TypeParam n = 0; +++ +++ // You will need to use `this` explicitly to refer to fixture members. +++ this->DoSomethingInteresting() +++ ... +++} +++ +++TYPED_TEST_P(FooTest, HasPropertyA) { ... } +++``` +++ +++Now the tricky part: you need to register all test patterns using the +++`REGISTER_TYPED_TEST_SUITE_P` macro before you can instantiate them. The first +++argument of the macro is the test suite name; the rest are the names of the +++tests in this test suite: +++ +++```c++ +++REGISTER_TYPED_TEST_SUITE_P(FooTest, +++ DoesBlah, HasPropertyA); +++``` +++ +++Finally, you are free to instantiate the pattern with the types you want. If you +++put the above code in a header file, you can `#include` it in multiple C++ +++source files and instantiate it multiple times. +++ +++```c++ +++using MyTypes = ::testing::Types; +++INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); +++``` +++ +++To distinguish different instances of the pattern, the first argument to the +++`INSTANTIATE_TYPED_TEST_SUITE_P` macro is a prefix that will be added to the +++actual test suite name. Remember to pick unique prefixes for different +++instances. +++ +++In the special case where the type list contains only one type, you can write +++that type directly without `::testing::Types<...>`, like this: +++ +++```c++ +++INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int); +++``` +++ +++You can see [sample6_unittest.cc] for a complete example. +++ +++## Testing Private Code +++ +++If you change your software's internal implementation, your tests should not +++break as long as the change is not observable by users. Therefore, **per the +++black-box testing principle, most of the time you should test your code through +++its public interfaces.** +++ +++**If you still find yourself needing to test internal implementation code, +++consider if there's a better design.** The desire to test internal +++implementation is often a sign that the class is doing too much. Consider +++extracting an implementation class, and testing it. Then use that implementation +++class in the original class. +++ +++If you absolutely have to test non-public interface code though, you can. There +++are two cases to consider: +++ +++* Static functions ( *not* the same as static member functions!) or unnamed +++ namespaces, and +++* Private or protected class members +++ +++To test them, we use the following special techniques: +++ +++* Both static functions and definitions/declarations in an unnamed namespace +++ are only visible within the same translation unit. To test them, you can +++ `#include` the entire `.cc` file being tested in your `*_test.cc` file. +++ (#including `.cc` files is not a good way to reuse code - you should not do +++ this in production code!) +++ +++ However, a better approach is to move the private code into the +++ `foo::internal` namespace, where `foo` is the namespace your project +++ normally uses, and put the private declarations in a `*-internal.h` file. +++ Your production `.cc` files and your tests are allowed to include this +++ internal header, but your clients are not. This way, you can fully test your +++ internal implementation without leaking it to your clients. +++ +++* Private class members are only accessible from within the class or by +++ friends. To access a class' private members, you can declare your test +++ fixture as a friend to the class and define accessors in your fixture. Tests +++ using the fixture can then access the private members of your production +++ class via the accessors in the fixture. Note that even though your fixture +++ is a friend to your production class, your tests are not automatically +++ friends to it, as they are technically defined in sub-classes of the +++ fixture. +++ +++ Another way to test private members is to refactor them into an +++ implementation class, which is then declared in a `*-internal.h` file. Your +++ clients aren't allowed to include this header but your tests can. Such is +++ called the +++ [Pimpl](https://www.gamedev.net/articles/programming/general-and-gameplay-programming/the-c-pimpl-r1794/) +++ (Private Implementation) idiom. +++ +++ Or, you can declare an individual test as a friend of your class by adding +++ this line in the class body: +++ +++ ```c++ +++ FRIEND_TEST(TestSuiteName, TestName); +++ ``` +++ +++ For example, +++ +++ ```c++ +++ // foo.h +++ class Foo { +++ ... +++ private: +++ FRIEND_TEST(FooTest, BarReturnsZeroOnNull); +++ +++ int Bar(void* x); +++ }; +++ +++ // foo_test.cc +++ ... +++ TEST(FooTest, BarReturnsZeroOnNull) { +++ Foo foo; +++ EXPECT_EQ(foo.Bar(NULL), 0); // Uses Foo's private member Bar(). +++ } +++ ``` +++ +++ Pay special attention when your class is defined in a namespace. If you want +++ your test fixtures and tests to be friends of your class, then they must be +++ defined in the exact same namespace (no anonymous or inline namespaces). +++ +++ For example, if the code to be tested looks like: +++ +++ ```c++ +++ namespace my_namespace { +++ +++ class Foo { +++ friend class FooTest; +++ FRIEND_TEST(FooTest, Bar); +++ FRIEND_TEST(FooTest, Baz); +++ ... definition of the class Foo ... +++ }; +++ +++ } // namespace my_namespace +++ ``` +++ +++ Your test code should be something like: +++ +++ ```c++ +++ namespace my_namespace { +++ +++ class FooTest : public testing::Test { +++ protected: +++ ... +++ }; +++ +++ TEST_F(FooTest, Bar) { ... } +++ TEST_F(FooTest, Baz) { ... } +++ +++ } // namespace my_namespace +++ ``` +++ +++## "Catching" Failures +++ +++If you are building a testing utility on top of GoogleTest, you'll want to test +++your utility. What framework would you use to test it? GoogleTest, of course. +++ +++The challenge is to verify that your testing utility reports failures correctly. +++In frameworks that report a failure by throwing an exception, you could catch +++the exception and assert on it. But GoogleTest doesn't use exceptions, so how do +++we test that a piece of code generates an expected failure? +++ +++`"gtest/gtest-spi.h"` contains some constructs to do this. +++After #including this header, you can use +++ +++```c++ +++ EXPECT_FATAL_FAILURE(statement, substring); +++``` +++ +++to assert that `statement` generates a fatal (e.g. `ASSERT_*`) failure in the +++current thread whose message contains the given `substring`, or use +++ +++```c++ +++ EXPECT_NONFATAL_FAILURE(statement, substring); +++``` +++ +++if you are expecting a non-fatal (e.g. `EXPECT_*`) failure. +++ +++Only failures in the current thread are checked to determine the result of this +++type of expectations. If `statement` creates new threads, failures in these +++threads are also ignored. If you want to catch failures in other threads as +++well, use one of the following macros instead: +++ +++```c++ +++ EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substring); +++ EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substring); +++``` +++ +++{: .callout .note} +++NOTE: Assertions from multiple threads are currently not supported on Windows. +++ +++For technical reasons, there are some caveats: +++ +++1. You cannot stream a failure message to either macro. +++ +++2. `statement` in `EXPECT_FATAL_FAILURE{_ON_ALL_THREADS}()` cannot reference +++ local non-static variables or non-static members of `this` object. +++ +++3. `statement` in `EXPECT_FATAL_FAILURE{_ON_ALL_THREADS}()` cannot return a +++ value. +++ +++## Registering tests programmatically +++ +++The `TEST` macros handle the vast majority of all use cases, but there are few +++where runtime registration logic is required. For those cases, the framework +++provides the `::testing::RegisterTest` that allows callers to register arbitrary +++tests dynamically. +++ +++This is an advanced API only to be used when the `TEST` macros are insufficient. +++The macros should be preferred when possible, as they avoid most of the +++complexity of calling this function. +++ +++It provides the following signature: +++ +++```c++ +++template +++TestInfo* RegisterTest(const char* test_suite_name, const char* test_name, +++ const char* type_param, const char* value_param, +++ const char* file, int line, Factory factory); +++``` +++ +++The `factory` argument is a factory callable (move-constructible) object or +++function pointer that creates a new instance of the Test object. It handles +++ownership to the caller. The signature of the callable is `Fixture*()`, where +++`Fixture` is the test fixture class for the test. All tests registered with the +++same `test_suite_name` must return the same fixture type. This is checked at +++runtime. +++ +++The framework will infer the fixture class from the factory and will call the +++`SetUpTestSuite` and `TearDownTestSuite` for it. +++ +++Must be called before `RUN_ALL_TESTS()` is invoked, otherwise behavior is +++undefined. +++ +++Use case example: +++ +++```c++ +++class MyFixture : public testing::Test { +++ public: +++ // All of these optional, just like in regular macro usage. +++ static void SetUpTestSuite() { ... } +++ static void TearDownTestSuite() { ... } +++ void SetUp() override { ... } +++ void TearDown() override { ... } +++}; +++ +++class MyTest : public MyFixture { +++ public: +++ explicit MyTest(int data) : data_(data) {} +++ void TestBody() override { ... } +++ +++ private: +++ int data_; +++}; +++ +++void RegisterMyTests(const std::vector& values) { +++ for (int v : values) { +++ testing::RegisterTest( +++ "MyFixture", ("Test" + std::to_string(v)).c_str(), nullptr, +++ std::to_string(v).c_str(), +++ __FILE__, __LINE__, +++ // Important to use the fixture type as the return type here. +++ [=]() -> MyFixture* { return new MyTest(v); }); +++ } +++} +++... +++int main(int argc, char** argv) { +++ testing::InitGoogleTest(&argc, argv); +++ std::vector values_to_test = LoadValuesFromConfig(); +++ RegisterMyTests(values_to_test); +++ ... +++ return RUN_ALL_TESTS(); +++} +++``` +++ +++## Getting the Current Test's Name +++ +++Sometimes a function may need to know the name of the currently running test. +++For example, you may be using the `SetUp()` method of your test fixture to set +++the golden file name based on which test is running. The +++[`TestInfo`](reference/testing.md#TestInfo) class has this information. +++ +++To obtain a `TestInfo` object for the currently running test, call +++`current_test_info()` on the [`UnitTest`](reference/testing.md#UnitTest) +++singleton object: +++ +++```c++ +++ // Gets information about the currently running test. +++ // Do NOT delete the returned object - it's managed by the UnitTest class. +++ const testing::TestInfo* const test_info = +++ testing::UnitTest::GetInstance()->current_test_info(); +++ +++ printf("We are in test %s of test suite %s.\n", +++ test_info->name(), +++ test_info->test_suite_name()); +++``` +++ +++`current_test_info()` returns a null pointer if no test is running. In +++particular, you cannot find the test suite name in `SetUpTestSuite()`, +++`TearDownTestSuite()` (where you know the test suite name implicitly), or +++functions called from them. +++ +++## Extending GoogleTest by Handling Test Events +++ +++GoogleTest provides an **event listener API** to let you receive notifications +++about the progress of a test program and test failures. The events you can +++listen to include the start and end of the test program, a test suite, or a test +++method, among others. You may use this API to augment or replace the standard +++console output, replace the XML output, or provide a completely different form +++of output, such as a GUI or a database. You can also use test events as +++checkpoints to implement a resource leak checker, for example. +++ +++### Defining Event Listeners +++ +++To define a event listener, you subclass either +++[`testing::TestEventListener`](reference/testing.md#TestEventListener) or +++[`testing::EmptyTestEventListener`](reference/testing.md#EmptyTestEventListener) +++The former is an (abstract) interface, where *each pure virtual method can be +++overridden to handle a test event* (For example, when a test starts, the +++`OnTestStart()` method will be called.). The latter provides an empty +++implementation of all methods in the interface, such that a subclass only needs +++to override the methods it cares about. +++ +++When an event is fired, its context is passed to the handler function as an +++argument. The following argument types are used: +++ +++* UnitTest reflects the state of the entire test program, +++* TestSuite has information about a test suite, which can contain one or more +++ tests, +++* TestInfo contains the state of a test, and +++* TestPartResult represents the result of a test assertion. +++ +++An event handler function can examine the argument it receives to find out +++interesting information about the event and the test program's state. +++ +++Here's an example: +++ +++```c++ +++ class MinimalistPrinter : public testing::EmptyTestEventListener { +++ // Called before a test starts. +++ void OnTestStart(const testing::TestInfo& test_info) override { +++ printf("*** Test %s.%s starting.\n", +++ test_info.test_suite_name(), test_info.name()); +++ } +++ +++ // Called after a failed assertion or a SUCCESS(). +++ void OnTestPartResult(const testing::TestPartResult& test_part_result) override { +++ printf("%s in %s:%d\n%s\n", +++ test_part_result.failed() ? "*** Failure" : "Success", +++ test_part_result.file_name(), +++ test_part_result.line_number(), +++ test_part_result.summary()); +++ } +++ +++ // Called after a test ends. +++ void OnTestEnd(const testing::TestInfo& test_info) override { +++ printf("*** Test %s.%s ending.\n", +++ test_info.test_suite_name(), test_info.name()); +++ } +++ }; +++``` +++ +++### Using Event Listeners +++ +++To use the event listener you have defined, add an instance of it to the +++GoogleTest event listener list (represented by class +++[`TestEventListeners`](reference/testing.md#TestEventListeners) - note the "s" +++at the end of the name) in your `main()` function, before calling +++`RUN_ALL_TESTS()`: +++ +++```c++ +++int main(int argc, char** argv) { +++ testing::InitGoogleTest(&argc, argv); +++ // Gets hold of the event listener list. +++ testing::TestEventListeners& listeners = +++ testing::UnitTest::GetInstance()->listeners(); +++ // Adds a listener to the end. GoogleTest takes the ownership. +++ listeners.Append(new MinimalistPrinter); +++ return RUN_ALL_TESTS(); +++} +++``` +++ +++There's only one problem: the default test result printer is still in effect, so +++its output will mingle with the output from your minimalist printer. To suppress +++the default printer, just release it from the event listener list and delete it. +++You can do so by adding one line: +++ +++```c++ +++ ... +++ delete listeners.Release(listeners.default_result_printer()); +++ listeners.Append(new MinimalistPrinter); +++ return RUN_ALL_TESTS(); +++``` +++ +++Now, sit back and enjoy a completely different output from your tests. For more +++details, see [sample9_unittest.cc]. +++ +++[sample9_unittest.cc]: https://github.com/google/googletest/blob/main/googletest/samples/sample9_unittest.cc "Event listener example" +++ +++You may append more than one listener to the list. When an `On*Start()` or +++`OnTestPartResult()` event is fired, the listeners will receive it in the order +++they appear in the list (since new listeners are added to the end of the list, +++the default text printer and the default XML generator will receive the event +++first). An `On*End()` event will be received by the listeners in the *reverse* +++order. This allows output by listeners added later to be framed by output from +++listeners added earlier. +++ +++### Generating Failures in Listeners +++ +++You may use failure-raising macros (`EXPECT_*()`, `ASSERT_*()`, `FAIL()`, etc) +++when processing an event. There are some restrictions: +++ +++1. You cannot generate any failure in `OnTestPartResult()` (otherwise it will +++ cause `OnTestPartResult()` to be called recursively). +++2. A listener that handles `OnTestPartResult()` is not allowed to generate any +++ failure. +++ +++When you add listeners to the listener list, you should put listeners that +++handle `OnTestPartResult()` *before* listeners that can generate failures. This +++ensures that failures generated by the latter are attributed to the right test +++by the former. +++ +++See [sample10_unittest.cc] for an example of a failure-raising listener. +++ +++[sample10_unittest.cc]: https://github.com/google/googletest/blob/main/googletest/samples/sample10_unittest.cc "Failure-raising listener example" +++ +++## Running Test Programs: Advanced Options +++ +++GoogleTest test programs are ordinary executables. Once built, you can run them +++directly and affect their behavior via the following environment variables +++and/or command line flags. For the flags to work, your programs must call +++`::testing::InitGoogleTest()` before calling `RUN_ALL_TESTS()`. +++ +++To see a list of supported flags and their usage, please run your test program +++with the `--help` flag. You can also use `-h`, `-?`, or `/?` for short. +++ +++If an option is specified both by an environment variable and by a flag, the +++latter takes precedence. +++ +++### Selecting Tests +++ +++#### Listing Test Names +++ +++Sometimes it is necessary to list the available tests in a program before +++running them so that a filter may be applied if needed. Including the flag +++`--gtest_list_tests` overrides all other flags and lists tests in the following +++format: +++ +++```none +++TestSuite1. +++ TestName1 +++ TestName2 +++TestSuite2. +++ TestName +++``` +++ +++None of the tests listed are actually run if the flag is provided. There is no +++corresponding environment variable for this flag. +++ +++#### Running a Subset of the Tests +++ +++By default, a GoogleTest program runs all tests the user has defined. Sometimes, +++you want to run only a subset of the tests (e.g. for debugging or quickly +++verifying a change). If you set the `GTEST_FILTER` environment variable or the +++`--gtest_filter` flag to a filter string, GoogleTest will only run the tests +++whose full names (in the form of `TestSuiteName.TestName`) match the filter. +++ +++The format of a filter is a '`:`'-separated list of wildcard patterns (called +++the *positive patterns*) optionally followed by a '`-`' and another +++'`:`'-separated pattern list (called the *negative patterns*). A test matches +++the filter if and only if it matches any of the positive patterns but does not +++match any of the negative patterns. +++ +++A pattern may contain `'*'` (matches any string) or `'?'` (matches any single +++character). For convenience, the filter `'*-NegativePatterns'` can be also +++written as `'-NegativePatterns'`. +++ +++For example: +++ +++* `./foo_test` Has no flag, and thus runs all its tests. +++* `./foo_test --gtest_filter=*` Also runs everything, due to the single +++ match-everything `*` value. +++* `./foo_test --gtest_filter=FooTest.*` Runs everything in test suite +++ `FooTest` . +++* `./foo_test --gtest_filter=*Null*:*Constructor*` Runs any test whose full +++ name contains either `"Null"` or `"Constructor"` . +++* `./foo_test --gtest_filter=-*DeathTest.*` Runs all non-death tests. +++* `./foo_test --gtest_filter=FooTest.*-FooTest.Bar` Runs everything in test +++ suite `FooTest` except `FooTest.Bar`. +++* `./foo_test --gtest_filter=FooTest.*:BarTest.*-FooTest.Bar:BarTest.Foo` Runs +++ everything in test suite `FooTest` except `FooTest.Bar` and everything in +++ test suite `BarTest` except `BarTest.Foo`. +++ +++#### Stop test execution upon first failure +++ +++By default, a GoogleTest program runs all tests the user has defined. In some +++cases (e.g. iterative test development & execution) it may be desirable stop +++test execution upon first failure (trading improved latency for completeness). +++If `GTEST_FAIL_FAST` environment variable or `--gtest_fail_fast` flag is set, +++the test runner will stop execution as soon as the first test failure is found. +++ +++#### Temporarily Disabling Tests +++ +++If you have a broken test that you cannot fix right away, you can add the +++`DISABLED_` prefix to its name. This will exclude it from execution. This is +++better than commenting out the code or using `#if 0`, as disabled tests are +++still compiled (and thus won't rot). +++ +++If you need to disable all tests in a test suite, you can either add `DISABLED_` +++to the front of the name of each test, or alternatively add it to the front of +++the test suite name. +++ +++For example, the following tests won't be run by GoogleTest, even though they +++will still be compiled: +++ +++```c++ +++// Tests that Foo does Abc. +++TEST(FooTest, DISABLED_DoesAbc) { ... } +++ +++class DISABLED_BarTest : public testing::Test { ... }; +++ +++// Tests that Bar does Xyz. +++TEST_F(DISABLED_BarTest, DoesXyz) { ... } +++``` +++ +++{: .callout .note} +++NOTE: This feature should only be used for temporary pain-relief. You still have +++to fix the disabled tests at a later date. As a reminder, GoogleTest will print +++a banner warning you if a test program contains any disabled tests. +++ +++{: .callout .tip} +++TIP: You can easily count the number of disabled tests you have using +++`grep`. This number can be used as a metric for +++improving your test quality. +++ +++#### Temporarily Enabling Disabled Tests +++ +++To include disabled tests in test execution, just invoke the test program with +++the `--gtest_also_run_disabled_tests` flag or set the +++`GTEST_ALSO_RUN_DISABLED_TESTS` environment variable to a value other than `0`. +++You can combine this with the `--gtest_filter` flag to further select which +++disabled tests to run. +++ +++### Repeating the Tests +++ +++Once in a while you'll run into a test whose result is hit-or-miss. Perhaps it +++will fail only 1% of the time, making it rather hard to reproduce the bug under +++a debugger. This can be a major source of frustration. +++ +++The `--gtest_repeat` flag allows you to repeat all (or selected) test methods in +++a program many times. Hopefully, a flaky test will eventually fail and give you +++a chance to debug. Here's how to use it: +++ +++```none +++$ foo_test --gtest_repeat=1000 +++Repeat foo_test 1000 times and don't stop at failures. +++ +++$ foo_test --gtest_repeat=-1 +++A negative count means repeating forever. +++ +++$ foo_test --gtest_repeat=1000 --gtest_break_on_failure +++Repeat foo_test 1000 times, stopping at the first failure. This +++is especially useful when running under a debugger: when the test +++fails, it will drop into the debugger and you can then inspect +++variables and stacks. +++ +++$ foo_test --gtest_repeat=1000 --gtest_filter=FooBar.* +++Repeat the tests whose name matches the filter 1000 times. +++``` +++ +++If your test program contains +++[global set-up/tear-down](#global-set-up-and-tear-down) code, it will be +++repeated in each iteration as well, as the flakiness may be in it. To avoid +++repeating global set-up/tear-down, specify +++`--gtest_recreate_environments_when_repeating=false`{.nowrap}. +++ +++You can also specify the repeat count by setting the `GTEST_REPEAT` environment +++variable. +++ +++### Shuffling the Tests +++ +++You can specify the `--gtest_shuffle` flag (or set the `GTEST_SHUFFLE` +++environment variable to `1`) to run the tests in a program in a random order. +++This helps to reveal bad dependencies between tests. +++ +++By default, GoogleTest uses a random seed calculated from the current time. +++Therefore you'll get a different order every time. The console output includes +++the random seed value, such that you can reproduce an order-related test failure +++later. To specify the random seed explicitly, use the `--gtest_random_seed=SEED` +++flag (or set the `GTEST_RANDOM_SEED` environment variable), where `SEED` is an +++integer in the range [0, 99999]. The seed value 0 is special: it tells +++GoogleTest to do the default behavior of calculating the seed from the current +++time. +++ +++If you combine this with `--gtest_repeat=N`, GoogleTest will pick a different +++random seed and re-shuffle the tests in each iteration. +++ +++### Distributing Test Functions to Multiple Machines +++ +++If you have more than one machine you can use to run a test program, you might +++want to run the test functions in parallel and get the result faster. We call +++this technique *sharding*, where each machine is called a *shard*. +++ +++GoogleTest is compatible with test sharding. To take advantage of this feature, +++your test runner (not part of GoogleTest) needs to do the following: +++ +++1. Allocate a number of machines (shards) to run the tests. +++1. On each shard, set the `GTEST_TOTAL_SHARDS` environment variable to the total +++ number of shards. It must be the same for all shards. +++1. On each shard, set the `GTEST_SHARD_INDEX` environment variable to the index +++ of the shard. Different shards must be assigned different indices, which +++ must be in the range `[0, GTEST_TOTAL_SHARDS - 1]`. +++1. Run the same test program on all shards. When GoogleTest sees the above two +++ environment variables, it will select a subset of the test functions to run. +++ Across all shards, each test function in the program will be run exactly +++ once. +++1. Wait for all shards to finish, then collect and report the results. +++ +++Your project may have tests that were written without GoogleTest and thus don't +++understand this protocol. In order for your test runner to figure out which test +++supports sharding, it can set the environment variable `GTEST_SHARD_STATUS_FILE` +++to a non-existent file path. If a test program supports sharding, it will create +++this file to acknowledge that fact; otherwise it will not create it. The actual +++contents of the file are not important at this time, although we may put some +++useful information in it in the future. +++ +++Here's an example to make it clear. Suppose you have a test program `foo_test` +++that contains the following 5 test functions: +++ +++``` +++TEST(A, V) +++TEST(A, W) +++TEST(B, X) +++TEST(B, Y) +++TEST(B, Z) +++``` +++ +++Suppose you have 3 machines at your disposal. To run the test functions in +++parallel, you would set `GTEST_TOTAL_SHARDS` to 3 on all machines, and set +++`GTEST_SHARD_INDEX` to 0, 1, and 2 on the machines respectively. Then you would +++run the same `foo_test` on each machine. +++ +++GoogleTest reserves the right to change how the work is distributed across the +++shards, but here's one possible scenario: +++ +++* Machine #0 runs `A.V` and `B.X`. +++* Machine #1 runs `A.W` and `B.Y`. +++* Machine #2 runs `B.Z`. +++ +++### Controlling Test Output +++ +++#### Colored Terminal Output +++ +++GoogleTest can use colors in its terminal output to make it easier to spot the +++important information: +++ +++
...
+++[----------] 1 test from FooTest
+++[ RUN      ] FooTest.DoesAbc
+++[       OK ] FooTest.DoesAbc
+++[----------] 2 tests from BarTest
+++[ RUN      ] BarTest.HasXyzProperty
+++[       OK ] BarTest.HasXyzProperty
+++[ RUN      ] BarTest.ReturnsTrueOnSuccess
+++... some error messages ...
+++[   FAILED ] BarTest.ReturnsTrueOnSuccess
+++...
+++[==========] 30 tests from 14 test suites ran.
+++[   PASSED ] 28 tests.
+++[   FAILED ] 2 tests, listed below:
+++[   FAILED ] BarTest.ReturnsTrueOnSuccess
+++[   FAILED ] AnotherTest.DoesXyz
+++
+++ 2 FAILED TESTS
+++
+++ +++You can set the `GTEST_COLOR` environment variable or the `--gtest_color` +++command line flag to `yes`, `no`, or `auto` (the default) to enable colors, +++disable colors, or let GoogleTest decide. When the value is `auto`, GoogleTest +++will use colors if and only if the output goes to a terminal and (on non-Windows +++platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`. +++ +++#### Suppressing test passes +++ +++By default, GoogleTest prints 1 line of output for each test, indicating if it +++passed or failed. To show only test failures, run the test program with +++`--gtest_brief=1`, or set the GTEST_BRIEF environment variable to `1`. +++ +++#### Suppressing the Elapsed Time +++ +++By default, GoogleTest prints the time it takes to run each test. To disable +++that, run the test program with the `--gtest_print_time=0` command line flag, or +++set the GTEST_PRINT_TIME environment variable to `0`. +++ +++#### Suppressing UTF-8 Text Output +++ +++In case of assertion failures, GoogleTest prints expected and actual values of +++type `string` both as hex-encoded strings as well as in readable UTF-8 text if +++they contain valid non-ASCII UTF-8 characters. If you want to suppress the UTF-8 +++text because, for example, you don't have an UTF-8 compatible output medium, run +++the test program with `--gtest_print_utf8=0` or set the `GTEST_PRINT_UTF8` +++environment variable to `0`. +++ +++#### Generating an XML Report +++ +++GoogleTest can emit a detailed XML report to a file in addition to its normal +++textual output. The report contains the duration of each test, and thus can help +++you identify slow tests. +++ +++To generate the XML report, set the `GTEST_OUTPUT` environment variable or the +++`--gtest_output` flag to the string `"xml:path_to_output_file"`, which will +++create the file at the given location. You can also just use the string `"xml"`, +++in which case the output can be found in the `test_detail.xml` file in the +++current directory. +++ +++If you specify a directory (for example, `"xml:output/directory/"` on Linux or +++`"xml:output\directory\"` on Windows), GoogleTest will create the XML file in +++that directory, named after the test executable (e.g. `foo_test.xml` for test +++program `foo_test` or `foo_test.exe`). If the file already exists (perhaps left +++over from a previous run), GoogleTest will pick a different name (e.g. +++`foo_test_1.xml`) to avoid overwriting it. +++ +++The report is based on the `junitreport` Ant task. Since that format was +++originally intended for Java, a little interpretation is required to make it +++apply to GoogleTest tests, as shown here: +++ +++```xml +++ +++ +++ +++ +++ +++ +++ +++ +++ +++``` +++ +++* The root `` element corresponds to the entire test program. +++* `` elements correspond to GoogleTest test suites. +++* `` elements correspond to GoogleTest test functions. +++ +++For instance, the following program +++ +++```c++ +++TEST(MathTest, Addition) { ... } +++TEST(MathTest, Subtraction) { ... } +++TEST(LogicTest, NonContradiction) { ... } +++``` +++ +++could generate this report: +++ +++```xml +++ +++ +++ +++ +++ ... +++ ... +++ +++ +++ +++ +++ +++ +++ +++ +++ +++``` +++ +++Things to note: +++ +++* The `tests` attribute of a `` or `` element tells how +++ many test functions the GoogleTest program or test suite contains, while the +++ `failures` attribute tells how many of them failed. +++ +++* The `time` attribute expresses the duration of the test, test suite, or +++ entire test program in seconds. +++ +++* The `timestamp` attribute records the local date and time of the test +++ execution. +++ +++* The `file` and `line` attributes record the source file location, where the +++ test was defined. +++ +++* Each `` element corresponds to a single failed GoogleTest +++ assertion. +++ +++#### Generating a JSON Report +++ +++GoogleTest can also emit a JSON report as an alternative format to XML. To +++generate the JSON report, set the `GTEST_OUTPUT` environment variable or the +++`--gtest_output` flag to the string `"json:path_to_output_file"`, which will +++create the file at the given location. You can also just use the string +++`"json"`, in which case the output can be found in the `test_detail.json` file +++in the current directory. +++ +++The report format conforms to the following JSON Schema: +++ +++```json +++{ +++ "$schema": "http://json-schema.org/schema#", +++ "type": "object", +++ "definitions": { +++ "TestCase": { +++ "type": "object", +++ "properties": { +++ "name": { "type": "string" }, +++ "tests": { "type": "integer" }, +++ "failures": { "type": "integer" }, +++ "disabled": { "type": "integer" }, +++ "time": { "type": "string" }, +++ "testsuite": { +++ "type": "array", +++ "items": { +++ "$ref": "#/definitions/TestInfo" +++ } +++ } +++ } +++ }, +++ "TestInfo": { +++ "type": "object", +++ "properties": { +++ "name": { "type": "string" }, +++ "file": { "type": "string" }, +++ "line": { "type": "integer" }, +++ "status": { +++ "type": "string", +++ "enum": ["RUN", "NOTRUN"] +++ }, +++ "time": { "type": "string" }, +++ "classname": { "type": "string" }, +++ "failures": { +++ "type": "array", +++ "items": { +++ "$ref": "#/definitions/Failure" +++ } +++ } +++ } +++ }, +++ "Failure": { +++ "type": "object", +++ "properties": { +++ "failures": { "type": "string" }, +++ "type": { "type": "string" } +++ } +++ } +++ }, +++ "properties": { +++ "tests": { "type": "integer" }, +++ "failures": { "type": "integer" }, +++ "disabled": { "type": "integer" }, +++ "errors": { "type": "integer" }, +++ "timestamp": { +++ "type": "string", +++ "format": "date-time" +++ }, +++ "time": { "type": "string" }, +++ "name": { "type": "string" }, +++ "testsuites": { +++ "type": "array", +++ "items": { +++ "$ref": "#/definitions/TestCase" +++ } +++ } +++ } +++} +++``` +++ +++The report uses the format that conforms to the following Proto3 using the +++[JSON encoding](https://developers.google.com/protocol-buffers/docs/proto3#json): +++ +++```proto +++syntax = "proto3"; +++ +++package googletest; +++ +++import "google/protobuf/timestamp.proto"; +++import "google/protobuf/duration.proto"; +++ +++message UnitTest { +++ int32 tests = 1; +++ int32 failures = 2; +++ int32 disabled = 3; +++ int32 errors = 4; +++ google.protobuf.Timestamp timestamp = 5; +++ google.protobuf.Duration time = 6; +++ string name = 7; +++ repeated TestCase testsuites = 8; +++} +++ +++message TestCase { +++ string name = 1; +++ int32 tests = 2; +++ int32 failures = 3; +++ int32 disabled = 4; +++ int32 errors = 5; +++ google.protobuf.Duration time = 6; +++ repeated TestInfo testsuite = 7; +++} +++ +++message TestInfo { +++ string name = 1; +++ string file = 6; +++ int32 line = 7; +++ enum Status { +++ RUN = 0; +++ NOTRUN = 1; +++ } +++ Status status = 2; +++ google.protobuf.Duration time = 3; +++ string classname = 4; +++ message Failure { +++ string failures = 1; +++ string type = 2; +++ } +++ repeated Failure failures = 5; +++} +++``` +++ +++For instance, the following program +++ +++```c++ +++TEST(MathTest, Addition) { ... } +++TEST(MathTest, Subtraction) { ... } +++TEST(LogicTest, NonContradiction) { ... } +++``` +++ +++could generate this report: +++ +++```json +++{ +++ "tests": 3, +++ "failures": 1, +++ "errors": 0, +++ "time": "0.035s", +++ "timestamp": "2011-10-31T18:52:42Z", +++ "name": "AllTests", +++ "testsuites": [ +++ { +++ "name": "MathTest", +++ "tests": 2, +++ "failures": 1, +++ "errors": 0, +++ "time": "0.015s", +++ "testsuite": [ +++ { +++ "name": "Addition", +++ "file": "test.cpp", +++ "line": 1, +++ "status": "RUN", +++ "time": "0.007s", +++ "classname": "", +++ "failures": [ +++ { +++ "message": "Value of: add(1, 1)\n Actual: 3\nExpected: 2", +++ "type": "" +++ }, +++ { +++ "message": "Value of: add(1, -1)\n Actual: 1\nExpected: 0", +++ "type": "" +++ } +++ ] +++ }, +++ { +++ "name": "Subtraction", +++ "file": "test.cpp", +++ "line": 2, +++ "status": "RUN", +++ "time": "0.005s", +++ "classname": "" +++ } +++ ] +++ }, +++ { +++ "name": "LogicTest", +++ "tests": 1, +++ "failures": 0, +++ "errors": 0, +++ "time": "0.005s", +++ "testsuite": [ +++ { +++ "name": "NonContradiction", +++ "file": "test.cpp", +++ "line": 3, +++ "status": "RUN", +++ "time": "0.005s", +++ "classname": "" +++ } +++ ] +++ } +++ ] +++} +++``` +++ +++{: .callout .important} +++IMPORTANT: The exact format of the JSON document is subject to change. +++ +++### Controlling How Failures Are Reported +++ +++#### Detecting Test Premature Exit +++ +++Google Test implements the _premature-exit-file_ protocol for test runners to +++catch any kind of unexpected exits of test programs. Upon start, Google Test +++creates the file which will be automatically deleted after all work has been +++finished. Then, the test runner can check if this file exists. In case the file +++remains undeleted, the inspected test has exited prematurely. +++ +++This feature is enabled only if the `TEST_PREMATURE_EXIT_FILE` environment +++variable has been set. +++ +++#### Turning Assertion Failures into Break-Points +++ +++When running test programs under a debugger, it's very convenient if the +++debugger can catch an assertion failure and automatically drop into interactive +++mode. GoogleTest's *break-on-failure* mode supports this behavior. +++ +++To enable it, set the `GTEST_BREAK_ON_FAILURE` environment variable to a value +++other than `0`. Alternatively, you can use the `--gtest_break_on_failure` +++command line flag. +++ +++#### Disabling Catching Test-Thrown Exceptions +++ +++GoogleTest can be used either with or without exceptions enabled. If a test +++throws a C++ exception or (on Windows) a structured exception (SEH), by default +++GoogleTest catches it, reports it as a test failure, and continues with the next +++test method. This maximizes the coverage of a test run. Also, on Windows an +++uncaught exception will cause a pop-up window, so catching the exceptions allows +++you to run the tests automatically. +++ +++When debugging the test failures, however, you may instead want the exceptions +++to be handled by the debugger, such that you can examine the call stack when an +++exception is thrown. To achieve that, set the `GTEST_CATCH_EXCEPTIONS` +++environment variable to `0`, or use the `--gtest_catch_exceptions=0` flag when +++running the tests. +++ +++### Sanitizer Integration +++ +++The +++[Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html), +++[Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer), +++and +++[Thread Sanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual) +++all provide weak functions that you can override to trigger explicit failures +++when they detect sanitizer errors, such as creating a reference from `nullptr`. +++To override these functions, place definitions for them in a source file that +++you compile as part of your main binary: +++ +++``` +++extern "C" { +++void __ubsan_on_report() { +++ FAIL() << "Encountered an undefined behavior sanitizer error"; +++} +++void __asan_on_error() { +++ FAIL() << "Encountered an address sanitizer error"; +++} +++void __tsan_on_report() { +++ FAIL() << "Encountered a thread sanitizer error"; +++} +++} // extern "C" +++``` +++ +++After compiling your project with one of the sanitizers enabled, if a particular +++test triggers a sanitizer error, GoogleTest will report that it failed. diff --cc googletest/docs/assets/css/style.scss index 000000000,000000000,000000000..bb30f418d new file mode 100644 --- /dev/null +++ b/googletest/docs/assets/css/style.scss @@@@ -1,0 -1,0 -1,0 +1,5 @@@@ +++--- +++--- +++ +++@import "jekyll-theme-primer"; +++@import "main"; diff --cc googletest/docs/community_created_documentation.md index 000000000,000000000,000000000..4569075ff new file mode 100644 --- /dev/null +++ b/googletest/docs/community_created_documentation.md @@@@ -1,0 -1,0 -1,0 +1,7 @@@@ +++# Community-Created Documentation +++ +++The following is a list, in no particular order, of links to documentation +++created by the Googletest community. +++ +++* [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), +++ by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) diff --cc googletest/docs/faq.md index 000000000,000000000,000000000..192809729 new file mode 100644 --- /dev/null +++ b/googletest/docs/faq.md @@@@ -1,0 -1,0 -1,0 +1,692 @@@@ +++# GoogleTest FAQ +++ +++## Why should test suite names and test names not contain underscore? +++ +++{: .callout .note} +++Note: GoogleTest reserves underscore (`_`) for special purpose keywords, such as +++[the `DISABLED_` prefix](advanced.md#temporarily-disabling-tests), in addition +++to the following rationale. +++ +++Underscore (`_`) is special, as C++ reserves the following to be used by the +++compiler and the standard library: +++ +++1. any identifier that starts with an `_` followed by an upper-case letter, and +++2. any identifier that contains two consecutive underscores (i.e. `__`) +++ *anywhere* in its name. +++ +++User code is *prohibited* from using such identifiers. +++ +++Now let's look at what this means for `TEST` and `TEST_F`. +++ +++Currently `TEST(TestSuiteName, TestName)` generates a class named +++`TestSuiteName_TestName_Test`. What happens if `TestSuiteName` or `TestName` +++contains `_`? +++ +++1. If `TestSuiteName` starts with an `_` followed by an upper-case letter (say, +++ `_Foo`), we end up with `_Foo_TestName_Test`, which is reserved and thus +++ invalid. +++2. If `TestSuiteName` ends with an `_` (say, `Foo_`), we get +++ `Foo__TestName_Test`, which is invalid. +++3. If `TestName` starts with an `_` (say, `_Bar`), we get +++ `TestSuiteName__Bar_Test`, which is invalid. +++4. If `TestName` ends with an `_` (say, `Bar_`), we get +++ `TestSuiteName_Bar__Test`, which is invalid. +++ +++So clearly `TestSuiteName` and `TestName` cannot start or end with `_` +++(Actually, `TestSuiteName` can start with `_` -- as long as the `_` isn't +++followed by an upper-case letter. But that's getting complicated. So for +++simplicity we just say that it cannot start with `_`.). +++ +++It may seem fine for `TestSuiteName` and `TestName` to contain `_` in the +++middle. However, consider this: +++ +++```c++ +++TEST(Time, Flies_Like_An_Arrow) { ... } +++TEST(Time_Flies, Like_An_Arrow) { ... } +++``` +++ +++Now, the two `TEST`s will both generate the same class +++(`Time_Flies_Like_An_Arrow_Test`). That's not good. +++ +++So for simplicity, we just ask the users to avoid `_` in `TestSuiteName` and +++`TestName`. The rule is more constraining than necessary, but it's simple and +++easy to remember. It also gives GoogleTest some wiggle room in case its +++implementation needs to change in the future. +++ +++If you violate the rule, there may not be immediate consequences, but your test +++may (just may) break with a new compiler (or a new version of the compiler you +++are using) or with a new version of GoogleTest. Therefore it's best to follow +++the rule. +++ +++## Why does GoogleTest support `EXPECT_EQ(NULL, ptr)` and `ASSERT_EQ(NULL, ptr)` but not `EXPECT_NE(NULL, ptr)` and `ASSERT_NE(NULL, ptr)`? +++ +++First of all, you can use `nullptr` with each of these macros, e.g. +++`EXPECT_EQ(ptr, nullptr)`, `EXPECT_NE(ptr, nullptr)`, `ASSERT_EQ(ptr, nullptr)`, +++`ASSERT_NE(ptr, nullptr)`. This is the preferred syntax in the style guide +++because `nullptr` does not have the type problems that `NULL` does. +++ +++Due to some peculiarity of C++, it requires some non-trivial template meta +++programming tricks to support using `NULL` as an argument of the `EXPECT_XX()` +++and `ASSERT_XX()` macros. Therefore we only do it where it's most needed +++(otherwise we make the implementation of GoogleTest harder to maintain and more +++error-prone than necessary). +++ +++Historically, the `EXPECT_EQ()` macro took the *expected* value as its first +++argument and the *actual* value as the second, though this argument order is now +++discouraged. It was reasonable that someone wanted +++to write `EXPECT_EQ(NULL, some_expression)`, and this indeed was requested +++several times. Therefore we implemented it. +++ +++The need for `EXPECT_NE(NULL, ptr)` wasn't nearly as strong. When the assertion +++fails, you already know that `ptr` must be `NULL`, so it doesn't add any +++information to print `ptr` in this case. That means `EXPECT_TRUE(ptr != NULL)` +++works just as well. +++ +++If we were to support `EXPECT_NE(NULL, ptr)`, for consistency we'd have to +++support `EXPECT_NE(ptr, NULL)` as well. This means using the template meta +++programming tricks twice in the implementation, making it even harder to +++understand and maintain. We believe the benefit doesn't justify the cost. +++ +++Finally, with the growth of the gMock matcher library, we are encouraging people +++to use the unified `EXPECT_THAT(value, matcher)` syntax more often in tests. One +++significant advantage of the matcher approach is that matchers can be easily +++combined to form new matchers, while the `EXPECT_NE`, etc, macros cannot be +++easily combined. Therefore we want to invest more in the matchers than in the +++`EXPECT_XX()` macros. +++ +++## I need to test that different implementations of an interface satisfy some common requirements. Should I use typed tests or value-parameterized tests? +++ +++For testing various implementations of the same interface, either typed tests or +++value-parameterized tests can get it done. It's really up to you the user to +++decide which is more convenient for you, depending on your particular case. Some +++rough guidelines: +++ +++* Typed tests can be easier to write if instances of the different +++ implementations can be created the same way, modulo the type. For example, +++ if all these implementations have a public default constructor (such that +++ you can write `new TypeParam`), or if their factory functions have the same +++ form (e.g. `CreateInstance()`). +++* Value-parameterized tests can be easier to write if you need different code +++ patterns to create different implementations' instances, e.g. `new Foo` vs +++ `new Bar(5)`. To accommodate for the differences, you can write factory +++ function wrappers and pass these function pointers to the tests as their +++ parameters. +++* When a typed test fails, the default output includes the name of the type, +++ which can help you quickly identify which implementation is wrong. +++ Value-parameterized tests only show the number of the failed iteration by +++ default. You will need to define a function that returns the iteration name +++ and pass it as the third parameter to INSTANTIATE_TEST_SUITE_P to have more +++ useful output. +++* When using typed tests, you need to make sure you are testing against the +++ interface type, not the concrete types (in other words, you want to make +++ sure `implicit_cast(my_concrete_impl)` works, not just that +++ `my_concrete_impl` works). It's less likely to make mistakes in this area +++ when using value-parameterized tests. +++ +++I hope I didn't confuse you more. :-) If you don't mind, I'd suggest you to give +++both approaches a try. Practice is a much better way to grasp the subtle +++differences between the two tools. Once you have some concrete experience, you +++can much more easily decide which one to use the next time. +++ +++## I got some run-time errors about invalid proto descriptors when using `ProtocolMessageEquals`. Help! +++ +++{: .callout .note} +++**Note:** `ProtocolMessageEquals` and `ProtocolMessageEquiv` are *deprecated* +++now. Please use `EqualsProto`, etc instead. +++ +++`ProtocolMessageEquals` and `ProtocolMessageEquiv` were redefined recently and +++are now less tolerant of invalid protocol buffer definitions. In particular, if +++you have a `foo.proto` that doesn't fully qualify the type of a protocol message +++it references (e.g. `message` where it should be `message`), you +++will now get run-time errors like: +++ +++``` +++... descriptor.cc:...] Invalid proto descriptor for file "path/to/foo.proto": +++... descriptor.cc:...] blah.MyMessage.my_field: ".Bar" is not defined. +++``` +++ +++If you see this, your `.proto` file is broken and needs to be fixed by making +++the types fully qualified. The new definition of `ProtocolMessageEquals` and +++`ProtocolMessageEquiv` just happen to reveal your bug. +++ +++## My death test modifies some state, but the change seems lost after the death test finishes. Why? +++ +++Death tests (`EXPECT_DEATH`, etc) are executed in a sub-process s.t. the +++expected crash won't kill the test program (i.e. the parent process). As a +++result, any in-memory side effects they incur are observable in their respective +++sub-processes, but not in the parent process. You can think of them as running +++in a parallel universe, more or less. +++ +++In particular, if you use mocking and the death test statement invokes some mock +++methods, the parent process will think the calls have never occurred. Therefore, +++you may want to move your `EXPECT_CALL` statements inside the `EXPECT_DEATH` +++macro. +++ +++## EXPECT_EQ(htonl(blah), blah_blah) generates weird compiler errors in opt mode. Is this a GoogleTest bug? +++ +++Actually, the bug is in `htonl()`. +++ +++According to `'man htonl'`, `htonl()` is a *function*, which means it's valid to +++use `htonl` as a function pointer. However, in opt mode `htonl()` is defined as +++a *macro*, which breaks this usage. +++ +++Worse, the macro definition of `htonl()` uses a `gcc` extension and is *not* +++standard C++. That hacky implementation has some ad hoc limitations. In +++particular, it prevents you from writing `Foo()`, where `Foo` +++is a template that has an integral argument. +++ +++The implementation of `EXPECT_EQ(a, b)` uses `sizeof(... a ...)` inside a +++template argument, and thus doesn't compile in opt mode when `a` contains a call +++to `htonl()`. It is difficult to make `EXPECT_EQ` bypass the `htonl()` bug, as +++the solution must work with different compilers on various platforms. +++ +++## The compiler complains about "undefined references" to some static const member variables, but I did define them in the class body. What's wrong? +++ +++If your class has a static data member: +++ +++```c++ +++// foo.h +++class Foo { +++ ... +++ static const int kBar = 100; +++}; +++``` +++ +++You also need to define it *outside* of the class body in `foo.cc`: +++ +++```c++ +++const int Foo::kBar; // No initializer here. +++``` +++ +++Otherwise your code is **invalid C++**, and may break in unexpected ways. In +++particular, using it in GoogleTest comparison assertions (`EXPECT_EQ`, etc) will +++generate an "undefined reference" linker error. The fact that "it used to work" +++doesn't mean it's valid. It just means that you were lucky. :-) +++ +++If the declaration of the static data member is `constexpr` then it is +++implicitly an `inline` definition, and a separate definition in `foo.cc` is not +++needed: +++ +++```c++ +++// foo.h +++class Foo { +++ ... +++ static constexpr int kBar = 100; // Defines kBar, no need to do it in foo.cc. +++}; +++``` +++ +++## Can I derive a test fixture from another? +++ +++Yes. +++ +++Each test fixture has a corresponding and same named test suite. This means only +++one test suite can use a particular fixture. Sometimes, however, multiple test +++cases may want to use the same or slightly different fixtures. For example, you +++may want to make sure that all of a GUI library's test suites don't leak +++important system resources like fonts and brushes. +++ +++In GoogleTest, you share a fixture among test suites by putting the shared logic +++in a base test fixture, then deriving from that base a separate fixture for each +++test suite that wants to use this common logic. You then use `TEST_F()` to write +++tests using each derived fixture. +++ +++Typically, your code looks like this: +++ +++```c++ +++// Defines a base test fixture. +++class BaseTest : public ::testing::Test { +++ protected: +++ ... +++}; +++ +++// Derives a fixture FooTest from BaseTest. +++class FooTest : public BaseTest { +++ protected: +++ void SetUp() override { +++ BaseTest::SetUp(); // Sets up the base fixture first. +++ ... additional set-up work ... +++ } +++ +++ void TearDown() override { +++ ... clean-up work for FooTest ... +++ BaseTest::TearDown(); // Remember to tear down the base fixture +++ // after cleaning up FooTest! +++ } +++ +++ ... functions and variables for FooTest ... +++}; +++ +++// Tests that use the fixture FooTest. +++TEST_F(FooTest, Bar) { ... } +++TEST_F(FooTest, Baz) { ... } +++ +++... additional fixtures derived from BaseTest ... +++``` +++ +++If necessary, you can continue to derive test fixtures from a derived fixture. +++GoogleTest has no limit on how deep the hierarchy can be. +++ +++For a complete example using derived test fixtures, see +++[sample5_unittest.cc](https://github.com/google/googletest/blob/main/googletest/samples/sample5_unittest.cc). +++ +++## My compiler complains "void value not ignored as it ought to be." What does this mean? +++ +++You're probably using an `ASSERT_*()` in a function that doesn't return `void`. +++`ASSERT_*()` can only be used in `void` functions, due to exceptions being +++disabled by our build system. Please see more details +++[here](advanced.md#assertion-placement). +++ +++## My death test hangs (or seg-faults). How do I fix it? +++ +++In GoogleTest, death tests are run in a child process and the way they work is +++delicate. To write death tests you really need to understand how they work—see +++the details at [Death Assertions](reference/assertions.md#death) in the +++Assertions Reference. +++ +++In particular, death tests don't like having multiple threads in the parent +++process. So the first thing you can try is to eliminate creating threads outside +++of `EXPECT_DEATH()`. For example, you may want to use mocks or fake objects +++instead of real ones in your tests. +++ +++Sometimes this is impossible as some library you must use may be creating +++threads before `main()` is even reached. In this case, you can try to minimize +++the chance of conflicts by either moving as many activities as possible inside +++`EXPECT_DEATH()` (in the extreme case, you want to move everything inside), or +++leaving as few things as possible in it. Also, you can try to set the death test +++style to `"threadsafe"`, which is safer but slower, and see if it helps. +++ +++If you go with thread-safe death tests, remember that they rerun the test +++program from the beginning in the child process. Therefore make sure your +++program can run side-by-side with itself and is deterministic. +++ +++In the end, this boils down to good concurrent programming. You have to make +++sure that there are no race conditions or deadlocks in your program. No silver +++bullet - sorry! +++ +++## Should I use the constructor/destructor of the test fixture or SetUp()/TearDown()? {#CtorVsSetUp} +++ +++The first thing to remember is that GoogleTest does **not** reuse the same test +++fixture object across multiple tests. For each `TEST_F`, GoogleTest will create +++a **fresh** test fixture object, immediately call `SetUp()`, run the test body, +++call `TearDown()`, and then delete the test fixture object. +++ +++When you need to write per-test set-up and tear-down logic, you have the choice +++between using the test fixture constructor/destructor or `SetUp()/TearDown()`. +++The former is usually preferred, as it has the following benefits: +++ +++* By initializing a member variable in the constructor, we have the option to +++ make it `const`, which helps prevent accidental changes to its value and +++ makes the tests more obviously correct. +++* In case we need to subclass the test fixture class, the subclass' +++ constructor is guaranteed to call the base class' constructor *first*, and +++ the subclass' destructor is guaranteed to call the base class' destructor +++ *afterward*. With `SetUp()/TearDown()`, a subclass may make the mistake of +++ forgetting to call the base class' `SetUp()/TearDown()` or call them at the +++ wrong time. +++ +++You may still want to use `SetUp()/TearDown()` in the following cases: +++ +++* C++ does not allow virtual function calls in constructors and destructors. +++ You can call a method declared as virtual, but it will not use dynamic +++ dispatch. It will use the definition from the class the constructor of which +++ is currently executing. This is because calling a virtual method before the +++ derived class constructor has a chance to run is very dangerous - the +++ virtual method might operate on uninitialized data. Therefore, if you need +++ to call a method that will be overridden in a derived class, you have to use +++ `SetUp()/TearDown()`. +++* In the body of a constructor (or destructor), it's not possible to use the +++ `ASSERT_xx` macros. Therefore, if the set-up operation could cause a fatal +++ test failure that should prevent the test from running, it's necessary to +++ use `abort` and abort the whole test +++ executable, or to use `SetUp()` instead of a constructor. +++* If the tear-down operation could throw an exception, you must use +++ `TearDown()` as opposed to the destructor, as throwing in a destructor leads +++ to undefined behavior and usually will kill your program right away. Note +++ that many standard libraries (like STL) may throw when exceptions are +++ enabled in the compiler. Therefore you should prefer `TearDown()` if you +++ want to write portable tests that work with or without exceptions. +++* The GoogleTest team is considering making the assertion macros throw on +++ platforms where exceptions are enabled (e.g. Windows, Mac OS, and Linux +++ client-side), which will eliminate the need for the user to propagate +++ failures from a subroutine to its caller. Therefore, you shouldn't use +++ GoogleTest assertions in a destructor if your code could run on such a +++ platform. +++ +++## The compiler complains "no matching function to call" when I use ASSERT_PRED*. How do I fix it? +++ +++See details for [`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) in the +++Assertions Reference. +++ +++## My compiler complains about "ignoring return value" when I call RUN_ALL_TESTS(). Why? +++ +++Some people had been ignoring the return value of `RUN_ALL_TESTS()`. That is, +++instead of +++ +++```c++ +++ return RUN_ALL_TESTS(); +++``` +++ +++they write +++ +++```c++ +++ RUN_ALL_TESTS(); +++``` +++ +++This is **wrong and dangerous**. The testing services needs to see the return +++value of `RUN_ALL_TESTS()` in order to determine if a test has passed. If your +++`main()` function ignores it, your test will be considered successful even if it +++has a GoogleTest assertion failure. Very bad. +++ +++We have decided to fix this (thanks to Michael Chastain for the idea). Now, your +++code will no longer be able to ignore `RUN_ALL_TESTS()` when compiled with +++`gcc`. If you do so, you'll get a compiler error. +++ +++If you see the compiler complaining about you ignoring the return value of +++`RUN_ALL_TESTS()`, the fix is simple: just make sure its value is used as the +++return value of `main()`. +++ +++But how could we introduce a change that breaks existing tests? Well, in this +++case, the code was already broken in the first place, so we didn't break it. :-) +++ +++## My compiler complains that a constructor (or destructor) cannot return a value. What's going on? +++ +++Due to a peculiarity of C++, in order to support the syntax for streaming +++messages to an `ASSERT_*`, e.g. +++ +++```c++ +++ ASSERT_EQ(1, Foo()) << "blah blah" << foo; +++``` +++ +++we had to give up using `ASSERT*` and `FAIL*` (but not `EXPECT*` and +++`ADD_FAILURE*`) in constructors and destructors. The workaround is to move the +++content of your constructor/destructor to a private void member function, or +++switch to `EXPECT_*()` if that works. This +++[section](advanced.md#assertion-placement) in the user's guide explains it. +++ +++## My SetUp() function is not called. Why? +++ +++C++ is case-sensitive. Did you spell it as `Setup()`? +++ +++Similarly, sometimes people spell `SetUpTestSuite()` as `SetupTestSuite()` and +++wonder why it's never called. +++ +++## I have several test suites which share the same test fixture logic, do I have to define a new test fixture class for each of them? This seems pretty tedious. +++ +++You don't have to. Instead of +++ +++```c++ +++class FooTest : public BaseTest {}; +++ +++TEST_F(FooTest, Abc) { ... } +++TEST_F(FooTest, Def) { ... } +++ +++class BarTest : public BaseTest {}; +++ +++TEST_F(BarTest, Abc) { ... } +++TEST_F(BarTest, Def) { ... } +++``` +++ +++you can simply `typedef` the test fixtures: +++ +++```c++ +++typedef BaseTest FooTest; +++ +++TEST_F(FooTest, Abc) { ... } +++TEST_F(FooTest, Def) { ... } +++ +++typedef BaseTest BarTest; +++ +++TEST_F(BarTest, Abc) { ... } +++TEST_F(BarTest, Def) { ... } +++``` +++ +++## GoogleTest output is buried in a whole bunch of LOG messages. What do I do? +++ +++The GoogleTest output is meant to be a concise and human-friendly report. If +++your test generates textual output itself, it will mix with the GoogleTest +++output, making it hard to read. However, there is an easy solution to this +++problem. +++ +++Since `LOG` messages go to stderr, we decided to let GoogleTest output go to +++stdout. This way, you can easily separate the two using redirection. For +++example: +++ +++```shell +++$ ./my_test > gtest_output.txt +++``` +++ +++## Why should I prefer test fixtures over global variables? +++ +++There are several good reasons: +++ +++1. It's likely your test needs to change the states of its global variables. +++ This makes it difficult to keep side effects from escaping one test and +++ contaminating others, making debugging difficult. By using fixtures, each +++ test has a fresh set of variables that's different (but with the same +++ names). Thus, tests are kept independent of each other. +++2. Global variables pollute the global namespace. +++3. Test fixtures can be reused via subclassing, which cannot be done easily +++ with global variables. This is useful if many test suites have something in +++ common. +++ +++## What can the statement argument in ASSERT_DEATH() be? +++ +++`ASSERT_DEATH(statement, matcher)` (or any death assertion macro) can be used +++wherever *`statement`* is valid. So basically *`statement`* can be any C++ +++statement that makes sense in the current context. In particular, it can +++reference global and/or local variables, and can be: +++ +++* a simple function call (often the case), +++* a complex expression, or +++* a compound statement. +++ +++Some examples are shown here: +++ +++```c++ +++// A death test can be a simple function call. +++TEST(MyDeathTest, FunctionCall) { +++ ASSERT_DEATH(Xyz(5), "Xyz failed"); +++} +++ +++// Or a complex expression that references variables and functions. +++TEST(MyDeathTest, ComplexExpression) { +++ const bool c = Condition(); +++ ASSERT_DEATH((c ? Func1(0) : object2.Method("test")), +++ "(Func1|Method) failed"); +++} +++ +++// Death assertions can be used anywhere in a function. In +++// particular, they can be inside a loop. +++TEST(MyDeathTest, InsideLoop) { +++ // Verifies that Foo(0), Foo(1), ..., and Foo(4) all die. +++ for (int i = 0; i < 5; i++) { +++ EXPECT_DEATH_M(Foo(i), "Foo has \\d+ errors", +++ ::testing::Message() << "where i is " << i); +++ } +++} +++ +++// A death assertion can contain a compound statement. +++TEST(MyDeathTest, CompoundStatement) { +++ // Verifies that at lease one of Bar(0), Bar(1), ..., and +++ // Bar(4) dies. +++ ASSERT_DEATH({ +++ for (int i = 0; i < 5; i++) { +++ Bar(i); +++ } +++ }, +++ "Bar has \\d+ errors"); +++} +++``` +++ +++## I have a fixture class `FooTest`, but `TEST_F(FooTest, Bar)` gives me error ``"no matching function for call to `FooTest::FooTest()'"``. Why? +++ +++GoogleTest needs to be able to create objects of your test fixture class, so it +++must have a default constructor. Normally the compiler will define one for you. +++However, there are cases where you have to define your own: +++ +++* If you explicitly declare a non-default constructor for class `FooTest` +++ (`DISALLOW_EVIL_CONSTRUCTORS()` does this), then you need to define a +++ default constructor, even if it would be empty. +++* If `FooTest` has a const non-static data member, then you have to define the +++ default constructor *and* initialize the const member in the initializer +++ list of the constructor. (Early versions of `gcc` doesn't force you to +++ initialize the const member. It's a bug that has been fixed in `gcc 4`.) +++ +++## Why does ASSERT_DEATH complain about previous threads that were already joined? +++ +++With the Linux pthread library, there is no turning back once you cross the line +++from a single thread to multiple threads. The first time you create a thread, a +++manager thread is created in addition, so you get 3, not 2, threads. Later when +++the thread you create joins the main thread, the thread count decrements by 1, +++but the manager thread will never be killed, so you still have 2 threads, which +++means you cannot safely run a death test. +++ +++The new NPTL thread library doesn't suffer from this problem, as it doesn't +++create a manager thread. However, if you don't control which machine your test +++runs on, you shouldn't depend on this. +++ +++## Why does GoogleTest require the entire test suite, instead of individual tests, to be named *DeathTest when it uses ASSERT_DEATH? +++ +++GoogleTest does not interleave tests from different test suites. That is, it +++runs all tests in one test suite first, and then runs all tests in the next test +++suite, and so on. GoogleTest does this because it needs to set up a test suite +++before the first test in it is run, and tear it down afterwards. Splitting up +++the test case would require multiple set-up and tear-down processes, which is +++inefficient and makes the semantics unclean. +++ +++If we were to determine the order of tests based on test name instead of test +++case name, then we would have a problem with the following situation: +++ +++```c++ +++TEST_F(FooTest, AbcDeathTest) { ... } +++TEST_F(FooTest, Uvw) { ... } +++ +++TEST_F(BarTest, DefDeathTest) { ... } +++TEST_F(BarTest, Xyz) { ... } +++``` +++ +++Since `FooTest.AbcDeathTest` needs to run before `BarTest.Xyz`, and we don't +++interleave tests from different test suites, we need to run all tests in the +++`FooTest` case before running any test in the `BarTest` case. This contradicts +++with the requirement to run `BarTest.DefDeathTest` before `FooTest.Uvw`. +++ +++## But I don't like calling my entire test suite \*DeathTest when it contains both death tests and non-death tests. What do I do? +++ +++You don't have to, but if you like, you may split up the test suite into +++`FooTest` and `FooDeathTest`, where the names make it clear that they are +++related: +++ +++```c++ +++class FooTest : public ::testing::Test { ... }; +++ +++TEST_F(FooTest, Abc) { ... } +++TEST_F(FooTest, Def) { ... } +++ +++using FooDeathTest = FooTest; +++ +++TEST_F(FooDeathTest, Uvw) { ... EXPECT_DEATH(...) ... } +++TEST_F(FooDeathTest, Xyz) { ... ASSERT_DEATH(...) ... } +++``` +++ +++## GoogleTest prints the LOG messages in a death test's child process only when the test fails. How can I see the LOG messages when the death test succeeds? +++ +++Printing the LOG messages generated by the statement inside `EXPECT_DEATH()` +++makes it harder to search for real problems in the parent's log. Therefore, +++GoogleTest only prints them when the death test has failed. +++ +++If you really need to see such LOG messages, a workaround is to temporarily +++break the death test (e.g. by changing the regex pattern it is expected to +++match). Admittedly, this is a hack. We'll consider a more permanent solution +++after the fork-and-exec-style death tests are implemented. +++ +++## The compiler complains about `no match for 'operator<<'` when I use an assertion. What gives? +++ +++If you use a user-defined type `FooType` in an assertion, you must make sure +++there is an `std::ostream& operator<<(std::ostream&, const FooType&)` function +++defined such that we can print a value of `FooType`. +++ +++In addition, if `FooType` is declared in a name space, the `<<` operator also +++needs to be defined in the *same* name space. See +++[Tip of the Week #49](http://abseil.io/tips/49) for details. +++ +++## How do I suppress the memory leak messages on Windows? +++ +++Since the statically initialized GoogleTest singleton requires allocations on +++the heap, the Visual C++ memory leak detector will report memory leaks at the +++end of the program run. The easiest way to avoid this is to use the +++`_CrtMemCheckpoint` and `_CrtMemDumpAllObjectsSince` calls to not report any +++statically initialized heap objects. See MSDN for more details and additional +++heap check/debug routines. +++ +++## How can my code detect if it is running in a test? +++ +++If you write code that sniffs whether it's running in a test and does different +++things accordingly, you are leaking test-only logic into production code and +++there is no easy way to ensure that the test-only code paths aren't run by +++mistake in production. Such cleverness also leads to +++[Heisenbugs](https://en.wikipedia.org/wiki/Heisenbug). Therefore we strongly +++advise against the practice, and GoogleTest doesn't provide a way to do it. +++ +++In general, the recommended way to cause the code to behave differently under +++test is [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection). You can inject +++different functionality from the test and from the production code. Since your +++production code doesn't link in the for-test logic at all (the +++[`testonly`](http://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly) attribute for BUILD targets helps to ensure +++that), there is no danger in accidentally running it. +++ +++However, if you *really*, *really*, *really* have no choice, and if you follow +++the rule of ending your test program names with `_test`, you can use the +++*horrible* hack of sniffing your executable name (`argv[0]` in `main()`) to know +++whether the code is under test. +++ +++## How do I temporarily disable a test? +++ +++If you have a broken test that you cannot fix right away, you can add the +++`DISABLED_` prefix to its name. This will exclude it from execution. This is +++better than commenting out the code or using `#if 0`, as disabled tests are +++still compiled (and thus won't rot). +++ +++To include disabled tests in test execution, just invoke the test program with +++the `--gtest_also_run_disabled_tests` flag. +++ +++## Is it OK if I have two separate `TEST(Foo, Bar)` test methods defined in different namespaces? +++ +++Yes. +++ +++The rule is **all test methods in the same test suite must use the same fixture +++class.** This means that the following is **allowed** because both tests use the +++same fixture class (`::testing::Test`). +++ +++```c++ +++namespace foo { +++TEST(CoolTest, DoSomething) { +++ SUCCEED(); +++} +++} // namespace foo +++ +++namespace bar { +++TEST(CoolTest, DoSomething) { +++ SUCCEED(); +++} +++} // namespace bar +++``` +++ +++However, the following code is **not allowed** and will produce a runtime error +++from GoogleTest because the test methods are using different test fixture +++classes with the same test suite name. +++ +++```c++ +++namespace foo { +++class CoolTest : public ::testing::Test {}; // Fixture foo::CoolTest +++TEST_F(CoolTest, DoSomething) { +++ SUCCEED(); +++} +++} // namespace foo +++ +++namespace bar { +++class CoolTest : public ::testing::Test {}; // Fixture: bar::CoolTest +++TEST_F(CoolTest, DoSomething) { +++ SUCCEED(); +++} +++} // namespace bar +++``` diff --cc googletest/docs/gmock_cheat_sheet.md index 000000000,000000000,000000000..ddafaaa22 new file mode 100644 --- /dev/null +++ b/googletest/docs/gmock_cheat_sheet.md @@@@ -1,0 -1,0 -1,0 +1,241 @@@@ +++# gMock Cheat Sheet +++ +++## Defining a Mock Class +++ +++### Mocking a Normal Class {#MockClass} +++ +++Given +++ +++```cpp +++class Foo { +++ public: +++ virtual ~Foo(); +++ virtual int GetSize() const = 0; +++ virtual string Describe(const char* name) = 0; +++ virtual string Describe(int type) = 0; +++ virtual bool Process(Bar elem, int count) = 0; +++}; +++``` +++ +++(note that `~Foo()` **must** be virtual) we can define its mock as +++ +++```cpp +++#include +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(int, GetSize, (), (const, override)); +++ MOCK_METHOD(string, Describe, (const char* name), (override)); +++ MOCK_METHOD(string, Describe, (int type), (override)); +++ MOCK_METHOD(bool, Process, (Bar elem, int count), (override)); +++}; +++``` +++ +++To create a "nice" mock, which ignores all uninteresting calls, a "naggy" mock, +++which warns on all uninteresting calls, or a "strict" mock, which treats them as +++failures: +++ +++```cpp +++using ::testing::NiceMock; +++using ::testing::NaggyMock; +++using ::testing::StrictMock; +++ +++NiceMock nice_foo; // The type is a subclass of MockFoo. +++NaggyMock naggy_foo; // The type is a subclass of MockFoo. +++StrictMock strict_foo; // The type is a subclass of MockFoo. +++``` +++ +++{: .callout .note} +++**Note:** A mock object is currently naggy by default. We may make it nice by +++default in the future. +++ +++### Mocking a Class Template {#MockTemplate} +++ +++Class templates can be mocked just like any class. +++ +++To mock +++ +++```cpp +++template +++class StackInterface { +++ public: +++ virtual ~StackInterface(); +++ virtual int GetSize() const = 0; +++ virtual void Push(const Elem& x) = 0; +++}; +++``` +++ +++(note that all member functions that are mocked, including `~StackInterface()` +++**must** be virtual). +++ +++```cpp +++template +++class MockStack : public StackInterface { +++ public: +++ MOCK_METHOD(int, GetSize, (), (const, override)); +++ MOCK_METHOD(void, Push, (const Elem& x), (override)); +++}; +++``` +++ +++### Specifying Calling Conventions for Mock Functions +++ +++If your mock function doesn't use the default calling convention, you can +++specify it by adding `Calltype(convention)` to `MOCK_METHOD`'s 4th parameter. +++For example, +++ +++```cpp +++ MOCK_METHOD(bool, Foo, (int n), (Calltype(STDMETHODCALLTYPE))); +++ MOCK_METHOD(int, Bar, (double x, double y), +++ (const, Calltype(STDMETHODCALLTYPE))); +++``` +++ +++where `STDMETHODCALLTYPE` is defined by `` on Windows. +++ +++## Using Mocks in Tests {#UsingMocks} +++ +++The typical work flow is: +++ +++1. Import the gMock names you need to use. All gMock symbols are in the +++ `testing` namespace unless they are macros or otherwise noted. +++2. Create the mock objects. +++3. Optionally, set the default actions of the mock objects. +++4. Set your expectations on the mock objects (How will they be called? What +++ will they do?). +++5. Exercise code that uses the mock objects; if necessary, check the result +++ using googletest assertions. +++6. When a mock object is destructed, gMock automatically verifies that all +++ expectations on it have been satisfied. +++ +++Here's an example: +++ +++```cpp +++using ::testing::Return; // #1 +++ +++TEST(BarTest, DoesThis) { +++ MockFoo foo; // #2 +++ +++ ON_CALL(foo, GetSize()) // #3 +++ .WillByDefault(Return(1)); +++ // ... other default actions ... +++ +++ EXPECT_CALL(foo, Describe(5)) // #4 +++ .Times(3) +++ .WillRepeatedly(Return("Category 5")); +++ // ... other expectations ... +++ +++ EXPECT_EQ(MyProductionFunction(&foo), "good"); // #5 +++} // #6 +++``` +++ +++## Setting Default Actions {#OnCall} +++ +++gMock has a **built-in default action** for any function that returns `void`, +++`bool`, a numeric value, or a pointer. In C++11, it will additionally returns +++the default-constructed value, if one exists for the given type. +++ +++To customize the default action for functions with return type `T`, use +++[`DefaultValue`](reference/mocking.md#DefaultValue). For example: +++ +++```cpp +++ // Sets the default action for return type std::unique_ptr to +++ // creating a new Buzz every time. +++ DefaultValue>::SetFactory( +++ [] { return std::make_unique(AccessLevel::kInternal); }); +++ +++ // When this fires, the default action of MakeBuzz() will run, which +++ // will return a new Buzz object. +++ EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")).Times(AnyNumber()); +++ +++ auto buzz1 = mock_buzzer_.MakeBuzz("hello"); +++ auto buzz2 = mock_buzzer_.MakeBuzz("hello"); +++ EXPECT_NE(buzz1, nullptr); +++ EXPECT_NE(buzz2, nullptr); +++ EXPECT_NE(buzz1, buzz2); +++ +++ // Resets the default action for return type std::unique_ptr, +++ // to avoid interfere with other tests. +++ DefaultValue>::Clear(); +++``` +++ +++To customize the default action for a particular method of a specific mock +++object, use [`ON_CALL`](reference/mocking.md#ON_CALL). `ON_CALL` has a similar +++syntax to `EXPECT_CALL`, but it is used for setting default behaviors when you +++do not require that the mock method is called. See +++[Knowing When to Expect](gmock_cook_book.md#UseOnCall) for a more detailed +++discussion. +++ +++## Setting Expectations {#ExpectCall} +++ +++See [`EXPECT_CALL`](reference/mocking.md#EXPECT_CALL) in the Mocking Reference. +++ +++## Matchers {#MatcherList} +++ +++See the [Matchers Reference](reference/matchers.md). +++ +++## Actions {#ActionList} +++ +++See the [Actions Reference](reference/actions.md). +++ +++## Cardinalities {#CardinalityList} +++ +++See the [`Times` clause](reference/mocking.md#EXPECT_CALL.Times) of +++`EXPECT_CALL` in the Mocking Reference. +++ +++## Expectation Order +++ +++By default, expectations can be matched in *any* order. If some or all +++expectations must be matched in a given order, you can use the +++[`After` clause](reference/mocking.md#EXPECT_CALL.After) or +++[`InSequence` clause](reference/mocking.md#EXPECT_CALL.InSequence) of +++`EXPECT_CALL`, or use an [`InSequence` object](reference/mocking.md#InSequence). +++ +++## Verifying and Resetting a Mock +++ +++gMock will verify the expectations on a mock object when it is destructed, or +++you can do it earlier: +++ +++```cpp +++using ::testing::Mock; +++... +++// Verifies and removes the expectations on mock_obj; +++// returns true if and only if successful. +++Mock::VerifyAndClearExpectations(&mock_obj); +++... +++// Verifies and removes the expectations on mock_obj; +++// also removes the default actions set by ON_CALL(); +++// returns true if and only if successful. +++Mock::VerifyAndClear(&mock_obj); +++``` +++ +++Do not set new expectations after verifying and clearing a mock after its use. +++Setting expectations after code that exercises the mock has undefined behavior. +++See [Using Mocks in Tests](gmock_for_dummies.md#using-mocks-in-tests) for more +++information. +++ +++You can also tell gMock that a mock object can be leaked and doesn't need to be +++verified: +++ +++```cpp +++Mock::AllowLeak(&mock_obj); +++``` +++ +++## Mock Classes +++ +++gMock defines a convenient mock class template +++ +++```cpp +++class MockFunction { +++ public: +++ MOCK_METHOD(R, Call, (A1, ..., An)); +++}; +++``` +++ +++See this [recipe](gmock_cook_book.md#UsingCheckPoints) for one application of +++it. +++ +++## Flags +++ +++| Flag | Description | +++| :----------------------------- | :---------------------------------------- | +++| `--gmock_catch_leaked_mocks=0` | Don't report leaked mock objects as failures. | +++| `--gmock_verbose=LEVEL` | Sets the default verbosity level (`info`, `warning`, or `error`) of Google Mock messages. | diff --cc googletest/docs/gmock_cook_book.md index 000000000,000000000,000000000..da10918c9 new file mode 100644 --- /dev/null +++ b/googletest/docs/gmock_cook_book.md @@@@ -1,0 -1,0 -1,0 +1,4344 @@@@ +++# gMock Cookbook +++ +++You can find recipes for using gMock here. If you haven't yet, please read +++[the dummy guide](gmock_for_dummies.md) first to make sure you understand the +++basics. +++ +++{: .callout .note} +++**Note:** gMock lives in the `testing` name space. For readability, it is +++recommended to write `using ::testing::Foo;` once in your file before using the +++name `Foo` defined by gMock. We omit such `using` statements in this section for +++brevity, but you should do it in your own code. +++ +++## Creating Mock Classes +++ +++Mock classes are defined as normal classes, using the `MOCK_METHOD` macro to +++generate mocked methods. The macro gets 3 or 4 parameters: +++ +++```cpp +++class MyMock { +++ public: +++ MOCK_METHOD(ReturnType, MethodName, (Args...)); +++ MOCK_METHOD(ReturnType, MethodName, (Args...), (Specs...)); +++}; +++``` +++ +++The first 3 parameters are simply the method declaration, split into 3 parts. +++The 4th parameter accepts a closed list of qualifiers, which affect the +++generated method: +++ +++* **`const`** - Makes the mocked method a `const` method. Required if +++ overriding a `const` method. +++* **`override`** - Marks the method with `override`. Recommended if overriding +++ a `virtual` method. +++* **`noexcept`** - Marks the method with `noexcept`. Required if overriding a +++ `noexcept` method. +++* **`Calltype(...)`** - Sets the call type for the method (e.g. to +++ `STDMETHODCALLTYPE`), useful in Windows. +++* **`ref(...)`** - Marks the method with the reference qualification +++ specified. Required if overriding a method that has reference +++ qualifications. Eg `ref(&)` or `ref(&&)`. +++ +++### Dealing with unprotected commas +++ +++Unprotected commas, i.e. commas which are not surrounded by parentheses, prevent +++`MOCK_METHOD` from parsing its arguments correctly: +++ +++{: .bad} +++```cpp +++class MockFoo { +++ public: +++ MOCK_METHOD(std::pair, GetPair, ()); // Won't compile! +++ MOCK_METHOD(bool, CheckMap, (std::map, bool)); // Won't compile! +++}; +++``` +++ +++Solution 1 - wrap with parentheses: +++ +++{: .good} +++```cpp +++class MockFoo { +++ public: +++ MOCK_METHOD((std::pair), GetPair, ()); +++ MOCK_METHOD(bool, CheckMap, ((std::map), bool)); +++}; +++``` +++ +++Note that wrapping a return or argument type with parentheses is, in general, +++invalid C++. `MOCK_METHOD` removes the parentheses. +++ +++Solution 2 - define an alias: +++ +++{: .good} +++```cpp +++class MockFoo { +++ public: +++ using BoolAndInt = std::pair; +++ MOCK_METHOD(BoolAndInt, GetPair, ()); +++ using MapIntDouble = std::map; +++ MOCK_METHOD(bool, CheckMap, (MapIntDouble, bool)); +++}; +++``` +++ +++### Mocking Private or Protected Methods +++ +++You must always put a mock method definition (`MOCK_METHOD`) in a `public:` +++section of the mock class, regardless of the method being mocked being `public`, +++`protected`, or `private` in the base class. This allows `ON_CALL` and +++`EXPECT_CALL` to reference the mock function from outside of the mock class. +++(Yes, C++ allows a subclass to change the access level of a virtual function in +++the base class.) Example: +++ +++```cpp +++class Foo { +++ public: +++ ... +++ virtual bool Transform(Gadget* g) = 0; +++ +++ protected: +++ virtual void Resume(); +++ +++ private: +++ virtual int GetTimeOut(); +++}; +++ +++class MockFoo : public Foo { +++ public: +++ ... +++ MOCK_METHOD(bool, Transform, (Gadget* g), (override)); +++ +++ // The following must be in the public section, even though the +++ // methods are protected or private in the base class. +++ MOCK_METHOD(void, Resume, (), (override)); +++ MOCK_METHOD(int, GetTimeOut, (), (override)); +++}; +++``` +++ +++### Mocking Overloaded Methods +++ +++You can mock overloaded functions as usual. No special attention is required: +++ +++```cpp +++class Foo { +++ ... +++ +++ // Must be virtual as we'll inherit from Foo. +++ virtual ~Foo(); +++ +++ // Overloaded on the types and/or numbers of arguments. +++ virtual int Add(Element x); +++ virtual int Add(int times, Element x); +++ +++ // Overloaded on the const-ness of this object. +++ virtual Bar& GetBar(); +++ virtual const Bar& GetBar() const; +++}; +++ +++class MockFoo : public Foo { +++ ... +++ MOCK_METHOD(int, Add, (Element x), (override)); +++ MOCK_METHOD(int, Add, (int times, Element x), (override)); +++ +++ MOCK_METHOD(Bar&, GetBar, (), (override)); +++ MOCK_METHOD(const Bar&, GetBar, (), (const, override)); +++}; +++``` +++ +++{: .callout .note} +++**Note:** if you don't mock all versions of the overloaded method, the compiler +++will give you a warning about some methods in the base class being hidden. To +++fix that, use `using` to bring them in scope: +++ +++```cpp +++class MockFoo : public Foo { +++ ... +++ using Foo::Add; +++ MOCK_METHOD(int, Add, (Element x), (override)); +++ // We don't want to mock int Add(int times, Element x); +++ ... +++}; +++``` +++ +++### Mocking Class Templates +++ +++You can mock class templates just like any class. +++ +++```cpp +++template +++class StackInterface { +++ ... +++ // Must be virtual as we'll inherit from StackInterface. +++ virtual ~StackInterface(); +++ +++ virtual int GetSize() const = 0; +++ virtual void Push(const Elem& x) = 0; +++}; +++ +++template +++class MockStack : public StackInterface { +++ ... +++ MOCK_METHOD(int, GetSize, (), (override)); +++ MOCK_METHOD(void, Push, (const Elem& x), (override)); +++}; +++``` +++ +++### Mocking Non-virtual Methods {#MockingNonVirtualMethods} +++ +++gMock can mock non-virtual functions to be used in Hi-perf dependency injection. +++ +++In this case, instead of sharing a common base class with the real class, your +++mock class will be *unrelated* to the real class, but contain methods with the +++same signatures. The syntax for mocking non-virtual methods is the *same* as +++mocking virtual methods (just don't add `override`): +++ +++```cpp +++// A simple packet stream class. None of its members is virtual. +++class ConcretePacketStream { +++ public: +++ void AppendPacket(Packet* new_packet); +++ const Packet* GetPacket(size_t packet_number) const; +++ size_t NumberOfPackets() const; +++ ... +++}; +++ +++// A mock packet stream class. It inherits from no other, but defines +++// GetPacket() and NumberOfPackets(). +++class MockPacketStream { +++ public: +++ MOCK_METHOD(const Packet*, GetPacket, (size_t packet_number), (const)); +++ MOCK_METHOD(size_t, NumberOfPackets, (), (const)); +++ ... +++}; +++``` +++ +++Note that the mock class doesn't define `AppendPacket()`, unlike the real class. +++That's fine as long as the test doesn't need to call it. +++ +++Next, you need a way to say that you want to use `ConcretePacketStream` in +++production code, and use `MockPacketStream` in tests. Since the functions are +++not virtual and the two classes are unrelated, you must specify your choice at +++*compile time* (as opposed to run time). +++ +++One way to do it is to templatize your code that needs to use a packet stream. +++More specifically, you will give your code a template type argument for the type +++of the packet stream. In production, you will instantiate your template with +++`ConcretePacketStream` as the type argument. In tests, you will instantiate the +++same template with `MockPacketStream`. For example, you may write: +++ +++```cpp +++template +++void CreateConnection(PacketStream* stream) { ... } +++ +++template +++class PacketReader { +++ public: +++ void ReadPackets(PacketStream* stream, size_t packet_num); +++}; +++``` +++ +++Then you can use `CreateConnection()` and +++`PacketReader` in production code, and use +++`CreateConnection()` and `PacketReader` in +++tests. +++ +++```cpp +++ MockPacketStream mock_stream; +++ EXPECT_CALL(mock_stream, ...)...; +++ .. set more expectations on mock_stream ... +++ PacketReader reader(&mock_stream); +++ ... exercise reader ... +++``` +++ +++### Mocking Free Functions +++ +++It is not possible to directly mock a free function (i.e. a C-style function or +++a static method). If you need to, you can rewrite your code to use an interface +++(abstract class). +++ +++Instead of calling a free function (say, `OpenFile`) directly, introduce an +++interface for it and have a concrete subclass that calls the free function: +++ +++```cpp +++class FileInterface { +++ public: +++ ... +++ virtual bool Open(const char* path, const char* mode) = 0; +++}; +++ +++class File : public FileInterface { +++ public: +++ ... +++ bool Open(const char* path, const char* mode) override { +++ return OpenFile(path, mode); +++ } +++}; +++``` +++ +++Your code should talk to `FileInterface` to open a file. Now it's easy to mock +++out the function. +++ +++This may seem like a lot of hassle, but in practice you often have multiple +++related functions that you can put in the same interface, so the per-function +++syntactic overhead will be much lower. +++ +++If you are concerned about the performance overhead incurred by virtual +++functions, and profiling confirms your concern, you can combine this with the +++recipe for [mocking non-virtual methods](#MockingNonVirtualMethods). +++ +++Alternatively, instead of introducing a new interface, you can rewrite your code +++to accept a std::function instead of the free function, and then use +++[MockFunction](#MockFunction) to mock the std::function. +++ +++### Old-Style `MOCK_METHODn` Macros +++ +++Before the generic `MOCK_METHOD` macro +++[was introduced in 2018](https://github.com/google/googletest/commit/c5f08bf91944ce1b19bcf414fa1760e69d20afc2), +++mocks where created using a family of macros collectively called `MOCK_METHODn`. +++These macros are still supported, though migration to the new `MOCK_METHOD` is +++recommended. +++ +++The macros in the `MOCK_METHODn` family differ from `MOCK_METHOD`: +++ +++* The general structure is `MOCK_METHODn(MethodName, ReturnType(Args))`, +++ instead of `MOCK_METHOD(ReturnType, MethodName, (Args))`. +++* The number `n` must equal the number of arguments. +++* When mocking a const method, one must use `MOCK_CONST_METHODn`. +++* When mocking a class template, the macro name must be suffixed with `_T`. +++* In order to specify the call type, the macro name must be suffixed with +++ `_WITH_CALLTYPE`, and the call type is the first macro argument. +++ +++Old macros and their new equivalents: +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
Simple
OldMOCK_METHOD1(Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int))
Const Method
OldMOCK_CONST_METHOD1(Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (const))
Method in a Class Template
OldMOCK_METHOD1_T(Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int))
Const Method in a Class Template
OldMOCK_CONST_METHOD1_T(Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (const))
Method with Call Type
OldMOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))
Const Method with Call Type
OldMOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))
Method with Call Type in a Class Template
OldMOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))
Const Method with Call Type in a Class Template
OldMOCK_CONST_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))
NewMOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))
+++ +++### The Nice, the Strict, and the Naggy {#NiceStrictNaggy} +++ +++If a mock method has no `EXPECT_CALL` spec but is called, we say that it's an +++"uninteresting call", and the default action (which can be specified using +++`ON_CALL()`) of the method will be taken. Currently, an uninteresting call will +++also by default cause gMock to print a warning. +++ +++However, sometimes you may want to ignore these uninteresting calls, and +++sometimes you may want to treat them as errors. gMock lets you make the decision +++on a per-mock-object basis. +++ +++Suppose your test uses a mock class `MockFoo`: +++ +++```cpp +++TEST(...) { +++ MockFoo mock_foo; +++ EXPECT_CALL(mock_foo, DoThis()); +++ ... code that uses mock_foo ... +++} +++``` +++ +++If a method of `mock_foo` other than `DoThis()` is called, you will get a +++warning. However, if you rewrite your test to use `NiceMock` instead, +++you can suppress the warning: +++ +++```cpp +++using ::testing::NiceMock; +++ +++TEST(...) { +++ NiceMock mock_foo; +++ EXPECT_CALL(mock_foo, DoThis()); +++ ... code that uses mock_foo ... +++} +++``` +++ +++`NiceMock` is a subclass of `MockFoo`, so it can be used wherever +++`MockFoo` is accepted. +++ +++It also works if `MockFoo`'s constructor takes some arguments, as +++`NiceMock` "inherits" `MockFoo`'s constructors: +++ +++```cpp +++using ::testing::NiceMock; +++ +++TEST(...) { +++ NiceMock mock_foo(5, "hi"); // Calls MockFoo(5, "hi"). +++ EXPECT_CALL(mock_foo, DoThis()); +++ ... code that uses mock_foo ... +++} +++``` +++ +++The usage of `StrictMock` is similar, except that it makes all uninteresting +++calls failures: +++ +++```cpp +++using ::testing::StrictMock; +++ +++TEST(...) { +++ StrictMock mock_foo; +++ EXPECT_CALL(mock_foo, DoThis()); +++ ... code that uses mock_foo ... +++ +++ // The test will fail if a method of mock_foo other than DoThis() +++ // is called. +++} +++``` +++ +++{: .callout .note} +++NOTE: `NiceMock` and `StrictMock` only affects *uninteresting* calls (calls of +++*methods* with no expectations); they do not affect *unexpected* calls (calls of +++methods with expectations, but they don't match). See +++[Understanding Uninteresting vs Unexpected Calls](#uninteresting-vs-unexpected). +++ +++There are some caveats though (sadly they are side effects of C++'s +++limitations): +++ +++1. `NiceMock` and `StrictMock` only work for mock methods +++ defined using the `MOCK_METHOD` macro **directly** in the `MockFoo` class. +++ If a mock method is defined in a **base class** of `MockFoo`, the "nice" or +++ "strict" modifier may not affect it, depending on the compiler. In +++ particular, nesting `NiceMock` and `StrictMock` (e.g. +++ `NiceMock >`) is **not** supported. +++2. `NiceMock` and `StrictMock` may not work correctly if the +++ destructor of `MockFoo` is not virtual. We would like to fix this, but it +++ requires cleaning up existing tests. +++ +++Finally, you should be **very cautious** about when to use naggy or strict +++mocks, as they tend to make tests more brittle and harder to maintain. When you +++refactor your code without changing its externally visible behavior, ideally you +++shouldn't need to update any tests. If your code interacts with a naggy mock, +++however, you may start to get spammed with warnings as the result of your +++change. Worse, if your code interacts with a strict mock, your tests may start +++to fail and you'll be forced to fix them. Our general recommendation is to use +++nice mocks (not yet the default) most of the time, use naggy mocks (the current +++default) when developing or debugging tests, and use strict mocks only as the +++last resort. +++ +++### Simplifying the Interface without Breaking Existing Code {#SimplerInterfaces} +++ +++Sometimes a method has a long list of arguments that is mostly uninteresting. +++For example: +++ +++```cpp +++class LogSink { +++ public: +++ ... +++ virtual void send(LogSeverity severity, const char* full_filename, +++ const char* base_filename, int line, +++ const struct tm* tm_time, +++ const char* message, size_t message_len) = 0; +++}; +++``` +++ +++This method's argument list is lengthy and hard to work with (the `message` +++argument is not even 0-terminated). If we mock it as is, using the mock will be +++awkward. If, however, we try to simplify this interface, we'll need to fix all +++clients depending on it, which is often infeasible. +++ +++The trick is to redispatch the method in the mock class: +++ +++```cpp +++class ScopedMockLog : public LogSink { +++ public: +++ ... +++ void send(LogSeverity severity, const char* full_filename, +++ const char* base_filename, int line, const tm* tm_time, +++ const char* message, size_t message_len) override { +++ // We are only interested in the log severity, full file name, and +++ // log message. +++ Log(severity, full_filename, std::string(message, message_len)); +++ } +++ +++ // Implements the mock method: +++ // +++ // void Log(LogSeverity severity, +++ // const string& file_path, +++ // const string& message); +++ MOCK_METHOD(void, Log, +++ (LogSeverity severity, const string& file_path, +++ const string& message)); +++}; +++``` +++ +++By defining a new mock method with a trimmed argument list, we make the mock +++class more user-friendly. +++ +++This technique may also be applied to make overloaded methods more amenable to +++mocking. For example, when overloads have been used to implement default +++arguments: +++ +++```cpp +++class MockTurtleFactory : public TurtleFactory { +++ public: +++ Turtle* MakeTurtle(int length, int weight) override { ... } +++ Turtle* MakeTurtle(int length, int weight, int speed) override { ... } +++ +++ // the above methods delegate to this one: +++ MOCK_METHOD(Turtle*, DoMakeTurtle, ()); +++}; +++``` +++ +++This allows tests that don't care which overload was invoked to avoid specifying +++argument matchers: +++ +++```cpp +++ON_CALL(factory, DoMakeTurtle) +++ .WillByDefault(Return(MakeMockTurtle())); +++``` +++ +++### Alternative to Mocking Concrete Classes +++ +++Often you may find yourself using classes that don't implement interfaces. In +++order to test your code that uses such a class (let's call it `Concrete`), you +++may be tempted to make the methods of `Concrete` virtual and then mock it. +++ +++Try not to do that. +++ +++Making a non-virtual function virtual is a big decision. It creates an extension +++point where subclasses can tweak your class' behavior. This weakens your control +++on the class because now it's harder to maintain the class invariants. You +++should make a function virtual only when there is a valid reason for a subclass +++to override it. +++ +++Mocking concrete classes directly is problematic as it creates a tight coupling +++between the class and the tests - any small change in the class may invalidate +++your tests and make test maintenance a pain. +++ +++To avoid such problems, many programmers have been practicing "coding to +++interfaces": instead of talking to the `Concrete` class, your code would define +++an interface and talk to it. Then you implement that interface as an adaptor on +++top of `Concrete`. In tests, you can easily mock that interface to observe how +++your code is doing. +++ +++This technique incurs some overhead: +++ +++* You pay the cost of virtual function calls (usually not a problem). +++* There is more abstraction for the programmers to learn. +++ +++However, it can also bring significant benefits in addition to better +++testability: +++ +++* `Concrete`'s API may not fit your problem domain very well, as you may not +++ be the only client it tries to serve. By designing your own interface, you +++ have a chance to tailor it to your need - you may add higher-level +++ functionalities, rename stuff, etc instead of just trimming the class. This +++ allows you to write your code (user of the interface) in a more natural way, +++ which means it will be more readable, more maintainable, and you'll be more +++ productive. +++* If `Concrete`'s implementation ever has to change, you don't have to rewrite +++ everywhere it is used. Instead, you can absorb the change in your +++ implementation of the interface, and your other code and tests will be +++ insulated from this change. +++ +++Some people worry that if everyone is practicing this technique, they will end +++up writing lots of redundant code. This concern is totally understandable. +++However, there are two reasons why it may not be the case: +++ +++* Different projects may need to use `Concrete` in different ways, so the best +++ interfaces for them will be different. Therefore, each of them will have its +++ own domain-specific interface on top of `Concrete`, and they will not be the +++ same code. +++* If enough projects want to use the same interface, they can always share it, +++ just like they have been sharing `Concrete`. You can check in the interface +++ and the adaptor somewhere near `Concrete` (perhaps in a `contrib` +++ sub-directory) and let many projects use it. +++ +++You need to weigh the pros and cons carefully for your particular problem, but +++I'd like to assure you that the Java community has been practicing this for a +++long time and it's a proven effective technique applicable in a wide variety of +++situations. :-) +++ +++### Delegating Calls to a Fake {#DelegatingToFake} +++ +++Some times you have a non-trivial fake implementation of an interface. For +++example: +++ +++```cpp +++class Foo { +++ public: +++ virtual ~Foo() {} +++ virtual char DoThis(int n) = 0; +++ virtual void DoThat(const char* s, int* p) = 0; +++}; +++ +++class FakeFoo : public Foo { +++ public: +++ char DoThis(int n) override { +++ return (n > 0) ? '+' : +++ (n < 0) ? '-' : '0'; +++ } +++ +++ void DoThat(const char* s, int* p) override { +++ *p = strlen(s); +++ } +++}; +++``` +++ +++Now you want to mock this interface such that you can set expectations on it. +++However, you also want to use `FakeFoo` for the default behavior, as duplicating +++it in the mock object is, well, a lot of work. +++ +++When you define the mock class using gMock, you can have it delegate its default +++action to a fake class you already have, using this pattern: +++ +++```cpp +++class MockFoo : public Foo { +++ public: +++ // Normal mock method definitions using gMock. +++ MOCK_METHOD(char, DoThis, (int n), (override)); +++ MOCK_METHOD(void, DoThat, (const char* s, int* p), (override)); +++ +++ // Delegates the default actions of the methods to a FakeFoo object. +++ // This must be called *before* the custom ON_CALL() statements. +++ void DelegateToFake() { +++ ON_CALL(*this, DoThis).WillByDefault([this](int n) { +++ return fake_.DoThis(n); +++ }); +++ ON_CALL(*this, DoThat).WillByDefault([this](const char* s, int* p) { +++ fake_.DoThat(s, p); +++ }); +++ } +++ +++ private: +++ FakeFoo fake_; // Keeps an instance of the fake in the mock. +++}; +++``` +++ +++With that, you can use `MockFoo` in your tests as usual. Just remember that if +++you don't explicitly set an action in an `ON_CALL()` or `EXPECT_CALL()`, the +++fake will be called upon to do it.: +++ +++```cpp +++using ::testing::_; +++ +++TEST(AbcTest, Xyz) { +++ MockFoo foo; +++ +++ foo.DelegateToFake(); // Enables the fake for delegation. +++ +++ // Put your ON_CALL(foo, ...)s here, if any. +++ +++ // No action specified, meaning to use the default action. +++ EXPECT_CALL(foo, DoThis(5)); +++ EXPECT_CALL(foo, DoThat(_, _)); +++ +++ int n = 0; +++ EXPECT_EQ(foo.DoThis(5), '+'); // FakeFoo::DoThis() is invoked. +++ foo.DoThat("Hi", &n); // FakeFoo::DoThat() is invoked. +++ EXPECT_EQ(n, 2); +++} +++``` +++ +++**Some tips:** +++ +++* If you want, you can still override the default action by providing your own +++ `ON_CALL()` or using `.WillOnce()` / `.WillRepeatedly()` in `EXPECT_CALL()`. +++* In `DelegateToFake()`, you only need to delegate the methods whose fake +++ implementation you intend to use. +++ +++* The general technique discussed here works for overloaded methods, but +++ you'll need to tell the compiler which version you mean. To disambiguate a +++ mock function (the one you specify inside the parentheses of `ON_CALL()`), +++ use [this technique](#SelectOverload); to disambiguate a fake function (the +++ one you place inside `Invoke()`), use a `static_cast` to specify the +++ function's type. For instance, if class `Foo` has methods `char DoThis(int +++ n)` and `bool DoThis(double x) const`, and you want to invoke the latter, +++ you need to write `Invoke(&fake_, static_cast(&FakeFoo::DoThis))` instead of `Invoke(&fake_, &FakeFoo::DoThis)` +++ (The strange-looking thing inside the angled brackets of `static_cast` is +++ the type of a function pointer to the second `DoThis()` method.). +++ +++* Having to mix a mock and a fake is often a sign of something gone wrong. +++ Perhaps you haven't got used to the interaction-based way of testing yet. Or +++ perhaps your interface is taking on too many roles and should be split up. +++ Therefore, **don't abuse this**. We would only recommend to do it as an +++ intermediate step when you are refactoring your code. +++ +++Regarding the tip on mixing a mock and a fake, here's an example on why it may +++be a bad sign: Suppose you have a class `System` for low-level system +++operations. In particular, it does file and I/O operations. And suppose you want +++to test how your code uses `System` to do I/O, and you just want the file +++operations to work normally. If you mock out the entire `System` class, you'll +++have to provide a fake implementation for the file operation part, which +++suggests that `System` is taking on too many roles. +++ +++Instead, you can define a `FileOps` interface and an `IOOps` interface and split +++`System`'s functionalities into the two. Then you can mock `IOOps` without +++mocking `FileOps`. +++ +++### Delegating Calls to a Real Object +++ +++When using testing doubles (mocks, fakes, stubs, and etc), sometimes their +++behaviors will differ from those of the real objects. This difference could be +++either intentional (as in simulating an error such that you can test the error +++handling code) or unintentional. If your mocks have different behaviors than the +++real objects by mistake, you could end up with code that passes the tests but +++fails in production. +++ +++You can use the *delegating-to-real* technique to ensure that your mock has the +++same behavior as the real object while retaining the ability to validate calls. +++This technique is very similar to the [delegating-to-fake](#DelegatingToFake) +++technique, the difference being that we use a real object instead of a fake. +++Here's an example: +++ +++```cpp +++using ::testing::AtLeast; +++ +++class MockFoo : public Foo { +++ public: +++ MockFoo() { +++ // By default, all calls are delegated to the real object. +++ ON_CALL(*this, DoThis).WillByDefault([this](int n) { +++ return real_.DoThis(n); +++ }); +++ ON_CALL(*this, DoThat).WillByDefault([this](const char* s, int* p) { +++ real_.DoThat(s, p); +++ }); +++ ... +++ } +++ MOCK_METHOD(char, DoThis, ...); +++ MOCK_METHOD(void, DoThat, ...); +++ ... +++ private: +++ Foo real_; +++}; +++ +++... +++ MockFoo mock; +++ EXPECT_CALL(mock, DoThis()) +++ .Times(3); +++ EXPECT_CALL(mock, DoThat("Hi")) +++ .Times(AtLeast(1)); +++ ... use mock in test ... +++``` +++ +++With this, gMock will verify that your code made the right calls (with the right +++arguments, in the right order, called the right number of times, etc), and a +++real object will answer the calls (so the behavior will be the same as in +++production). This gives you the best of both worlds. +++ +++### Delegating Calls to a Parent Class +++ +++Ideally, you should code to interfaces, whose methods are all pure virtual. In +++reality, sometimes you do need to mock a virtual method that is not pure (i.e, +++it already has an implementation). For example: +++ +++```cpp +++class Foo { +++ public: +++ virtual ~Foo(); +++ +++ virtual void Pure(int n) = 0; +++ virtual int Concrete(const char* str) { ... } +++}; +++ +++class MockFoo : public Foo { +++ public: +++ // Mocking a pure method. +++ MOCK_METHOD(void, Pure, (int n), (override)); +++ // Mocking a concrete method. Foo::Concrete() is shadowed. +++ MOCK_METHOD(int, Concrete, (const char* str), (override)); +++}; +++``` +++ +++Sometimes you may want to call `Foo::Concrete()` instead of +++`MockFoo::Concrete()`. Perhaps you want to do it as part of a stub action, or +++perhaps your test doesn't need to mock `Concrete()` at all (but it would be +++oh-so painful to have to define a new mock class whenever you don't need to mock +++one of its methods). +++ +++You can call `Foo::Concrete()` inside an action by: +++ +++```cpp +++... +++ EXPECT_CALL(foo, Concrete).WillOnce([&foo](const char* str) { +++ return foo.Foo::Concrete(str); +++ }); +++``` +++ +++or tell the mock object that you don't want to mock `Concrete()`: +++ +++```cpp +++... +++ ON_CALL(foo, Concrete).WillByDefault([&foo](const char* str) { +++ return foo.Foo::Concrete(str); +++ }); +++``` +++ +++(Why don't we just write `{ return foo.Concrete(str); }`? If you do that, +++`MockFoo::Concrete()` will be called (and cause an infinite recursion) since +++`Foo::Concrete()` is virtual. That's just how C++ works.) +++ +++## Using Matchers +++ +++### Matching Argument Values Exactly +++ +++You can specify exactly which arguments a mock method is expecting: +++ +++```cpp +++using ::testing::Return; +++... +++ EXPECT_CALL(foo, DoThis(5)) +++ .WillOnce(Return('a')); +++ EXPECT_CALL(foo, DoThat("Hello", bar)); +++``` +++ +++### Using Simple Matchers +++ +++You can use matchers to match arguments that have a certain property: +++ +++```cpp +++using ::testing::NotNull; +++using ::testing::Return; +++... +++ EXPECT_CALL(foo, DoThis(Ge(5))) // The argument must be >= 5. +++ .WillOnce(Return('a')); +++ EXPECT_CALL(foo, DoThat("Hello", NotNull())); +++ // The second argument must not be NULL. +++``` +++ +++A frequently used matcher is `_`, which matches anything: +++ +++```cpp +++ EXPECT_CALL(foo, DoThat(_, NotNull())); +++``` +++ +++### Combining Matchers {#CombiningMatchers} +++ +++You can build complex matchers from existing ones using `AllOf()`, +++`AllOfArray()`, `AnyOf()`, `AnyOfArray()` and `Not()`: +++ +++```cpp +++using ::testing::AllOf; +++using ::testing::Gt; +++using ::testing::HasSubstr; +++using ::testing::Ne; +++using ::testing::Not; +++... +++ // The argument must be > 5 and != 10. +++ EXPECT_CALL(foo, DoThis(AllOf(Gt(5), +++ Ne(10)))); +++ +++ // The first argument must not contain sub-string "blah". +++ EXPECT_CALL(foo, DoThat(Not(HasSubstr("blah")), +++ NULL)); +++``` +++ +++Matchers are function objects, and parametrized matchers can be composed just +++like any other function. However because their types can be long and rarely +++provide meaningful information, it can be easier to express them with C++14 +++generic lambdas to avoid specifying types. For example, +++ +++```cpp +++using ::testing::Contains; +++using ::testing::Property; +++ +++inline constexpr auto HasFoo = [](const auto& f) { +++ return Property("foo", &MyClass::foo, Contains(f)); +++}; +++... +++ EXPECT_THAT(x, HasFoo("blah")); +++``` +++ +++### Casting Matchers {#SafeMatcherCast} +++ +++gMock matchers are statically typed, meaning that the compiler can catch your +++mistake if you use a matcher of the wrong type (for example, if you use `Eq(5)` +++to match a `string` argument). Good for you! +++ +++Sometimes, however, you know what you're doing and want the compiler to give you +++some slack. One example is that you have a matcher for `long` and the argument +++you want to match is `int`. While the two types aren't exactly the same, there +++is nothing really wrong with using a `Matcher` to match an `int` - after +++all, we can first convert the `int` argument to a `long` losslessly before +++giving it to the matcher. +++ +++To support this need, gMock gives you the `SafeMatcherCast(m)` function. It +++casts a matcher `m` to type `Matcher`. To ensure safety, gMock checks that +++(let `U` be the type `m` accepts : +++ +++1. Type `T` can be *implicitly* cast to type `U`; +++2. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and +++ floating-point numbers), the conversion from `T` to `U` is not lossy (in +++ other words, any value representable by `T` can also be represented by `U`); +++ and +++3. When `U` is a reference, `T` must also be a reference (as the underlying +++ matcher may be interested in the address of the `U` value). +++ +++The code won't compile if any of these conditions isn't met. +++ +++Here's one example: +++ +++```cpp +++using ::testing::SafeMatcherCast; +++ +++// A base class and a child class. +++class Base { ... }; +++class Derived : public Base { ... }; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(void, DoThis, (Derived* derived), (override)); +++}; +++ +++... +++ MockFoo foo; +++ // m is a Matcher we got from somewhere. +++ EXPECT_CALL(foo, DoThis(SafeMatcherCast(m))); +++``` +++ +++If you find `SafeMatcherCast(m)` too limiting, you can use a similar function +++`MatcherCast(m)`. The difference is that `MatcherCast` works as long as you +++can `static_cast` type `T` to type `U`. +++ +++`MatcherCast` essentially lets you bypass C++'s type system (`static_cast` isn't +++always safe as it could throw away information, for example), so be careful not +++to misuse/abuse it. +++ +++### Selecting Between Overloaded Functions {#SelectOverload} +++ +++If you expect an overloaded function to be called, the compiler may need some +++help on which overloaded version it is. +++ +++To disambiguate functions overloaded on the const-ness of this object, use the +++`Const()` argument wrapper. +++ +++```cpp +++using ::testing::ReturnRef; +++ +++class MockFoo : public Foo { +++ ... +++ MOCK_METHOD(Bar&, GetBar, (), (override)); +++ MOCK_METHOD(const Bar&, GetBar, (), (const, override)); +++}; +++ +++... +++ MockFoo foo; +++ Bar bar1, bar2; +++ EXPECT_CALL(foo, GetBar()) // The non-const GetBar(). +++ .WillOnce(ReturnRef(bar1)); +++ EXPECT_CALL(Const(foo), GetBar()) // The const GetBar(). +++ .WillOnce(ReturnRef(bar2)); +++``` +++ +++(`Const()` is defined by gMock and returns a `const` reference to its argument.) +++ +++To disambiguate overloaded functions with the same number of arguments but +++different argument types, you may need to specify the exact type of a matcher, +++either by wrapping your matcher in `Matcher()`, or using a matcher whose +++type is fixed (`TypedEq`, `An()`, etc): +++ +++```cpp +++using ::testing::An; +++using ::testing::Matcher; +++using ::testing::TypedEq; +++ +++class MockPrinter : public Printer { +++ public: +++ MOCK_METHOD(void, Print, (int n), (override)); +++ MOCK_METHOD(void, Print, (char c), (override)); +++}; +++ +++TEST(PrinterTest, Print) { +++ MockPrinter printer; +++ +++ EXPECT_CALL(printer, Print(An())); // void Print(int); +++ EXPECT_CALL(printer, Print(Matcher(Lt(5)))); // void Print(int); +++ EXPECT_CALL(printer, Print(TypedEq('a'))); // void Print(char); +++ +++ printer.Print(3); +++ printer.Print(6); +++ printer.Print('a'); +++} +++``` +++ +++### Performing Different Actions Based on the Arguments +++ +++When a mock method is called, the *last* matching expectation that's still +++active will be selected (think "newer overrides older"). So, you can make a +++method do different things depending on its argument values like this: +++ +++```cpp +++using ::testing::_; +++using ::testing::Lt; +++using ::testing::Return; +++... +++ // The default case. +++ EXPECT_CALL(foo, DoThis(_)) +++ .WillRepeatedly(Return('b')); +++ // The more specific case. +++ EXPECT_CALL(foo, DoThis(Lt(5))) +++ .WillRepeatedly(Return('a')); +++``` +++ +++Now, if `foo.DoThis()` is called with a value less than 5, `'a'` will be +++returned; otherwise `'b'` will be returned. +++ +++### Matching Multiple Arguments as a Whole +++ +++Sometimes it's not enough to match the arguments individually. For example, we +++may want to say that the first argument must be less than the second argument. +++The `With()` clause allows us to match all arguments of a mock function as a +++whole. For example, +++ +++```cpp +++using ::testing::_; +++using ::testing::Ne; +++using ::testing::Lt; +++... +++ EXPECT_CALL(foo, InRange(Ne(0), _)) +++ .With(Lt()); +++``` +++ +++says that the first argument of `InRange()` must not be 0, and must be less than +++the second argument. +++ +++The expression inside `With()` must be a matcher of type `Matcher>`, where `A1`, ..., `An` are the types of the function arguments. +++ +++You can also write `AllArgs(m)` instead of `m` inside `.With()`. The two forms +++are equivalent, but `.With(AllArgs(Lt()))` is more readable than `.With(Lt())`. +++ +++You can use `Args(m)` to match the `n` selected arguments (as a +++tuple) against `m`. For example, +++ +++```cpp +++using ::testing::_; +++using ::testing::AllOf; +++using ::testing::Args; +++using ::testing::Lt; +++... +++ EXPECT_CALL(foo, Blah) +++ .With(AllOf(Args<0, 1>(Lt()), Args<1, 2>(Lt()))); +++``` +++ +++says that `Blah` will be called with arguments `x`, `y`, and `z` where `x < y < +++z`. Note that in this example, it wasn't necessary to specify the positional +++matchers. +++ +++As a convenience and example, gMock provides some matchers for 2-tuples, +++including the `Lt()` matcher above. See +++[Multi-argument Matchers](reference/matchers.md#MultiArgMatchers) for the +++complete list. +++ +++Note that if you want to pass the arguments to a predicate of your own (e.g. +++`.With(Args<0, 1>(Truly(&MyPredicate)))`), that predicate MUST be written to +++take a `std::tuple` as its argument; gMock will pass the `n` selected arguments +++as *one* single tuple to the predicate. +++ +++### Using Matchers as Predicates +++ +++Have you noticed that a matcher is just a fancy predicate that also knows how to +++describe itself? Many existing algorithms take predicates as arguments (e.g. +++those defined in STL's `` header), and it would be a shame if gMock +++matchers were not allowed to participate. +++ +++Luckily, you can use a matcher where a unary predicate functor is expected by +++wrapping it inside the `Matches()` function. For example, +++ +++```cpp +++#include +++#include +++ +++using ::testing::Matches; +++using ::testing::Ge; +++ +++vector v; +++... +++// How many elements in v are >= 10? +++const int count = count_if(v.begin(), v.end(), Matches(Ge(10))); +++``` +++ +++Since you can build complex matchers from simpler ones easily using gMock, this +++gives you a way to conveniently construct composite predicates (doing the same +++using STL's `` header is just painful). For example, here's a +++predicate that's satisfied by any number that is >= 0, <= 100, and != 50: +++ +++```cpp +++using ::testing::AllOf; +++using ::testing::Ge; +++using ::testing::Le; +++using ::testing::Matches; +++using ::testing::Ne; +++... +++Matches(AllOf(Ge(0), Le(100), Ne(50))) +++``` +++ +++### Using Matchers in googletest Assertions +++ +++See [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) in the Assertions +++Reference. +++ +++### Using Predicates as Matchers +++ +++gMock provides a set of built-in matchers for matching arguments with expected +++values—see the [Matchers Reference](reference/matchers.md) for more information. +++In case you find the built-in set lacking, you can use an arbitrary unary +++predicate function or functor as a matcher - as long as the predicate accepts a +++value of the type you want. You do this by wrapping the predicate inside the +++`Truly()` function, for example: +++ +++```cpp +++using ::testing::Truly; +++ +++int IsEven(int n) { return (n % 2) == 0 ? 1 : 0; } +++... +++ // Bar() must be called with an even number. +++ EXPECT_CALL(foo, Bar(Truly(IsEven))); +++``` +++ +++Note that the predicate function / functor doesn't have to return `bool`. It +++works as long as the return value can be used as the condition in the statement +++`if (condition) ...`. +++ +++### Matching Arguments that Are Not Copyable +++ +++When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, gMock saves away a copy of +++`bar`. When `Foo()` is called later, gMock compares the argument to `Foo()` with +++the saved copy of `bar`. This way, you don't need to worry about `bar` being +++modified or destroyed after the `EXPECT_CALL()` is executed. The same is true +++when you use matchers like `Eq(bar)`, `Le(bar)`, and so on. +++ +++But what if `bar` cannot be copied (i.e. has no copy constructor)? You could +++define your own matcher function or callback and use it with `Truly()`, as the +++previous couple of recipes have shown. Or, you may be able to get away from it +++if you can guarantee that `bar` won't be changed after the `EXPECT_CALL()` is +++executed. Just tell gMock that it should save a reference to `bar`, instead of a +++copy of it. Here's how: +++ +++```cpp +++using ::testing::Eq; +++using ::testing::Lt; +++... +++ // Expects that Foo()'s argument == bar. +++ EXPECT_CALL(mock_obj, Foo(Eq(std::ref(bar)))); +++ +++ // Expects that Foo()'s argument < bar. +++ EXPECT_CALL(mock_obj, Foo(Lt(std::ref(bar)))); +++``` +++ +++Remember: if you do this, don't change `bar` after the `EXPECT_CALL()`, or the +++result is undefined. +++ +++### Validating a Member of an Object +++ +++Often a mock function takes a reference to object as an argument. When matching +++the argument, you may not want to compare the entire object against a fixed +++object, as that may be over-specification. Instead, you may need to validate a +++certain member variable or the result of a certain getter method of the object. +++You can do this with `Field()` and `Property()`. More specifically, +++ +++```cpp +++Field(&Foo::bar, m) +++``` +++ +++is a matcher that matches a `Foo` object whose `bar` member variable satisfies +++matcher `m`. +++ +++```cpp +++Property(&Foo::baz, m) +++``` +++ +++is a matcher that matches a `Foo` object whose `baz()` method returns a value +++that satisfies matcher `m`. +++ +++For example: +++ +++| Expression | Description | +++| :--------------------------- | :--------------------------------------- | +++| `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. | +++| `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. | +++ +++Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no argument +++and be declared as `const`. Don't use `Property()` against member functions that +++you do not own, because taking addresses of functions is fragile and generally +++not part of the contract of the function. +++ +++`Field()` and `Property()` can also match plain pointers to objects. For +++instance, +++ +++```cpp +++using ::testing::Field; +++using ::testing::Ge; +++... +++Field(&Foo::number, Ge(3)) +++``` +++ +++matches a plain pointer `p` where `p->number >= 3`. If `p` is `NULL`, the match +++will always fail regardless of the inner matcher. +++ +++What if you want to validate more than one members at the same time? Remember +++that there are [`AllOf()` and `AllOfArray()`](#CombiningMatchers). +++ +++Finally `Field()` and `Property()` provide overloads that take the field or +++property names as the first argument to include it in the error message. This +++can be useful when creating combined matchers. +++ +++```cpp +++using ::testing::AllOf; +++using ::testing::Field; +++using ::testing::Matcher; +++using ::testing::SafeMatcherCast; +++ +++Matcher IsFoo(const Foo& foo) { +++ return AllOf(Field("some_field", &Foo::some_field, foo.some_field), +++ Field("other_field", &Foo::other_field, foo.other_field), +++ Field("last_field", &Foo::last_field, foo.last_field)); +++} +++``` +++ +++### Validating the Value Pointed to by a Pointer Argument +++ +++C++ functions often take pointers as arguments. You can use matchers like +++`IsNull()`, `NotNull()`, and other comparison matchers to match a pointer, but +++what if you want to make sure the value *pointed to* by the pointer, instead of +++the pointer itself, has a certain property? Well, you can use the `Pointee(m)` +++matcher. +++ +++`Pointee(m)` matches a pointer if and only if `m` matches the value the pointer +++points to. For example: +++ +++```cpp +++using ::testing::Ge; +++using ::testing::Pointee; +++... +++ EXPECT_CALL(foo, Bar(Pointee(Ge(3)))); +++``` +++ +++expects `foo.Bar()` to be called with a pointer that points to a value greater +++than or equal to 3. +++ +++One nice thing about `Pointee()` is that it treats a `NULL` pointer as a match +++failure, so you can write `Pointee(m)` instead of +++ +++```cpp +++using ::testing::AllOf; +++using ::testing::NotNull; +++using ::testing::Pointee; +++... +++ AllOf(NotNull(), Pointee(m)) +++``` +++ +++without worrying that a `NULL` pointer will crash your test. +++ +++Also, did we tell you that `Pointee()` works with both raw pointers **and** +++smart pointers (`std::unique_ptr`, `std::shared_ptr`, etc)? +++ +++What if you have a pointer to pointer? You guessed it - you can use nested +++`Pointee()` to probe deeper inside the value. For example, +++`Pointee(Pointee(Lt(3)))` matches a pointer that points to a pointer that points +++to a number less than 3 (what a mouthful...). +++ +++### Defining a Custom Matcher Class {#CustomMatcherClass} +++ +++Most matchers can be simply defined using [the MATCHER* macros](#NewMatchers), +++which are terse and flexible, and produce good error messages. However, these +++macros are not very explicit about the interfaces they create and are not always +++suitable, especially for matchers that will be widely reused. +++ +++For more advanced cases, you may need to define your own matcher class. A custom +++matcher allows you to test a specific invariant property of that object. Let's +++take a look at how to do so. +++ +++Imagine you have a mock function that takes an object of type `Foo`, which has +++an `int bar()` method and an `int baz()` method. You want to constrain that the +++argument's `bar()` value plus its `baz()` value is a given number. (This is an +++invariant.) Here's how we can write and use a matcher class to do so: +++ +++```cpp +++class BarPlusBazEqMatcher { +++ public: +++ using is_gtest_matcher = void; +++ +++ explicit BarPlusBazEqMatcher(int expected_sum) +++ : expected_sum_(expected_sum) {} +++ +++ bool MatchAndExplain(const Foo& foo, +++ std::ostream* /* listener */) const { +++ return (foo.bar() + foo.baz()) == expected_sum_; +++ } +++ +++ void DescribeTo(std::ostream* os) const { +++ *os << "bar() + baz() equals " << expected_sum_; +++ } +++ +++ void DescribeNegationTo(std::ostream* os) const { +++ *os << "bar() + baz() does not equal " << expected_sum_; +++ } +++ private: +++ const int expected_sum_; +++}; +++ +++::testing::Matcher BarPlusBazEq(int expected_sum) { +++ return BarPlusBazEqMatcher(expected_sum); +++} +++ +++... +++ Foo foo; +++ EXPECT_THAT(foo, BarPlusBazEq(5))...; +++``` +++ +++### Matching Containers +++ +++Sometimes an STL container (e.g. list, vector, map, ...) is passed to a mock +++function and you may want to validate it. Since most STL containers support the +++`==` operator, you can write `Eq(expected_container)` or simply +++`expected_container` to match a container exactly. +++ +++Sometimes, though, you may want to be more flexible (for example, the first +++element must be an exact match, but the second element can be any positive +++number, and so on). Also, containers used in tests often have a small number of +++elements, and having to define the expected container out-of-line is a bit of a +++hassle. +++ +++You can use the `ElementsAre()` or `UnorderedElementsAre()` matcher in such +++cases: +++ +++```cpp +++using ::testing::_; +++using ::testing::ElementsAre; +++using ::testing::Gt; +++... +++ MOCK_METHOD(void, Foo, (const vector& numbers), (override)); +++... +++ EXPECT_CALL(mock, Foo(ElementsAre(1, Gt(0), _, 5))); +++``` +++ +++The above matcher says that the container must have 4 elements, which must be 1, +++greater than 0, anything, and 5 respectively. +++ +++If you instead write: +++ +++```cpp +++using ::testing::_; +++using ::testing::Gt; +++using ::testing::UnorderedElementsAre; +++... +++ MOCK_METHOD(void, Foo, (const vector& numbers), (override)); +++... +++ EXPECT_CALL(mock, Foo(UnorderedElementsAre(1, Gt(0), _, 5))); +++``` +++ +++It means that the container must have 4 elements, which (under some permutation) +++must be 1, greater than 0, anything, and 5 respectively. +++ +++As an alternative you can place the arguments in a C-style array and use +++`ElementsAreArray()` or `UnorderedElementsAreArray()` instead: +++ +++```cpp +++using ::testing::ElementsAreArray; +++... +++ // ElementsAreArray accepts an array of element values. +++ const int expected_vector1[] = {1, 5, 2, 4, ...}; +++ EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector1))); +++ +++ // Or, an array of element matchers. +++ Matcher expected_vector2[] = {1, Gt(2), _, 3, ...}; +++ EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector2))); +++``` +++ +++In case the array needs to be dynamically created (and therefore the array size +++cannot be inferred by the compiler), you can give `ElementsAreArray()` an +++additional argument to specify the array size: +++ +++```cpp +++using ::testing::ElementsAreArray; +++... +++ int* const expected_vector3 = new int[count]; +++ ... fill expected_vector3 with values ... +++ EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector3, count))); +++``` +++ +++Use `Pair` when comparing maps or other associative containers. +++ +++{% raw %} +++ +++```cpp +++using ::testing::UnorderedElementsAre; +++using ::testing::Pair; +++... +++ absl::flat_hash_map m = {{"a", 1}, {"b", 2}, {"c", 3}}; +++ EXPECT_THAT(m, UnorderedElementsAre( +++ Pair("a", 1), Pair("b", 2), Pair("c", 3))); +++``` +++ +++{% endraw %} +++ +++**Tips:** +++ +++* `ElementsAre*()` can be used to match *any* container that implements the +++ STL iterator pattern (i.e. it has a `const_iterator` type and supports +++ `begin()/end()`), not just the ones defined in STL. It will even work with +++ container types yet to be written - as long as they follows the above +++ pattern. +++* You can use nested `ElementsAre*()` to match nested (multi-dimensional) +++ containers. +++* If the container is passed by pointer instead of by reference, just write +++ `Pointee(ElementsAre*(...))`. +++* The order of elements *matters* for `ElementsAre*()`. If you are using it +++ with containers whose element order are undefined (such as a +++ `std::unordered_map`) you should use `UnorderedElementsAre`. +++ +++### Sharing Matchers +++ +++Under the hood, a gMock matcher object consists of a pointer to a ref-counted +++implementation object. Copying matchers is allowed and very efficient, as only +++the pointer is copied. When the last matcher that references the implementation +++object dies, the implementation object will be deleted. +++ +++Therefore, if you have some complex matcher that you want to use again and +++again, there is no need to build it every time. Just assign it to a matcher +++variable and use that variable repeatedly! For example, +++ +++```cpp +++using ::testing::AllOf; +++using ::testing::Gt; +++using ::testing::Le; +++using ::testing::Matcher; +++... +++ Matcher in_range = AllOf(Gt(5), Le(10)); +++ ... use in_range as a matcher in multiple EXPECT_CALLs ... +++``` +++ +++### Matchers must have no side-effects {#PureMatchers} +++ +++{: .callout .warning} +++WARNING: gMock does not guarantee when or how many times a matcher will be +++invoked. Therefore, all matchers must be *purely functional*: they cannot have +++any side effects, and the match result must not depend on anything other than +++the matcher's parameters and the value being matched. +++ +++This requirement must be satisfied no matter how a matcher is defined (e.g., if +++it is one of the standard matchers, or a custom matcher). In particular, a +++matcher can never call a mock function, as that will affect the state of the +++mock object and gMock. +++ +++## Setting Expectations +++ +++### Knowing When to Expect {#UseOnCall} +++ +++**`ON_CALL`** is likely the *single most under-utilized construct* in gMock. +++ +++There are basically two constructs for defining the behavior of a mock object: +++`ON_CALL` and `EXPECT_CALL`. The difference? `ON_CALL` defines what happens when +++a mock method is called, but doesn't imply any expectation on the method +++being called. `EXPECT_CALL` not only defines the behavior, but also sets an +++expectation that the method will be called with the given arguments, for the +++given number of times (and *in the given order* when you specify the order +++too). +++ +++Since `EXPECT_CALL` does more, isn't it better than `ON_CALL`? Not really. Every +++`EXPECT_CALL` adds a constraint on the behavior of the code under test. Having +++more constraints than necessary is *baaad* - even worse than not having enough +++constraints. +++ +++This may be counter-intuitive. How could tests that verify more be worse than +++tests that verify less? Isn't verification the whole point of tests? +++ +++The answer lies in *what* a test should verify. **A good test verifies the +++contract of the code.** If a test over-specifies, it doesn't leave enough +++freedom to the implementation. As a result, changing the implementation without +++breaking the contract (e.g. refactoring and optimization), which should be +++perfectly fine to do, can break such tests. Then you have to spend time fixing +++them, only to see them broken again the next time the implementation is changed. +++ +++Keep in mind that one doesn't have to verify more than one property in one test. +++In fact, **it's a good style to verify only one thing in one test.** If you do +++that, a bug will likely break only one or two tests instead of dozens (which +++case would you rather debug?). If you are also in the habit of giving tests +++descriptive names that tell what they verify, you can often easily guess what's +++wrong just from the test log itself. +++ +++So use `ON_CALL` by default, and only use `EXPECT_CALL` when you actually intend +++to verify that the call is made. For example, you may have a bunch of `ON_CALL`s +++in your test fixture to set the common mock behavior shared by all tests in the +++same group, and write (scarcely) different `EXPECT_CALL`s in different `TEST_F`s +++to verify different aspects of the code's behavior. Compared with the style +++where each `TEST` has many `EXPECT_CALL`s, this leads to tests that are more +++resilient to implementational changes (and thus less likely to require +++maintenance) and makes the intent of the tests more obvious (so they are easier +++to maintain when you do need to maintain them). +++ +++If you are bothered by the "Uninteresting mock function call" message printed +++when a mock method without an `EXPECT_CALL` is called, you may use a `NiceMock` +++instead to suppress all such messages for the mock object, or suppress the +++message for specific methods by adding `EXPECT_CALL(...).Times(AnyNumber())`. DO +++NOT suppress it by blindly adding an `EXPECT_CALL(...)`, or you'll have a test +++that's a pain to maintain. +++ +++### Ignoring Uninteresting Calls +++ +++If you are not interested in how a mock method is called, just don't say +++anything about it. In this case, if the method is ever called, gMock will +++perform its default action to allow the test program to continue. If you are not +++happy with the default action taken by gMock, you can override it using +++`DefaultValue::Set()` (described [here](#DefaultValue)) or `ON_CALL()`. +++ +++Please note that once you expressed interest in a particular mock method (via +++`EXPECT_CALL()`), all invocations to it must match some expectation. If this +++function is called but the arguments don't match any `EXPECT_CALL()` statement, +++it will be an error. +++ +++### Disallowing Unexpected Calls +++ +++If a mock method shouldn't be called at all, explicitly say so: +++ +++```cpp +++using ::testing::_; +++... +++ EXPECT_CALL(foo, Bar(_)) +++ .Times(0); +++``` +++ +++If some calls to the method are allowed, but the rest are not, just list all the +++expected calls: +++ +++```cpp +++using ::testing::AnyNumber; +++using ::testing::Gt; +++... +++ EXPECT_CALL(foo, Bar(5)); +++ EXPECT_CALL(foo, Bar(Gt(10))) +++ .Times(AnyNumber()); +++``` +++ +++A call to `foo.Bar()` that doesn't match any of the `EXPECT_CALL()` statements +++will be an error. +++ +++### Understanding Uninteresting vs Unexpected Calls {#uninteresting-vs-unexpected} +++ +++*Uninteresting* calls and *unexpected* calls are different concepts in gMock. +++*Very* different. +++ +++A call `x.Y(...)` is **uninteresting** if there's *not even a single* +++`EXPECT_CALL(x, Y(...))` set. In other words, the test isn't interested in the +++`x.Y()` method at all, as evident in that the test doesn't care to say anything +++about it. +++ +++A call `x.Y(...)` is **unexpected** if there are *some* `EXPECT_CALL(x, +++Y(...))`s set, but none of them matches the call. Put another way, the test is +++interested in the `x.Y()` method (therefore it explicitly sets some +++`EXPECT_CALL` to verify how it's called); however, the verification fails as the +++test doesn't expect this particular call to happen. +++ +++**An unexpected call is always an error,** as the code under test doesn't behave +++the way the test expects it to behave. +++ +++**By default, an uninteresting call is not an error,** as it violates no +++constraint specified by the test. (gMock's philosophy is that saying nothing +++means there is no constraint.) However, it leads to a warning, as it *might* +++indicate a problem (e.g. the test author might have forgotten to specify a +++constraint). +++ +++In gMock, `NiceMock` and `StrictMock` can be used to make a mock class "nice" or +++"strict". How does this affect uninteresting calls and unexpected calls? +++ +++A **nice mock** suppresses uninteresting call *warnings*. It is less chatty than +++the default mock, but otherwise is the same. If a test fails with a default +++mock, it will also fail using a nice mock instead. And vice versa. Don't expect +++making a mock nice to change the test's result. +++ +++A **strict mock** turns uninteresting call warnings into errors. So making a +++mock strict may change the test's result. +++ +++Let's look at an example: +++ +++```cpp +++TEST(...) { +++ NiceMock mock_registry; +++ EXPECT_CALL(mock_registry, GetDomainOwner("google.com")) +++ .WillRepeatedly(Return("Larry Page")); +++ +++ // Use mock_registry in code under test. +++ ... &mock_registry ... +++} +++``` +++ +++The sole `EXPECT_CALL` here says that all calls to `GetDomainOwner()` must have +++`"google.com"` as the argument. If `GetDomainOwner("yahoo.com")` is called, it +++will be an unexpected call, and thus an error. *Having a nice mock doesn't +++change the severity of an unexpected call.* +++ +++So how do we tell gMock that `GetDomainOwner()` can be called with some other +++arguments as well? The standard technique is to add a "catch all" `EXPECT_CALL`: +++ +++```cpp +++ EXPECT_CALL(mock_registry, GetDomainOwner(_)) +++ .Times(AnyNumber()); // catches all other calls to this method. +++ EXPECT_CALL(mock_registry, GetDomainOwner("google.com")) +++ .WillRepeatedly(Return("Larry Page")); +++``` +++ +++Remember that `_` is the wildcard matcher that matches anything. With this, if +++`GetDomainOwner("google.com")` is called, it will do what the second +++`EXPECT_CALL` says; if it is called with a different argument, it will do what +++the first `EXPECT_CALL` says. +++ +++Note that the order of the two `EXPECT_CALL`s is important, as a newer +++`EXPECT_CALL` takes precedence over an older one. +++ +++For more on uninteresting calls, nice mocks, and strict mocks, read +++["The Nice, the Strict, and the Naggy"](#NiceStrictNaggy). +++ +++### Ignoring Uninteresting Arguments {#ParameterlessExpectations} +++ +++If your test doesn't care about the parameters (it only cares about the number +++or order of calls), you can often simply omit the parameter list: +++ +++```cpp +++ // Expect foo.Bar( ... ) twice with any arguments. +++ EXPECT_CALL(foo, Bar).Times(2); +++ +++ // Delegate to the given method whenever the factory is invoked. +++ ON_CALL(foo_factory, MakeFoo) +++ .WillByDefault(&BuildFooForTest); +++``` +++ +++This functionality is only available when a method is not overloaded; to prevent +++unexpected behavior it is a compilation error to try to set an expectation on a +++method where the specific overload is ambiguous. You can work around this by +++supplying a [simpler mock interface](#SimplerInterfaces) than the mocked class +++provides. +++ +++This pattern is also useful when the arguments are interesting, but match logic +++is substantially complex. You can leave the argument list unspecified and use +++SaveArg actions to [save the values for later verification](#SaveArgVerify). If +++you do that, you can easily differentiate calling the method the wrong number of +++times from calling it with the wrong arguments. +++ +++### Expecting Ordered Calls {#OrderedCalls} +++ +++Although an `EXPECT_CALL()` statement defined later takes precedence when gMock +++tries to match a function call with an expectation, by default calls don't have +++to happen in the order `EXPECT_CALL()` statements are written. For example, if +++the arguments match the matchers in the second `EXPECT_CALL()`, but not those in +++the first and third, then the second expectation will be used. +++ +++If you would rather have all calls occur in the order of the expectations, put +++the `EXPECT_CALL()` statements in a block where you define a variable of type +++`InSequence`: +++ +++```cpp +++using ::testing::_; +++using ::testing::InSequence; +++ +++ { +++ InSequence s; +++ +++ EXPECT_CALL(foo, DoThis(5)); +++ EXPECT_CALL(bar, DoThat(_)) +++ .Times(2); +++ EXPECT_CALL(foo, DoThis(6)); +++ } +++``` +++ +++In this example, we expect a call to `foo.DoThis(5)`, followed by two calls to +++`bar.DoThat()` where the argument can be anything, which are in turn followed by +++a call to `foo.DoThis(6)`. If a call occurred out-of-order, gMock will report an +++error. +++ +++### Expecting Partially Ordered Calls {#PartialOrder} +++ +++Sometimes requiring everything to occur in a predetermined order can lead to +++brittle tests. For example, we may care about `A` occurring before both `B` and +++`C`, but aren't interested in the relative order of `B` and `C`. In this case, +++the test should reflect our real intent, instead of being overly constraining. +++ +++gMock allows you to impose an arbitrary DAG (directed acyclic graph) on the +++calls. One way to express the DAG is to use the +++[`After` clause](reference/mocking.md#EXPECT_CALL.After) of `EXPECT_CALL`. +++ +++Another way is via the `InSequence()` clause (not the same as the `InSequence` +++class), which we borrowed from jMock 2. It's less flexible than `After()`, but +++more convenient when you have long chains of sequential calls, as it doesn't +++require you to come up with different names for the expectations in the chains. +++Here's how it works: +++ +++If we view `EXPECT_CALL()` statements as nodes in a graph, and add an edge from +++node A to node B wherever A must occur before B, we can get a DAG. We use the +++term "sequence" to mean a directed path in this DAG. Now, if we decompose the +++DAG into sequences, we just need to know which sequences each `EXPECT_CALL()` +++belongs to in order to be able to reconstruct the original DAG. +++ +++So, to specify the partial order on the expectations we need to do two things: +++first to define some `Sequence` objects, and then for each `EXPECT_CALL()` say +++which `Sequence` objects it is part of. +++ +++Expectations in the same sequence must occur in the order they are written. For +++example, +++ +++```cpp +++using ::testing::Sequence; +++... +++ Sequence s1, s2; +++ +++ EXPECT_CALL(foo, A()) +++ .InSequence(s1, s2); +++ EXPECT_CALL(bar, B()) +++ .InSequence(s1); +++ EXPECT_CALL(bar, C()) +++ .InSequence(s2); +++ EXPECT_CALL(foo, D()) +++ .InSequence(s2); +++``` +++ +++specifies the following DAG (where `s1` is `A -> B`, and `s2` is `A -> C -> D`): +++ +++```text +++ +---> B +++ | +++ A ---| +++ | +++ +---> C ---> D +++``` +++ +++This means that A must occur before B and C, and C must occur before D. There's +++no restriction about the order other than these. +++ +++### Controlling When an Expectation Retires +++ +++When a mock method is called, gMock only considers expectations that are still +++active. An expectation is active when created, and becomes inactive (aka +++*retires*) when a call that has to occur later has occurred. For example, in +++ +++```cpp +++using ::testing::_; +++using ::testing::Sequence; +++... +++ Sequence s1, s2; +++ +++ EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #1 +++ .Times(AnyNumber()) +++ .InSequence(s1, s2); +++ EXPECT_CALL(log, Log(WARNING, _, "Data set is empty.")) // #2 +++ .InSequence(s1); +++ EXPECT_CALL(log, Log(WARNING, _, "User not found.")) // #3 +++ .InSequence(s2); +++``` +++ +++as soon as either #2 or #3 is matched, #1 will retire. If a warning `"File too +++large."` is logged after this, it will be an error. +++ +++Note that an expectation doesn't retire automatically when it's saturated. For +++example, +++ +++```cpp +++using ::testing::_; +++... +++ EXPECT_CALL(log, Log(WARNING, _, _)); // #1 +++ EXPECT_CALL(log, Log(WARNING, _, "File too large.")); // #2 +++``` +++ +++says that there will be exactly one warning with the message `"File too +++large."`. If the second warning contains this message too, #2 will match again +++and result in an upper-bound-violated error. +++ +++If this is not what you want, you can ask an expectation to retire as soon as it +++becomes saturated: +++ +++```cpp +++using ::testing::_; +++... +++ EXPECT_CALL(log, Log(WARNING, _, _)); // #1 +++ EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #2 +++ .RetiresOnSaturation(); +++``` +++ +++Here #2 can be used only once, so if you have two warnings with the message +++`"File too large."`, the first will match #2 and the second will match #1 - +++there will be no error. +++ +++## Using Actions +++ +++### Returning References from Mock Methods +++ +++If a mock function's return type is a reference, you need to use `ReturnRef()` +++instead of `Return()` to return a result: +++ +++```cpp +++using ::testing::ReturnRef; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(Bar&, GetBar, (), (override)); +++}; +++... +++ MockFoo foo; +++ Bar bar; +++ EXPECT_CALL(foo, GetBar()) +++ .WillOnce(ReturnRef(bar)); +++... +++``` +++ +++### Returning Live Values from Mock Methods +++ +++The `Return(x)` action saves a copy of `x` when the action is created, and +++always returns the same value whenever it's executed. Sometimes you may want to +++instead return the *live* value of `x` (i.e. its value at the time when the +++action is *executed*.). Use either `ReturnRef()` or `ReturnPointee()` for this +++purpose. +++ +++If the mock function's return type is a reference, you can do it using +++`ReturnRef(x)`, as shown in the previous recipe ("Returning References from Mock +++Methods"). However, gMock doesn't let you use `ReturnRef()` in a mock function +++whose return type is not a reference, as doing that usually indicates a user +++error. So, what shall you do? +++ +++Though you may be tempted, DO NOT use `std::ref()`: +++ +++```cpp +++using ::testing::Return; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(int, GetValue, (), (override)); +++}; +++... +++ int x = 0; +++ MockFoo foo; +++ EXPECT_CALL(foo, GetValue()) +++ .WillRepeatedly(Return(std::ref(x))); // Wrong! +++ x = 42; +++ EXPECT_EQ(foo.GetValue(), 42); +++``` +++ +++Unfortunately, it doesn't work here. The above code will fail with error: +++ +++```text +++Value of: foo.GetValue() +++ Actual: 0 +++Expected: 42 +++``` +++ +++The reason is that `Return(*value*)` converts `value` to the actual return type +++of the mock function at the time when the action is *created*, not when it is +++*executed*. (This behavior was chosen for the action to be safe when `value` is +++a proxy object that references some temporary objects.) As a result, +++`std::ref(x)` is converted to an `int` value (instead of a `const int&`) when +++the expectation is set, and `Return(std::ref(x))` will always return 0. +++ +++`ReturnPointee(pointer)` was provided to solve this problem specifically. It +++returns the value pointed to by `pointer` at the time the action is *executed*: +++ +++```cpp +++using ::testing::ReturnPointee; +++... +++ int x = 0; +++ MockFoo foo; +++ EXPECT_CALL(foo, GetValue()) +++ .WillRepeatedly(ReturnPointee(&x)); // Note the & here. +++ x = 42; +++ EXPECT_EQ(foo.GetValue(), 42); // This will succeed now. +++``` +++ +++### Combining Actions +++ +++Want to do more than one thing when a function is called? That's fine. `DoAll()` +++allows you to do a sequence of actions every time. Only the return value of the +++last action in the sequence will be used. +++ +++```cpp +++using ::testing::_; +++using ::testing::DoAll; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(bool, Bar, (int n), (override)); +++}; +++... +++ EXPECT_CALL(foo, Bar(_)) +++ .WillOnce(DoAll(action_1, +++ action_2, +++ ... +++ action_n)); +++``` +++ +++### Verifying Complex Arguments {#SaveArgVerify} +++ +++If you want to verify that a method is called with a particular argument but the +++match criteria is complex, it can be difficult to distinguish between +++cardinality failures (calling the method the wrong number of times) and argument +++match failures. Similarly, if you are matching multiple parameters, it may not +++be easy to distinguishing which argument failed to match. For example: +++ +++```cpp +++ // Not ideal: this could fail because of a problem with arg1 or arg2, or maybe +++ // just the method wasn't called. +++ EXPECT_CALL(foo, SendValues(_, ElementsAre(1, 4, 4, 7), EqualsProto( ... ))); +++``` +++ +++You can instead save the arguments and test them individually: +++ +++```cpp +++ EXPECT_CALL(foo, SendValues) +++ .WillOnce(DoAll(SaveArg<1>(&actual_array), SaveArg<2>(&actual_proto))); +++ ... run the test +++ EXPECT_THAT(actual_array, ElementsAre(1, 4, 4, 7)); +++ EXPECT_THAT(actual_proto, EqualsProto( ... )); +++``` +++ +++### Mocking Side Effects {#MockingSideEffects} +++ +++Sometimes a method exhibits its effect not via returning a value but via side +++effects. For example, it may change some global state or modify an output +++argument. To mock side effects, in general you can define your own action by +++implementing `::testing::ActionInterface`. +++ +++If all you need to do is to change an output argument, the built-in +++`SetArgPointee()` action is convenient: +++ +++```cpp +++using ::testing::_; +++using ::testing::SetArgPointee; +++ +++class MockMutator : public Mutator { +++ public: +++ MOCK_METHOD(void, Mutate, (bool mutate, int* value), (override)); +++ ... +++} +++... +++ MockMutator mutator; +++ EXPECT_CALL(mutator, Mutate(true, _)) +++ .WillOnce(SetArgPointee<1>(5)); +++``` +++ +++In this example, when `mutator.Mutate()` is called, we will assign 5 to the +++`int` variable pointed to by argument #1 (0-based). +++ +++`SetArgPointee()` conveniently makes an internal copy of the value you pass to +++it, removing the need to keep the value in scope and alive. The implication +++however is that the value must have a copy constructor and assignment operator. +++ +++If the mock method also needs to return a value as well, you can chain +++`SetArgPointee()` with `Return()` using `DoAll()`, remembering to put the +++`Return()` statement last: +++ +++```cpp +++using ::testing::_; +++using ::testing::DoAll; +++using ::testing::Return; +++using ::testing::SetArgPointee; +++ +++class MockMutator : public Mutator { +++ public: +++ ... +++ MOCK_METHOD(bool, MutateInt, (int* value), (override)); +++} +++... +++ MockMutator mutator; +++ EXPECT_CALL(mutator, MutateInt(_)) +++ .WillOnce(DoAll(SetArgPointee<0>(5), +++ Return(true))); +++``` +++ +++Note, however, that if you use the `ReturnOKWith()` method, it will override the +++values provided by `SetArgPointee()` in the response parameters of your function +++call. +++ +++If the output argument is an array, use the `SetArrayArgument(first, last)` +++action instead. It copies the elements in source range `[first, last)` to the +++array pointed to by the `N`-th (0-based) argument: +++ +++```cpp +++using ::testing::NotNull; +++using ::testing::SetArrayArgument; +++ +++class MockArrayMutator : public ArrayMutator { +++ public: +++ MOCK_METHOD(void, Mutate, (int* values, int num_values), (override)); +++ ... +++} +++... +++ MockArrayMutator mutator; +++ int values[5] = {1, 2, 3, 4, 5}; +++ EXPECT_CALL(mutator, Mutate(NotNull(), 5)) +++ .WillOnce(SetArrayArgument<0>(values, values + 5)); +++``` +++ +++This also works when the argument is an output iterator: +++ +++```cpp +++using ::testing::_; +++using ::testing::SetArrayArgument; +++ +++class MockRolodex : public Rolodex { +++ public: +++ MOCK_METHOD(void, GetNames, (std::back_insert_iterator>), +++ (override)); +++ ... +++} +++... +++ MockRolodex rolodex; +++ vector names = {"George", "John", "Thomas"}; +++ EXPECT_CALL(rolodex, GetNames(_)) +++ .WillOnce(SetArrayArgument<0>(names.begin(), names.end())); +++``` +++ +++### Changing a Mock Object's Behavior Based on the State +++ +++If you expect a call to change the behavior of a mock object, you can use +++`::testing::InSequence` to specify different behaviors before and after the +++call: +++ +++```cpp +++using ::testing::InSequence; +++using ::testing::Return; +++ +++... +++ { +++ InSequence seq; +++ EXPECT_CALL(my_mock, IsDirty()) +++ .WillRepeatedly(Return(true)); +++ EXPECT_CALL(my_mock, Flush()); +++ EXPECT_CALL(my_mock, IsDirty()) +++ .WillRepeatedly(Return(false)); +++ } +++ my_mock.FlushIfDirty(); +++``` +++ +++This makes `my_mock.IsDirty()` return `true` before `my_mock.Flush()` is called +++and return `false` afterwards. +++ +++If the behavior change is more complex, you can store the effects in a variable +++and make a mock method get its return value from that variable: +++ +++```cpp +++using ::testing::_; +++using ::testing::SaveArg; +++using ::testing::Return; +++ +++ACTION_P(ReturnPointee, p) { return *p; } +++... +++ int previous_value = 0; +++ EXPECT_CALL(my_mock, GetPrevValue) +++ .WillRepeatedly(ReturnPointee(&previous_value)); +++ EXPECT_CALL(my_mock, UpdateValue) +++ .WillRepeatedly(SaveArg<0>(&previous_value)); +++ my_mock.DoSomethingToUpdateValue(); +++``` +++ +++Here `my_mock.GetPrevValue()` will always return the argument of the last +++`UpdateValue()` call. +++ +++### Setting the Default Value for a Return Type {#DefaultValue} +++ +++If a mock method's return type is a built-in C++ type or pointer, by default it +++will return 0 when invoked. Also, in C++ 11 and above, a mock method whose +++return type has a default constructor will return a default-constructed value by +++default. You only need to specify an action if this default value doesn't work +++for you. +++ +++Sometimes, you may want to change this default value, or you may want to specify +++a default value for types gMock doesn't know about. You can do this using the +++`::testing::DefaultValue` class template: +++ +++```cpp +++using ::testing::DefaultValue; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(Bar, CalculateBar, (), (override)); +++}; +++ +++ +++... +++ Bar default_bar; +++ // Sets the default return value for type Bar. +++ DefaultValue::Set(default_bar); +++ +++ MockFoo foo; +++ +++ // We don't need to specify an action here, as the default +++ // return value works for us. +++ EXPECT_CALL(foo, CalculateBar()); +++ +++ foo.CalculateBar(); // This should return default_bar. +++ +++ // Unsets the default return value. +++ DefaultValue::Clear(); +++``` +++ +++Please note that changing the default value for a type can make your tests hard +++to understand. We recommend you to use this feature judiciously. For example, +++you may want to make sure the `Set()` and `Clear()` calls are right next to the +++code that uses your mock. +++ +++### Setting the Default Actions for a Mock Method +++ +++You've learned how to change the default value of a given type. However, this +++may be too coarse for your purpose: perhaps you have two mock methods with the +++same return type and you want them to have different behaviors. The `ON_CALL()` +++macro allows you to customize your mock's behavior at the method level: +++ +++```cpp +++using ::testing::_; +++using ::testing::AnyNumber; +++using ::testing::Gt; +++using ::testing::Return; +++... +++ ON_CALL(foo, Sign(_)) +++ .WillByDefault(Return(-1)); +++ ON_CALL(foo, Sign(0)) +++ .WillByDefault(Return(0)); +++ ON_CALL(foo, Sign(Gt(0))) +++ .WillByDefault(Return(1)); +++ +++ EXPECT_CALL(foo, Sign(_)) +++ .Times(AnyNumber()); +++ +++ foo.Sign(5); // This should return 1. +++ foo.Sign(-9); // This should return -1. +++ foo.Sign(0); // This should return 0. +++``` +++ +++As you may have guessed, when there are more than one `ON_CALL()` statements, +++the newer ones in the order take precedence over the older ones. In other words, +++the **last** one that matches the function arguments will be used. This matching +++order allows you to set up the common behavior in a mock object's constructor or +++the test fixture's set-up phase and specialize the mock's behavior later. +++ +++Note that both `ON_CALL` and `EXPECT_CALL` have the same "later statements take +++precedence" rule, but they don't interact. That is, `EXPECT_CALL`s have their +++own precedence order distinct from the `ON_CALL` precedence order. +++ +++### Using Functions/Methods/Functors/Lambdas as Actions {#FunctionsAsActions} +++ +++If the built-in actions don't suit you, you can use an existing callable +++(function, `std::function`, method, functor, lambda) as an action. +++ +++```cpp +++using ::testing::_; using ::testing::Invoke; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(int, Sum, (int x, int y), (override)); +++ MOCK_METHOD(bool, ComplexJob, (int x), (override)); +++}; +++ +++int CalculateSum(int x, int y) { return x + y; } +++int Sum3(int x, int y, int z) { return x + y + z; } +++ +++class Helper { +++ public: +++ bool ComplexJob(int x); +++}; +++ +++... +++ MockFoo foo; +++ Helper helper; +++ EXPECT_CALL(foo, Sum(_, _)) +++ .WillOnce(&CalculateSum) +++ .WillRepeatedly(Invoke(NewPermanentCallback(Sum3, 1))); +++ EXPECT_CALL(foo, ComplexJob(_)) +++ .WillOnce(Invoke(&helper, &Helper::ComplexJob)) +++ .WillOnce([] { return true; }) +++ .WillRepeatedly([](int x) { return x > 0; }); +++ +++ foo.Sum(5, 6); // Invokes CalculateSum(5, 6). +++ foo.Sum(2, 3); // Invokes Sum3(1, 2, 3). +++ foo.ComplexJob(10); // Invokes helper.ComplexJob(10). +++ foo.ComplexJob(-1); // Invokes the inline lambda. +++``` +++ +++The only requirement is that the type of the function, etc must be *compatible* +++with the signature of the mock function, meaning that the latter's arguments (if +++it takes any) can be implicitly converted to the corresponding arguments of the +++former, and the former's return type can be implicitly converted to that of the +++latter. So, you can invoke something whose type is *not* exactly the same as the +++mock function, as long as it's safe to do so - nice, huh? +++ +++Note that: +++ +++* The action takes ownership of the callback and will delete it when the +++ action itself is destructed. +++* If the type of a callback is derived from a base callback type `C`, you need +++ to implicitly cast it to `C` to resolve the overloading, e.g. +++ +++ ```cpp +++ using ::testing::Invoke; +++ ... +++ ResultCallback* is_ok = ...; +++ ... Invoke(is_ok) ...; // This works. +++ +++ BlockingClosure* done = new BlockingClosure; +++ ... Invoke(implicit_cast(done)) ...; // The cast is necessary. +++ ``` +++ +++### Using Functions with Extra Info as Actions +++ +++The function or functor you call using `Invoke()` must have the same number of +++arguments as the mock function you use it for. Sometimes you may have a function +++that takes more arguments, and you are willing to pass in the extra arguments +++yourself to fill the gap. You can do this in gMock using callbacks with +++pre-bound arguments. Here's an example: +++ +++```cpp +++using ::testing::Invoke; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(char, DoThis, (int n), (override)); +++}; +++ +++char SignOfSum(int x, int y) { +++ const int sum = x + y; +++ return (sum > 0) ? '+' : (sum < 0) ? '-' : '0'; +++} +++ +++TEST_F(FooTest, Test) { +++ MockFoo foo; +++ +++ EXPECT_CALL(foo, DoThis(2)) +++ .WillOnce(Invoke(NewPermanentCallback(SignOfSum, 5))); +++ EXPECT_EQ(foo.DoThis(2), '+'); // Invokes SignOfSum(5, 2). +++} +++``` +++ +++### Invoking a Function/Method/Functor/Lambda/Callback Without Arguments +++ +++`Invoke()` passes the mock function's arguments to the function, etc being +++invoked such that the callee has the full context of the call to work with. If +++the invoked function is not interested in some or all of the arguments, it can +++simply ignore them. +++ +++Yet, a common pattern is that a test author wants to invoke a function without +++the arguments of the mock function. She could do that using a wrapper function +++that throws away the arguments before invoking an underlining nullary function. +++Needless to say, this can be tedious and obscures the intent of the test. +++ +++There are two solutions to this problem. First, you can pass any callable of +++zero args as an action. Alternatively, use `InvokeWithoutArgs()`, which is like +++`Invoke()` except that it doesn't pass the mock function's arguments to the +++callee. Here's an example of each: +++ +++```cpp +++using ::testing::_; +++using ::testing::InvokeWithoutArgs; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(bool, ComplexJob, (int n), (override)); +++}; +++ +++bool Job1() { ... } +++bool Job2(int n, char c) { ... } +++ +++... +++ MockFoo foo; +++ EXPECT_CALL(foo, ComplexJob(_)) +++ .WillOnce([] { Job1(); }); +++ .WillOnce(InvokeWithoutArgs(NewPermanentCallback(Job2, 5, 'a'))); +++ +++ foo.ComplexJob(10); // Invokes Job1(). +++ foo.ComplexJob(20); // Invokes Job2(5, 'a'). +++``` +++ +++Note that: +++ +++* The action takes ownership of the callback and will delete it when the +++ action itself is destructed. +++* If the type of a callback is derived from a base callback type `C`, you need +++ to implicitly cast it to `C` to resolve the overloading, e.g. +++ +++ ```cpp +++ using ::testing::InvokeWithoutArgs; +++ ... +++ ResultCallback* is_ok = ...; +++ ... InvokeWithoutArgs(is_ok) ...; // This works. +++ +++ BlockingClosure* done = ...; +++ ... InvokeWithoutArgs(implicit_cast(done)) ...; +++ // The cast is necessary. +++ ``` +++ +++### Invoking an Argument of the Mock Function +++ +++Sometimes a mock function will receive a function pointer, a functor (in other +++words, a "callable") as an argument, e.g. +++ +++```cpp +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(bool, DoThis, (int n, (ResultCallback1* callback)), +++ (override)); +++}; +++``` +++ +++and you may want to invoke this callable argument: +++ +++```cpp +++using ::testing::_; +++... +++ MockFoo foo; +++ EXPECT_CALL(foo, DoThis(_, _)) +++ .WillOnce(...); +++ // Will execute callback->Run(5), where callback is the +++ // second argument DoThis() receives. +++``` +++ +++{: .callout .note} +++NOTE: The section below is legacy documentation from before C++ had lambdas: +++ +++Arghh, you need to refer to a mock function argument but C++ has no lambda +++(yet), so you have to define your own action. :-( Or do you really? +++ +++Well, gMock has an action to solve *exactly* this problem: +++ +++```cpp +++InvokeArgument(arg_1, arg_2, ..., arg_m) +++``` +++ +++will invoke the `N`-th (0-based) argument the mock function receives, with +++`arg_1`, `arg_2`, ..., and `arg_m`. No matter if the argument is a function +++pointer, a functor, or a callback. gMock handles them all. +++ +++With that, you could write: +++ +++```cpp +++using ::testing::_; +++using ::testing::InvokeArgument; +++... +++ EXPECT_CALL(foo, DoThis(_, _)) +++ .WillOnce(InvokeArgument<1>(5)); +++ // Will execute callback->Run(5), where callback is the +++ // second argument DoThis() receives. +++``` +++ +++What if the callable takes an argument by reference? No problem - just wrap it +++inside `std::ref()`: +++ +++```cpp +++ ... +++ MOCK_METHOD(bool, Bar, +++ ((ResultCallback2* callback)), +++ (override)); +++ ... +++ using ::testing::_; +++ using ::testing::InvokeArgument; +++ ... +++ MockFoo foo; +++ Helper helper; +++ ... +++ EXPECT_CALL(foo, Bar(_)) +++ .WillOnce(InvokeArgument<0>(5, std::ref(helper))); +++ // std::ref(helper) guarantees that a reference to helper, not a copy of +++ // it, will be passed to the callback. +++``` +++ +++What if the callable takes an argument by reference and we do **not** wrap the +++argument in `std::ref()`? Then `InvokeArgument()` will *make a copy* of the +++argument, and pass a *reference to the copy*, instead of a reference to the +++original value, to the callable. This is especially handy when the argument is a +++temporary value: +++ +++```cpp +++ ... +++ MOCK_METHOD(bool, DoThat, (bool (*f)(const double& x, const string& s)), +++ (override)); +++ ... +++ using ::testing::_; +++ using ::testing::InvokeArgument; +++ ... +++ MockFoo foo; +++ ... +++ EXPECT_CALL(foo, DoThat(_)) +++ .WillOnce(InvokeArgument<0>(5.0, string("Hi"))); +++ // Will execute (*f)(5.0, string("Hi")), where f is the function pointer +++ // DoThat() receives. Note that the values 5.0 and string("Hi") are +++ // temporary and dead once the EXPECT_CALL() statement finishes. Yet +++ // it's fine to perform this action later, since a copy of the values +++ // are kept inside the InvokeArgument action. +++``` +++ +++### Ignoring an Action's Result +++ +++Sometimes you have an action that returns *something*, but you need an action +++that returns `void` (perhaps you want to use it in a mock function that returns +++`void`, or perhaps it needs to be used in `DoAll()` and it's not the last in the +++list). `IgnoreResult()` lets you do that. For example: +++ +++```cpp +++using ::testing::_; +++using ::testing::DoAll; +++using ::testing::IgnoreResult; +++using ::testing::Return; +++ +++int Process(const MyData& data); +++string DoSomething(); +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(void, Abc, (const MyData& data), (override)); +++ MOCK_METHOD(bool, Xyz, (), (override)); +++}; +++ +++ ... +++ MockFoo foo; +++ EXPECT_CALL(foo, Abc(_)) +++ // .WillOnce(Invoke(Process)); +++ // The above line won't compile as Process() returns int but Abc() needs +++ // to return void. +++ .WillOnce(IgnoreResult(Process)); +++ EXPECT_CALL(foo, Xyz()) +++ .WillOnce(DoAll(IgnoreResult(DoSomething), +++ // Ignores the string DoSomething() returns. +++ Return(true))); +++``` +++ +++Note that you **cannot** use `IgnoreResult()` on an action that already returns +++`void`. Doing so will lead to ugly compiler errors. +++ +++### Selecting an Action's Arguments {#SelectingArgs} +++ +++Say you have a mock function `Foo()` that takes seven arguments, and you have a +++custom action that you want to invoke when `Foo()` is called. Trouble is, the +++custom action only wants three arguments: +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++... +++ MOCK_METHOD(bool, Foo, +++ (bool visible, const string& name, int x, int y, +++ (const map>), double& weight, double min_weight, +++ double max_wight)); +++... +++bool IsVisibleInQuadrant1(bool visible, int x, int y) { +++ return visible && x >= 0 && y >= 0; +++} +++... +++ EXPECT_CALL(mock, Foo) +++ .WillOnce(Invoke(IsVisibleInQuadrant1)); // Uh, won't compile. :-( +++``` +++ +++To please the compiler God, you need to define an "adaptor" that has the same +++signature as `Foo()` and calls the custom action with the right arguments: +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++... +++bool MyIsVisibleInQuadrant1(bool visible, const string& name, int x, int y, +++ const map, double>& weight, +++ double min_weight, double max_wight) { +++ return IsVisibleInQuadrant1(visible, x, y); +++} +++... +++ EXPECT_CALL(mock, Foo) +++ .WillOnce(Invoke(MyIsVisibleInQuadrant1)); // Now it works. +++``` +++ +++But isn't this awkward? +++ +++gMock provides a generic *action adaptor*, so you can spend your time minding +++more important business than writing your own adaptors. Here's the syntax: +++ +++```cpp +++WithArgs(action) +++``` +++ +++creates an action that passes the arguments of the mock function at the given +++indices (0-based) to the inner `action` and performs it. Using `WithArgs`, our +++original example can be written as: +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++using ::testing::WithArgs; +++... +++ EXPECT_CALL(mock, Foo) +++ .WillOnce(WithArgs<0, 2, 3>(Invoke(IsVisibleInQuadrant1))); // No need to define your own adaptor. +++``` +++ +++For better readability, gMock also gives you: +++ +++* `WithoutArgs(action)` when the inner `action` takes *no* argument, and +++* `WithArg(action)` (no `s` after `Arg`) when the inner `action` takes +++ *one* argument. +++ +++As you may have realized, `InvokeWithoutArgs(...)` is just syntactic sugar for +++`WithoutArgs(Invoke(...))`. +++ +++Here are more tips: +++ +++* The inner action used in `WithArgs` and friends does not have to be +++ `Invoke()` -- it can be anything. +++* You can repeat an argument in the argument list if necessary, e.g. +++ `WithArgs<2, 3, 3, 5>(...)`. +++* You can change the order of the arguments, e.g. `WithArgs<3, 2, 1>(...)`. +++* The types of the selected arguments do *not* have to match the signature of +++ the inner action exactly. It works as long as they can be implicitly +++ converted to the corresponding arguments of the inner action. For example, +++ if the 4-th argument of the mock function is an `int` and `my_action` takes +++ a `double`, `WithArg<4>(my_action)` will work. +++ +++### Ignoring Arguments in Action Functions +++ +++The [selecting-an-action's-arguments](#SelectingArgs) recipe showed us one way +++to make a mock function and an action with incompatible argument lists fit +++together. The downside is that wrapping the action in `WithArgs<...>()` can get +++tedious for people writing the tests. +++ +++If you are defining a function (or method, functor, lambda, callback) to be used +++with `Invoke*()`, and you are not interested in some of its arguments, an +++alternative to `WithArgs` is to declare the uninteresting arguments as `Unused`. +++This makes the definition less cluttered and less fragile in case the types of +++the uninteresting arguments change. It could also increase the chance the action +++function can be reused. For example, given +++ +++```cpp +++ public: +++ MOCK_METHOD(double, Foo, double(const string& label, double x, double y), +++ (override)); +++ MOCK_METHOD(double, Bar, (int index, double x, double y), (override)); +++``` +++ +++instead of +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++ +++double DistanceToOriginWithLabel(const string& label, double x, double y) { +++ return sqrt(x*x + y*y); +++} +++double DistanceToOriginWithIndex(int index, double x, double y) { +++ return sqrt(x*x + y*y); +++} +++... +++ EXPECT_CALL(mock, Foo("abc", _, _)) +++ .WillOnce(Invoke(DistanceToOriginWithLabel)); +++ EXPECT_CALL(mock, Bar(5, _, _)) +++ .WillOnce(Invoke(DistanceToOriginWithIndex)); +++``` +++ +++you could write +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++using ::testing::Unused; +++ +++double DistanceToOrigin(Unused, double x, double y) { +++ return sqrt(x*x + y*y); +++} +++... +++ EXPECT_CALL(mock, Foo("abc", _, _)) +++ .WillOnce(Invoke(DistanceToOrigin)); +++ EXPECT_CALL(mock, Bar(5, _, _)) +++ .WillOnce(Invoke(DistanceToOrigin)); +++``` +++ +++### Sharing Actions +++ +++Just like matchers, a gMock action object consists of a pointer to a ref-counted +++implementation object. Therefore copying actions is also allowed and very +++efficient. When the last action that references the implementation object dies, +++the implementation object will be deleted. +++ +++If you have some complex action that you want to use again and again, you may +++not have to build it from scratch every time. If the action doesn't have an +++internal state (i.e. if it always does the same thing no matter how many times +++it has been called), you can assign it to an action variable and use that +++variable repeatedly. For example: +++ +++```cpp +++using ::testing::Action; +++using ::testing::DoAll; +++using ::testing::Return; +++using ::testing::SetArgPointee; +++... +++ Action set_flag = DoAll(SetArgPointee<0>(5), +++ Return(true)); +++ ... use set_flag in .WillOnce() and .WillRepeatedly() ... +++``` +++ +++However, if the action has its own state, you may be surprised if you share the +++action object. Suppose you have an action factory `IncrementCounter(init)` which +++creates an action that increments and returns a counter whose initial value is +++`init`, using two actions created from the same expression and using a shared +++action will exhibit different behaviors. Example: +++ +++```cpp +++ EXPECT_CALL(foo, DoThis()) +++ .WillRepeatedly(IncrementCounter(0)); +++ EXPECT_CALL(foo, DoThat()) +++ .WillRepeatedly(IncrementCounter(0)); +++ foo.DoThis(); // Returns 1. +++ foo.DoThis(); // Returns 2. +++ foo.DoThat(); // Returns 1 - DoThat() uses a different +++ // counter than DoThis()'s. +++``` +++ +++versus +++ +++```cpp +++using ::testing::Action; +++... +++ Action increment = IncrementCounter(0); +++ EXPECT_CALL(foo, DoThis()) +++ .WillRepeatedly(increment); +++ EXPECT_CALL(foo, DoThat()) +++ .WillRepeatedly(increment); +++ foo.DoThis(); // Returns 1. +++ foo.DoThis(); // Returns 2. +++ foo.DoThat(); // Returns 3 - the counter is shared. +++``` +++ +++### Testing Asynchronous Behavior +++ +++One oft-encountered problem with gMock is that it can be hard to test +++asynchronous behavior. Suppose you had a `EventQueue` class that you wanted to +++test, and you created a separate `EventDispatcher` interface so that you could +++easily mock it out. However, the implementation of the class fired all the +++events on a background thread, which made test timings difficult. You could just +++insert `sleep()` statements and hope for the best, but that makes your test +++behavior nondeterministic. A better way is to use gMock actions and +++`Notification` objects to force your asynchronous test to behave synchronously. +++ +++```cpp +++class MockEventDispatcher : public EventDispatcher { +++ MOCK_METHOD(bool, DispatchEvent, (int32), (override)); +++}; +++ +++TEST(EventQueueTest, EnqueueEventTest) { +++ MockEventDispatcher mock_event_dispatcher; +++ EventQueue event_queue(&mock_event_dispatcher); +++ +++ const int32 kEventId = 321; +++ absl::Notification done; +++ EXPECT_CALL(mock_event_dispatcher, DispatchEvent(kEventId)) +++ .WillOnce([&done] { done.Notify(); }); +++ +++ event_queue.EnqueueEvent(kEventId); +++ done.WaitForNotification(); +++} +++``` +++ +++In the example above, we set our normal gMock expectations, but then add an +++additional action to notify the `Notification` object. Now we can just call +++`Notification::WaitForNotification()` in the main thread to wait for the +++asynchronous call to finish. After that, our test suite is complete and we can +++safely exit. +++ +++{: .callout .note} +++Note: this example has a downside: namely, if the expectation is not satisfied, +++our test will run forever. It will eventually time-out and fail, but it will +++take longer and be slightly harder to debug. To alleviate this problem, you can +++use `WaitForNotificationWithTimeout(ms)` instead of `WaitForNotification()`. +++ +++## Misc Recipes on Using gMock +++ +++### Mocking Methods That Use Move-Only Types +++ +++C++11 introduced *move-only types*. A move-only-typed value can be moved from +++one object to another, but cannot be copied. `std::unique_ptr` is probably +++the most commonly used move-only type. +++ +++Mocking a method that takes and/or returns move-only types presents some +++challenges, but nothing insurmountable. This recipe shows you how you can do it. +++Note that the support for move-only method arguments was only introduced to +++gMock in April 2017; in older code, you may find more complex +++[workarounds](#LegacyMoveOnly) for lack of this feature. +++ +++Let’s say we are working on a fictional project that lets one post and share +++snippets called “buzzes”. Your code uses these types: +++ +++```cpp +++enum class AccessLevel { kInternal, kPublic }; +++ +++class Buzz { +++ public: +++ explicit Buzz(AccessLevel access) { ... } +++ ... +++}; +++ +++class Buzzer { +++ public: +++ virtual ~Buzzer() {} +++ virtual std::unique_ptr MakeBuzz(StringPiece text) = 0; +++ virtual bool ShareBuzz(std::unique_ptr buzz, int64_t timestamp) = 0; +++ ... +++}; +++``` +++ +++A `Buzz` object represents a snippet being posted. A class that implements the +++`Buzzer` interface is capable of creating and sharing `Buzz`es. Methods in +++`Buzzer` may return a `unique_ptr` or take a `unique_ptr`. Now we +++need to mock `Buzzer` in our tests. +++ +++To mock a method that accepts or returns move-only types, you just use the +++familiar `MOCK_METHOD` syntax as usual: +++ +++```cpp +++class MockBuzzer : public Buzzer { +++ public: +++ MOCK_METHOD(std::unique_ptr, MakeBuzz, (StringPiece text), (override)); +++ MOCK_METHOD(bool, ShareBuzz, (std::unique_ptr buzz, int64_t timestamp), +++ (override)); +++}; +++``` +++ +++Now that we have the mock class defined, we can use it in tests. In the +++following code examples, we assume that we have defined a `MockBuzzer` object +++named `mock_buzzer_`: +++ +++```cpp +++ MockBuzzer mock_buzzer_; +++``` +++ +++First let’s see how we can set expectations on the `MakeBuzz()` method, which +++returns a `unique_ptr`. +++ +++As usual, if you set an expectation without an action (i.e. the `.WillOnce()` or +++`.WillRepeatedly()` clause), when that expectation fires, the default action for +++that method will be taken. Since `unique_ptr<>` has a default constructor that +++returns a null `unique_ptr`, that’s what you’ll get if you don’t specify an +++action: +++ +++```cpp +++using ::testing::IsNull; +++... +++ // Use the default action. +++ EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")); +++ +++ // Triggers the previous EXPECT_CALL. +++ EXPECT_THAT(mock_buzzer_.MakeBuzz("hello"), IsNull()); +++``` +++ +++If you are not happy with the default action, you can tweak it as usual; see +++[Setting Default Actions](#OnCall). +++ +++If you just need to return a move-only value, you can use it in combination with +++`WillOnce`. For example: +++ +++```cpp +++ EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")) +++ .WillOnce(Return(std::make_unique(AccessLevel::kInternal))); +++ EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("hello")); +++``` +++ +++Quiz time! What do you think will happen if a `Return` action is performed more +++than once (e.g. you write `... .WillRepeatedly(Return(std::move(...)));`)? Come +++think of it, after the first time the action runs, the source value will be +++consumed (since it’s a move-only value), so the next time around, there’s no +++value to move from -- you’ll get a run-time error that `Return(std::move(...))` +++can only be run once. +++ +++If you need your mock method to do more than just moving a pre-defined value, +++remember that you can always use a lambda or a callable object, which can do +++pretty much anything you want: +++ +++```cpp +++ EXPECT_CALL(mock_buzzer_, MakeBuzz("x")) +++ .WillRepeatedly([](StringPiece text) { +++ return std::make_unique(AccessLevel::kInternal); +++ }); +++ +++ EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x")); +++ EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x")); +++``` +++ +++Every time this `EXPECT_CALL` fires, a new `unique_ptr` will be created +++and returned. You cannot do this with `Return(std::make_unique<...>(...))`. +++ +++That covers returning move-only values; but how do we work with methods +++accepting move-only arguments? The answer is that they work normally, although +++some actions will not compile when any of method's arguments are move-only. You +++can always use `Return`, or a [lambda or functor](#FunctionsAsActions): +++ +++```cpp +++ using ::testing::Unused; +++ +++ EXPECT_CALL(mock_buzzer_, ShareBuzz(NotNull(), _)).WillOnce(Return(true)); +++ EXPECT_TRUE(mock_buzzer_.ShareBuzz(std::make_unique(AccessLevel::kInternal)), +++ 0); +++ +++ EXPECT_CALL(mock_buzzer_, ShareBuzz(_, _)).WillOnce( +++ [](std::unique_ptr buzz, Unused) { return buzz != nullptr; }); +++ EXPECT_FALSE(mock_buzzer_.ShareBuzz(nullptr, 0)); +++``` +++ +++Many built-in actions (`WithArgs`, `WithoutArgs`,`DeleteArg`, `SaveArg`, ...) +++could in principle support move-only arguments, but the support for this is not +++implemented yet. If this is blocking you, please file a bug. +++ +++A few actions (e.g. `DoAll`) copy their arguments internally, so they can never +++work with non-copyable objects; you'll have to use functors instead. +++ +++#### Legacy workarounds for move-only types {#LegacyMoveOnly} +++ +++Support for move-only function arguments was only introduced to gMock in April +++of 2017. In older code, you may encounter the following workaround for the lack +++of this feature (it is no longer necessary - we're including it just for +++reference): +++ +++```cpp +++class MockBuzzer : public Buzzer { +++ public: +++ MOCK_METHOD(bool, DoShareBuzz, (Buzz* buzz, Time timestamp)); +++ bool ShareBuzz(std::unique_ptr buzz, Time timestamp) override { +++ return DoShareBuzz(buzz.get(), timestamp); +++ } +++}; +++``` +++ +++The trick is to delegate the `ShareBuzz()` method to a mock method (let’s call +++it `DoShareBuzz()`) that does not take move-only parameters. Then, instead of +++setting expectations on `ShareBuzz()`, you set them on the `DoShareBuzz()` mock +++method: +++ +++```cpp +++ MockBuzzer mock_buzzer_; +++ EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _)); +++ +++ // When one calls ShareBuzz() on the MockBuzzer like this, the call is +++ // forwarded to DoShareBuzz(), which is mocked. Therefore this statement +++ // will trigger the above EXPECT_CALL. +++ mock_buzzer_.ShareBuzz(std::make_unique(AccessLevel::kInternal), 0); +++``` +++ +++### Making the Compilation Faster +++ +++Believe it or not, the *vast majority* of the time spent on compiling a mock +++class is in generating its constructor and destructor, as they perform +++non-trivial tasks (e.g. verification of the expectations). What's more, mock +++methods with different signatures have different types and thus their +++constructors/destructors need to be generated by the compiler separately. As a +++result, if you mock many different types of methods, compiling your mock class +++can get really slow. +++ +++If you are experiencing slow compilation, you can move the definition of your +++mock class' constructor and destructor out of the class body and into a `.cc` +++file. This way, even if you `#include` your mock class in N files, the compiler +++only needs to generate its constructor and destructor once, resulting in a much +++faster compilation. +++ +++Let's illustrate the idea using an example. Here's the definition of a mock +++class before applying this recipe: +++ +++```cpp +++// File mock_foo.h. +++... +++class MockFoo : public Foo { +++ public: +++ // Since we don't declare the constructor or the destructor, +++ // the compiler will generate them in every translation unit +++ // where this mock class is used. +++ +++ MOCK_METHOD(int, DoThis, (), (override)); +++ MOCK_METHOD(bool, DoThat, (const char* str), (override)); +++ ... more mock methods ... +++}; +++``` +++ +++After the change, it would look like: +++ +++```cpp +++// File mock_foo.h. +++... +++class MockFoo : public Foo { +++ public: +++ // The constructor and destructor are declared, but not defined, here. +++ MockFoo(); +++ virtual ~MockFoo(); +++ +++ MOCK_METHOD(int, DoThis, (), (override)); +++ MOCK_METHOD(bool, DoThat, (const char* str), (override)); +++ ... more mock methods ... +++}; +++``` +++ +++and +++ +++```cpp +++// File mock_foo.cc. +++#include "path/to/mock_foo.h" +++ +++// The definitions may appear trivial, but the functions actually do a +++// lot of things through the constructors/destructors of the member +++// variables used to implement the mock methods. +++MockFoo::MockFoo() {} +++MockFoo::~MockFoo() {} +++``` +++ +++### Forcing a Verification +++ +++When it's being destroyed, your friendly mock object will automatically verify +++that all expectations on it have been satisfied, and will generate googletest +++failures if not. This is convenient as it leaves you with one less thing to +++worry about. That is, unless you are not sure if your mock object will be +++destroyed. +++ +++How could it be that your mock object won't eventually be destroyed? Well, it +++might be created on the heap and owned by the code you are testing. Suppose +++there's a bug in that code and it doesn't delete the mock object properly - you +++could end up with a passing test when there's actually a bug. +++ +++Using a heap checker is a good idea and can alleviate the concern, but its +++implementation is not 100% reliable. So, sometimes you do want to *force* gMock +++to verify a mock object before it is (hopefully) destructed. You can do this +++with `Mock::VerifyAndClearExpectations(&mock_object)`: +++ +++```cpp +++TEST(MyServerTest, ProcessesRequest) { +++ using ::testing::Mock; +++ +++ MockFoo* const foo = new MockFoo; +++ EXPECT_CALL(*foo, ...)...; +++ // ... other expectations ... +++ +++ // server now owns foo. +++ MyServer server(foo); +++ server.ProcessRequest(...); +++ +++ // In case that server's destructor will forget to delete foo, +++ // this will verify the expectations anyway. +++ Mock::VerifyAndClearExpectations(foo); +++} // server is destroyed when it goes out of scope here. +++``` +++ +++{: .callout .tip} +++**Tip:** The `Mock::VerifyAndClearExpectations()` function returns a `bool` to +++indicate whether the verification was successful (`true` for yes), so you can +++wrap that function call inside a `ASSERT_TRUE()` if there is no point going +++further when the verification has failed. +++ +++Do not set new expectations after verifying and clearing a mock after its use. +++Setting expectations after code that exercises the mock has undefined behavior. +++See [Using Mocks in Tests](gmock_for_dummies.md#using-mocks-in-tests) for more +++information. +++ +++### Using Checkpoints {#UsingCheckPoints} +++ +++Sometimes you might want to test a mock object's behavior in phases whose sizes +++are each manageable, or you might want to set more detailed expectations about +++which API calls invoke which mock functions. +++ +++A technique you can use is to put the expectations in a sequence and insert +++calls to a dummy "checkpoint" function at specific places. Then you can verify +++that the mock function calls do happen at the right time. For example, if you +++are exercising the code: +++ +++```cpp +++ Foo(1); +++ Foo(2); +++ Foo(3); +++``` +++ +++and want to verify that `Foo(1)` and `Foo(3)` both invoke `mock.Bar("a")`, but +++`Foo(2)` doesn't invoke anything, you can write: +++ +++```cpp +++using ::testing::MockFunction; +++ +++TEST(FooTest, InvokesBarCorrectly) { +++ MyMock mock; +++ // Class MockFunction has exactly one mock method. It is named +++ // Call() and has type F. +++ MockFunction check; +++ { +++ InSequence s; +++ +++ EXPECT_CALL(mock, Bar("a")); +++ EXPECT_CALL(check, Call("1")); +++ EXPECT_CALL(check, Call("2")); +++ EXPECT_CALL(mock, Bar("a")); +++ } +++ Foo(1); +++ check.Call("1"); +++ Foo(2); +++ check.Call("2"); +++ Foo(3); +++} +++``` +++ +++The expectation spec says that the first `Bar("a")` call must happen before +++checkpoint "1", the second `Bar("a")` call must happen after checkpoint "2", and +++nothing should happen between the two checkpoints. The explicit checkpoints make +++it clear which `Bar("a")` is called by which call to `Foo()`. +++ +++### Mocking Destructors +++ +++Sometimes you want to make sure a mock object is destructed at the right time, +++e.g. after `bar->A()` is called but before `bar->B()` is called. We already know +++that you can specify constraints on the [order](#OrderedCalls) of mock function +++calls, so all we need to do is to mock the destructor of the mock function. +++ +++This sounds simple, except for one problem: a destructor is a special function +++with special syntax and special semantics, and the `MOCK_METHOD` macro doesn't +++work for it: +++ +++```cpp +++MOCK_METHOD(void, ~MockFoo, ()); // Won't compile! +++``` +++ +++The good news is that you can use a simple pattern to achieve the same effect. +++First, add a mock function `Die()` to your mock class and call it in the +++destructor, like this: +++ +++```cpp +++class MockFoo : public Foo { +++ ... +++ // Add the following two lines to the mock class. +++ MOCK_METHOD(void, Die, ()); +++ ~MockFoo() override { Die(); } +++}; +++``` +++ +++(If the name `Die()` clashes with an existing symbol, choose another name.) Now, +++we have translated the problem of testing when a `MockFoo` object dies to +++testing when its `Die()` method is called: +++ +++```cpp +++ MockFoo* foo = new MockFoo; +++ MockBar* bar = new MockBar; +++ ... +++ { +++ InSequence s; +++ +++ // Expects *foo to die after bar->A() and before bar->B(). +++ EXPECT_CALL(*bar, A()); +++ EXPECT_CALL(*foo, Die()); +++ EXPECT_CALL(*bar, B()); +++ } +++``` +++ +++And that's that. +++ +++### Using gMock and Threads {#UsingThreads} +++ +++In a **unit** test, it's best if you could isolate and test a piece of code in a +++single-threaded context. That avoids race conditions and dead locks, and makes +++debugging your test much easier. +++ +++Yet most programs are multi-threaded, and sometimes to test something we need to +++pound on it from more than one thread. gMock works for this purpose too. +++ +++Remember the steps for using a mock: +++ +++1. Create a mock object `foo`. +++2. Set its default actions and expectations using `ON_CALL()` and +++ `EXPECT_CALL()`. +++3. The code under test calls methods of `foo`. +++4. Optionally, verify and reset the mock. +++5. Destroy the mock yourself, or let the code under test destroy it. The +++ destructor will automatically verify it. +++ +++If you follow the following simple rules, your mocks and threads can live +++happily together: +++ +++* Execute your *test code* (as opposed to the code being tested) in *one* +++ thread. This makes your test easy to follow. +++* Obviously, you can do step #1 without locking. +++* When doing step #2 and #5, make sure no other thread is accessing `foo`. +++ Obvious too, huh? +++* #3 and #4 can be done either in one thread or in multiple threads - anyway +++ you want. gMock takes care of the locking, so you don't have to do any - +++ unless required by your test logic. +++ +++If you violate the rules (for example, if you set expectations on a mock while +++another thread is calling its methods), you get undefined behavior. That's not +++fun, so don't do it. +++ +++gMock guarantees that the action for a mock function is done in the same thread +++that called the mock function. For example, in +++ +++```cpp +++ EXPECT_CALL(mock, Foo(1)) +++ .WillOnce(action1); +++ EXPECT_CALL(mock, Foo(2)) +++ .WillOnce(action2); +++``` +++ +++if `Foo(1)` is called in thread 1 and `Foo(2)` is called in thread 2, gMock will +++execute `action1` in thread 1 and `action2` in thread 2. +++ +++gMock does *not* impose a sequence on actions performed in different threads +++(doing so may create deadlocks as the actions may need to cooperate). This means +++that the execution of `action1` and `action2` in the above example *may* +++interleave. If this is a problem, you should add proper synchronization logic to +++`action1` and `action2` to make the test thread-safe. +++ +++Also, remember that `DefaultValue` is a global resource that potentially +++affects *all* living mock objects in your program. Naturally, you won't want to +++mess with it from multiple threads or when there still are mocks in action. +++ +++### Controlling How Much Information gMock Prints +++ +++When gMock sees something that has the potential of being an error (e.g. a mock +++function with no expectation is called, a.k.a. an uninteresting call, which is +++allowed but perhaps you forgot to explicitly ban the call), it prints some +++warning messages, including the arguments of the function, the return value, and +++the stack trace. Hopefully this will remind you to take a look and see if there +++is indeed a problem. +++ +++Sometimes you are confident that your tests are correct and may not appreciate +++such friendly messages. Some other times, you are debugging your tests or +++learning about the behavior of the code you are testing, and wish you could +++observe every mock call that happens (including argument values, the return +++value, and the stack trace). Clearly, one size doesn't fit all. +++ +++You can control how much gMock tells you using the `--gmock_verbose=LEVEL` +++command-line flag, where `LEVEL` is a string with three possible values: +++ +++* `info`: gMock will print all informational messages, warnings, and errors +++ (most verbose). At this setting, gMock will also log any calls to the +++ `ON_CALL/EXPECT_CALL` macros. It will include a stack trace in +++ "uninteresting call" warnings. +++* `warning`: gMock will print both warnings and errors (less verbose); it will +++ omit the stack traces in "uninteresting call" warnings. This is the default. +++* `error`: gMock will print errors only (least verbose). +++ +++Alternatively, you can adjust the value of that flag from within your tests like +++so: +++ +++```cpp +++ ::testing::FLAGS_gmock_verbose = "error"; +++``` +++ +++If you find gMock printing too many stack frames with its informational or +++warning messages, remember that you can control their amount with the +++`--gtest_stack_trace_depth=max_depth` flag. +++ +++Now, judiciously use the right flag to enable gMock serve you better! +++ +++### Gaining Super Vision into Mock Calls +++ +++You have a test using gMock. It fails: gMock tells you some expectations aren't +++satisfied. However, you aren't sure why: Is there a typo somewhere in the +++matchers? Did you mess up the order of the `EXPECT_CALL`s? Or is the code under +++test doing something wrong? How can you find out the cause? +++ +++Won't it be nice if you have X-ray vision and can actually see the trace of all +++`EXPECT_CALL`s and mock method calls as they are made? For each call, would you +++like to see its actual argument values and which `EXPECT_CALL` gMock thinks it +++matches? If you still need some help to figure out who made these calls, how +++about being able to see the complete stack trace at each mock call? +++ +++You can unlock this power by running your test with the `--gmock_verbose=info` +++flag. For example, given the test program: +++ +++```cpp +++#include +++ +++using ::testing::_; +++using ::testing::HasSubstr; +++using ::testing::Return; +++ +++class MockFoo { +++ public: +++ MOCK_METHOD(void, F, (const string& x, const string& y)); +++}; +++ +++TEST(Foo, Bar) { +++ MockFoo mock; +++ EXPECT_CALL(mock, F(_, _)).WillRepeatedly(Return()); +++ EXPECT_CALL(mock, F("a", "b")); +++ EXPECT_CALL(mock, F("c", HasSubstr("d"))); +++ +++ mock.F("a", "good"); +++ mock.F("a", "b"); +++} +++``` +++ +++if you run it with `--gmock_verbose=info`, you will see this output: +++ +++```shell +++[ RUN ] Foo.Bar +++ +++foo_test.cc:14: EXPECT_CALL(mock, F(_, _)) invoked +++Stack trace: ... +++ +++foo_test.cc:15: EXPECT_CALL(mock, F("a", "b")) invoked +++Stack trace: ... +++ +++foo_test.cc:16: EXPECT_CALL(mock, F("c", HasSubstr("d"))) invoked +++Stack trace: ... +++ +++foo_test.cc:14: Mock function call matches EXPECT_CALL(mock, F(_, _))... +++ Function call: F(@0x7fff7c8dad40"a",@0x7fff7c8dad10"good") +++Stack trace: ... +++ +++foo_test.cc:15: Mock function call matches EXPECT_CALL(mock, F("a", "b"))... +++ Function call: F(@0x7fff7c8dada0"a",@0x7fff7c8dad70"b") +++Stack trace: ... +++ +++foo_test.cc:16: Failure +++Actual function call count doesn't match EXPECT_CALL(mock, F("c", HasSubstr("d")))... +++ Expected: to be called once +++ Actual: never called - unsatisfied and active +++[ FAILED ] Foo.Bar +++``` +++ +++Suppose the bug is that the `"c"` in the third `EXPECT_CALL` is a typo and +++should actually be `"a"`. With the above message, you should see that the actual +++`F("a", "good")` call is matched by the first `EXPECT_CALL`, not the third as +++you thought. From that it should be obvious that the third `EXPECT_CALL` is +++written wrong. Case solved. +++ +++If you are interested in the mock call trace but not the stack traces, you can +++combine `--gmock_verbose=info` with `--gtest_stack_trace_depth=0` on the test +++command line. +++ +++### Running Tests in Emacs +++ +++If you build and run your tests in Emacs using the `M-x google-compile` command +++(as many googletest users do), the source file locations of gMock and googletest +++errors will be highlighted. Just press `` on one of them and you'll be +++taken to the offending line. Or, you can just type `C-x`` to jump to the next +++error. +++ +++To make it even easier, you can add the following lines to your `~/.emacs` file: +++ +++```text +++(global-set-key "\M-m" 'google-compile) ; m is for make +++(global-set-key [M-down] 'next-error) +++(global-set-key [M-up] '(lambda () (interactive) (next-error -1))) +++``` +++ +++Then you can type `M-m` to start a build (if you want to run the test as well, +++just make sure `foo_test.run` or `runtests` is in the build command you supply +++after typing `M-m`), or `M-up`/`M-down` to move back and forth between errors. +++ +++## Extending gMock +++ +++### Writing New Matchers Quickly {#NewMatchers} +++ +++{: .callout .warning} +++WARNING: gMock does not guarantee when or how many times a matcher will be +++invoked. Therefore, all matchers must be functionally pure. See +++[this section](#PureMatchers) for more details. +++ +++The `MATCHER*` family of macros can be used to define custom matchers easily. +++The syntax: +++ +++```cpp +++MATCHER(name, description_string_expression) { statements; } +++``` +++ +++will define a matcher with the given name that executes the statements, which +++must return a `bool` to indicate if the match succeeds. Inside the statements, +++you can refer to the value being matched by `arg`, and refer to its type by +++`arg_type`. +++ +++The *description string* is a `string`-typed expression that documents what the +++matcher does, and is used to generate the failure message when the match fails. +++It can (and should) reference the special `bool` variable `negation`, and should +++evaluate to the description of the matcher when `negation` is `false`, or that +++of the matcher's negation when `negation` is `true`. +++ +++For convenience, we allow the description string to be empty (`""`), in which +++case gMock will use the sequence of words in the matcher name as the +++description. +++ +++For example: +++ +++```cpp +++MATCHER(IsDivisibleBy7, "") { return (arg % 7) == 0; } +++``` +++ +++allows you to write +++ +++```cpp +++ // Expects mock_foo.Bar(n) to be called where n is divisible by 7. +++ EXPECT_CALL(mock_foo, Bar(IsDivisibleBy7())); +++``` +++ +++or, +++ +++```cpp +++ using ::testing::Not; +++ ... +++ // Verifies that a value is divisible by 7 and the other is not. +++ EXPECT_THAT(some_expression, IsDivisibleBy7()); +++ EXPECT_THAT(some_other_expression, Not(IsDivisibleBy7())); +++``` +++ +++If the above assertions fail, they will print something like: +++ +++```shell +++ Value of: some_expression +++ Expected: is divisible by 7 +++ Actual: 27 +++ ... +++ Value of: some_other_expression +++ Expected: not (is divisible by 7) +++ Actual: 21 +++``` +++ +++where the descriptions `"is divisible by 7"` and `"not (is divisible by 7)"` are +++automatically calculated from the matcher name `IsDivisibleBy7`. +++ +++As you may have noticed, the auto-generated descriptions (especially those for +++the negation) may not be so great. You can always override them with a `string` +++expression of your own: +++ +++```cpp +++MATCHER(IsDivisibleBy7, +++ absl::StrCat(negation ? "isn't" : "is", " divisible by 7")) { +++ return (arg % 7) == 0; +++} +++``` +++ +++Optionally, you can stream additional information to a hidden argument named +++`result_listener` to explain the match result. For example, a better definition +++of `IsDivisibleBy7` is: +++ +++```cpp +++MATCHER(IsDivisibleBy7, "") { +++ if ((arg % 7) == 0) +++ return true; +++ +++ *result_listener << "the remainder is " << (arg % 7); +++ return false; +++} +++``` +++ +++With this definition, the above assertion will give a better message: +++ +++```shell +++ Value of: some_expression +++ Expected: is divisible by 7 +++ Actual: 27 (the remainder is 6) +++``` +++ +++You should let `MatchAndExplain()` print *any additional information* that can +++help a user understand the match result. Note that it should explain why the +++match succeeds in case of a success (unless it's obvious) - this is useful when +++the matcher is used inside `Not()`. There is no need to print the argument value +++itself, as gMock already prints it for you. +++ +++{: .callout .note} +++NOTE: The type of the value being matched (`arg_type`) is determined by the +++context in which you use the matcher and is supplied to you by the compiler, so +++you don't need to worry about declaring it (nor can you). This allows the +++matcher to be polymorphic. For example, `IsDivisibleBy7()` can be used to match +++any type where the value of `(arg % 7) == 0` can be implicitly converted to a +++`bool`. In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an +++`int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will +++be `unsigned long`; and so on. +++ +++### Writing New Parameterized Matchers Quickly +++ +++Sometimes you'll want to define a matcher that has parameters. For that you can +++use the macro: +++ +++```cpp +++MATCHER_P(name, param_name, description_string) { statements; } +++``` +++ +++where the description string can be either `""` or a `string` expression that +++references `negation` and `param_name`. +++ +++For example: +++ +++```cpp +++MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } +++``` +++ +++will allow you to write: +++ +++```cpp +++ EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); +++``` +++ +++which may lead to this message (assuming `n` is 10): +++ +++```shell +++ Value of: Blah("a") +++ Expected: has absolute value 10 +++ Actual: -9 +++``` +++ +++Note that both the matcher description and its parameter are printed, making the +++message human-friendly. +++ +++In the matcher definition body, you can write `foo_type` to reference the type +++of a parameter named `foo`. For example, in the body of +++`MATCHER_P(HasAbsoluteValue, value)` above, you can write `value_type` to refer +++to the type of `value`. +++ +++gMock also provides `MATCHER_P2`, `MATCHER_P3`, ..., up to `MATCHER_P10` to +++support multi-parameter matchers: +++ +++```cpp +++MATCHER_Pk(name, param_1, ..., param_k, description_string) { statements; } +++``` +++ +++Please note that the custom description string is for a particular *instance* of +++the matcher, where the parameters have been bound to actual values. Therefore +++usually you'll want the parameter values to be part of the description. gMock +++lets you do that by referencing the matcher parameters in the description string +++expression. +++ +++For example, +++ +++```cpp +++using ::testing::PrintToString; +++MATCHER_P2(InClosedRange, low, hi, +++ absl::StrFormat("%s in range [%s, %s]", negation ? "isn't" : "is", +++ PrintToString(low), PrintToString(hi))) { +++ return low <= arg && arg <= hi; +++} +++... +++EXPECT_THAT(3, InClosedRange(4, 6)); +++``` +++ +++would generate a failure that contains the message: +++ +++```shell +++ Expected: is in range [4, 6] +++``` +++ +++If you specify `""` as the description, the failure message will contain the +++sequence of words in the matcher name followed by the parameter values printed +++as a tuple. For example, +++ +++```cpp +++ MATCHER_P2(InClosedRange, low, hi, "") { ... } +++ ... +++ EXPECT_THAT(3, InClosedRange(4, 6)); +++``` +++ +++would generate a failure that contains the text: +++ +++```shell +++ Expected: in closed range (4, 6) +++``` +++ +++For the purpose of typing, you can view +++ +++```cpp +++MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } +++``` +++ +++as shorthand for +++ +++```cpp +++template +++FooMatcherPk +++Foo(p1_type p1, ..., pk_type pk) { ... } +++``` +++ +++When you write `Foo(v1, ..., vk)`, the compiler infers the types of the +++parameters `v1`, ..., and `vk` for you. If you are not happy with the result of +++the type inference, you can specify the types by explicitly instantiating the +++template, as in `Foo(5, false)`. As said earlier, you don't get to +++(or need to) specify `arg_type` as that's determined by the context in which the +++matcher is used. +++ +++You can assign the result of expression `Foo(p1, ..., pk)` to a variable of type +++`FooMatcherPk`. This can be useful when composing +++matchers. Matchers that don't have a parameter or have only one parameter have +++special types: you can assign `Foo()` to a `FooMatcher`-typed variable, and +++assign `Foo(p)` to a `FooMatcherP`-typed variable. +++ +++While you can instantiate a matcher template with reference types, passing the +++parameters by pointer usually makes your code more readable. If, however, you +++still want to pass a parameter by reference, be aware that in the failure +++message generated by the matcher you will see the value of the referenced object +++but not its address. +++ +++You can overload matchers with different numbers of parameters: +++ +++```cpp +++MATCHER_P(Blah, a, description_string_1) { ... } +++MATCHER_P2(Blah, a, b, description_string_2) { ... } +++``` +++ +++While it's tempting to always use the `MATCHER*` macros when defining a new +++matcher, you should also consider implementing the matcher interface directly +++instead (see the recipes that follow), especially if you need to use the matcher +++a lot. While these approaches require more work, they give you more control on +++the types of the value being matched and the matcher parameters, which in +++general leads to better compiler error messages that pay off in the long run. +++They also allow overloading matchers based on parameter types (as opposed to +++just based on the number of parameters). +++ +++### Writing New Monomorphic Matchers +++ +++A matcher of argument type `T` implements the matcher interface for `T` and does +++two things: it tests whether a value of type `T` matches the matcher, and can +++describe what kind of values it matches. The latter ability is used for +++generating readable error messages when expectations are violated. +++ +++A matcher of `T` must declare a typedef like: +++ +++```cpp +++using is_gtest_matcher = void; +++``` +++ +++and supports the following operations: +++ +++```cpp +++// Match a value and optionally explain into an ostream. +++bool matched = matcher.MatchAndExplain(value, maybe_os); +++// where `value` is of type `T` and +++// `maybe_os` is of type `std::ostream*`, where it can be null if the caller +++// is not interested in there textual explanation. +++ +++matcher.DescribeTo(os); +++matcher.DescribeNegationTo(os); +++// where `os` is of type `std::ostream*`. +++``` +++ +++If you need a custom matcher but `Truly()` is not a good option (for example, +++you may not be happy with the way `Truly(predicate)` describes itself, or you +++may want your matcher to be polymorphic as `Eq(value)` is), you can define a +++matcher to do whatever you want in two steps: first implement the matcher +++interface, and then define a factory function to create a matcher instance. The +++second step is not strictly needed but it makes the syntax of using the matcher +++nicer. +++ +++For example, you can define a matcher to test whether an `int` is divisible by 7 +++and then use it like this: +++ +++```cpp +++using ::testing::Matcher; +++ +++class DivisibleBy7Matcher { +++ public: +++ using is_gtest_matcher = void; +++ +++ bool MatchAndExplain(int n, std::ostream*) const { +++ return (n % 7) == 0; +++ } +++ +++ void DescribeTo(std::ostream* os) const { +++ *os << "is divisible by 7"; +++ } +++ +++ void DescribeNegationTo(std::ostream* os) const { +++ *os << "is not divisible by 7"; +++ } +++}; +++ +++Matcher DivisibleBy7() { +++ return DivisibleBy7Matcher(); +++} +++ +++... +++ EXPECT_CALL(foo, Bar(DivisibleBy7())); +++``` +++ +++You may improve the matcher message by streaming additional information to the +++`os` argument in `MatchAndExplain()`: +++ +++```cpp +++class DivisibleBy7Matcher { +++ public: +++ bool MatchAndExplain(int n, std::ostream* os) const { +++ const int remainder = n % 7; +++ if (remainder != 0 && os != nullptr) { +++ *os << "the remainder is " << remainder; +++ } +++ return remainder == 0; +++ } +++ ... +++}; +++``` +++ +++Then, `EXPECT_THAT(x, DivisibleBy7());` may generate a message like this: +++ +++```shell +++Value of: x +++Expected: is divisible by 7 +++ Actual: 23 (the remainder is 2) +++``` +++ +++{: .callout .tip} +++Tip: for convenience, `MatchAndExplain()` can take a `MatchResultListener*` +++instead of `std::ostream*`. +++ +++### Writing New Polymorphic Matchers +++ +++Expanding what we learned above to *polymorphic* matchers is now just as simple +++as adding templates in the right place. +++ +++```cpp +++ +++class NotNullMatcher { +++ public: +++ using is_gtest_matcher = void; +++ +++ // To implement a polymorphic matcher, we just need to make MatchAndExplain a +++ // template on its first argument. +++ +++ // In this example, we want to use NotNull() with any pointer, so +++ // MatchAndExplain() accepts a pointer of any type as its first argument. +++ // In general, you can define MatchAndExplain() as an ordinary method or +++ // a method template, or even overload it. +++ template +++ bool MatchAndExplain(T* p, std::ostream*) const { +++ return p != nullptr; +++ } +++ +++ // Describes the property of a value matching this matcher. +++ void DescribeTo(std::ostream* os) const { *os << "is not NULL"; } +++ +++ // Describes the property of a value NOT matching this matcher. +++ void DescribeNegationTo(std::ostream* os) const { *os << "is NULL"; } +++}; +++ +++NotNullMatcher NotNull() { +++ return NotNullMatcher(); +++} +++ +++... +++ +++ EXPECT_CALL(foo, Bar(NotNull())); // The argument must be a non-NULL pointer. +++``` +++ +++### Legacy Matcher Implementation +++ +++Defining matchers used to be somewhat more complicated, in which it required +++several supporting classes and virtual functions. To implement a matcher for +++type `T` using the legacy API you have to derive from `MatcherInterface` and +++call `MakeMatcher` to construct the object. +++ +++The interface looks like this: +++ +++```cpp +++class MatchResultListener { +++ public: +++ ... +++ // Streams x to the underlying ostream; does nothing if the ostream +++ // is NULL. +++ template +++ MatchResultListener& operator<<(const T& x); +++ +++ // Returns the underlying ostream. +++ std::ostream* stream(); +++}; +++ +++template +++class MatcherInterface { +++ public: +++ virtual ~MatcherInterface(); +++ +++ // Returns true if and only if the matcher matches x; also explains the match +++ // result to 'listener'. +++ virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0; +++ +++ // Describes this matcher to an ostream. +++ virtual void DescribeTo(std::ostream* os) const = 0; +++ +++ // Describes the negation of this matcher to an ostream. +++ virtual void DescribeNegationTo(std::ostream* os) const; +++}; +++``` +++ +++Fortunately, most of the time you can define a polymorphic matcher easily with +++the help of `MakePolymorphicMatcher()`. Here's how you can define `NotNull()` as +++an example: +++ +++```cpp +++using ::testing::MakePolymorphicMatcher; +++using ::testing::MatchResultListener; +++using ::testing::PolymorphicMatcher; +++ +++class NotNullMatcher { +++ public: +++ // To implement a polymorphic matcher, first define a COPYABLE class +++ // that has three members MatchAndExplain(), DescribeTo(), and +++ // DescribeNegationTo(), like the following. +++ +++ // In this example, we want to use NotNull() with any pointer, so +++ // MatchAndExplain() accepts a pointer of any type as its first argument. +++ // In general, you can define MatchAndExplain() as an ordinary method or +++ // a method template, or even overload it. +++ template +++ bool MatchAndExplain(T* p, +++ MatchResultListener* /* listener */) const { +++ return p != NULL; +++ } +++ +++ // Describes the property of a value matching this matcher. +++ void DescribeTo(std::ostream* os) const { *os << "is not NULL"; } +++ +++ // Describes the property of a value NOT matching this matcher. +++ void DescribeNegationTo(std::ostream* os) const { *os << "is NULL"; } +++}; +++ +++// To construct a polymorphic matcher, pass an instance of the class +++// to MakePolymorphicMatcher(). Note the return type. +++PolymorphicMatcher NotNull() { +++ return MakePolymorphicMatcher(NotNullMatcher()); +++} +++ +++... +++ +++ EXPECT_CALL(foo, Bar(NotNull())); // The argument must be a non-NULL pointer. +++``` +++ +++{: .callout .note} +++**Note:** Your polymorphic matcher class does **not** need to inherit from +++`MatcherInterface` or any other class, and its methods do **not** need to be +++virtual. +++ +++Like in a monomorphic matcher, you may explain the match result by streaming +++additional information to the `listener` argument in `MatchAndExplain()`. +++ +++### Writing New Cardinalities +++ +++A cardinality is used in `Times()` to tell gMock how many times you expect a +++call to occur. It doesn't have to be exact. For example, you can say +++`AtLeast(5)` or `Between(2, 4)`. +++ +++If the [built-in set](gmock_cheat_sheet.md#CardinalityList) of cardinalities +++doesn't suit you, you are free to define your own by implementing the following +++interface (in namespace `testing`): +++ +++```cpp +++class CardinalityInterface { +++ public: +++ virtual ~CardinalityInterface(); +++ +++ // Returns true if and only if call_count calls will satisfy this cardinality. +++ virtual bool IsSatisfiedByCallCount(int call_count) const = 0; +++ +++ // Returns true if and only if call_count calls will saturate this +++ // cardinality. +++ virtual bool IsSaturatedByCallCount(int call_count) const = 0; +++ +++ // Describes self to an ostream. +++ virtual void DescribeTo(std::ostream* os) const = 0; +++}; +++``` +++ +++For example, to specify that a call must occur even number of times, you can +++write +++ +++```cpp +++using ::testing::Cardinality; +++using ::testing::CardinalityInterface; +++using ::testing::MakeCardinality; +++ +++class EvenNumberCardinality : public CardinalityInterface { +++ public: +++ bool IsSatisfiedByCallCount(int call_count) const override { +++ return (call_count % 2) == 0; +++ } +++ +++ bool IsSaturatedByCallCount(int call_count) const override { +++ return false; +++ } +++ +++ void DescribeTo(std::ostream* os) const { +++ *os << "called even number of times"; +++ } +++}; +++ +++Cardinality EvenNumber() { +++ return MakeCardinality(new EvenNumberCardinality); +++} +++ +++... +++ EXPECT_CALL(foo, Bar(3)) +++ .Times(EvenNumber()); +++``` +++ +++### Writing New Actions {#QuickNewActions} +++ +++If the built-in actions don't work for you, you can easily define your own one. +++All you need is a call operator with a signature compatible with the mocked +++function. So you can use a lambda: +++ +++```cpp +++MockFunction mock; +++EXPECT_CALL(mock, Call).WillOnce([](const int input) { return input * 7; }); +++EXPECT_EQ(mock.AsStdFunction()(2), 14); +++``` +++ +++Or a struct with a call operator (even a templated one): +++ +++```cpp +++struct MultiplyBy { +++ template +++ T operator()(T arg) { return arg * multiplier; } +++ +++ int multiplier; +++}; +++ +++// Then use: +++// EXPECT_CALL(...).WillOnce(MultiplyBy{7}); +++``` +++ +++It's also fine for the callable to take no arguments, ignoring the arguments +++supplied to the mock function: +++ +++```cpp +++MockFunction mock; +++EXPECT_CALL(mock, Call).WillOnce([] { return 17; }); +++EXPECT_EQ(mock.AsStdFunction()(0), 17); +++``` +++ +++When used with `WillOnce`, the callable can assume it will be called at most +++once and is allowed to be a move-only type: +++ +++```cpp +++// An action that contains move-only types and has an &&-qualified operator, +++// demanding in the type system that it be called at most once. This can be +++// used with WillOnce, but the compiler will reject it if handed to +++// WillRepeatedly. +++struct MoveOnlyAction { +++ std::unique_ptr move_only_state; +++ std::unique_ptr operator()() && { return std::move(move_only_state); } +++}; +++ +++MockFunction()> mock; +++EXPECT_CALL(mock, Call).WillOnce(MoveOnlyAction{std::make_unique(17)}); +++EXPECT_THAT(mock.AsStdFunction()(), Pointee(Eq(17))); +++``` +++ +++More generally, to use with a mock function whose signature is `R(Args...)` the +++object can be anything convertible to `OnceAction` or +++`Action. The difference between the two is that `OnceAction` has +++weaker requirements (`Action` requires a copy-constructible input that can be +++called repeatedly whereas `OnceAction` requires only move-constructible and +++supports `&&`-qualified call operators), but can be used only with `WillOnce`. +++`OnceAction` is typically relevant only when supporting move-only types or +++actions that want a type-system guarantee that they will be called at most once. +++ +++Typically the `OnceAction` and `Action` templates need not be referenced +++directly in your actions: a struct or class with a call operator is sufficient, +++as in the examples above. But fancier polymorphic actions that need to know the +++specific return type of the mock function can define templated conversion +++operators to make that possible. See `gmock-actions.h` for examples. +++ +++#### Legacy macro-based Actions +++ +++Before C++11, the functor-based actions were not supported; the old way of +++writing actions was through a set of `ACTION*` macros. We suggest to avoid them +++in new code; they hide a lot of logic behind the macro, potentially leading to +++harder-to-understand compiler errors. Nevertheless, we cover them here for +++completeness. +++ +++By writing +++ +++```cpp +++ACTION(name) { statements; } +++``` +++ +++in a namespace scope (i.e. not inside a class or function), you will define an +++action with the given name that executes the statements. The value returned by +++`statements` will be used as the return value of the action. Inside the +++statements, you can refer to the K-th (0-based) argument of the mock function as +++`argK`. For example: +++ +++```cpp +++ACTION(IncrementArg1) { return ++(*arg1); } +++``` +++ +++allows you to write +++ +++```cpp +++... WillOnce(IncrementArg1()); +++``` +++ +++Note that you don't need to specify the types of the mock function arguments. +++Rest assured that your code is type-safe though: you'll get a compiler error if +++`*arg1` doesn't support the `++` operator, or if the type of `++(*arg1)` isn't +++compatible with the mock function's return type. +++ +++Another example: +++ +++```cpp +++ACTION(Foo) { +++ (*arg2)(5); +++ Blah(); +++ *arg1 = 0; +++ return arg0; +++} +++``` +++ +++defines an action `Foo()` that invokes argument #2 (a function pointer) with 5, +++calls function `Blah()`, sets the value pointed to by argument #1 to 0, and +++returns argument #0. +++ +++For more convenience and flexibility, you can also use the following pre-defined +++symbols in the body of `ACTION`: +++ +++`argK_type` | The type of the K-th (0-based) argument of the mock function +++:-------------- | :----------------------------------------------------------- +++`args` | All arguments of the mock function as a tuple +++`args_type` | The type of all arguments of the mock function as a tuple +++`return_type` | The return type of the mock function +++`function_type` | The type of the mock function +++ +++For example, when using an `ACTION` as a stub action for mock function: +++ +++```cpp +++int DoSomething(bool flag, int* ptr); +++``` +++ +++we have: +++ +++Pre-defined Symbol | Is Bound To +++------------------ | --------------------------------- +++`arg0` | the value of `flag` +++`arg0_type` | the type `bool` +++`arg1` | the value of `ptr` +++`arg1_type` | the type `int*` +++`args` | the tuple `(flag, ptr)` +++`args_type` | the type `std::tuple` +++`return_type` | the type `int` +++`function_type` | the type `int(bool, int*)` +++ +++#### Legacy macro-based parameterized Actions +++ +++Sometimes you'll want to parameterize an action you define. For that we have +++another macro +++ +++```cpp +++ACTION_P(name, param) { statements; } +++``` +++ +++For example, +++ +++```cpp +++ACTION_P(Add, n) { return arg0 + n; } +++``` +++ +++will allow you to write +++ +++```cpp +++// Returns argument #0 + 5. +++... WillOnce(Add(5)); +++``` +++ +++For convenience, we use the term *arguments* for the values used to invoke the +++mock function, and the term *parameters* for the values used to instantiate an +++action. +++ +++Note that you don't need to provide the type of the parameter either. Suppose +++the parameter is named `param`, you can also use the gMock-defined symbol +++`param_type` to refer to the type of the parameter as inferred by the compiler. +++For example, in the body of `ACTION_P(Add, n)` above, you can write `n_type` for +++the type of `n`. +++ +++gMock also provides `ACTION_P2`, `ACTION_P3`, and etc to support multi-parameter +++actions. For example, +++ +++```cpp +++ACTION_P2(ReturnDistanceTo, x, y) { +++ double dx = arg0 - x; +++ double dy = arg1 - y; +++ return sqrt(dx*dx + dy*dy); +++} +++``` +++ +++lets you write +++ +++```cpp +++... WillOnce(ReturnDistanceTo(5.0, 26.5)); +++``` +++ +++You can view `ACTION` as a degenerated parameterized action where the number of +++parameters is 0. +++ +++You can also easily define actions overloaded on the number of parameters: +++ +++```cpp +++ACTION_P(Plus, a) { ... } +++ACTION_P2(Plus, a, b) { ... } +++``` +++ +++### Restricting the Type of an Argument or Parameter in an ACTION +++ +++For maximum brevity and reusability, the `ACTION*` macros don't ask you to +++provide the types of the mock function arguments and the action parameters. +++Instead, we let the compiler infer the types for us. +++ +++Sometimes, however, we may want to be more explicit about the types. There are +++several tricks to do that. For example: +++ +++```cpp +++ACTION(Foo) { +++ // Makes sure arg0 can be converted to int. +++ int n = arg0; +++ ... use n instead of arg0 here ... +++} +++ +++ACTION_P(Bar, param) { +++ // Makes sure the type of arg1 is const char*. +++ ::testing::StaticAssertTypeEq(); +++ +++ // Makes sure param can be converted to bool. +++ bool flag = param; +++} +++``` +++ +++where `StaticAssertTypeEq` is a compile-time assertion in googletest that +++verifies two types are the same. +++ +++### Writing New Action Templates Quickly +++ +++Sometimes you want to give an action explicit template parameters that cannot be +++inferred from its value parameters. `ACTION_TEMPLATE()` supports that and can be +++viewed as an extension to `ACTION()` and `ACTION_P*()`. +++ +++The syntax: +++ +++```cpp +++ACTION_TEMPLATE(ActionName, +++ HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m), +++ AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; } +++``` +++ +++defines an action template that takes *m* explicit template parameters and *n* +++value parameters, where *m* is in [1, 10] and *n* is in [0, 10]. `name_i` is the +++name of the *i*-th template parameter, and `kind_i` specifies whether it's a +++`typename`, an integral constant, or a template. `p_i` is the name of the *i*-th +++value parameter. +++ +++Example: +++ +++```cpp +++// DuplicateArg(output) converts the k-th argument of the mock +++// function to type T and copies it to *output. +++ACTION_TEMPLATE(DuplicateArg, +++ // Note the comma between int and k: +++ HAS_2_TEMPLATE_PARAMS(int, k, typename, T), +++ AND_1_VALUE_PARAMS(output)) { +++ *output = T(std::get(args)); +++} +++``` +++ +++To create an instance of an action template, write: +++ +++```cpp +++ActionName(v1, ..., v_n) +++``` +++ +++where the `t`s are the template arguments and the `v`s are the value arguments. +++The value argument types are inferred by the compiler. For example: +++ +++```cpp +++using ::testing::_; +++... +++ int n; +++ EXPECT_CALL(mock, Foo).WillOnce(DuplicateArg<1, unsigned char>(&n)); +++``` +++ +++If you want to explicitly specify the value argument types, you can provide +++additional template arguments: +++ +++```cpp +++ActionName(v1, ..., v_n) +++``` +++ +++where `u_i` is the desired type of `v_i`. +++ +++`ACTION_TEMPLATE` and `ACTION`/`ACTION_P*` can be overloaded on the number of +++value parameters, but not on the number of template parameters. Without the +++restriction, the meaning of the following is unclear: +++ +++```cpp +++ OverloadedAction(x); +++``` +++ +++Are we using a single-template-parameter action where `bool` refers to the type +++of `x`, or a two-template-parameter action where the compiler is asked to infer +++the type of `x`? +++ +++### Using the ACTION Object's Type +++ +++If you are writing a function that returns an `ACTION` object, you'll need to +++know its type. The type depends on the macro used to define the action and the +++parameter types. The rule is relatively simple: +++ +++ +++| Given Definition | Expression | Has Type | +++| ----------------------------- | ------------------- | --------------------- | +++| `ACTION(Foo)` | `Foo()` | `FooAction` | +++| `ACTION_TEMPLATE(Foo, HAS_m_TEMPLATE_PARAMS(...), AND_0_VALUE_PARAMS())` | `Foo()` | `FooAction` | +++| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP` | +++| `ACTION_TEMPLATE(Bar, HAS_m_TEMPLATE_PARAMS(...), AND_1_VALUE_PARAMS(p1))` | `Bar(int_value)` | `BarActionP` | +++| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2` | +++| `ACTION_TEMPLATE(Baz, HAS_m_TEMPLATE_PARAMS(...), AND_2_VALUE_PARAMS(p1, p2))` | `Baz(bool_value, int_value)` | `BazActionP2` | +++| ... | ... | ... | +++ +++ +++Note that we have to pick different suffixes (`Action`, `ActionP`, `ActionP2`, +++and etc) for actions with different numbers of value parameters, or the action +++definitions cannot be overloaded on the number of them. +++ +++### Writing New Monomorphic Actions {#NewMonoActions} +++ +++While the `ACTION*` macros are very convenient, sometimes they are +++inappropriate. For example, despite the tricks shown in the previous recipes, +++they don't let you directly specify the types of the mock function arguments and +++the action parameters, which in general leads to unoptimized compiler error +++messages that can baffle unfamiliar users. They also don't allow overloading +++actions based on parameter types without jumping through some hoops. +++ +++An alternative to the `ACTION*` macros is to implement +++`::testing::ActionInterface`, where `F` is the type of the mock function in +++which the action will be used. For example: +++ +++```cpp +++template +++class ActionInterface { +++ public: +++ virtual ~ActionInterface(); +++ +++ // Performs the action. Result is the return type of function type +++ // F, and ArgumentTuple is the tuple of arguments of F. +++ // +++ +++ // For example, if F is int(bool, const string&), then Result would +++ // be int, and ArgumentTuple would be std::tuple. +++ virtual Result Perform(const ArgumentTuple& args) = 0; +++}; +++``` +++ +++```cpp +++using ::testing::_; +++using ::testing::Action; +++using ::testing::ActionInterface; +++using ::testing::MakeAction; +++ +++typedef int IncrementMethod(int*); +++ +++class IncrementArgumentAction : public ActionInterface { +++ public: +++ int Perform(const std::tuple& args) override { +++ int* p = std::get<0>(args); // Grabs the first argument. +++ return *p++; +++ } +++}; +++ +++Action IncrementArgument() { +++ return MakeAction(new IncrementArgumentAction); +++} +++ +++... +++ EXPECT_CALL(foo, Baz(_)) +++ .WillOnce(IncrementArgument()); +++ +++ int n = 5; +++ foo.Baz(&n); // Should return 5 and change n to 6. +++``` +++ +++### Writing New Polymorphic Actions {#NewPolyActions} +++ +++The previous recipe showed you how to define your own action. This is all good, +++except that you need to know the type of the function in which the action will +++be used. Sometimes that can be a problem. For example, if you want to use the +++action in functions with *different* types (e.g. like `Return()` and +++`SetArgPointee()`). +++ +++If an action can be used in several types of mock functions, we say it's +++*polymorphic*. The `MakePolymorphicAction()` function template makes it easy to +++define such an action: +++ +++```cpp +++namespace testing { +++template +++PolymorphicAction MakePolymorphicAction(const Impl& impl); +++} // namespace testing +++``` +++ +++As an example, let's define an action that returns the second argument in the +++mock function's argument list. The first step is to define an implementation +++class: +++ +++```cpp +++class ReturnSecondArgumentAction { +++ public: +++ template +++ Result Perform(const ArgumentTuple& args) const { +++ // To get the i-th (0-based) argument, use std::get(args). +++ return std::get<1>(args); +++ } +++}; +++``` +++ +++This implementation class does *not* need to inherit from any particular class. +++What matters is that it must have a `Perform()` method template. This method +++template takes the mock function's arguments as a tuple in a **single** +++argument, and returns the result of the action. It can be either `const` or not, +++but must be invocable with exactly one template argument, which is the result +++type. In other words, you must be able to call `Perform(args)` where `R` is +++the mock function's return type and `args` is its arguments in a tuple. +++ +++Next, we use `MakePolymorphicAction()` to turn an instance of the implementation +++class into the polymorphic action we need. It will be convenient to have a +++wrapper for this: +++ +++```cpp +++using ::testing::MakePolymorphicAction; +++using ::testing::PolymorphicAction; +++ +++PolymorphicAction ReturnSecondArgument() { +++ return MakePolymorphicAction(ReturnSecondArgumentAction()); +++} +++``` +++ +++Now, you can use this polymorphic action the same way you use the built-in ones: +++ +++```cpp +++using ::testing::_; +++ +++class MockFoo : public Foo { +++ public: +++ MOCK_METHOD(int, DoThis, (bool flag, int n), (override)); +++ MOCK_METHOD(string, DoThat, (int x, const char* str1, const char* str2), +++ (override)); +++}; +++ +++ ... +++ MockFoo foo; +++ EXPECT_CALL(foo, DoThis).WillOnce(ReturnSecondArgument()); +++ EXPECT_CALL(foo, DoThat).WillOnce(ReturnSecondArgument()); +++ ... +++ foo.DoThis(true, 5); // Will return 5. +++ foo.DoThat(1, "Hi", "Bye"); // Will return "Hi". +++``` +++ +++### Teaching gMock How to Print Your Values +++ +++When an uninteresting or unexpected call occurs, gMock prints the argument +++values and the stack trace to help you debug. Assertion macros like +++`EXPECT_THAT` and `EXPECT_EQ` also print the values in question when the +++assertion fails. gMock and googletest do this using googletest's user-extensible +++value printer. +++ +++This printer knows how to print built-in C++ types, native arrays, STL +++containers, and any type that supports the `<<` operator. For other types, it +++prints the raw bytes in the value and hopes that you the user can figure it out. +++[The GoogleTest advanced guide](advanced.md#teaching-googletest-how-to-print-your-values) +++explains how to extend the printer to do a better job at printing your +++particular type than to dump the bytes. +++ +++## Useful Mocks Created Using gMock +++ +++ +++ +++ +++### Mock std::function {#MockFunction} +++ +++`std::function` is a general function type introduced in C++11. It is a +++preferred way of passing callbacks to new interfaces. Functions are copyable, +++and are not usually passed around by pointer, which makes them tricky to mock. +++But fear not - `MockFunction` can help you with that. +++ +++`MockFunction` has a mock method `Call()` with the signature: +++ +++```cpp +++ R Call(T1, ..., Tn); +++``` +++ +++It also has a `AsStdFunction()` method, which creates a `std::function` proxy +++forwarding to Call: +++ +++```cpp +++ std::function AsStdFunction(); +++``` +++ +++To use `MockFunction`, first create `MockFunction` object and set up +++expectations on its `Call` method. Then pass proxy obtained from +++`AsStdFunction()` to the code you are testing. For example: +++ +++```cpp +++TEST(FooTest, RunsCallbackWithBarArgument) { +++ // 1. Create a mock object. +++ MockFunction mock_function; +++ +++ // 2. Set expectations on Call() method. +++ EXPECT_CALL(mock_function, Call("bar")).WillOnce(Return(1)); +++ +++ // 3. Exercise code that uses std::function. +++ Foo(mock_function.AsStdFunction()); +++ // Foo's signature can be either of: +++ // void Foo(const std::function& fun); +++ // void Foo(std::function fun); +++ +++ // 4. All expectations will be verified when mock_function +++ // goes out of scope and is destroyed. +++} +++``` +++ +++Remember that function objects created with `AsStdFunction()` are just +++forwarders. If you create multiple of them, they will share the same set of +++expectations. +++ +++Although `std::function` supports unlimited number of arguments, `MockFunction` +++implementation is limited to ten. If you ever hit that limit... well, your +++callback has bigger problems than being mockable. :-) diff --cc googletest/docs/gmock_faq.md index 000000000,000000000,000000000..8f220bf7a new file mode 100644 --- /dev/null +++ b/googletest/docs/gmock_faq.md @@@@ -1,0 -1,0 -1,0 +1,390 @@@@ +++# Legacy gMock FAQ +++ +++### When I call a method on my mock object, the method for the real object is invoked instead. What's the problem? +++ +++In order for a method to be mocked, it must be *virtual*, unless you use the +++[high-perf dependency injection technique](gmock_cook_book.md#MockingNonVirtualMethods). +++ +++### Can I mock a variadic function? +++ +++You cannot mock a variadic function (i.e. a function taking ellipsis (`...`) +++arguments) directly in gMock. +++ +++The problem is that in general, there is *no way* for a mock object to know how +++many arguments are passed to the variadic method, and what the arguments' types +++are. Only the *author of the base class* knows the protocol, and we cannot look +++into his or her head. +++ +++Therefore, to mock such a function, the *user* must teach the mock object how to +++figure out the number of arguments and their types. One way to do it is to +++provide overloaded versions of the function. +++ +++Ellipsis arguments are inherited from C and not really a C++ feature. They are +++unsafe to use and don't work with arguments that have constructors or +++destructors. Therefore we recommend to avoid them in C++ as much as possible. +++ +++### MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter. Why? +++ +++If you compile this using Microsoft Visual C++ 2005 SP1: +++ +++```cpp +++class Foo { +++ ... +++ virtual void Bar(const int i) = 0; +++}; +++ +++class MockFoo : public Foo { +++ ... +++ MOCK_METHOD(void, Bar, (const int i), (override)); +++}; +++``` +++ +++You may get the following warning: +++ +++```shell +++warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier +++``` +++ +++This is a MSVC bug. The same code compiles fine with gcc, for example. If you +++use Visual C++ 2008 SP1, you would get the warning: +++ +++```shell +++warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers +++``` +++ +++In C++, if you *declare* a function with a `const` parameter, the `const` +++modifier is ignored. Therefore, the `Foo` base class above is equivalent to: +++ +++```cpp +++class Foo { +++ ... +++ virtual void Bar(int i) = 0; // int or const int? Makes no difference. +++}; +++``` +++ +++In fact, you can *declare* `Bar()` with an `int` parameter, and define it with a +++`const int` parameter. The compiler will still match them up. +++ +++Since making a parameter `const` is meaningless in the method declaration, we +++recommend to remove it in both `Foo` and `MockFoo`. That should workaround the +++VC bug. +++ +++Note that we are talking about the *top-level* `const` modifier here. If the +++function parameter is passed by pointer or reference, declaring the pointee or +++referee as `const` is still meaningful. For example, the following two +++declarations are *not* equivalent: +++ +++```cpp +++void Bar(int* p); // Neither p nor *p is const. +++void Bar(const int* p); // p is not const, but *p is. +++``` +++ +++### I can't figure out why gMock thinks my expectations are not satisfied. What should I do? +++ +++You might want to run your test with `--gmock_verbose=info`. This flag lets +++gMock print a trace of every mock function call it receives. By studying the +++trace, you'll gain insights on why the expectations you set are not met. +++ +++If you see the message "The mock function has no default action set, and its +++return type has no default value set.", then try +++[adding a default action](gmock_cheat_sheet.md#OnCall). Due to a known issue, +++unexpected calls on mocks without default actions don't print out a detailed +++comparison between the actual arguments and the expected arguments. +++ +++### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug? +++ +++gMock and `ScopedMockLog` are likely doing the right thing here. +++ +++When a test crashes, the failure signal handler will try to log a lot of +++information (the stack trace, and the address map, for example). The messages +++are compounded if you have many threads with depth stacks. When `ScopedMockLog` +++intercepts these messages and finds that they don't match any expectations, it +++prints an error for each of them. +++ +++You can learn to ignore the errors, or you can rewrite your expectations to make +++your test more robust, for example, by adding something like: +++ +++```cpp +++using ::testing::AnyNumber; +++using ::testing::Not; +++... +++ // Ignores any log not done by us. +++ EXPECT_CALL(log, Log(_, Not(EndsWith("/my_file.cc")), _)) +++ .Times(AnyNumber()); +++``` +++ +++### How can I assert that a function is NEVER called? +++ +++```cpp +++using ::testing::_; +++... +++ EXPECT_CALL(foo, Bar(_)) +++ .Times(0); +++``` +++ +++### I have a failed test where gMock tells me TWICE that a particular expectation is not satisfied. Isn't this redundant? +++ +++When gMock detects a failure, it prints relevant information (the mock function +++arguments, the state of relevant expectations, and etc) to help the user debug. +++If another failure is detected, gMock will do the same, including printing the +++state of relevant expectations. +++ +++Sometimes an expectation's state didn't change between two failures, and you'll +++see the same description of the state twice. They are however *not* redundant, +++as they refer to *different points in time*. The fact they are the same *is* +++interesting information. +++ +++### I get a heapcheck failure when using a mock object, but using a real object is fine. What can be wrong? +++ +++Does the class (hopefully a pure interface) you are mocking have a virtual +++destructor? +++ +++Whenever you derive from a base class, make sure its destructor is virtual. +++Otherwise Bad Things will happen. Consider the following code: +++ +++```cpp +++class Base { +++ public: +++ // Not virtual, but should be. +++ ~Base() { ... } +++ ... +++}; +++ +++class Derived : public Base { +++ public: +++ ... +++ private: +++ std::string value_; +++}; +++ +++... +++ Base* p = new Derived; +++ ... +++ delete p; // Surprise! ~Base() will be called, but ~Derived() will not +++ // - value_ is leaked. +++``` +++ +++By changing `~Base()` to virtual, `~Derived()` will be correctly called when +++`delete p` is executed, and the heap checker will be happy. +++ +++### The "newer expectations override older ones" rule makes writing expectations awkward. Why does gMock do that? +++ +++When people complain about this, often they are referring to code like: +++ +++```cpp +++using ::testing::Return; +++... +++ // foo.Bar() should be called twice, return 1 the first time, and return +++ // 2 the second time. However, I have to write the expectations in the +++ // reverse order. This sucks big time!!! +++ EXPECT_CALL(foo, Bar()) +++ .WillOnce(Return(2)) +++ .RetiresOnSaturation(); +++ EXPECT_CALL(foo, Bar()) +++ .WillOnce(Return(1)) +++ .RetiresOnSaturation(); +++``` +++ +++The problem, is that they didn't pick the **best** way to express the test's +++intent. +++ +++By default, expectations don't have to be matched in *any* particular order. If +++you want them to match in a certain order, you need to be explicit. This is +++gMock's (and jMock's) fundamental philosophy: it's easy to accidentally +++over-specify your tests, and we want to make it harder to do so. +++ +++There are two better ways to write the test spec. You could either put the +++expectations in sequence: +++ +++```cpp +++using ::testing::Return; +++... +++ // foo.Bar() should be called twice, return 1 the first time, and return +++ // 2 the second time. Using a sequence, we can write the expectations +++ // in their natural order. +++ { +++ InSequence s; +++ EXPECT_CALL(foo, Bar()) +++ .WillOnce(Return(1)) +++ .RetiresOnSaturation(); +++ EXPECT_CALL(foo, Bar()) +++ .WillOnce(Return(2)) +++ .RetiresOnSaturation(); +++ } +++``` +++ +++or you can put the sequence of actions in the same expectation: +++ +++```cpp +++using ::testing::Return; +++... +++ // foo.Bar() should be called twice, return 1 the first time, and return +++ // 2 the second time. +++ EXPECT_CALL(foo, Bar()) +++ .WillOnce(Return(1)) +++ .WillOnce(Return(2)) +++ .RetiresOnSaturation(); +++``` +++ +++Back to the original questions: why does gMock search the expectations (and +++`ON_CALL`s) from back to front? Because this allows a user to set up a mock's +++behavior for the common case early (e.g. in the mock's constructor or the test +++fixture's set-up phase) and customize it with more specific rules later. If +++gMock searches from front to back, this very useful pattern won't be possible. +++ +++### gMock prints a warning when a function without EXPECT_CALL is called, even if I have set its behavior using ON_CALL. Would it be reasonable not to show the warning in this case? +++ +++When choosing between being neat and being safe, we lean toward the latter. So +++the answer is that we think it's better to show the warning. +++ +++Often people write `ON_CALL`s in the mock object's constructor or `SetUp()`, as +++the default behavior rarely changes from test to test. Then in the test body +++they set the expectations, which are often different for each test. Having an +++`ON_CALL` in the set-up part of a test doesn't mean that the calls are expected. +++If there's no `EXPECT_CALL` and the method is called, it's possibly an error. If +++we quietly let the call go through without notifying the user, bugs may creep in +++unnoticed. +++ +++If, however, you are sure that the calls are OK, you can write +++ +++```cpp +++using ::testing::_; +++... +++ EXPECT_CALL(foo, Bar(_)) +++ .WillRepeatedly(...); +++``` +++ +++instead of +++ +++```cpp +++using ::testing::_; +++... +++ ON_CALL(foo, Bar(_)) +++ .WillByDefault(...); +++``` +++ +++This tells gMock that you do expect the calls and no warning should be printed. +++ +++Also, you can control the verbosity by specifying `--gmock_verbose=error`. Other +++values are `info` and `warning`. If you find the output too noisy when +++debugging, just choose a less verbose level. +++ +++### How can I delete the mock function's argument in an action? +++ +++If your mock function takes a pointer argument and you want to delete that +++argument, you can use testing::DeleteArg() to delete the N'th (zero-indexed) +++argument: +++ +++```cpp +++using ::testing::_; +++ ... +++ MOCK_METHOD(void, Bar, (X* x, const Y& y)); +++ ... +++ EXPECT_CALL(mock_foo_, Bar(_, _)) +++ .WillOnce(testing::DeleteArg<0>())); +++``` +++ +++### How can I perform an arbitrary action on a mock function's argument? +++ +++If you find yourself needing to perform some action that's not supported by +++gMock directly, remember that you can define your own actions using +++[`MakeAction()`](#NewMonoActions) or +++[`MakePolymorphicAction()`](#NewPolyActions), or you can write a stub function +++and invoke it using [`Invoke()`](#FunctionsAsActions). +++ +++```cpp +++using ::testing::_; +++using ::testing::Invoke; +++ ... +++ MOCK_METHOD(void, Bar, (X* p)); +++ ... +++ EXPECT_CALL(mock_foo_, Bar(_)) +++ .WillOnce(Invoke(MyAction(...))); +++``` +++ +++### My code calls a static/global function. Can I mock it? +++ +++You can, but you need to make some changes. +++ +++In general, if you find yourself needing to mock a static function, it's a sign +++that your modules are too tightly coupled (and less flexible, less reusable, +++less testable, etc). You are probably better off defining a small interface and +++call the function through that interface, which then can be easily mocked. It's +++a bit of work initially, but usually pays for itself quickly. +++ +++This Google Testing Blog +++[post](https://testing.googleblog.com/2008/06/defeat-static-cling.html) says it +++excellently. Check it out. +++ +++### My mock object needs to do complex stuff. It's a lot of pain to specify the actions. gMock sucks! +++ +++I know it's not a question, but you get an answer for free any way. :-) +++ +++With gMock, you can create mocks in C++ easily. And people might be tempted to +++use them everywhere. Sometimes they work great, and sometimes you may find them, +++well, a pain to use. So, what's wrong in the latter case? +++ +++When you write a test without using mocks, you exercise the code and assert that +++it returns the correct value or that the system is in an expected state. This is +++sometimes called "state-based testing". +++ +++Mocks are great for what some call "interaction-based" testing: instead of +++checking the system state at the very end, mock objects verify that they are +++invoked the right way and report an error as soon as it arises, giving you a +++handle on the precise context in which the error was triggered. This is often +++more effective and economical to do than state-based testing. +++ +++If you are doing state-based testing and using a test double just to simulate +++the real object, you are probably better off using a fake. Using a mock in this +++case causes pain, as it's not a strong point for mocks to perform complex +++actions. If you experience this and think that mocks suck, you are just not +++using the right tool for your problem. Or, you might be trying to solve the +++wrong problem. :-) +++ +++### I got a warning "Uninteresting function call encountered - default action taken.." Should I panic? +++ +++By all means, NO! It's just an FYI. :-) +++ +++What it means is that you have a mock function, you haven't set any expectations +++on it (by gMock's rule this means that you are not interested in calls to this +++function and therefore it can be called any number of times), and it is called. +++That's OK - you didn't say it's not OK to call the function! +++ +++What if you actually meant to disallow this function to be called, but forgot to +++write `EXPECT_CALL(foo, Bar()).Times(0)`? While one can argue that it's the +++user's fault, gMock tries to be nice and prints you a note. +++ +++So, when you see the message and believe that there shouldn't be any +++uninteresting calls, you should investigate what's going on. To make your life +++easier, gMock dumps the stack trace when an uninteresting call is encountered. +++From that you can figure out which mock function it is, and how it is called. +++ +++### I want to define a custom action. Should I use Invoke() or implement the ActionInterface interface? +++ +++Either way is fine - you want to choose the one that's more convenient for your +++circumstance. +++ +++Usually, if your action is for a particular function type, defining it using +++`Invoke()` should be easier; if your action can be used in functions of +++different types (e.g. if you are defining `Return(*value*)`), +++`MakePolymorphicAction()` is easiest. Sometimes you want precise control on what +++types of functions the action can be used in, and implementing `ActionInterface` +++is the way to go here. See the implementation of `Return()` in `gmock-actions.h` +++for an example. +++ +++### I use SetArgPointee() in WillOnce(), but gcc complains about "conflicting return type specified". What does it mean? +++ +++You got this error as gMock has no idea what value it should return when the +++mock method is called. `SetArgPointee()` says what the side effect is, but +++doesn't say what the return value should be. You need `DoAll()` to chain a +++`SetArgPointee()` with a `Return()` that provides a value appropriate to the API +++being mocked. +++ +++See this [recipe](gmock_cook_book.md#mocking-side-effects) for more details and +++an example. +++ +++### I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it. What can I do? +++ +++We've noticed that when the `/clr` compiler flag is used, Visual C++ uses 5~6 +++times as much memory when compiling a mock class. We suggest to avoid `/clr` +++when compiling native C++ mocks. diff --cc googletest/docs/gmock_for_dummies.md index 000000000,000000000,000000000..43f907aaa new file mode 100644 --- /dev/null +++ b/googletest/docs/gmock_for_dummies.md @@@@ -1,0 -1,0 -1,0 +1,700 @@@@ +++# gMock for Dummies +++ +++## What Is gMock? +++ +++When you write a prototype or test, often it's not feasible or wise to rely on +++real objects entirely. A **mock object** implements the same interface as a real +++object (so it can be used as one), but lets you specify at run time how it will +++be used and what it should do (which methods will be called? in which order? how +++many times? with what arguments? what will they return? etc). +++ +++It is easy to confuse the term *fake objects* with mock objects. Fakes and mocks +++actually mean very different things in the Test-Driven Development (TDD) +++community: +++ +++* **Fake** objects have working implementations, but usually take some +++ shortcut (perhaps to make the operations less expensive), which makes them +++ not suitable for production. An in-memory file system would be an example of +++ a fake. +++* **Mocks** are objects pre-programmed with *expectations*, which form a +++ specification of the calls they are expected to receive. +++ +++If all this seems too abstract for you, don't worry - the most important thing +++to remember is that a mock allows you to check the *interaction* between itself +++and code that uses it. The difference between fakes and mocks shall become much +++clearer once you start to use mocks. +++ +++**gMock** is a library (sometimes we also call it a "framework" to make it sound +++cool) for creating mock classes and using them. It does to C++ what +++jMock/EasyMock does to Java (well, more or less). +++ +++When using gMock, +++ +++1. first, you use some simple macros to describe the interface you want to +++ mock, and they will expand to the implementation of your mock class; +++2. next, you create some mock objects and specify its expectations and behavior +++ using an intuitive syntax; +++3. then you exercise code that uses the mock objects. gMock will catch any +++ violation to the expectations as soon as it arises. +++ +++## Why gMock? +++ +++While mock objects help you remove unnecessary dependencies in tests and make +++them fast and reliable, using mocks manually in C++ is *hard*: +++ +++* Someone has to implement the mocks. The job is usually tedious and +++ error-prone. No wonder people go great distance to avoid it. +++* The quality of those manually written mocks is a bit, uh, unpredictable. You +++ may see some really polished ones, but you may also see some that were +++ hacked up in a hurry and have all sorts of ad hoc restrictions. +++* The knowledge you gained from using one mock doesn't transfer to the next +++ one. +++ +++In contrast, Java and Python programmers have some fine mock frameworks (jMock, +++EasyMock, etc), which automate the creation of mocks. As a result, mocking is a +++proven effective technique and widely adopted practice in those communities. +++Having the right tool absolutely makes the difference. +++ +++gMock was built to help C++ programmers. It was inspired by jMock and EasyMock, +++but designed with C++'s specifics in mind. It is your friend if any of the +++following problems is bothering you: +++ +++* You are stuck with a sub-optimal design and wish you had done more +++ prototyping before it was too late, but prototyping in C++ is by no means +++ "rapid". +++* Your tests are slow as they depend on too many libraries or use expensive +++ resources (e.g. a database). +++* Your tests are brittle as some resources they use are unreliable (e.g. the +++ network). +++* You want to test how your code handles a failure (e.g. a file checksum +++ error), but it's not easy to cause one. +++* You need to make sure that your module interacts with other modules in the +++ right way, but it's hard to observe the interaction; therefore you resort to +++ observing the side effects at the end of the action, but it's awkward at +++ best. +++* You want to "mock out" your dependencies, except that they don't have mock +++ implementations yet; and, frankly, you aren't thrilled by some of those +++ hand-written mocks. +++ +++We encourage you to use gMock as +++ +++* a *design* tool, for it lets you experiment with your interface design early +++ and often. More iterations lead to better designs! +++* a *testing* tool to cut your tests' outbound dependencies and probe the +++ interaction between your module and its collaborators. +++ +++## Getting Started +++ +++gMock is bundled with googletest. +++ +++## A Case for Mock Turtles +++ +++Let's look at an example. Suppose you are developing a graphics program that +++relies on a [LOGO](http://en.wikipedia.org/wiki/Logo_programming_language)-like +++API for drawing. How would you test that it does the right thing? Well, you can +++run it and compare the screen with a golden screen snapshot, but let's admit it: +++tests like this are expensive to run and fragile (What if you just upgraded to a +++shiny new graphics card that has better anti-aliasing? Suddenly you have to +++update all your golden images.). It would be too painful if all your tests are +++like this. Fortunately, you learned about +++[Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection) and know the right thing +++to do: instead of having your application talk to the system API directly, wrap +++the API in an interface (say, `Turtle`) and code to that interface: +++ +++```cpp +++class Turtle { +++ ... +++ virtual ~Turtle() {} +++ virtual void PenUp() = 0; +++ virtual void PenDown() = 0; +++ virtual void Forward(int distance) = 0; +++ virtual void Turn(int degrees) = 0; +++ virtual void GoTo(int x, int y) = 0; +++ virtual int GetX() const = 0; +++ virtual int GetY() const = 0; +++}; +++``` +++ +++(Note that the destructor of `Turtle` **must** be virtual, as is the case for +++**all** classes you intend to inherit from - otherwise the destructor of the +++derived class will not be called when you delete an object through a base +++pointer, and you'll get corrupted program states like memory leaks.) +++ +++You can control whether the turtle's movement will leave a trace using `PenUp()` +++and `PenDown()`, and control its movement using `Forward()`, `Turn()`, and +++`GoTo()`. Finally, `GetX()` and `GetY()` tell you the current position of the +++turtle. +++ +++Your program will normally use a real implementation of this interface. In +++tests, you can use a mock implementation instead. This allows you to easily +++check what drawing primitives your program is calling, with what arguments, and +++in which order. Tests written this way are much more robust (they won't break +++because your new machine does anti-aliasing differently), easier to read and +++maintain (the intent of a test is expressed in the code, not in some binary +++images), and run *much, much faster*. +++ +++## Writing the Mock Class +++ +++If you are lucky, the mocks you need to use have already been implemented by +++some nice people. If, however, you find yourself in the position to write a mock +++class, relax - gMock turns this task into a fun game! (Well, almost.) +++ +++### How to Define It +++ +++Using the `Turtle` interface as example, here are the simple steps you need to +++follow: +++ +++* Derive a class `MockTurtle` from `Turtle`. +++* Take a *virtual* function of `Turtle` (while it's possible to +++ [mock non-virtual methods using templates](gmock_cook_book.md#MockingNonVirtualMethods), +++ it's much more involved). +++* In the `public:` section of the child class, write `MOCK_METHOD();` +++* Now comes the fun part: you take the function signature, cut-and-paste it +++ into the macro, and add two commas - one between the return type and the +++ name, another between the name and the argument list. +++* If you're mocking a const method, add a 4th parameter containing `(const)` +++ (the parentheses are required). +++* Since you're overriding a virtual method, we suggest adding the `override` +++ keyword. For const methods the 4th parameter becomes `(const, override)`, +++ for non-const methods just `(override)`. This isn't mandatory. +++* Repeat until all virtual functions you want to mock are done. (It goes +++ without saying that *all* pure virtual methods in your abstract class must +++ be either mocked or overridden.) +++ +++After the process, you should have something like: +++ +++```cpp +++#include // Brings in gMock. +++ +++class MockTurtle : public Turtle { +++ public: +++ ... +++ MOCK_METHOD(void, PenUp, (), (override)); +++ MOCK_METHOD(void, PenDown, (), (override)); +++ MOCK_METHOD(void, Forward, (int distance), (override)); +++ MOCK_METHOD(void, Turn, (int degrees), (override)); +++ MOCK_METHOD(void, GoTo, (int x, int y), (override)); +++ MOCK_METHOD(int, GetX, (), (const, override)); +++ MOCK_METHOD(int, GetY, (), (const, override)); +++}; +++``` +++ +++You don't need to define these mock methods somewhere else - the `MOCK_METHOD` +++macro will generate the definitions for you. It's that simple! +++ +++### Where to Put It +++ +++When you define a mock class, you need to decide where to put its definition. +++Some people put it in a `_test.cc`. This is fine when the interface being mocked +++(say, `Foo`) is owned by the same person or team. Otherwise, when the owner of +++`Foo` changes it, your test could break. (You can't really expect `Foo`'s +++maintainer to fix every test that uses `Foo`, can you?) +++ +++Generally, you should not mock classes you don't own. If you must mock such a +++class owned by others, define the mock class in `Foo`'s Bazel package (usually +++the same directory or a `testing` sub-directory), and put it in a `.h` and a +++`cc_library` with `testonly=True`. Then everyone can reference them from their +++tests. If `Foo` ever changes, there is only one copy of `MockFoo` to change, and +++only tests that depend on the changed methods need to be fixed. +++ +++Another way to do it: you can introduce a thin layer `FooAdaptor` on top of +++`Foo` and code to this new interface. Since you own `FooAdaptor`, you can absorb +++changes in `Foo` much more easily. While this is more work initially, carefully +++choosing the adaptor interface can make your code easier to write and more +++readable (a net win in the long run), as you can choose `FooAdaptor` to fit your +++specific domain much better than `Foo` does. +++ +++## Using Mocks in Tests +++ +++Once you have a mock class, using it is easy. The typical work flow is: +++ +++1. Import the gMock names from the `testing` namespace such that you can use +++ them unqualified (You only have to do it once per file). Remember that +++ namespaces are a good idea. +++2. Create some mock objects. +++3. Specify your expectations on them (How many times will a method be called? +++ With what arguments? What should it do? etc.). +++4. Exercise some code that uses the mocks; optionally, check the result using +++ googletest assertions. If a mock method is called more than expected or with +++ wrong arguments, you'll get an error immediately. +++5. When a mock is destructed, gMock will automatically check whether all +++ expectations on it have been satisfied. +++ +++Here's an example: +++ +++```cpp +++#include "path/to/mock-turtle.h" +++#include +++#include +++ +++using ::testing::AtLeast; // #1 +++ +++TEST(PainterTest, CanDrawSomething) { +++ MockTurtle turtle; // #2 +++ EXPECT_CALL(turtle, PenDown()) // #3 +++ .Times(AtLeast(1)); +++ +++ Painter painter(&turtle); // #4 +++ +++ EXPECT_TRUE(painter.DrawCircle(0, 0, 10)); // #5 +++} +++``` +++ +++As you might have guessed, this test checks that `PenDown()` is called at least +++once. If the `painter` object didn't call this method, your test will fail with +++a message like this: +++ +++```text +++path/to/my_test.cc:119: Failure +++Actual function call count doesn't match this expectation: +++Actually: never called; +++Expected: called at least once. +++Stack trace: +++... +++``` +++ +++**Tip 1:** If you run the test from an Emacs buffer, you can hit `` on +++the line number to jump right to the failed expectation. +++ +++**Tip 2:** If your mock objects are never deleted, the final verification won't +++happen. Therefore it's a good idea to turn on the heap checker in your tests +++when you allocate mocks on the heap. You get that automatically if you use the +++`gtest_main` library already. +++ +++**Important note:** gMock requires expectations to be set **before** the mock +++functions are called, otherwise the behavior is **undefined**. Do not alternate +++between calls to `EXPECT_CALL()` and calls to the mock functions, and do not set +++any expectations on a mock after passing the mock to an API. +++ +++This means `EXPECT_CALL()` should be read as expecting that a call will occur +++*in the future*, not that a call has occurred. Why does gMock work like that? +++Well, specifying the expectation beforehand allows gMock to report a violation +++as soon as it rises, when the context (stack trace, etc) is still available. +++This makes debugging much easier. +++ +++Admittedly, this test is contrived and doesn't do much. You can easily achieve +++the same effect without using gMock. However, as we shall reveal soon, gMock +++allows you to do *so much more* with the mocks. +++ +++## Setting Expectations +++ +++The key to using a mock object successfully is to set the *right expectations* +++on it. If you set the expectations too strict, your test will fail as the result +++of unrelated changes. If you set them too loose, bugs can slip through. You want +++to do it just right such that your test can catch exactly the kind of bugs you +++intend it to catch. gMock provides the necessary means for you to do it "just +++right." +++ +++### General Syntax +++ +++In gMock we use the `EXPECT_CALL()` macro to set an expectation on a mock +++method. The general syntax is: +++ +++```cpp +++EXPECT_CALL(mock_object, method(matchers)) +++ .Times(cardinality) +++ .WillOnce(action) +++ .WillRepeatedly(action); +++``` +++ +++The macro has two arguments: first the mock object, and then the method and its +++arguments. Note that the two are separated by a comma (`,`), not a period (`.`). +++(Why using a comma? The answer is that it was necessary for technical reasons.) +++If the method is not overloaded, the macro can also be called without matchers: +++ +++```cpp +++EXPECT_CALL(mock_object, non-overloaded-method) +++ .Times(cardinality) +++ .WillOnce(action) +++ .WillRepeatedly(action); +++``` +++ +++This syntax allows the test writer to specify "called with any arguments" +++without explicitly specifying the number or types of arguments. To avoid +++unintended ambiguity, this syntax may only be used for methods that are not +++overloaded. +++ +++Either form of the macro can be followed by some optional *clauses* that provide +++more information about the expectation. We'll discuss how each clause works in +++the coming sections. +++ +++This syntax is designed to make an expectation read like English. For example, +++you can probably guess that +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(turtle, GetX()) +++ .Times(5) +++ .WillOnce(Return(100)) +++ .WillOnce(Return(150)) +++ .WillRepeatedly(Return(200)); +++``` +++ +++says that the `turtle` object's `GetX()` method will be called five times, it +++will return 100 the first time, 150 the second time, and then 200 every time. +++Some people like to call this style of syntax a Domain-Specific Language (DSL). +++ +++{: .callout .note} +++**Note:** Why do we use a macro to do this? Well it serves two purposes: first +++it makes expectations easily identifiable (either by `grep` or by a human +++reader), and second it allows gMock to include the source file location of a +++failed expectation in messages, making debugging easier. +++ +++### Matchers: What Arguments Do We Expect? +++ +++When a mock function takes arguments, we may specify what arguments we are +++expecting, for example: +++ +++```cpp +++// Expects the turtle to move forward by 100 units. +++EXPECT_CALL(turtle, Forward(100)); +++``` +++ +++Oftentimes you do not want to be too specific. Remember that talk about tests +++being too rigid? Over specification leads to brittle tests and obscures the +++intent of tests. Therefore we encourage you to specify only what's necessary—no +++more, no less. If you aren't interested in the value of an argument, write `_` +++as the argument, which means "anything goes": +++ +++```cpp +++using ::testing::_; +++... +++// Expects that the turtle jumps to somewhere on the x=50 line. +++EXPECT_CALL(turtle, GoTo(50, _)); +++``` +++ +++`_` is an instance of what we call **matchers**. A matcher is like a predicate +++and can test whether an argument is what we'd expect. You can use a matcher +++inside `EXPECT_CALL()` wherever a function argument is expected. `_` is a +++convenient way of saying "any value". +++ +++In the above examples, `100` and `50` are also matchers; implicitly, they are +++the same as `Eq(100)` and `Eq(50)`, which specify that the argument must be +++equal (using `operator==`) to the matcher argument. There are many +++[built-in matchers](reference/matchers.md) for common types (as well as +++[custom matchers](gmock_cook_book.md#NewMatchers)); for example: +++ +++```cpp +++using ::testing::Ge; +++... +++// Expects the turtle moves forward by at least 100. +++EXPECT_CALL(turtle, Forward(Ge(100))); +++``` +++ +++If you don't care about *any* arguments, rather than specify `_` for each of +++them you may instead omit the parameter list: +++ +++```cpp +++// Expects the turtle to move forward. +++EXPECT_CALL(turtle, Forward); +++// Expects the turtle to jump somewhere. +++EXPECT_CALL(turtle, GoTo); +++``` +++ +++This works for all non-overloaded methods; if a method is overloaded, you need +++to help gMock resolve which overload is expected by specifying the number of +++arguments and possibly also the +++[types of the arguments](gmock_cook_book.md#SelectOverload). +++ +++### Cardinalities: How Many Times Will It Be Called? +++ +++The first clause we can specify following an `EXPECT_CALL()` is `Times()`. We +++call its argument a **cardinality** as it tells *how many times* the call should +++occur. It allows us to repeat an expectation many times without actually writing +++it as many times. More importantly, a cardinality can be "fuzzy", just like a +++matcher can be. This allows a user to express the intent of a test exactly. +++ +++An interesting special case is when we say `Times(0)`. You may have guessed - it +++means that the function shouldn't be called with the given arguments at all, and +++gMock will report a googletest failure whenever the function is (wrongfully) +++called. +++ +++We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the +++list of built-in cardinalities you can use, see +++[here](gmock_cheat_sheet.md#CardinalityList). +++ +++The `Times()` clause can be omitted. **If you omit `Times()`, gMock will infer +++the cardinality for you.** The rules are easy to remember: +++ +++* If **neither** `WillOnce()` **nor** `WillRepeatedly()` is in the +++ `EXPECT_CALL()`, the inferred cardinality is `Times(1)`. +++* If there are *n* `WillOnce()`'s but **no** `WillRepeatedly()`, where *n* >= +++ 1, the cardinality is `Times(n)`. +++* If there are *n* `WillOnce()`'s and **one** `WillRepeatedly()`, where *n* >= +++ 0, the cardinality is `Times(AtLeast(n))`. +++ +++**Quick quiz:** what do you think will happen if a function is expected to be +++called twice but actually called four times? +++ +++### Actions: What Should It Do? +++ +++Remember that a mock object doesn't really have a working implementation? We as +++users have to tell it what to do when a method is invoked. This is easy in +++gMock. +++ +++First, if the return type of a mock function is a built-in type or a pointer, +++the function has a **default action** (a `void` function will just return, a +++`bool` function will return `false`, and other functions will return 0). In +++addition, in C++ 11 and above, a mock function whose return type is +++default-constructible (i.e. has a default constructor) has a default action of +++returning a default-constructed value. If you don't say anything, this behavior +++will be used. +++ +++Second, if a mock function doesn't have a default action, or the default action +++doesn't suit you, you can specify the action to be taken each time the +++expectation matches using a series of `WillOnce()` clauses followed by an +++optional `WillRepeatedly()`. For example, +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(turtle, GetX()) +++ .WillOnce(Return(100)) +++ .WillOnce(Return(200)) +++ .WillOnce(Return(300)); +++``` +++ +++says that `turtle.GetX()` will be called *exactly three times* (gMock inferred +++this from how many `WillOnce()` clauses we've written, since we didn't +++explicitly write `Times()`), and will return 100, 200, and 300 respectively. +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(turtle, GetY()) +++ .WillOnce(Return(100)) +++ .WillOnce(Return(200)) +++ .WillRepeatedly(Return(300)); +++``` +++ +++says that `turtle.GetY()` will be called *at least twice* (gMock knows this as +++we've written two `WillOnce()` clauses and a `WillRepeatedly()` while having no +++explicit `Times()`), will return 100 and 200 respectively the first two times, +++and 300 from the third time on. +++ +++Of course, if you explicitly write a `Times()`, gMock will not try to infer the +++cardinality itself. What if the number you specified is larger than there are +++`WillOnce()` clauses? Well, after all `WillOnce()`s are used up, gMock will do +++the *default* action for the function every time (unless, of course, you have a +++`WillRepeatedly()`.). +++ +++What can we do inside `WillOnce()` besides `Return()`? You can return a +++reference using `ReturnRef(`*`variable`*`)`, or invoke a pre-defined function, +++among [others](gmock_cook_book.md#using-actions). +++ +++**Important note:** The `EXPECT_CALL()` statement evaluates the action clause +++only once, even though the action may be performed many times. Therefore you +++must be careful about side effects. The following may not do what you want: +++ +++```cpp +++using ::testing::Return; +++... +++int n = 100; +++EXPECT_CALL(turtle, GetX()) +++ .Times(4) +++ .WillRepeatedly(Return(n++)); +++``` +++ +++Instead of returning 100, 101, 102, ..., consecutively, this mock function will +++always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)` +++will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will +++return the same pointer every time. If you want the side effect to happen every +++time, you need to define a custom action, which we'll teach in the +++[cook book](gmock_cook_book.md). +++ +++Time for another quiz! What do you think the following means? +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(turtle, GetY()) +++ .Times(4) +++ .WillOnce(Return(100)); +++``` +++ +++Obviously `turtle.GetY()` is expected to be called four times. But if you think +++it will return 100 every time, think twice! Remember that one `WillOnce()` +++clause will be consumed each time the function is invoked and the default action +++will be taken afterwards. So the right answer is that `turtle.GetY()` will +++return 100 the first time, but **return 0 from the second time on**, as +++returning 0 is the default action for `int` functions. +++ +++### Using Multiple Expectations {#MultiExpectations} +++ +++So far we've only shown examples where you have a single expectation. More +++realistically, you'll specify expectations on multiple mock methods which may be +++from multiple mock objects. +++ +++By default, when a mock method is invoked, gMock will search the expectations in +++the **reverse order** they are defined, and stop when an active expectation that +++matches the arguments is found (you can think of it as "newer rules override +++older ones."). If the matching expectation cannot take any more calls, you will +++get an upper-bound-violated failure. Here's an example: +++ +++```cpp +++using ::testing::_; +++... +++EXPECT_CALL(turtle, Forward(_)); // #1 +++EXPECT_CALL(turtle, Forward(10)) // #2 +++ .Times(2); +++``` +++ +++If `Forward(10)` is called three times in a row, the third time it will be an +++error, as the last matching expectation (#2) has been saturated. If, however, +++the third `Forward(10)` call is replaced by `Forward(20)`, then it would be OK, +++as now #1 will be the matching expectation. +++ +++{: .callout .note} +++**Note:** Why does gMock search for a match in the *reverse* order of the +++expectations? The reason is that this allows a user to set up the default +++expectations in a mock object's constructor or the test fixture's set-up phase +++and then customize the mock by writing more specific expectations in the test +++body. So, if you have two expectations on the same method, you want to put the +++one with more specific matchers **after** the other, or the more specific rule +++would be shadowed by the more general one that comes after it. +++ +++{: .callout .tip} +++**Tip:** It is very common to start with a catch-all expectation for a method +++and `Times(AnyNumber())` (omitting arguments, or with `_` for all arguments, if +++overloaded). This makes any calls to the method expected. This is not necessary +++for methods that are not mentioned at all (these are "uninteresting"), but is +++useful for methods that have some expectations, but for which other calls are +++ok. See +++[Understanding Uninteresting vs Unexpected Calls](gmock_cook_book.md#uninteresting-vs-unexpected). +++ +++### Ordered vs Unordered Calls {#OrderedCalls} +++ +++By default, an expectation can match a call even though an earlier expectation +++hasn't been satisfied. In other words, the calls don't have to occur in the +++order the expectations are specified. +++ +++Sometimes, you may want all the expected calls to occur in a strict order. To +++say this in gMock is easy: +++ +++```cpp +++using ::testing::InSequence; +++... +++TEST(FooTest, DrawsLineSegment) { +++ ... +++ { +++ InSequence seq; +++ +++ EXPECT_CALL(turtle, PenDown()); +++ EXPECT_CALL(turtle, Forward(100)); +++ EXPECT_CALL(turtle, PenUp()); +++ } +++ Foo(); +++} +++``` +++ +++By creating an object of type `InSequence`, all expectations in its scope are +++put into a *sequence* and have to occur *sequentially*. Since we are just +++relying on the constructor and destructor of this object to do the actual work, +++its name is really irrelevant. +++ +++In this example, we test that `Foo()` calls the three expected functions in the +++order as written. If a call is made out-of-order, it will be an error. +++ +++(What if you care about the relative order of some of the calls, but not all of +++them? Can you specify an arbitrary partial order? The answer is ... yes! The +++details can be found [here](gmock_cook_book.md#OrderedCalls).) +++ +++### All Expectations Are Sticky (Unless Said Otherwise) {#StickyExpectations} +++ +++Now let's do a quick quiz to see how well you can use this mock stuff already. +++How would you test that the turtle is asked to go to the origin *exactly twice* +++(you want to ignore any other instructions it receives)? +++ +++After you've come up with your answer, take a look at ours and compare notes +++(solve it yourself first - don't cheat!): +++ +++```cpp +++using ::testing::_; +++using ::testing::AnyNumber; +++... +++EXPECT_CALL(turtle, GoTo(_, _)) // #1 +++ .Times(AnyNumber()); +++EXPECT_CALL(turtle, GoTo(0, 0)) // #2 +++ .Times(2); +++``` +++ +++Suppose `turtle.GoTo(0, 0)` is called three times. In the third time, gMock will +++see that the arguments match expectation #2 (remember that we always pick the +++last matching expectation). Now, since we said that there should be only two +++such calls, gMock will report an error immediately. This is basically what we've +++told you in the [Using Multiple Expectations](#MultiExpectations) section above. +++ +++This example shows that **expectations in gMock are "sticky" by default**, in +++the sense that they remain active even after we have reached their invocation +++upper bounds. This is an important rule to remember, as it affects the meaning +++of the spec, and is **different** to how it's done in many other mocking +++frameworks (Why'd we do that? Because we think our rule makes the common cases +++easier to express and understand.). +++ +++Simple? Let's see if you've really understood it: what does the following code +++say? +++ +++```cpp +++using ::testing::Return; +++... +++for (int i = n; i > 0; i--) { +++ EXPECT_CALL(turtle, GetX()) +++ .WillOnce(Return(10*i)); +++} +++``` +++ +++If you think it says that `turtle.GetX()` will be called `n` times and will +++return 10, 20, 30, ..., consecutively, think twice! The problem is that, as we +++said, expectations are sticky. So, the second time `turtle.GetX()` is called, +++the last (latest) `EXPECT_CALL()` statement will match, and will immediately +++lead to an "upper bound violated" error - this piece of code is not very useful! +++ +++One correct way of saying that `turtle.GetX()` will return 10, 20, 30, ..., is +++to explicitly say that the expectations are *not* sticky. In other words, they +++should *retire* as soon as they are saturated: +++ +++```cpp +++using ::testing::Return; +++... +++for (int i = n; i > 0; i--) { +++ EXPECT_CALL(turtle, GetX()) +++ .WillOnce(Return(10*i)) +++ .RetiresOnSaturation(); +++} +++``` +++ +++And, there's a better way to do it: in this case, we expect the calls to occur +++in a specific order, and we line up the actions to match the order. Since the +++order is important here, we should make it explicit using a sequence: +++ +++```cpp +++using ::testing::InSequence; +++using ::testing::Return; +++... +++{ +++ InSequence s; +++ +++ for (int i = 1; i <= n; i++) { +++ EXPECT_CALL(turtle, GetX()) +++ .WillOnce(Return(10*i)) +++ .RetiresOnSaturation(); +++ } +++} +++``` +++ +++By the way, the other situation where an expectation may *not* be sticky is when +++it's in a sequence - as soon as another expectation that comes after it in the +++sequence has been used, it automatically retires (and will never be used to +++match any call). +++ +++### Uninteresting Calls +++ +++A mock object may have many methods, and not all of them are that interesting. +++For example, in some tests we may not care about how many times `GetX()` and +++`GetY()` get called. +++ +++In gMock, if you are not interested in a method, just don't say anything about +++it. If a call to this method occurs, you'll see a warning in the test output, +++but it won't be a failure. This is called "naggy" behavior; to change, see +++[The Nice, the Strict, and the Naggy](gmock_cook_book.md#NiceStrictNaggy). diff --cc googletest/docs/index.md index 000000000,000000000,000000000..b162c7401 new file mode 100644 --- /dev/null +++ b/googletest/docs/index.md @@@@ -1,0 -1,0 -1,0 +1,22 @@@@ +++# GoogleTest User's Guide +++ +++## Welcome to GoogleTest! +++ +++GoogleTest is Google's C++ testing and mocking framework. This user's guide has +++the following contents: +++ +++* [GoogleTest Primer](primer.md) - Teaches you how to write simple tests using +++ GoogleTest. Read this first if you are new to GoogleTest. +++* [GoogleTest Advanced](advanced.md) - Read this when you've finished the +++ Primer and want to utilize GoogleTest to its full potential. +++* [GoogleTest Samples](samples.md) - Describes some GoogleTest samples. +++* [GoogleTest FAQ](faq.md) - Have a question? Want some tips? Check here +++ first. +++* [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock +++ objects and use them in tests. +++* [Mocking Cookbook](gmock_cook_book.md) - Includes tips and approaches to +++ common mocking use cases. +++* [Mocking Cheat Sheet](gmock_cheat_sheet.md) - A handy reference for +++ matchers, actions, invariants, and more. +++* [Mocking FAQ](gmock_faq.md) - Contains answers to some mocking-specific +++ questions. diff --cc googletest/docs/pkgconfig.md index 000000000,000000000,000000000..bf05d5931 new file mode 100644 --- /dev/null +++ b/googletest/docs/pkgconfig.md @@@@ -1,0 -1,0 -1,0 +1,144 @@@@ +++## Using GoogleTest from various build systems +++ +++GoogleTest comes with pkg-config files that can be used to determine all +++necessary flags for compiling and linking to GoogleTest (and GoogleMock). +++Pkg-config is a standardised plain-text format containing +++ +++* the includedir (-I) path +++* necessary macro (-D) definitions +++* further required flags (-pthread) +++* the library (-L) path +++* the library (-l) to link to +++ +++All current build systems support pkg-config in one way or another. For all +++examples here we assume you want to compile the sample +++`samples/sample3_unittest.cc`. +++ +++### CMake +++ +++Using `pkg-config` in CMake is fairly easy: +++ +++```cmake +++find_package(PkgConfig) +++pkg_search_module(GTEST REQUIRED gtest_main) +++ +++add_executable(testapp) +++target_sources(testapp PRIVATE samples/sample3_unittest.cc) +++target_link_libraries(testapp PRIVATE ${GTEST_LDFLAGS}) +++target_compile_options(testapp PRIVATE ${GTEST_CFLAGS}) +++ +++enable_testing() +++add_test(first_and_only_test testapp) +++``` +++ +++It is generally recommended that you use `target_compile_options` + `_CFLAGS` +++over `target_include_directories` + `_INCLUDE_DIRS` as the former includes not +++just -I flags (GoogleTest might require a macro indicating to internal headers +++that all libraries have been compiled with threading enabled. In addition, +++GoogleTest might also require `-pthread` in the compiling step, and as such +++splitting the pkg-config `Cflags` variable into include dirs and macros for +++`target_compile_definitions()` might still miss this). The same recommendation +++goes for using `_LDFLAGS` over the more commonplace `_LIBRARIES`, which happens +++to discard `-L` flags and `-pthread`. +++ +++### Help! pkg-config can't find GoogleTest! +++ +++Let's say you have a `CMakeLists.txt` along the lines of the one in this +++tutorial and you try to run `cmake`. It is very possible that you get a failure +++along the lines of: +++ +++``` +++-- Checking for one of the modules 'gtest_main' +++CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message): +++ None of the required 'gtest_main' found +++``` +++ +++These failures are common if you installed GoogleTest yourself and have not +++sourced it from a distro or other package manager. If so, you need to tell +++pkg-config where it can find the `.pc` files containing the information. Say you +++installed GoogleTest to `/usr/local`, then it might be that the `.pc` files are +++installed under `/usr/local/lib64/pkgconfig`. If you set +++ +++``` +++export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig +++``` +++ +++pkg-config will also try to look in `PKG_CONFIG_PATH` to find `gtest_main.pc`. +++ +++### Using pkg-config in a cross-compilation setting +++ +++Pkg-config can be used in a cross-compilation setting too. To do this, let's +++assume the final prefix of the cross-compiled installation will be `/usr`, and +++your sysroot is `/home/MYUSER/sysroot`. Configure and install GTest using +++ +++``` +++mkdir build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. +++``` +++ +++Install into the sysroot using `DESTDIR`: +++ +++``` +++make -j install DESTDIR=/home/MYUSER/sysroot +++``` +++ +++Before we continue, it is recommended to **always** define the following two +++variables for pkg-config in a cross-compilation setting: +++ +++``` +++export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=yes +++export PKG_CONFIG_ALLOW_SYSTEM_LIBS=yes +++``` +++ +++otherwise `pkg-config` will filter `-I` and `-L` flags against standard prefixes +++such as `/usr` (see https://bugs.freedesktop.org/show_bug.cgi?id=28264#c3 for +++reasons why this stripping needs to occur usually). +++ +++If you look at the generated pkg-config file, it will look something like +++ +++``` +++libdir=/usr/lib64 +++includedir=/usr/include +++ +++Name: gtest +++Description: GoogleTest (without main() function) +++Version: 1.11.0 +++URL: https://github.com/google/googletest +++Libs: -L${libdir} -lgtest -lpthread +++Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -lpthread +++``` +++ +++Notice that the sysroot is not included in `libdir` and `includedir`! If you try +++to run `pkg-config` with the correct +++`PKG_CONFIG_LIBDIR=/home/MYUSER/sysroot/usr/lib64/pkgconfig` against this `.pc` +++file, you will get +++ +++``` +++$ pkg-config --cflags gtest +++-DGTEST_HAS_PTHREAD=1 -lpthread -I/usr/include +++$ pkg-config --libs gtest +++-L/usr/lib64 -lgtest -lpthread +++``` +++ +++which is obviously wrong and points to the `CBUILD` and not `CHOST` root. In +++order to use this in a cross-compilation setting, we need to tell pkg-config to +++inject the actual sysroot into `-I` and `-L` variables. Let us now tell +++pkg-config about the actual sysroot +++ +++``` +++export PKG_CONFIG_DIR= +++export PKG_CONFIG_SYSROOT_DIR=/home/MYUSER/sysroot +++export PKG_CONFIG_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}/usr/lib64/pkgconfig +++``` +++ +++and running `pkg-config` again we get +++ +++``` +++$ pkg-config --cflags gtest +++-DGTEST_HAS_PTHREAD=1 -lpthread -I/home/MYUSER/sysroot/usr/include +++$ pkg-config --libs gtest +++-L/home/MYUSER/sysroot/usr/lib64 -lgtest -lpthread +++``` +++ +++which contains the correct sysroot now. For a more comprehensive guide to also +++including `${CHOST}` in build system calls, see the excellent tutorial by Diego +++Elio Pettenò: diff --cc googletest/docs/platforms.md index 000000000,000000000,000000000..d35a7be05 new file mode 100644 --- /dev/null +++ b/googletest/docs/platforms.md @@@@ -1,0 -1,0 -1,0 +1,8 @@@@ +++# Supported Platforms +++ +++GoogleTest follows Google's +++[Foundational C++ Support Policy](https://opensource.google/documentation/policies/cplusplus-support). +++See +++[this table](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) +++for a list of currently supported versions compilers, platforms, and build +++tools. diff --cc googletest/docs/primer.md index 000000000,000000000,000000000..f2a97a726 new file mode 100644 --- /dev/null +++ b/googletest/docs/primer.md @@@@ -1,0 -1,0 -1,0 +1,483 @@@@ +++# GoogleTest Primer +++ +++## Introduction: Why GoogleTest? +++ +++*GoogleTest* helps you write better C++ tests. +++ +++GoogleTest is a testing framework developed by the Testing Technology team with +++Google's specific requirements and constraints in mind. Whether you work on +++Linux, Windows, or a Mac, if you write C++ code, GoogleTest can help you. And it +++supports *any* kind of tests, not just unit tests. +++ +++So what makes a good test, and how does GoogleTest fit in? We believe: +++ +++1. Tests should be *independent* and *repeatable*. It's a pain to debug a test +++ that succeeds or fails as a result of other tests. GoogleTest isolates the +++ tests by running each of them on a different object. When a test fails, +++ GoogleTest allows you to run it in isolation for quick debugging. +++2. Tests should be well *organized* and reflect the structure of the tested +++ code. GoogleTest groups related tests into test suites that can share data +++ and subroutines. This common pattern is easy to recognize and makes tests +++ easy to maintain. Such consistency is especially helpful when people switch +++ projects and start to work on a new code base. +++3. Tests should be *portable* and *reusable*. Google has a lot of code that is +++ platform-neutral; its tests should also be platform-neutral. GoogleTest +++ works on different OSes, with different compilers, with or without +++ exceptions, so GoogleTest tests can work with a variety of configurations. +++4. When tests fail, they should provide as much *information* about the problem +++ as possible. GoogleTest doesn't stop at the first test failure. Instead, it +++ only stops the current test and continues with the next. You can also set up +++ tests that report non-fatal failures after which the current test continues. +++ Thus, you can detect and fix multiple bugs in a single run-edit-compile +++ cycle. +++5. The testing framework should liberate test writers from housekeeping chores +++ and let them focus on the test *content*. GoogleTest automatically keeps +++ track of all tests defined, and doesn't require the user to enumerate them +++ in order to run them. +++6. Tests should be *fast*. With GoogleTest, you can reuse shared resources +++ across tests and pay for the set-up/tear-down only once, without making +++ tests depend on each other. +++ +++Since GoogleTest is based on the popular xUnit architecture, you'll feel right +++at home if you've used JUnit or PyUnit before. If not, it will take you about 10 +++minutes to learn the basics and get started. So let's go! +++ +++## Beware of the Nomenclature +++ +++{: .callout .note} +++*Note:* There might be some confusion arising from different definitions of the +++terms *Test*, *Test Case* and *Test Suite*, so beware of misunderstanding these. +++ +++Historically, GoogleTest started to use the term *Test Case* for grouping +++related tests, whereas current publications, including International Software +++Testing Qualifications Board ([ISTQB](http://www.istqb.org/)) materials and +++various textbooks on software quality, use the term +++*[Test Suite][istqb test suite]* for this. +++ +++The related term *Test*, as it is used in GoogleTest, corresponds to the term +++*[Test Case][istqb test case]* of ISTQB and others. +++ +++The term *Test* is commonly of broad enough sense, including ISTQB's definition +++of *Test Case*, so it's not much of a problem here. But the term *Test Case* as +++was used in Google Test is of contradictory sense and thus confusing. +++ +++GoogleTest recently started replacing the term *Test Case* with *Test Suite*. +++The preferred API is *TestSuite*. The older TestCase API is being slowly +++deprecated and refactored away. +++ +++So please be aware of the different definitions of the terms: +++ +++ +++Meaning | GoogleTest Term | [ISTQB](http://www.istqb.org/) Term +++:----------------------------------------------------------------------------------- | :---------------------- | :---------------------------------- +++Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case][istqb test case] +++ +++ +++[istqb test case]: http://glossary.istqb.org/en/search/test%20case +++[istqb test suite]: http://glossary.istqb.org/en/search/test%20suite +++ +++## Basic Concepts +++ +++When using GoogleTest, you start by writing *assertions*, which are statements +++that check whether a condition is true. An assertion's result can be *success*, +++*nonfatal failure*, or *fatal failure*. If a fatal failure occurs, it aborts the +++current function; otherwise the program continues normally. +++ +++*Tests* use assertions to verify the tested code's behavior. If a test crashes +++or has a failed assertion, then it *fails*; otherwise it *succeeds*. +++ +++A *test suite* contains one or many tests. You should group your tests into test +++suites that reflect the structure of the tested code. When multiple tests in a +++test suite need to share common objects and subroutines, you can put them into a +++*test fixture* class. +++ +++A *test program* can contain multiple test suites. +++ +++We'll now explain how to write a test program, starting at the individual +++assertion level and building up to tests and test suites. +++ +++## Assertions +++ +++GoogleTest assertions are macros that resemble function calls. You test a class +++or function by making assertions about its behavior. When an assertion fails, +++GoogleTest prints the assertion's source file and line number location, along +++with a failure message. You may also supply a custom failure message which will +++be appended to GoogleTest's message. +++ +++The assertions come in pairs that test the same thing but have different effects +++on the current function. `ASSERT_*` versions generate fatal failures when they +++fail, and **abort the current function**. `EXPECT_*` versions generate nonfatal +++failures, which don't abort the current function. Usually `EXPECT_*` are +++preferred, as they allow more than one failure to be reported in a test. +++However, you should use `ASSERT_*` if it doesn't make sense to continue when the +++assertion in question fails. +++ +++Since a failed `ASSERT_*` returns from the current function immediately, +++possibly skipping clean-up code that comes after it, it may cause a space leak. +++Depending on the nature of the leak, it may or may not be worth fixing - so keep +++this in mind if you get a heap checker error in addition to assertion errors. +++ +++To provide a custom failure message, simply stream it into the macro using the +++`<<` operator or a sequence of such operators. See the following example, using +++the [`ASSERT_EQ` and `EXPECT_EQ`](reference/assertions.md#EXPECT_EQ) macros to +++verify value equality: +++ +++```c++ +++ASSERT_EQ(x.size(), y.size()) << "Vectors x and y are of unequal length"; +++ +++for (int i = 0; i < x.size(); ++i) { +++ EXPECT_EQ(x[i], y[i]) << "Vectors x and y differ at index " << i; +++} +++``` +++ +++Anything that can be streamed to an `ostream` can be streamed to an assertion +++macro--in particular, C strings and `string` objects. If a wide string +++(`wchar_t*`, `TCHAR*` in `UNICODE` mode on Windows, or `std::wstring`) is +++streamed to an assertion, it will be translated to UTF-8 when printed. +++ +++GoogleTest provides a collection of assertions for verifying the behavior of +++your code in various ways. You can check Boolean conditions, compare values +++based on relational operators, verify string values, floating-point values, and +++much more. There are even assertions that enable you to verify more complex +++states by providing custom predicates. For the complete list of assertions +++provided by GoogleTest, see the [Assertions Reference](reference/assertions.md). +++ +++## Simple Tests +++ +++To create a test: +++ +++1. Use the `TEST()` macro to define and name a test function. These are +++ ordinary C++ functions that don't return a value. +++2. In this function, along with any valid C++ statements you want to include, +++ use the various GoogleTest assertions to check values. +++3. The test's result is determined by the assertions; if any assertion in the +++ test fails (either fatally or non-fatally), or if the test crashes, the +++ entire test fails. Otherwise, it succeeds. +++ +++```c++ +++TEST(TestSuiteName, TestName) { +++ ... test body ... +++} +++``` +++ +++`TEST()` arguments go from general to specific. The *first* argument is the name +++of the test suite, and the *second* argument is the test's name within the test +++suite. Both names must be valid C++ identifiers, and they should not contain any +++underscores (`_`). A test's *full name* consists of its containing test suite +++and its individual name. Tests from different test suites can have the same +++individual name. +++ +++For example, let's take a simple integer function: +++ +++```c++ +++int Factorial(int n); // Returns the factorial of n +++``` +++ +++A test suite for this function might look like: +++ +++```c++ +++// Tests factorial of 0. +++TEST(FactorialTest, HandlesZeroInput) { +++ EXPECT_EQ(Factorial(0), 1); +++} +++ +++// Tests factorial of positive numbers. +++TEST(FactorialTest, HandlesPositiveInput) { +++ EXPECT_EQ(Factorial(1), 1); +++ EXPECT_EQ(Factorial(2), 2); +++ EXPECT_EQ(Factorial(3), 6); +++ EXPECT_EQ(Factorial(8), 40320); +++} +++``` +++ +++GoogleTest groups the test results by test suites, so logically related tests +++should be in the same test suite; in other words, the first argument to their +++`TEST()` should be the same. In the above example, we have two tests, +++`HandlesZeroInput` and `HandlesPositiveInput`, that belong to the same test +++suite `FactorialTest`. +++ +++When naming your test suites and tests, you should follow the same convention as +++for +++[naming functions and classes](https://google.github.io/styleguide/cppguide.html#Function_Names). +++ +++**Availability**: Linux, Windows, Mac. +++ +++## Test Fixtures: Using the Same Data Configuration for Multiple Tests {#same-data-multiple-tests} +++ +++If you find yourself writing two or more tests that operate on similar data, you +++can use a *test fixture*. This allows you to reuse the same configuration of +++objects for several different tests. +++ +++To create a fixture: +++ +++1. Derive a class from `::testing::Test` . Start its body with `protected:`, as +++ we'll want to access fixture members from sub-classes. +++2. Inside the class, declare any objects you plan to use. +++3. If necessary, write a default constructor or `SetUp()` function to prepare +++ the objects for each test. A common mistake is to spell `SetUp()` as +++ **`Setup()`** with a small `u` - Use `override` in C++11 to make sure you +++ spelled it correctly. +++4. If necessary, write a destructor or `TearDown()` function to release any +++ resources you allocated in `SetUp()` . To learn when you should use the +++ constructor/destructor and when you should use `SetUp()/TearDown()`, read +++ the [FAQ](faq.md#CtorVsSetUp). +++5. If needed, define subroutines for your tests to share. +++ +++When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to +++access objects and subroutines in the test fixture: +++ +++```c++ +++TEST_F(TestFixtureClassName, TestName) { +++ ... test body ... +++} +++``` +++ +++Unlike `TEST()`, in `TEST_F()` the first argument must be the name of the test +++fixture class. (`_F` stands for "Fixture"). No test suite name is specified for +++this macro. +++ +++Unfortunately, the C++ macro system does not allow us to create a single macro +++that can handle both types of tests. Using the wrong macro causes a compiler +++error. +++ +++Also, you must first define a test fixture class before using it in a +++`TEST_F()`, or you'll get the compiler error "`virtual outside class +++declaration`". +++ +++For each test defined with `TEST_F()`, GoogleTest will create a *fresh* test +++fixture at runtime, immediately initialize it via `SetUp()`, run the test, clean +++up by calling `TearDown()`, and then delete the test fixture. Note that +++different tests in the same test suite have different test fixture objects, and +++GoogleTest always deletes a test fixture before it creates the next one. +++GoogleTest does **not** reuse the same test fixture for multiple tests. Any +++changes one test makes to the fixture do not affect other tests. +++ +++As an example, let's write tests for a FIFO queue class named `Queue`, which has +++the following interface: +++ +++```c++ +++template // E is the element type. +++class Queue { +++ public: +++ Queue(); +++ void Enqueue(const E& element); +++ E* Dequeue(); // Returns NULL if the queue is empty. +++ size_t size() const; +++ ... +++}; +++``` +++ +++First, define a fixture class. By convention, you should give it the name +++`FooTest` where `Foo` is the class being tested. +++ +++```c++ +++class QueueTest : public ::testing::Test { +++ protected: +++ void SetUp() override { +++ // q0_ remains empty +++ q1_.Enqueue(1); +++ q2_.Enqueue(2); +++ q2_.Enqueue(3); +++ } +++ +++ // void TearDown() override {} +++ +++ Queue q0_; +++ Queue q1_; +++ Queue q2_; +++}; +++``` +++ +++In this case, `TearDown()` is not needed since we don't have to clean up after +++each test, other than what's already done by the destructor. +++ +++Now we'll write tests using `TEST_F()` and this fixture. +++ +++```c++ +++TEST_F(QueueTest, IsEmptyInitially) { +++ EXPECT_EQ(q0_.size(), 0); +++} +++ +++TEST_F(QueueTest, DequeueWorks) { +++ int* n = q0_.Dequeue(); +++ EXPECT_EQ(n, nullptr); +++ +++ n = q1_.Dequeue(); +++ ASSERT_NE(n, nullptr); +++ EXPECT_EQ(*n, 1); +++ EXPECT_EQ(q1_.size(), 0); +++ delete n; +++ +++ n = q2_.Dequeue(); +++ ASSERT_NE(n, nullptr); +++ EXPECT_EQ(*n, 2); +++ EXPECT_EQ(q2_.size(), 1); +++ delete n; +++} +++``` +++ +++The above uses both `ASSERT_*` and `EXPECT_*` assertions. The rule of thumb is +++to use `EXPECT_*` when you want the test to continue to reveal more errors after +++the assertion failure, and use `ASSERT_*` when continuing after failure doesn't +++make sense. For example, the second assertion in the `Dequeue` test is +++`ASSERT_NE(n, nullptr)`, as we need to dereference the pointer `n` later, which +++would lead to a segfault when `n` is `NULL`. +++ +++When these tests run, the following happens: +++ +++1. GoogleTest constructs a `QueueTest` object (let's call it `t1`). +++2. `t1.SetUp()` initializes `t1`. +++3. The first test (`IsEmptyInitially`) runs on `t1`. +++4. `t1.TearDown()` cleans up after the test finishes. +++5. `t1` is destructed. +++6. The above steps are repeated on another `QueueTest` object, this time +++ running the `DequeueWorks` test. +++ +++**Availability**: Linux, Windows, Mac. +++ +++## Invoking the Tests +++ +++`TEST()` and `TEST_F()` implicitly register their tests with GoogleTest. So, +++unlike with many other C++ testing frameworks, you don't have to re-list all +++your defined tests in order to run them. +++ +++After defining your tests, you can run them with `RUN_ALL_TESTS()`, which +++returns `0` if all the tests are successful, or `1` otherwise. Note that +++`RUN_ALL_TESTS()` runs *all tests* in your link unit--they can be from different +++test suites, or even different source files. +++ +++When invoked, the `RUN_ALL_TESTS()` macro: +++ +++* Saves the state of all GoogleTest flags. +++ +++* Creates a test fixture object for the first test. +++ +++* Initializes it via `SetUp()`. +++ +++* Runs the test on the fixture object. +++ +++* Cleans up the fixture via `TearDown()`. +++ +++* Deletes the fixture. +++ +++* Restores the state of all GoogleTest flags. +++ +++* Repeats the above steps for the next test, until all tests have run. +++ +++If a fatal failure happens the subsequent steps will be skipped. +++ +++{: .callout .important} +++> IMPORTANT: You must **not** ignore the return value of `RUN_ALL_TESTS()`, or +++> you will get a compiler error. The rationale for this design is that the +++> automated testing service determines whether a test has passed based on its +++> exit code, not on its stdout/stderr output; thus your `main()` function must +++> return the value of `RUN_ALL_TESTS()`. +++> +++> Also, you should call `RUN_ALL_TESTS()` only **once**. Calling it more than +++> once conflicts with some advanced GoogleTest features (e.g., thread-safe +++> [death tests](advanced.md#death-tests)) and thus is not supported. +++ +++**Availability**: Linux, Windows, Mac. +++ +++## Writing the main() Function +++ +++Most users should *not* need to write their own `main` function and instead link +++with `gtest_main` (as opposed to with `gtest`), which defines a suitable entry +++point. See the end of this section for details. The remainder of this section +++should only apply when you need to do something custom before the tests run that +++cannot be expressed within the framework of fixtures and test suites. +++ +++If you write your own `main` function, it should return the value of +++`RUN_ALL_TESTS()`. +++ +++You can start from this boilerplate: +++ +++```c++ +++#include "this/package/foo.h" +++ +++#include +++ +++namespace my { +++namespace project { +++namespace { +++ +++// The fixture for testing class Foo. +++class FooTest : public ::testing::Test { +++ protected: +++ // You can remove any or all of the following functions if their bodies would +++ // be empty. +++ +++ FooTest() { +++ // You can do set-up work for each test here. +++ } +++ +++ ~FooTest() override { +++ // You can do clean-up work that doesn't throw exceptions here. +++ } +++ +++ // If the constructor and destructor are not enough for setting up +++ // and cleaning up each test, you can define the following methods: +++ +++ void SetUp() override { +++ // Code here will be called immediately after the constructor (right +++ // before each test). +++ } +++ +++ void TearDown() override { +++ // Code here will be called immediately after each test (right +++ // before the destructor). +++ } +++ +++ // Class members declared here can be used by all tests in the test suite +++ // for Foo. +++}; +++ +++// Tests that the Foo::Bar() method does Abc. +++TEST_F(FooTest, MethodBarDoesAbc) { +++ const std::string input_filepath = "this/package/testdata/myinputfile.dat"; +++ const std::string output_filepath = "this/package/testdata/myoutputfile.dat"; +++ Foo f; +++ EXPECT_EQ(f.Bar(input_filepath, output_filepath), 0); +++} +++ +++// Tests that Foo does Xyz. +++TEST_F(FooTest, DoesXyz) { +++ // Exercises the Xyz feature of Foo. +++} +++ +++} // namespace +++} // namespace project +++} // namespace my +++ +++int main(int argc, char **argv) { +++ ::testing::InitGoogleTest(&argc, argv); +++ return RUN_ALL_TESTS(); +++} +++``` +++ +++The `::testing::InitGoogleTest()` function parses the command line for +++GoogleTest flags, and removes all recognized flags. This allows the user to +++control a test program's behavior via various flags, which we'll cover in the +++[AdvancedGuide](advanced.md). You **must** call this function before calling +++`RUN_ALL_TESTS()`, or the flags won't be properly initialized. +++ +++On Windows, `InitGoogleTest()` also works with wide strings, so it can be used +++in programs compiled in `UNICODE` mode as well. +++ +++But maybe you think that writing all those `main` functions is too much work? We +++agree with you completely, and that's why Google Test provides a basic +++implementation of main(). If it fits your needs, then just link your test with +++the `gtest_main` library and you are good to go. +++ +++{: .callout .note} +++NOTE: `ParseGUnitFlags()` is deprecated in favor of `InitGoogleTest()`. +++ +++## Known Limitations +++ +++* Google Test is designed to be thread-safe. The implementation is thread-safe +++ on systems where the `pthreads` library is available. It is currently +++ *unsafe* to use Google Test assertions from two threads concurrently on +++ other systems (e.g. Windows). In most tests this is not an issue as usually +++ the assertions are done in the main thread. If you want to help, you can +++ volunteer to implement the necessary synchronization primitives in +++ `gtest-port.h` for your platform. diff --cc googletest/docs/quickstart-bazel.md index 000000000,000000000,000000000..4f693dbe7 new file mode 100644 --- /dev/null +++ b/googletest/docs/quickstart-bazel.md @@@@ -1,0 -1,0 -1,0 +1,153 @@@@ +++# Quickstart: Building with Bazel +++ +++This tutorial aims to get you up and running with GoogleTest using the Bazel +++build system. If you're using GoogleTest for the first time or need a refresher, +++we recommend this tutorial as a starting point. +++ +++## Prerequisites +++ +++To complete this tutorial, you'll need: +++ +++* A compatible operating system (e.g. Linux, macOS, Windows). +++* A compatible C++ compiler that supports at least C++14. +++* [Bazel](https://bazel.build/), the preferred build system used by the +++ GoogleTest team. +++ +++See [Supported Platforms](platforms.md) for more information about platforms +++compatible with GoogleTest. +++ +++If you don't already have Bazel installed, see the +++[Bazel installation guide](https://bazel.build/install). +++ +++{: .callout .note} Note: The terminal commands in this tutorial show a Unix +++shell prompt, but the commands work on the Windows command line as well. +++ +++## Set up a Bazel workspace +++ +++A +++[Bazel workspace](https://docs.bazel.build/versions/main/build-ref.html#workspace) +++is a directory on your filesystem that you use to manage source files for the +++software you want to build. Each workspace directory has a text file named +++`WORKSPACE` which may be empty, or may contain references to external +++dependencies required to build the outputs. +++ +++First, create a directory for your workspace: +++ +++``` +++$ mkdir my_workspace && cd my_workspace +++``` +++ +++Next, you’ll create the `WORKSPACE` file to specify dependencies. A common and +++recommended way to depend on GoogleTest is to use a +++[Bazel external dependency](https://docs.bazel.build/versions/main/external.html) +++via the +++[`http_archive` rule](https://docs.bazel.build/versions/main/repo/http.html#http_archive). +++To do this, in the root directory of your workspace (`my_workspace/`), create a +++file named `WORKSPACE` with the following contents: +++ +++``` +++load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +++ +++http_archive( +++ name = "com_google_googletest", +++ urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"], +++ strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015", +++) +++``` +++ +++The above configuration declares a dependency on GoogleTest which is downloaded +++as a ZIP archive from GitHub. In the above example, +++`5ab508a01f9eb089207ee87fd547d290da39d015` is the Git commit hash of the +++GoogleTest version to use; we recommend updating the hash often to point to the +++latest version. Use a recent hash on the `main` branch. +++ +++Now you're ready to build C++ code that uses GoogleTest. +++ +++## Create and run a binary +++ +++With your Bazel workspace set up, you can now use GoogleTest code within your +++own project. +++ +++As an example, create a file named `hello_test.cc` in your `my_workspace` +++directory with the following contents: +++ +++```cpp +++#include +++ +++// Demonstrate some basic assertions. +++TEST(HelloTest, BasicAssertions) { +++ // Expect two strings not to be equal. +++ EXPECT_STRNE("hello", "world"); +++ // Expect equality. +++ EXPECT_EQ(7 * 6, 42); +++} +++``` +++ +++GoogleTest provides [assertions](primer.md#assertions) that you use to test the +++behavior of your code. The above sample includes the main GoogleTest header file +++and demonstrates some basic assertions. +++ +++To build the code, create a file named `BUILD` in the same directory with the +++following contents: +++ +++``` +++cc_test( +++ name = "hello_test", +++ size = "small", +++ srcs = ["hello_test.cc"], +++ deps = ["@com_google_googletest//:gtest_main"], +++) +++``` +++ +++This `cc_test` rule declares the C++ test binary you want to build, and links to +++GoogleTest (`//:gtest_main`) using the prefix you specified in the `WORKSPACE` +++file (`@com_google_googletest`). For more information about Bazel `BUILD` files, +++see the +++[Bazel C++ Tutorial](https://docs.bazel.build/versions/main/tutorial/cpp.html). +++ +++{: .callout .note} +++NOTE: In the example below, we assume Clang or GCC and set `--cxxopt=-std=c++14` +++to ensure that GoogleTest is compiled as C++14 instead of the compiler's default +++setting (which could be C++11). For MSVC, the equivalent would be +++`--cxxopt=/std:c++14`. See [Supported Platforms](platforms.md) for more details +++on supported language versions. +++ +++Now you can build and run your test: +++ +++
+++my_workspace$ bazel test --cxxopt=-std=c++14 --test_output=all //:hello_test
+++INFO: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
+++INFO: Found 1 test target...
+++INFO: From Testing //:hello_test:
+++==================== Test output for //:hello_test:
+++Running main() from gmock_main.cc
+++[==========] Running 1 test from 1 test suite.
+++[----------] Global test environment set-up.
+++[----------] 1 test from HelloTest
+++[ RUN      ] HelloTest.BasicAssertions
+++[       OK ] HelloTest.BasicAssertions (0 ms)
+++[----------] 1 test from HelloTest (0 ms total)
+++
+++[----------] Global test environment tear-down
+++[==========] 1 test from 1 test suite ran. (0 ms total)
+++[  PASSED  ] 1 test.
+++================================================================================
+++Target //:hello_test up-to-date:
+++  bazel-bin/hello_test
+++INFO: Elapsed time: 4.190s, Critical Path: 3.05s
+++INFO: 27 processes: 8 internal, 19 linux-sandbox.
+++INFO: Build completed successfully, 27 total actions
+++//:hello_test                                                     PASSED in 0.1s
+++
+++INFO: Build completed successfully, 27 total actions
+++
+++ +++Congratulations! You've successfully built and run a test binary using +++GoogleTest. +++ +++## Next steps +++ +++* [Check out the Primer](primer.md) to start learning how to write simple +++ tests. +++* [See the code samples](samples.md) for more examples showing how to use a +++ variety of GoogleTest features. diff --cc googletest/docs/quickstart-cmake.md index 000000000,000000000,000000000..4e422b74f new file mode 100644 --- /dev/null +++ b/googletest/docs/quickstart-cmake.md @@@@ -1,0 -1,0 -1,0 +1,157 @@@@ +++# Quickstart: Building with CMake +++ +++This tutorial aims to get you up and running with GoogleTest using CMake. If +++you're using GoogleTest for the first time or need a refresher, we recommend +++this tutorial as a starting point. If your project uses Bazel, see the +++[Quickstart for Bazel](quickstart-bazel.md) instead. +++ +++## Prerequisites +++ +++To complete this tutorial, you'll need: +++ +++* A compatible operating system (e.g. Linux, macOS, Windows). +++* A compatible C++ compiler that supports at least C++14. +++* [CMake](https://cmake.org/) and a compatible build tool for building the +++ project. +++ * Compatible build tools include +++ [Make](https://www.gnu.org/software/make/), +++ [Ninja](https://ninja-build.org/), and others - see +++ [CMake Generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) +++ for more information. +++ +++See [Supported Platforms](platforms.md) for more information about platforms +++compatible with GoogleTest. +++ +++If you don't already have CMake installed, see the +++[CMake installation guide](https://cmake.org/install). +++ +++{: .callout .note} +++Note: The terminal commands in this tutorial show a Unix shell prompt, but the +++commands work on the Windows command line as well. +++ +++## Set up a project +++ +++CMake uses a file named `CMakeLists.txt` to configure the build system for a +++project. You'll use this file to set up your project and declare a dependency on +++GoogleTest. +++ +++First, create a directory for your project: +++ +++``` +++$ mkdir my_project && cd my_project +++``` +++ +++Next, you'll create the `CMakeLists.txt` file and declare a dependency on +++GoogleTest. There are many ways to express dependencies in the CMake ecosystem; +++in this quickstart, you'll use the +++[`FetchContent` CMake module](https://cmake.org/cmake/help/latest/module/FetchContent.html). +++To do this, in your project directory (`my_project`), create a file named +++`CMakeLists.txt` with the following contents: +++ +++```cmake +++cmake_minimum_required(VERSION 3.14) +++project(my_project) +++ +++# GoogleTest requires at least C++14 +++set(CMAKE_CXX_STANDARD 14) +++set(CMAKE_CXX_STANDARD_REQUIRED ON) +++ +++include(FetchContent) +++FetchContent_Declare( +++ googletest +++ URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip +++) +++# For Windows: Prevent overriding the parent project's compiler/linker settings +++set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +++FetchContent_MakeAvailable(googletest) +++``` +++ +++The above configuration declares a dependency on GoogleTest which is downloaded +++from GitHub. In the above example, `03597a01ee50ed33e9dfd640b249b4be3799d395` is +++the Git commit hash of the GoogleTest version to use; we recommend updating the +++hash often to point to the latest version. +++ +++For more information about how to create `CMakeLists.txt` files, see the +++[CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html). +++ +++## Create and run a binary +++ +++With GoogleTest declared as a dependency, you can use GoogleTest code within +++your own project. +++ +++As an example, create a file named `hello_test.cc` in your `my_project` +++directory with the following contents: +++ +++```cpp +++#include +++ +++// Demonstrate some basic assertions. +++TEST(HelloTest, BasicAssertions) { +++ // Expect two strings not to be equal. +++ EXPECT_STRNE("hello", "world"); +++ // Expect equality. +++ EXPECT_EQ(7 * 6, 42); +++} +++``` +++ +++GoogleTest provides [assertions](primer.md#assertions) that you use to test the +++behavior of your code. The above sample includes the main GoogleTest header file +++and demonstrates some basic assertions. +++ +++To build the code, add the following to the end of your `CMakeLists.txt` file: +++ +++```cmake +++enable_testing() +++ +++add_executable( +++ hello_test +++ hello_test.cc +++) +++target_link_libraries( +++ hello_test +++ GTest::gtest_main +++) +++ +++include(GoogleTest) +++gtest_discover_tests(hello_test) +++``` +++ +++The above configuration enables testing in CMake, declares the C++ test binary +++you want to build (`hello_test`), and links it to GoogleTest (`gtest_main`). The +++last two lines enable CMake's test runner to discover the tests included in the +++binary, using the +++[`GoogleTest` CMake module](https://cmake.org/cmake/help/git-stage/module/GoogleTest.html). +++ +++Now you can build and run your test: +++ +++
+++my_project$ cmake -S . -B build
+++-- The C compiler identification is GNU 10.2.1
+++-- The CXX compiler identification is GNU 10.2.1
+++...
+++-- Build files have been written to: .../my_project/build
+++
+++my_project$ cmake --build build
+++Scanning dependencies of target gtest
+++...
+++[100%] Built target gmock_main
+++
+++my_project$ cd build && ctest
+++Test project .../my_project/build
+++    Start 1: HelloTest.BasicAssertions
+++1/1 Test #1: HelloTest.BasicAssertions ........   Passed    0.00 sec
+++
+++100% tests passed, 0 tests failed out of 1
+++
+++Total Test time (real) =   0.01 sec
+++
+++ +++Congratulations! You've successfully built and run a test binary using +++GoogleTest. +++ +++## Next steps +++ +++* [Check out the Primer](primer.md) to start learning how to write simple +++ tests. +++* [See the code samples](samples.md) for more examples showing how to use a +++ variety of GoogleTest features. diff --cc googletest/docs/reference/actions.md index 000000000,000000000,000000000..ab81a129e new file mode 100644 --- /dev/null +++ b/googletest/docs/reference/actions.md @@@@ -1,0 -1,0 -1,0 +1,115 @@@@ +++# Actions Reference +++ +++[**Actions**](../gmock_for_dummies.md#actions-what-should-it-do) specify what a +++mock function should do when invoked. This page lists the built-in actions +++provided by GoogleTest. All actions are defined in the `::testing` namespace. +++ +++## Returning a Value +++ +++| Action | Description | +++| :-------------------------------- | :-------------------------------------------- | +++| `Return()` | Return from a `void` mock function. | +++| `Return(value)` | Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type at the time the expectation is set, not when the action is executed. | +++| `ReturnArg()` | Return the `N`-th (0-based) argument. | +++| `ReturnNew(a1, ..., ak)` | Return `new T(a1, ..., ak)`; a different object is created each time. | +++| `ReturnNull()` | Return a null pointer. | +++| `ReturnPointee(ptr)` | Return the value pointed to by `ptr`. | +++| `ReturnRef(variable)` | Return a reference to `variable`. | +++| `ReturnRefOfCopy(value)` | Return a reference to a copy of `value`; the copy lives as long as the action. | +++| `ReturnRoundRobin({a1, ..., ak})` | Each call will return the next `ai` in the list, starting at the beginning when the end of the list is reached. | +++ +++## Side Effects +++ +++| Action | Description | +++| :--------------------------------- | :-------------------------------------- | +++| `Assign(&variable, value)` | Assign `value` to variable. | +++| `DeleteArg()` | Delete the `N`-th (0-based) argument, which must be a pointer. | +++| `SaveArg(pointer)` | Save the `N`-th (0-based) argument to `*pointer`. | +++| `SaveArgPointee(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. | +++| `SetArgReferee(value)` | Assign `value` to the variable referenced by the `N`-th (0-based) argument. | +++| `SetArgPointee(value)` | Assign `value` to the variable pointed by the `N`-th (0-based) argument. | +++| `SetArgumentPointee(value)` | Same as `SetArgPointee(value)`. Deprecated. Will be removed in v1.7.0. | +++| `SetArrayArgument(first, last)` | Copies the elements in source range [`first`, `last`) to the array pointed to by the `N`-th (0-based) argument, which can be either a pointer or an iterator. The action does not take ownership of the elements in the source range. | +++| `SetErrnoAndReturn(error, value)` | Set `errno` to `error` and return `value`. | +++| `Throw(exception)` | Throws the given exception, which can be any copyable value. Available since v1.1.0. | +++ +++## Using a Function, Functor, or Lambda as an Action +++ +++In the following, by "callable" we mean a free function, `std::function`, +++functor, or lambda. +++ +++| Action | Description | +++| :---------------------------------- | :------------------------------------- | +++| `f` | Invoke `f` with the arguments passed to the mock function, where `f` is a callable. | +++| `Invoke(f)` | Invoke `f` with the arguments passed to the mock function, where `f` can be a global/static function or a functor. | +++| `Invoke(object_pointer, &class::method)` | Invoke the method on the object with the arguments passed to the mock function. | +++| `InvokeWithoutArgs(f)` | Invoke `f`, which can be a global/static function or a functor. `f` must take no arguments. | +++| `InvokeWithoutArgs(object_pointer, &class::method)` | Invoke the method on the object, which takes no arguments. | +++| `InvokeArgument(arg1, arg2, ..., argk)` | Invoke the mock function's `N`-th (0-based) argument, which must be a function or a functor, with the `k` arguments. | +++ +++The return value of the invoked function is used as the return value of the +++action. +++ +++When defining a callable to be used with `Invoke*()`, you can declare any unused +++parameters as `Unused`: +++ +++```cpp +++using ::testing::Invoke; +++double Distance(Unused, double x, double y) { return sqrt(x*x + y*y); } +++... +++EXPECT_CALL(mock, Foo("Hi", _, _)).WillOnce(Invoke(Distance)); +++``` +++ +++`Invoke(callback)` and `InvokeWithoutArgs(callback)` take ownership of +++`callback`, which must be permanent. The type of `callback` must be a base +++callback type instead of a derived one, e.g. +++ +++```cpp +++ BlockingClosure* done = new BlockingClosure; +++ ... Invoke(done) ...; // This won't compile! +++ +++ Closure* done2 = new BlockingClosure; +++ ... Invoke(done2) ...; // This works. +++``` +++ +++In `InvokeArgument(...)`, if an argument needs to be passed by reference, +++wrap it inside `std::ref()`. For example, +++ +++```cpp +++using ::testing::InvokeArgument; +++... +++InvokeArgument<2>(5, string("Hi"), std::ref(foo)) +++``` +++ +++calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by +++value, and `foo` by reference. +++ +++## Default Action +++ +++| Action | Description | +++| :------------ | :----------------------------------------------------- | +++| `DoDefault()` | Do the default action (specified by `ON_CALL()` or the built-in one). | +++ +++{: .callout .note} +++**Note:** due to technical reasons, `DoDefault()` cannot be used inside a +++composite action - trying to do so will result in a run-time error. +++ +++## Composite Actions +++ +++| Action | Description | +++| :----------------------------- | :------------------------------------------ | +++| `DoAll(a1, a2, ..., an)` | Do all actions `a1` to `an` and return the result of `an` in each invocation. The first `n - 1` sub-actions must return void and will receive a readonly view of the arguments. | +++| `IgnoreResult(a)` | Perform action `a` and ignore its result. `a` must not return void. | +++| `WithArg(a)` | Pass the `N`-th (0-based) argument of the mock function to action `a` and perform it. | +++| `WithArgs(a)` | Pass the selected (0-based) arguments of the mock function to action `a` and perform it. | +++| `WithoutArgs(a)` | Perform action `a` without any arguments. | +++ +++## Defining Actions +++ +++| Macro | Description | +++| :--------------------------------- | :-------------------------------------- | +++| `ACTION(Sum) { return arg0 + arg1; }` | Defines an action `Sum()` to return the sum of the mock function's argument #0 and #1. | +++| `ACTION_P(Plus, n) { return arg0 + n; }` | Defines an action `Plus(n)` to return the sum of the mock function's argument #0 and `n`. | +++| `ACTION_Pk(Foo, p1, ..., pk) { statements; }` | Defines a parameterized action `Foo(p1, ..., pk)` to execute the given `statements`. | +++ +++The `ACTION*` macros cannot be used inside a function or class. diff --cc googletest/docs/reference/assertions.md index 000000000,000000000,000000000..aa1dbc04b new file mode 100644 --- /dev/null +++ b/googletest/docs/reference/assertions.md @@@@ -1,0 -1,0 -1,0 +1,633 @@@@ +++# Assertions Reference +++ +++This page lists the assertion macros provided by GoogleTest for verifying code +++behavior. To use them, include the header `gtest/gtest.h`. +++ +++The majority of the macros listed below come as a pair with an `EXPECT_` variant +++and an `ASSERT_` variant. Upon failure, `EXPECT_` macros generate nonfatal +++failures and allow the current function to continue running, while `ASSERT_` +++macros generate fatal failures and abort the current function. +++ +++All assertion macros support streaming a custom failure message into them with +++the `<<` operator, for example: +++ +++```cpp +++EXPECT_TRUE(my_condition) << "My condition is not true"; +++``` +++ +++Anything that can be streamed to an `ostream` can be streamed to an assertion +++macro—in particular, C strings and string objects. If a wide string (`wchar_t*`, +++`TCHAR*` in `UNICODE` mode on Windows, or `std::wstring`) is streamed to an +++assertion, it will be translated to UTF-8 when printed. +++ +++## Explicit Success and Failure {#success-failure} +++ +++The assertions in this section generate a success or failure directly instead of +++testing a value or expression. These are useful when control flow, rather than a +++Boolean expression, determines the test's success or failure, as shown by the +++following example: +++ +++```c++ +++switch(expression) { +++ case 1: +++ ... some checks ... +++ case 2: +++ ... some other checks ... +++ default: +++ FAIL() << "We shouldn't get here."; +++} +++``` +++ +++### SUCCEED {#SUCCEED} +++ +++`SUCCEED()` +++ +++Generates a success. This *does not* make the overall test succeed. A test is +++considered successful only if none of its assertions fail during its execution. +++ +++The `SUCCEED` assertion is purely documentary and currently doesn't generate any +++user-visible output. However, we may add `SUCCEED` messages to GoogleTest output +++in the future. +++ +++### FAIL {#FAIL} +++ +++`FAIL()` +++ +++Generates a fatal failure, which returns from the current function. +++ +++Can only be used in functions that return `void`. See +++[Assertion Placement](../advanced.md#assertion-placement) for more information. +++ +++### ADD_FAILURE {#ADD_FAILURE} +++ +++`ADD_FAILURE()` +++ +++Generates a nonfatal failure, which allows the current function to continue +++running. +++ +++### ADD_FAILURE_AT {#ADD_FAILURE_AT} +++ +++`ADD_FAILURE_AT(`*`file_path`*`,`*`line_number`*`)` +++ +++Generates a nonfatal failure at the file and line number specified. +++ +++## Generalized Assertion {#generalized} +++ +++The following assertion allows [matchers](matchers.md) to be used to verify +++values. +++ +++### EXPECT_THAT {#EXPECT_THAT} +++ +++`EXPECT_THAT(`*`value`*`,`*`matcher`*`)` \ +++`ASSERT_THAT(`*`value`*`,`*`matcher`*`)` +++ +++Verifies that *`value`* matches the [matcher](matchers.md) *`matcher`*. +++ +++For example, the following code verifies that the string `value1` starts with +++`"Hello"`, `value2` matches a regular expression, and `value3` is between 5 and +++10: +++ +++```cpp +++#include +++ +++using ::testing::AllOf; +++using ::testing::Gt; +++using ::testing::Lt; +++using ::testing::MatchesRegex; +++using ::testing::StartsWith; +++ +++... +++EXPECT_THAT(value1, StartsWith("Hello")); +++EXPECT_THAT(value2, MatchesRegex("Line \\d+")); +++ASSERT_THAT(value3, AllOf(Gt(5), Lt(10))); +++``` +++ +++Matchers enable assertions of this form to read like English and generate +++informative failure messages. For example, if the above assertion on `value1` +++fails, the resulting message will be similar to the following: +++ +++``` +++Value of: value1 +++ Actual: "Hi, world!" +++Expected: starts with "Hello" +++``` +++ +++GoogleTest provides a built-in library of matchers—see the +++[Matchers Reference](matchers.md). It is also possible to write your own +++matchers—see [Writing New Matchers Quickly](../gmock_cook_book.md#NewMatchers). +++The use of matchers makes `EXPECT_THAT` a powerful, extensible assertion. +++ +++*The idea for this assertion was borrowed from Joe Walnes' Hamcrest project, +++which adds `assertThat()` to JUnit.* +++ +++## Boolean Conditions {#boolean} +++ +++The following assertions test Boolean conditions. +++ +++### EXPECT_TRUE {#EXPECT_TRUE} +++ +++`EXPECT_TRUE(`*`condition`*`)` \ +++`ASSERT_TRUE(`*`condition`*`)` +++ +++Verifies that *`condition`* is true. +++ +++### EXPECT_FALSE {#EXPECT_FALSE} +++ +++`EXPECT_FALSE(`*`condition`*`)` \ +++`ASSERT_FALSE(`*`condition`*`)` +++ +++Verifies that *`condition`* is false. +++ +++## Binary Comparison {#binary-comparison} +++ +++The following assertions compare two values. The value arguments must be +++comparable by the assertion's comparison operator, otherwise a compiler error +++will result. +++ +++If an argument supports the `<<` operator, it will be called to print the +++argument when the assertion fails. Otherwise, GoogleTest will attempt to print +++them in the best way it can—see +++[Teaching GoogleTest How to Print Your Values](../advanced.md#teaching-googletest-how-to-print-your-values). +++ +++Arguments are always evaluated exactly once, so it's OK for the arguments to +++have side effects. However, the argument evaluation order is undefined and +++programs should not depend on any particular argument evaluation order. +++ +++These assertions work with both narrow and wide string objects (`string` and +++`wstring`). +++ +++See also the [Floating-Point Comparison](#floating-point) assertions to compare +++floating-point numbers and avoid problems caused by rounding. +++ +++### EXPECT_EQ {#EXPECT_EQ} +++ +++`EXPECT_EQ(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_EQ(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`==`*`val2`*. +++ +++Does pointer equality on pointers. If used on two C strings, it tests if they +++are in the same memory location, not if they have the same value. Use +++[`EXPECT_STREQ`](#EXPECT_STREQ) to compare C strings (e.g. `const char*`) by +++value. +++ +++When comparing a pointer to `NULL`, use `EXPECT_EQ(`*`ptr`*`, nullptr)` instead +++of `EXPECT_EQ(`*`ptr`*`, NULL)`. +++ +++### EXPECT_NE {#EXPECT_NE} +++ +++`EXPECT_NE(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_NE(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`!=`*`val2`*. +++ +++Does pointer equality on pointers. If used on two C strings, it tests if they +++are in different memory locations, not if they have different values. Use +++[`EXPECT_STRNE`](#EXPECT_STRNE) to compare C strings (e.g. `const char*`) by +++value. +++ +++When comparing a pointer to `NULL`, use `EXPECT_NE(`*`ptr`*`, nullptr)` instead +++of `EXPECT_NE(`*`ptr`*`, NULL)`. +++ +++### EXPECT_LT {#EXPECT_LT} +++ +++`EXPECT_LT(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_LT(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`<`*`val2`*. +++ +++### EXPECT_LE {#EXPECT_LE} +++ +++`EXPECT_LE(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_LE(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`<=`*`val2`*. +++ +++### EXPECT_GT {#EXPECT_GT} +++ +++`EXPECT_GT(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_GT(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`>`*`val2`*. +++ +++### EXPECT_GE {#EXPECT_GE} +++ +++`EXPECT_GE(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_GE(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that *`val1`*`>=`*`val2`*. +++ +++## String Comparison {#c-strings} +++ +++The following assertions compare two **C strings**. To compare two `string` +++objects, use [`EXPECT_EQ`](#EXPECT_EQ) or [`EXPECT_NE`](#EXPECT_NE) instead. +++ +++These assertions also accept wide C strings (`wchar_t*`). If a comparison of two +++wide strings fails, their values will be printed as UTF-8 narrow strings. +++ +++To compare a C string with `NULL`, use `EXPECT_EQ(`*`c_string`*`, nullptr)` or +++`EXPECT_NE(`*`c_string`*`, nullptr)`. +++ +++### EXPECT_STREQ {#EXPECT_STREQ} +++ +++`EXPECT_STREQ(`*`str1`*`,`*`str2`*`)` \ +++`ASSERT_STREQ(`*`str1`*`,`*`str2`*`)` +++ +++Verifies that the two C strings *`str1`* and *`str2`* have the same contents. +++ +++### EXPECT_STRNE {#EXPECT_STRNE} +++ +++`EXPECT_STRNE(`*`str1`*`,`*`str2`*`)` \ +++`ASSERT_STRNE(`*`str1`*`,`*`str2`*`)` +++ +++Verifies that the two C strings *`str1`* and *`str2`* have different contents. +++ +++### EXPECT_STRCASEEQ {#EXPECT_STRCASEEQ} +++ +++`EXPECT_STRCASEEQ(`*`str1`*`,`*`str2`*`)` \ +++`ASSERT_STRCASEEQ(`*`str1`*`,`*`str2`*`)` +++ +++Verifies that the two C strings *`str1`* and *`str2`* have the same contents, +++ignoring case. +++ +++### EXPECT_STRCASENE {#EXPECT_STRCASENE} +++ +++`EXPECT_STRCASENE(`*`str1`*`,`*`str2`*`)` \ +++`ASSERT_STRCASENE(`*`str1`*`,`*`str2`*`)` +++ +++Verifies that the two C strings *`str1`* and *`str2`* have different contents, +++ignoring case. +++ +++## Floating-Point Comparison {#floating-point} +++ +++The following assertions compare two floating-point values. +++ +++Due to rounding errors, it is very unlikely that two floating-point values will +++match exactly, so `EXPECT_EQ` is not suitable. In general, for floating-point +++comparison to make sense, the user needs to carefully choose the error bound. +++ +++GoogleTest also provides assertions that use a default error bound based on +++Units in the Last Place (ULPs). To learn more about ULPs, see the article +++[Comparing Floating Point Numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). +++ +++### EXPECT_FLOAT_EQ {#EXPECT_FLOAT_EQ} +++ +++`EXPECT_FLOAT_EQ(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_FLOAT_EQ(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that the two `float` values *`val1`* and *`val2`* are approximately +++equal, to within 4 ULPs from each other. +++ +++### EXPECT_DOUBLE_EQ {#EXPECT_DOUBLE_EQ} +++ +++`EXPECT_DOUBLE_EQ(`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_DOUBLE_EQ(`*`val1`*`,`*`val2`*`)` +++ +++Verifies that the two `double` values *`val1`* and *`val2`* are approximately +++equal, to within 4 ULPs from each other. +++ +++### EXPECT_NEAR {#EXPECT_NEAR} +++ +++`EXPECT_NEAR(`*`val1`*`,`*`val2`*`,`*`abs_error`*`)` \ +++`ASSERT_NEAR(`*`val1`*`,`*`val2`*`,`*`abs_error`*`)` +++ +++Verifies that the difference between *`val1`* and *`val2`* does not exceed the +++absolute error bound *`abs_error`*. +++ +++## Exception Assertions {#exceptions} +++ +++The following assertions verify that a piece of code throws, or does not throw, +++an exception. Usage requires exceptions to be enabled in the build environment. +++ +++Note that the piece of code under test can be a compound statement, for example: +++ +++```cpp +++EXPECT_NO_THROW({ +++ int n = 5; +++ DoSomething(&n); +++}); +++``` +++ +++### EXPECT_THROW {#EXPECT_THROW} +++ +++`EXPECT_THROW(`*`statement`*`,`*`exception_type`*`)` \ +++`ASSERT_THROW(`*`statement`*`,`*`exception_type`*`)` +++ +++Verifies that *`statement`* throws an exception of type *`exception_type`*. +++ +++### EXPECT_ANY_THROW {#EXPECT_ANY_THROW} +++ +++`EXPECT_ANY_THROW(`*`statement`*`)` \ +++`ASSERT_ANY_THROW(`*`statement`*`)` +++ +++Verifies that *`statement`* throws an exception of any type. +++ +++### EXPECT_NO_THROW {#EXPECT_NO_THROW} +++ +++`EXPECT_NO_THROW(`*`statement`*`)` \ +++`ASSERT_NO_THROW(`*`statement`*`)` +++ +++Verifies that *`statement`* does not throw any exception. +++ +++## Predicate Assertions {#predicates} +++ +++The following assertions enable more complex predicates to be verified while +++printing a more clear failure message than if `EXPECT_TRUE` were used alone. +++ +++### EXPECT_PRED* {#EXPECT_PRED} +++ +++`EXPECT_PRED1(`*`pred`*`,`*`val1`*`)` \ +++`EXPECT_PRED2(`*`pred`*`,`*`val1`*`,`*`val2`*`)` \ +++`EXPECT_PRED3(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \ +++`EXPECT_PRED4(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` \ +++`EXPECT_PRED5(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)` +++ +++`ASSERT_PRED1(`*`pred`*`,`*`val1`*`)` \ +++`ASSERT_PRED2(`*`pred`*`,`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_PRED3(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \ +++`ASSERT_PRED4(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` \ +++`ASSERT_PRED5(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)` +++ +++Verifies that the predicate *`pred`* returns `true` when passed the given values +++as arguments. +++ +++The parameter *`pred`* is a function or functor that accepts as many arguments +++as the corresponding macro accepts values. If *`pred`* returns `true` for the +++given arguments, the assertion succeeds, otherwise the assertion fails. +++ +++When the assertion fails, it prints the value of each argument. Arguments are +++always evaluated exactly once. +++ +++As an example, see the following code: +++ +++```cpp +++// Returns true if m and n have no common divisors except 1. +++bool MutuallyPrime(int m, int n) { ... } +++... +++const int a = 3; +++const int b = 4; +++const int c = 10; +++... +++EXPECT_PRED2(MutuallyPrime, a, b); // Succeeds +++EXPECT_PRED2(MutuallyPrime, b, c); // Fails +++``` +++ +++In the above example, the first assertion succeeds, and the second fails with +++the following message: +++ +++``` +++MutuallyPrime(b, c) is false, where +++b is 4 +++c is 10 +++``` +++ +++Note that if the given predicate is an overloaded function or a function +++template, the assertion macro might not be able to determine which version to +++use, and it might be necessary to explicitly specify the type of the function. +++For example, for a Boolean function `IsPositive()` overloaded to take either a +++single `int` or `double` argument, it would be necessary to write one of the +++following: +++ +++```cpp +++EXPECT_PRED1(static_cast(IsPositive), 5); +++EXPECT_PRED1(static_cast(IsPositive), 3.14); +++``` +++ +++Writing simply `EXPECT_PRED1(IsPositive, 5);` would result in a compiler error. +++Similarly, to use a template function, specify the template arguments: +++ +++```cpp +++template +++bool IsNegative(T x) { +++ return x < 0; +++} +++... +++EXPECT_PRED1(IsNegative, -5); // Must specify type for IsNegative +++``` +++ +++If a template has multiple parameters, wrap the predicate in parentheses so the +++macro arguments are parsed correctly: +++ +++```cpp +++ASSERT_PRED2((MyPredicate), 5, 0); +++``` +++ +++### EXPECT_PRED_FORMAT* {#EXPECT_PRED_FORMAT} +++ +++`EXPECT_PRED_FORMAT1(`*`pred_formatter`*`,`*`val1`*`)` \ +++`EXPECT_PRED_FORMAT2(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`)` \ +++`EXPECT_PRED_FORMAT3(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \ +++`EXPECT_PRED_FORMAT4(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` +++\ +++`EXPECT_PRED_FORMAT5(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)` +++ +++`ASSERT_PRED_FORMAT1(`*`pred_formatter`*`,`*`val1`*`)` \ +++`ASSERT_PRED_FORMAT2(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`)` \ +++`ASSERT_PRED_FORMAT3(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \ +++`ASSERT_PRED_FORMAT4(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` +++\ +++`ASSERT_PRED_FORMAT5(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)` +++ +++Verifies that the predicate *`pred_formatter`* succeeds when passed the given +++values as arguments. +++ +++The parameter *`pred_formatter`* is a *predicate-formatter*, which is a function +++or functor with the signature: +++ +++```cpp +++testing::AssertionResult PredicateFormatter(const char* expr1, +++ const char* expr2, +++ ... +++ const char* exprn, +++ T1 val1, +++ T2 val2, +++ ... +++ Tn valn); +++``` +++ +++where *`val1`*, *`val2`*, ..., *`valn`* are the values of the predicate +++arguments, and *`expr1`*, *`expr2`*, ..., *`exprn`* are the corresponding +++expressions as they appear in the source code. The types `T1`, `T2`, ..., `Tn` +++can be either value types or reference types; if an argument has type `T`, it +++can be declared as either `T` or `const T&`, whichever is appropriate. For more +++about the return type `testing::AssertionResult`, see +++[Using a Function That Returns an AssertionResult](../advanced.md#using-a-function-that-returns-an-assertionresult). +++ +++As an example, see the following code: +++ +++```cpp +++// Returns the smallest prime common divisor of m and n, +++// or 1 when m and n are mutually prime. +++int SmallestPrimeCommonDivisor(int m, int n) { ... } +++ +++// Returns true if m and n have no common divisors except 1. +++bool MutuallyPrime(int m, int n) { ... } +++ +++// A predicate-formatter for asserting that two integers are mutually prime. +++testing::AssertionResult AssertMutuallyPrime(const char* m_expr, +++ const char* n_expr, +++ int m, +++ int n) { +++ if (MutuallyPrime(m, n)) return testing::AssertionSuccess(); +++ +++ return testing::AssertionFailure() << m_expr << " and " << n_expr +++ << " (" << m << " and " << n << ") are not mutually prime, " +++ << "as they have a common divisor " << SmallestPrimeCommonDivisor(m, n); +++} +++ +++... +++const int a = 3; +++const int b = 4; +++const int c = 10; +++... +++EXPECT_PRED_FORMAT2(AssertMutuallyPrime, a, b); // Succeeds +++EXPECT_PRED_FORMAT2(AssertMutuallyPrime, b, c); // Fails +++``` +++ +++In the above example, the final assertion fails and the predicate-formatter +++produces the following failure message: +++ +++``` +++b and c (4 and 10) are not mutually prime, as they have a common divisor 2 +++``` +++ +++## Windows HRESULT Assertions {#HRESULT} +++ +++The following assertions test for `HRESULT` success or failure. For example: +++ +++```cpp +++CComPtr shell; +++ASSERT_HRESULT_SUCCEEDED(shell.CoCreateInstance(L"Shell.Application")); +++CComVariant empty; +++ASSERT_HRESULT_SUCCEEDED(shell->ShellExecute(CComBSTR(url), empty, empty, empty, empty)); +++``` +++ +++The generated output contains the human-readable error message associated with +++the returned `HRESULT` code. +++ +++### EXPECT_HRESULT_SUCCEEDED {#EXPECT_HRESULT_SUCCEEDED} +++ +++`EXPECT_HRESULT_SUCCEEDED(`*`expression`*`)` \ +++`ASSERT_HRESULT_SUCCEEDED(`*`expression`*`)` +++ +++Verifies that *`expression`* is a success `HRESULT`. +++ +++### EXPECT_HRESULT_FAILED {#EXPECT_HRESULT_FAILED} +++ +++`EXPECT_HRESULT_FAILED(`*`expression`*`)` \ +++`ASSERT_HRESULT_FAILED(`*`expression`*`)` +++ +++Verifies that *`expression`* is a failure `HRESULT`. +++ +++## Death Assertions {#death} +++ +++The following assertions verify that a piece of code causes the process to +++terminate. For context, see [Death Tests](../advanced.md#death-tests). +++ +++These assertions spawn a new process and execute the code under test in that +++process. How that happens depends on the platform and the variable +++`::testing::GTEST_FLAG(death_test_style)`, which is initialized from the +++command-line flag `--gtest_death_test_style`. +++ +++* On POSIX systems, `fork()` (or `clone()` on Linux) is used to spawn the +++ child, after which: +++ * If the variable's value is `"fast"`, the death test statement is +++ immediately executed. +++ * If the variable's value is `"threadsafe"`, the child process re-executes +++ the unit test binary just as it was originally invoked, but with some +++ extra flags to cause just the single death test under consideration to +++ be run. +++* On Windows, the child is spawned using the `CreateProcess()` API, and +++ re-executes the binary to cause just the single death test under +++ consideration to be run - much like the `"threadsafe"` mode on POSIX. +++ +++Other values for the variable are illegal and will cause the death test to fail. +++Currently, the flag's default value is +++**`"fast"`**. +++ +++If the death test statement runs to completion without dying, the child process +++will nonetheless terminate, and the assertion fails. +++ +++Note that the piece of code under test can be a compound statement, for example: +++ +++```cpp +++EXPECT_DEATH({ +++ int n = 5; +++ DoSomething(&n); +++}, "Error on line .* of DoSomething()"); +++``` +++ +++### EXPECT_DEATH {#EXPECT_DEATH} +++ +++`EXPECT_DEATH(`*`statement`*`,`*`matcher`*`)` \ +++`ASSERT_DEATH(`*`statement`*`,`*`matcher`*`)` +++ +++Verifies that *`statement`* causes the process to terminate with a nonzero exit +++status and produces `stderr` output that matches *`matcher`*. +++ +++The parameter *`matcher`* is either a [matcher](matchers.md) for a `const +++std::string&`, or a regular expression (see +++[Regular Expression Syntax](../advanced.md#regular-expression-syntax))—a bare +++string *`s`* (with no matcher) is treated as +++[`ContainsRegex(s)`](matchers.md#string-matchers), **not** +++[`Eq(s)`](matchers.md#generic-comparison). +++ +++For example, the following code verifies that calling `DoSomething(42)` causes +++the process to die with an error message that contains the text `My error`: +++ +++```cpp +++EXPECT_DEATH(DoSomething(42), "My error"); +++``` +++ +++### EXPECT_DEATH_IF_SUPPORTED {#EXPECT_DEATH_IF_SUPPORTED} +++ +++`EXPECT_DEATH_IF_SUPPORTED(`*`statement`*`,`*`matcher`*`)` \ +++`ASSERT_DEATH_IF_SUPPORTED(`*`statement`*`,`*`matcher`*`)` +++ +++If death tests are supported, behaves the same as +++[`EXPECT_DEATH`](#EXPECT_DEATH). Otherwise, verifies nothing. +++ +++### EXPECT_DEBUG_DEATH {#EXPECT_DEBUG_DEATH} +++ +++`EXPECT_DEBUG_DEATH(`*`statement`*`,`*`matcher`*`)` \ +++`ASSERT_DEBUG_DEATH(`*`statement`*`,`*`matcher`*`)` +++ +++In debug mode, behaves the same as [`EXPECT_DEATH`](#EXPECT_DEATH). When not in +++debug mode (i.e. `NDEBUG` is defined), just executes *`statement`*. +++ +++### EXPECT_EXIT {#EXPECT_EXIT} +++ +++`EXPECT_EXIT(`*`statement`*`,`*`predicate`*`,`*`matcher`*`)` \ +++`ASSERT_EXIT(`*`statement`*`,`*`predicate`*`,`*`matcher`*`)` +++ +++Verifies that *`statement`* causes the process to terminate with an exit status +++that satisfies *`predicate`*, and produces `stderr` output that matches +++*`matcher`*. +++ +++The parameter *`predicate`* is a function or functor that accepts an `int` exit +++status and returns a `bool`. GoogleTest provides two predicates to handle common +++cases: +++ +++```cpp +++// Returns true if the program exited normally with the given exit status code. +++::testing::ExitedWithCode(exit_code); +++ +++// Returns true if the program was killed by the given signal. +++// Not available on Windows. +++::testing::KilledBySignal(signal_number); +++``` +++ +++The parameter *`matcher`* is either a [matcher](matchers.md) for a `const +++std::string&`, or a regular expression (see +++[Regular Expression Syntax](../advanced.md#regular-expression-syntax))—a bare +++string *`s`* (with no matcher) is treated as +++[`ContainsRegex(s)`](matchers.md#string-matchers), **not** +++[`Eq(s)`](matchers.md#generic-comparison). +++ +++For example, the following code verifies that calling `NormalExit()` causes the +++process to print a message containing the text `Success` to `stderr` and exit +++with exit status code 0: +++ +++```cpp +++EXPECT_EXIT(NormalExit(), testing::ExitedWithCode(0), "Success"); +++``` diff --cc googletest/docs/reference/matchers.md index 000000000,000000000,000000000..243e3f951 new file mode 100644 --- /dev/null +++ b/googletest/docs/reference/matchers.md @@@@ -1,0 -1,0 -1,0 +1,302 @@@@ +++# Matchers Reference +++ +++A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or +++`EXPECT_CALL()`, or use it to validate a value directly using two macros: +++ +++| Macro | Description | +++| :----------------------------------- | :------------------------------------ | +++| `EXPECT_THAT(actual_value, matcher)` | Asserts that `actual_value` matches `matcher`. | +++| `ASSERT_THAT(actual_value, matcher)` | The same as `EXPECT_THAT(actual_value, matcher)`, except that it generates a **fatal** failure. | +++ +++{: .callout .warning} +++**WARNING:** Equality matching via `EXPECT_THAT(actual_value, expected_value)` +++is supported, however note that implicit conversions can cause surprising +++results. For example, `EXPECT_THAT(some_bool, "some string")` will compile and +++may pass unintentionally. +++ +++**BEST PRACTICE:** Prefer to make the comparison explicit via +++`EXPECT_THAT(actual_value, Eq(expected_value))` or `EXPECT_EQ(actual_value, +++expected_value)`. +++ +++Built-in matchers (where `argument` is the function argument, e.g. +++`actual_value` in the example above, or when used in the context of +++`EXPECT_CALL(mock_object, method(matchers))`, the arguments of `method`) are +++divided into several categories. All matchers are defined in the `::testing` +++namespace unless otherwise noted. +++ +++## Wildcard +++ +++Matcher | Description +++:-------------------------- | :----------------------------------------------- +++`_` | `argument` can be any value of the correct type. +++`A()` or `An()` | `argument` can be any value of type `type`. +++ +++## Generic Comparison +++ +++| Matcher | Description | +++| :--------------------- | :-------------------------------------------------- | +++| `Eq(value)` or `value` | `argument == value` | +++| `Ge(value)` | `argument >= value` | +++| `Gt(value)` | `argument > value` | +++| `Le(value)` | `argument <= value` | +++| `Lt(value)` | `argument < value` | +++| `Ne(value)` | `argument != value` | +++| `IsFalse()` | `argument` evaluates to `false` in a Boolean context. | +++| `IsTrue()` | `argument` evaluates to `true` in a Boolean context. | +++| `IsNull()` | `argument` is a `NULL` pointer (raw or smart). | +++| `NotNull()` | `argument` is a non-null pointer (raw or smart). | +++| `Optional(m)` | `argument` is `optional<>` that contains a value matching `m`. (For testing whether an `optional<>` is set, check for equality with `nullopt`. You may need to use `Eq(nullopt)` if the inner type doesn't have `==`.)| +++| `VariantWith(m)` | `argument` is `variant<>` that holds the alternative of type T with a value matching `m`. | +++| `Ref(variable)` | `argument` is a reference to `variable`. | +++| `TypedEq(value)` | `argument` has type `type` and is equal to `value`. You may need to use this instead of `Eq(value)` when the mock function is overloaded. | +++ +++Except `Ref()`, these matchers make a *copy* of `value` in case it's modified or +++destructed later. If the compiler complains that `value` doesn't have a public +++copy constructor, try wrap it in `std::ref()`, e.g. +++`Eq(std::ref(non_copyable_value))`. If you do that, make sure +++`non_copyable_value` is not changed afterwards, or the meaning of your matcher +++will be changed. +++ +++`IsTrue` and `IsFalse` are useful when you need to use a matcher, or for types +++that can be explicitly converted to Boolean, but are not implicitly converted to +++Boolean. In other cases, you can use the basic +++[`EXPECT_TRUE` and `EXPECT_FALSE`](assertions.md#boolean) assertions. +++ +++## Floating-Point Matchers {#FpMatchers} +++ +++| Matcher | Description | +++| :------------------------------- | :--------------------------------- | +++| `DoubleEq(a_double)` | `argument` is a `double` value approximately equal to `a_double`, treating two NaNs as unequal. | +++| `FloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as unequal. | +++| `NanSensitiveDoubleEq(a_double)` | `argument` is a `double` value approximately equal to `a_double`, treating two NaNs as equal. | +++| `NanSensitiveFloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as equal. | +++| `IsNan()` | `argument` is any floating-point type with a NaN value. | +++ +++The above matchers use ULP-based comparison (the same as used in googletest). +++They automatically pick a reasonable error bound based on the absolute value of +++the expected value. `DoubleEq()` and `FloatEq()` conform to the IEEE standard, +++which requires comparing two NaNs for equality to return false. The +++`NanSensitive*` version instead treats two NaNs as equal, which is often what a +++user wants. +++ +++| Matcher | Description | +++| :------------------------------------------------ | :----------------------- | +++| `DoubleNear(a_double, max_abs_error)` | `argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as unequal. | +++| `FloatNear(a_float, max_abs_error)` | `argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as unequal. | +++| `NanSensitiveDoubleNear(a_double, max_abs_error)` | `argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as equal. | +++| `NanSensitiveFloatNear(a_float, max_abs_error)` | `argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as equal. | +++ +++## String Matchers +++ +++The `argument` can be either a C string or a C++ string object: +++ +++| Matcher | Description | +++| :---------------------- | :------------------------------------------------- | +++| `ContainsRegex(string)` | `argument` matches the given regular expression. | +++| `EndsWith(suffix)` | `argument` ends with string `suffix`. | +++| `HasSubstr(string)` | `argument` contains `string` as a sub-string. | +++| `IsEmpty()` | `argument` is an empty string. | +++| `MatchesRegex(string)` | `argument` matches the given regular expression with the match starting at the first character and ending at the last character. | +++| `StartsWith(prefix)` | `argument` starts with string `prefix`. | +++| `StrCaseEq(string)` | `argument` is equal to `string`, ignoring case. | +++| `StrCaseNe(string)` | `argument` is not equal to `string`, ignoring case. | +++| `StrEq(string)` | `argument` is equal to `string`. | +++| `StrNe(string)` | `argument` is not equal to `string`. | +++| `WhenBase64Unescaped(m)` | `argument` is a base-64 escaped string whose unescaped string matches `m`. The web-safe format from [RFC 4648](https://www.rfc-editor.org/rfc/rfc4648#section-5) is supported. | +++ +++`ContainsRegex()` and `MatchesRegex()` take ownership of the `RE` object. They +++use the regular expression syntax defined +++[here](../advanced.md#regular-expression-syntax). All of these matchers, except +++`ContainsRegex()` and `MatchesRegex()` work for wide strings as well. +++ +++## Container Matchers +++ +++Most STL-style containers support `==`, so you can use `Eq(expected_container)` +++or simply `expected_container` to match a container exactly. If you want to +++write the elements in-line, match them more flexibly, or get more informative +++messages, you can use: +++ +++| Matcher | Description | +++| :---------------------------------------- | :------------------------------- | +++| `BeginEndDistanceIs(m)` | `argument` is a container whose `begin()` and `end()` iterators are separated by a number of increments matching `m`. E.g. `BeginEndDistanceIs(2)` or `BeginEndDistanceIs(Lt(2))`. For containers that define a `size()` method, `SizeIs(m)` may be more efficient. | +++| `ContainerEq(container)` | The same as `Eq(container)` except that the failure message also includes which elements are in one container but not the other. | +++| `Contains(e)` | `argument` contains an element that matches `e`, which can be either a value or a matcher. | +++| `Contains(e).Times(n)` | `argument` contains elements that match `e`, which can be either a value or a matcher, and the number of matches is `n`, which can be either a value or a matcher. Unlike the plain `Contains` and `Each` this allows to check for arbitrary occurrences including testing for absence with `Contains(e).Times(0)`. | +++| `Each(e)` | `argument` is a container where *every* element matches `e`, which can be either a value or a matcher. | +++| `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the *i*-th element matches `ei`, which can be a value or a matcher. | +++| `ElementsAreArray({e0, e1, ..., en})`, `ElementsAreArray(a_container)`, `ElementsAreArray(begin, end)`, `ElementsAreArray(array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, iterator range, or C-style array. | +++| `IsEmpty()` | `argument` is an empty container (`container.empty()`). | +++| `IsSubsetOf({e0, e1, ..., en})`, `IsSubsetOf(a_container)`, `IsSubsetOf(begin, end)`, `IsSubsetOf(array)`, or `IsSubsetOf(array, count)` | `argument` matches `UnorderedElementsAre(x0, x1, ..., xk)` for some subset `{x0, x1, ..., xk}` of the expected matchers. | +++| `IsSupersetOf({e0, e1, ..., en})`, `IsSupersetOf(a_container)`, `IsSupersetOf(begin, end)`, `IsSupersetOf(array)`, or `IsSupersetOf(array, count)` | Some subset of `argument` matches `UnorderedElementsAre(`expected matchers`)`. | +++| `Pointwise(m, container)`, `Pointwise(m, {e0, e1, ..., en})` | `argument` contains the same number of elements as in `container`, and for all i, (the i-th element in `argument`, the i-th element in `container`) match `m`, which is a matcher on 2-tuples. E.g. `Pointwise(Le(), upper_bounds)` verifies that each element in `argument` doesn't exceed the corresponding element in `upper_bounds`. See more detail below. | +++| `SizeIs(m)` | `argument` is a container whose size matches `m`. E.g. `SizeIs(2)` or `SizeIs(Lt(2))`. | +++| `UnorderedElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, and under *some* permutation of the elements, each element matches an `ei` (for a different `i`), which can be a value or a matcher. | +++| `UnorderedElementsAreArray({e0, e1, ..., en})`, `UnorderedElementsAreArray(a_container)`, `UnorderedElementsAreArray(begin, end)`, `UnorderedElementsAreArray(array)`, or `UnorderedElementsAreArray(array, count)` | The same as `UnorderedElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, iterator range, or C-style array. | +++| `UnorderedPointwise(m, container)`, `UnorderedPointwise(m, {e0, e1, ..., en})` | Like `Pointwise(m, container)`, but ignores the order of elements. | +++| `WhenSorted(m)` | When `argument` is sorted using the `<` operator, it matches container matcher `m`. E.g. `WhenSorted(ElementsAre(1, 2, 3))` verifies that `argument` contains elements 1, 2, and 3, ignoring order. | +++| `WhenSortedBy(comparator, m)` | The same as `WhenSorted(m)`, except that the given comparator instead of `<` is used to sort `argument`. E.g. `WhenSortedBy(std::greater(), ElementsAre(3, 2, 1))`. | +++ +++**Notes:** +++ +++* These matchers can also match: +++ 1. a native array passed by reference (e.g. in `Foo(const int (&a)[5])`), +++ and +++ 2. an array passed as a pointer and a count (e.g. in `Bar(const T* buffer, +++ int len)` -- see [Multi-argument Matchers](#MultiArgMatchers)). +++* The array being matched may be multi-dimensional (i.e. its elements can be +++ arrays). +++* `m` in `Pointwise(m, ...)` and `UnorderedPointwise(m, ...)` should be a +++ matcher for `::std::tuple` where `T` and `U` are the element type of +++ the actual container and the expected container, respectively. For example, +++ to compare two `Foo` containers where `Foo` doesn't support `operator==`, +++ one might write: +++ +++ ```cpp +++ MATCHER(FooEq, "") { +++ return std::get<0>(arg).Equals(std::get<1>(arg)); +++ } +++ ... +++ EXPECT_THAT(actual_foos, Pointwise(FooEq(), expected_foos)); +++ ``` +++ +++## Member Matchers +++ +++| Matcher | Description | +++| :------------------------------ | :----------------------------------------- | +++| `Field(&class::field, m)` | `argument.field` (or `argument->field` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. | +++| `Field(field_name, &class::field, m)` | The same as the two-parameter version, but provides a better error message. | +++| `Key(e)` | `argument.first` matches `e`, which can be either a value or a matcher. E.g. `Contains(Key(Le(5)))` can verify that a `map` contains a key `<= 5`. | +++| `Pair(m1, m2)` | `argument` is an `std::pair` whose `first` field matches `m1` and `second` field matches `m2`. | +++| `FieldsAre(m...)` | `argument` is a compatible object where each field matches piecewise with the matchers `m...`. A compatible object is any that supports the `std::tuple_size`+`get(obj)` protocol. In C++17 and up this also supports types compatible with structured bindings, like aggregates. | +++| `Property(&class::property, m)` | `argument.property()` (or `argument->property()` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. The method `property()` must take no argument and be declared as `const`. | +++| `Property(property_name, &class::property, m)` | The same as the two-parameter version, but provides a better error message. +++ +++**Notes:** +++ +++* You can use `FieldsAre()` to match any type that supports structured +++ bindings, such as `std::tuple`, `std::pair`, `std::array`, and aggregate +++ types. For example: +++ +++ ```cpp +++ std::tuple my_tuple{7, "hello world"}; +++ EXPECT_THAT(my_tuple, FieldsAre(Ge(0), HasSubstr("hello"))); +++ +++ struct MyStruct { +++ int value = 42; +++ std::string greeting = "aloha"; +++ }; +++ MyStruct s; +++ EXPECT_THAT(s, FieldsAre(42, "aloha")); +++ ``` +++ +++* Don't use `Property()` against member functions that you do not own, because +++ taking addresses of functions is fragile and generally not part of the +++ contract of the function. +++ +++## Matching the Result of a Function, Functor, or Callback +++ +++| Matcher | Description | +++| :--------------- | :------------------------------------------------ | +++| `ResultOf(f, m)` | `f(argument)` matches matcher `m`, where `f` is a function or functor. | +++| `ResultOf(result_description, f, m)` | The same as the two-parameter version, but provides a better error message. +++ +++## Pointer Matchers +++ +++| Matcher | Description | +++| :------------------------ | :---------------------------------------------- | +++| `Address(m)` | the result of `std::addressof(argument)` matches `m`. | +++| `Pointee(m)` | `argument` (either a smart pointer or a raw pointer) points to a value that matches matcher `m`. | +++| `Pointer(m)` | `argument` (either a smart pointer or a raw pointer) contains a pointer that matches `m`. `m` will match against the raw pointer regardless of the type of `argument`. | +++| `WhenDynamicCastTo(m)` | when `argument` is passed through `dynamic_cast()`, it matches matcher `m`. | +++ +++## Multi-argument Matchers {#MultiArgMatchers} +++ +++Technically, all matchers match a *single* value. A "multi-argument" matcher is +++just one that matches a *tuple*. The following matchers can be used to match a +++tuple `(x, y)`: +++ +++Matcher | Description +++:------ | :---------- +++`Eq()` | `x == y` +++`Ge()` | `x >= y` +++`Gt()` | `x > y` +++`Le()` | `x <= y` +++`Lt()` | `x < y` +++`Ne()` | `x != y` +++ +++You can use the following selectors to pick a subset of the arguments (or +++reorder them) to participate in the matching: +++ +++| Matcher | Description | +++| :------------------------- | :---------------------------------------------- | +++| `AllArgs(m)` | Equivalent to `m`. Useful as syntactic sugar in `.With(AllArgs(m))`. | +++| `Args(m)` | The tuple of the `k` selected (using 0-based indices) arguments matches `m`, e.g. `Args<1, 2>(Eq())`. | +++ +++## Composite Matchers +++ +++You can make a matcher from one or more other matchers: +++ +++| Matcher | Description | +++| :------------------------------- | :-------------------------------------- | +++| `AllOf(m1, m2, ..., mn)` | `argument` matches all of the matchers `m1` to `mn`. | +++| `AllOfArray({m0, m1, ..., mn})`, `AllOfArray(a_container)`, `AllOfArray(begin, end)`, `AllOfArray(array)`, or `AllOfArray(array, count)` | The same as `AllOf()` except that the matchers come from an initializer list, STL-style container, iterator range, or C-style array. | +++| `AnyOf(m1, m2, ..., mn)` | `argument` matches at least one of the matchers `m1` to `mn`. | +++| `AnyOfArray({m0, m1, ..., mn})`, `AnyOfArray(a_container)`, `AnyOfArray(begin, end)`, `AnyOfArray(array)`, or `AnyOfArray(array, count)` | The same as `AnyOf()` except that the matchers come from an initializer list, STL-style container, iterator range, or C-style array. | +++| `Not(m)` | `argument` doesn't match matcher `m`. | +++| `Conditional(cond, m1, m2)` | Matches matcher `m1` if `cond` evaluates to true, else matches `m2`.| +++ +++## Adapters for Matchers +++ +++| Matcher | Description | +++| :---------------------- | :------------------------------------ | +++| `MatcherCast(m)` | casts matcher `m` to type `Matcher`. | +++| `SafeMatcherCast(m)` | [safely casts](../gmock_cook_book.md#SafeMatcherCast) matcher `m` to type `Matcher`. | +++| `Truly(predicate)` | `predicate(argument)` returns something considered by C++ to be true, where `predicate` is a function or functor. | +++ +++`AddressSatisfies(callback)` and `Truly(callback)` take ownership of `callback`, +++which must be a permanent callback. +++ +++## Using Matchers as Predicates {#MatchersAsPredicatesCheat} +++ +++| Matcher | Description | +++| :---------------------------- | :------------------------------------------ | +++| `Matches(m)(value)` | evaluates to `true` if `value` matches `m`. You can use `Matches(m)` alone as a unary functor. | +++| `ExplainMatchResult(m, value, result_listener)` | evaluates to `true` if `value` matches `m`, explaining the result to `result_listener`. | +++| `Value(value, m)` | evaluates to `true` if `value` matches `m`. | +++ +++## Defining Matchers +++ +++| Macro | Description | +++| :----------------------------------- | :------------------------------------ | +++| `MATCHER(IsEven, "") { return (arg % 2) == 0; }` | Defines a matcher `IsEven()` to match an even number. | +++| `MATCHER_P(IsDivisibleBy, n, "") { *result_listener << "where the remainder is " << (arg % n); return (arg % n) == 0; }` | Defines a matcher `IsDivisibleBy(n)` to match a number divisible by `n`. | +++| `MATCHER_P2(IsBetween, a, b, absl::StrCat(negation ? "isn't" : "is", " between ", PrintToString(a), " and ", PrintToString(b))) { return a <= arg && arg <= b; }` | Defines a matcher `IsBetween(a, b)` to match a value in the range [`a`, `b`]. | +++ +++**Notes:** +++ +++1. The `MATCHER*` macros cannot be used inside a function or class. +++2. The matcher body must be *purely functional* (i.e. it cannot have any side +++ effect, and the result must not depend on anything other than the value +++ being matched and the matcher parameters). +++3. You can use `PrintToString(x)` to convert a value `x` of any type to a +++ string. +++4. You can use `ExplainMatchResult()` in a custom matcher to wrap another +++ matcher, for example: +++ +++ ```cpp +++ MATCHER_P(NestedPropertyMatches, matcher, "") { +++ return ExplainMatchResult(matcher, arg.nested().property(), result_listener); +++ } +++ ``` +++ +++5. You can use `DescribeMatcher<>` to describe another matcher. For example: +++ +++ ```cpp +++ MATCHER_P(XAndYThat, matcher, +++ "X that " + DescribeMatcher(matcher, negation) + +++ (negation ? " or" : " and") + " Y that " + +++ DescribeMatcher(matcher, negation)) { +++ return ExplainMatchResult(matcher, arg.x(), result_listener) && +++ ExplainMatchResult(matcher, arg.y(), result_listener); +++ } +++ ``` diff --cc googletest/docs/reference/mocking.md index 000000000,000000000,000000000..e414ffbd0 new file mode 100644 --- /dev/null +++ b/googletest/docs/reference/mocking.md @@@@ -1,0 -1,0 -1,0 +1,589 @@@@ +++# Mocking Reference +++ +++This page lists the facilities provided by GoogleTest for creating and working +++with mock objects. To use them, include the header +++`gmock/gmock.h`. +++ +++## Macros {#macros} +++ +++GoogleTest defines the following macros for working with mocks. +++ +++### MOCK_METHOD {#MOCK_METHOD} +++ +++`MOCK_METHOD(`*`return_type`*`,`*`method_name`*`, (`*`args...`*`));` \ +++`MOCK_METHOD(`*`return_type`*`,`*`method_name`*`, (`*`args...`*`), +++(`*`specs...`*`));` +++ +++Defines a mock method *`method_name`* with arguments `(`*`args...`*`)` and +++return type *`return_type`* within a mock class. +++ +++The parameters of `MOCK_METHOD` mirror the method declaration. The optional +++fourth parameter *`specs...`* is a comma-separated list of qualifiers. The +++following qualifiers are accepted: +++ +++| Qualifier | Meaning | +++| -------------------------- | -------------------------------------------- | +++| `const` | Makes the mocked method a `const` method. Required if overriding a `const` method. | +++| `override` | Marks the method with `override`. Recommended if overriding a `virtual` method. | +++| `noexcept` | Marks the method with `noexcept`. Required if overriding a `noexcept` method. | +++| `Calltype(`*`calltype`*`)` | Sets the call type for the method, for example `Calltype(STDMETHODCALLTYPE)`. Useful on Windows. | +++| `ref(`*`qualifier`*`)` | Marks the method with the given reference qualifier, for example `ref(&)` or `ref(&&)`. Required if overriding a method that has a reference qualifier. | +++ +++Note that commas in arguments prevent `MOCK_METHOD` from parsing the arguments +++correctly if they are not appropriately surrounded by parentheses. See the +++following example: +++ +++```cpp +++class MyMock { +++ public: +++ // The following 2 lines will not compile due to commas in the arguments: +++ MOCK_METHOD(std::pair, GetPair, ()); // Error! +++ MOCK_METHOD(bool, CheckMap, (std::map, bool)); // Error! +++ +++ // One solution - wrap arguments that contain commas in parentheses: +++ MOCK_METHOD((std::pair), GetPair, ()); +++ MOCK_METHOD(bool, CheckMap, ((std::map), bool)); +++ +++ // Another solution - use type aliases: +++ using BoolAndInt = std::pair; +++ MOCK_METHOD(BoolAndInt, GetPair, ()); +++ using MapIntDouble = std::map; +++ MOCK_METHOD(bool, CheckMap, (MapIntDouble, bool)); +++}; +++``` +++ +++`MOCK_METHOD` must be used in the `public:` section of a mock class definition, +++regardless of whether the method being mocked is `public`, `protected`, or +++`private` in the base class. +++ +++### EXPECT_CALL {#EXPECT_CALL} +++ +++`EXPECT_CALL(`*`mock_object`*`,`*`method_name`*`(`*`matchers...`*`))` +++ +++Creates an [expectation](../gmock_for_dummies.md#setting-expectations) that the +++method *`method_name`* of the object *`mock_object`* is called with arguments +++that match the given matchers *`matchers...`*. `EXPECT_CALL` must precede any +++code that exercises the mock object. +++ +++The parameter *`matchers...`* is a comma-separated list of +++[matchers](../gmock_for_dummies.md#matchers-what-arguments-do-we-expect) that +++correspond to each argument of the method *`method_name`*. The expectation will +++apply only to calls of *`method_name`* whose arguments match all of the +++matchers. If `(`*`matchers...`*`)` is omitted, the expectation behaves as if +++each argument's matcher were a [wildcard matcher (`_`)](matchers.md#wildcard). +++See the [Matchers Reference](matchers.md) for a list of all built-in matchers. +++ +++The following chainable clauses can be used to modify the expectation, and they +++must be used in the following order: +++ +++```cpp +++EXPECT_CALL(mock_object, method_name(matchers...)) +++ .With(multi_argument_matcher) // Can be used at most once +++ .Times(cardinality) // Can be used at most once +++ .InSequence(sequences...) // Can be used any number of times +++ .After(expectations...) // Can be used any number of times +++ .WillOnce(action) // Can be used any number of times +++ .WillRepeatedly(action) // Can be used at most once +++ .RetiresOnSaturation(); // Can be used at most once +++``` +++ +++See details for each modifier clause below. +++ +++#### With {#EXPECT_CALL.With} +++ +++`.With(`*`multi_argument_matcher`*`)` +++ +++Restricts the expectation to apply only to mock function calls whose arguments +++as a whole match the multi-argument matcher *`multi_argument_matcher`*. +++ +++GoogleTest passes all of the arguments as one tuple into the matcher. The +++parameter *`multi_argument_matcher`* must thus be a matcher of type +++`Matcher>`, where `A1, ..., An` are the types of the +++function arguments. +++ +++For example, the following code sets the expectation that +++`my_mock.SetPosition()` is called with any two arguments, the first argument +++being less than the second: +++ +++```cpp +++using ::testing::_; +++using ::testing::Lt; +++... +++EXPECT_CALL(my_mock, SetPosition(_, _)) +++ .With(Lt()); +++``` +++ +++GoogleTest provides some built-in matchers for 2-tuples, including the `Lt()` +++matcher above. See [Multi-argument Matchers](matchers.md#MultiArgMatchers). +++ +++The `With` clause can be used at most once on an expectation and must be the +++first clause. +++ +++#### Times {#EXPECT_CALL.Times} +++ +++`.Times(`*`cardinality`*`)` +++ +++Specifies how many times the mock function call is expected. +++ +++The parameter *`cardinality`* represents the number of expected calls and can be +++one of the following, all defined in the `::testing` namespace: +++ +++| Cardinality | Meaning | +++| ------------------- | --------------------------------------------------- | +++| `AnyNumber()` | The function can be called any number of times. | +++| `AtLeast(n)` | The function call is expected at least *n* times. | +++| `AtMost(n)` | The function call is expected at most *n* times. | +++| `Between(m, n)` | The function call is expected between *m* and *n* times, inclusive. | +++| `Exactly(n)` or `n` | The function call is expected exactly *n* times. If *n* is 0, the call should never happen. | +++ +++If the `Times` clause is omitted, GoogleTest infers the cardinality as follows: +++ +++* If neither [`WillOnce`](#EXPECT_CALL.WillOnce) nor +++ [`WillRepeatedly`](#EXPECT_CALL.WillRepeatedly) are specified, the inferred +++ cardinality is `Times(1)`. +++* If there are *n* `WillOnce` clauses and no `WillRepeatedly` clause, where +++ *n* >= 1, the inferred cardinality is `Times(n)`. +++* If there are *n* `WillOnce` clauses and one `WillRepeatedly` clause, where +++ *n* >= 0, the inferred cardinality is `Times(AtLeast(n))`. +++ +++The `Times` clause can be used at most once on an expectation. +++ +++#### InSequence {#EXPECT_CALL.InSequence} +++ +++`.InSequence(`*`sequences...`*`)` +++ +++Specifies that the mock function call is expected in a certain sequence. +++ +++The parameter *`sequences...`* is any number of [`Sequence`](#Sequence) objects. +++Expected calls assigned to the same sequence are expected to occur in the order +++the expectations are declared. +++ +++For example, the following code sets the expectation that the `Reset()` method +++of `my_mock` is called before both `GetSize()` and `Describe()`, and `GetSize()` +++and `Describe()` can occur in any order relative to each other: +++ +++```cpp +++using ::testing::Sequence; +++Sequence s1, s2; +++... +++EXPECT_CALL(my_mock, Reset()) +++ .InSequence(s1, s2); +++EXPECT_CALL(my_mock, GetSize()) +++ .InSequence(s1); +++EXPECT_CALL(my_mock, Describe()) +++ .InSequence(s2); +++``` +++ +++The `InSequence` clause can be used any number of times on an expectation. +++ +++See also the [`InSequence` class](#InSequence). +++ +++#### After {#EXPECT_CALL.After} +++ +++`.After(`*`expectations...`*`)` +++ +++Specifies that the mock function call is expected to occur after one or more +++other calls. +++ +++The parameter *`expectations...`* can be up to five +++[`Expectation`](#Expectation) or [`ExpectationSet`](#ExpectationSet) objects. +++The mock function call is expected to occur after all of the given expectations. +++ +++For example, the following code sets the expectation that the `Describe()` +++method of `my_mock` is called only after both `InitX()` and `InitY()` have been +++called. +++ +++```cpp +++using ::testing::Expectation; +++... +++Expectation init_x = EXPECT_CALL(my_mock, InitX()); +++Expectation init_y = EXPECT_CALL(my_mock, InitY()); +++EXPECT_CALL(my_mock, Describe()) +++ .After(init_x, init_y); +++``` +++ +++The `ExpectationSet` object is helpful when the number of prerequisites for an +++expectation is large or variable, for example: +++ +++```cpp +++using ::testing::ExpectationSet; +++... +++ExpectationSet all_inits; +++// Collect all expectations of InitElement() calls +++for (int i = 0; i < element_count; i++) { +++ all_inits += EXPECT_CALL(my_mock, InitElement(i)); +++} +++EXPECT_CALL(my_mock, Describe()) +++ .After(all_inits); // Expect Describe() call after all InitElement() calls +++``` +++ +++The `After` clause can be used any number of times on an expectation. +++ +++#### WillOnce {#EXPECT_CALL.WillOnce} +++ +++`.WillOnce(`*`action`*`)` +++ +++Specifies the mock function's actual behavior when invoked, for a single +++matching function call. +++ +++The parameter *`action`* represents the +++[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function +++call will perform. See the [Actions Reference](actions.md) for a list of +++built-in actions. +++ +++The use of `WillOnce` implicitly sets a cardinality on the expectation when +++`Times` is not specified. See [`Times`](#EXPECT_CALL.Times). +++ +++Each matching function call will perform the next action in the order declared. +++For example, the following code specifies that `my_mock.GetNumber()` is expected +++to be called exactly 3 times and will return `1`, `2`, and `3` respectively on +++the first, second, and third calls: +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(my_mock, GetNumber()) +++ .WillOnce(Return(1)) +++ .WillOnce(Return(2)) +++ .WillOnce(Return(3)); +++``` +++ +++The `WillOnce` clause can be used any number of times on an expectation. Unlike +++`WillRepeatedly`, the action fed to each `WillOnce` call will be called at most +++once, so may be a move-only type and/or have an `&&`-qualified call operator. +++ +++#### WillRepeatedly {#EXPECT_CALL.WillRepeatedly} +++ +++`.WillRepeatedly(`*`action`*`)` +++ +++Specifies the mock function's actual behavior when invoked, for all subsequent +++matching function calls. Takes effect after the actions specified in the +++[`WillOnce`](#EXPECT_CALL.WillOnce) clauses, if any, have been performed. +++ +++The parameter *`action`* represents the +++[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function +++call will perform. See the [Actions Reference](actions.md) for a list of +++built-in actions. +++ +++The use of `WillRepeatedly` implicitly sets a cardinality on the expectation +++when `Times` is not specified. See [`Times`](#EXPECT_CALL.Times). +++ +++If any `WillOnce` clauses have been specified, matching function calls will +++perform those actions before the action specified by `WillRepeatedly`. See the +++following example: +++ +++```cpp +++using ::testing::Return; +++... +++EXPECT_CALL(my_mock, GetName()) +++ .WillRepeatedly(Return("John Doe")); // Return "John Doe" on all calls +++ +++EXPECT_CALL(my_mock, GetNumber()) +++ .WillOnce(Return(42)) // Return 42 on the first call +++ .WillRepeatedly(Return(7)); // Return 7 on all subsequent calls +++``` +++ +++The `WillRepeatedly` clause can be used at most once on an expectation. +++ +++#### RetiresOnSaturation {#EXPECT_CALL.RetiresOnSaturation} +++ +++`.RetiresOnSaturation()` +++ +++Indicates that the expectation will no longer be active after the expected +++number of matching function calls has been reached. +++ +++The `RetiresOnSaturation` clause is only meaningful for expectations with an +++upper-bounded cardinality. The expectation will *retire* (no longer match any +++function calls) after it has been *saturated* (the upper bound has been +++reached). See the following example: +++ +++```cpp +++using ::testing::_; +++using ::testing::AnyNumber; +++... +++EXPECT_CALL(my_mock, SetNumber(_)) // Expectation 1 +++ .Times(AnyNumber()); +++EXPECT_CALL(my_mock, SetNumber(7)) // Expectation 2 +++ .Times(2) +++ .RetiresOnSaturation(); +++``` +++ +++In the above example, the first two calls to `my_mock.SetNumber(7)` match +++expectation 2, which then becomes inactive and no longer matches any calls. A +++third call to `my_mock.SetNumber(7)` would then match expectation 1. Without +++`RetiresOnSaturation()` on expectation 2, a third call to `my_mock.SetNumber(7)` +++would match expectation 2 again, producing a failure since the limit of 2 calls +++was exceeded. +++ +++The `RetiresOnSaturation` clause can be used at most once on an expectation and +++must be the last clause. +++ +++### ON_CALL {#ON_CALL} +++ +++`ON_CALL(`*`mock_object`*`,`*`method_name`*`(`*`matchers...`*`))` +++ +++Defines what happens when the method *`method_name`* of the object +++*`mock_object`* is called with arguments that match the given matchers +++*`matchers...`*. Requires a modifier clause to specify the method's behavior. +++*Does not* set any expectations that the method will be called. +++ +++The parameter *`matchers...`* is a comma-separated list of +++[matchers](../gmock_for_dummies.md#matchers-what-arguments-do-we-expect) that +++correspond to each argument of the method *`method_name`*. The `ON_CALL` +++specification will apply only to calls of *`method_name`* whose arguments match +++all of the matchers. If `(`*`matchers...`*`)` is omitted, the behavior is as if +++each argument's matcher were a [wildcard matcher (`_`)](matchers.md#wildcard). +++See the [Matchers Reference](matchers.md) for a list of all built-in matchers. +++ +++The following chainable clauses can be used to set the method's behavior, and +++they must be used in the following order: +++ +++```cpp +++ON_CALL(mock_object, method_name(matchers...)) +++ .With(multi_argument_matcher) // Can be used at most once +++ .WillByDefault(action); // Required +++``` +++ +++See details for each modifier clause below. +++ +++#### With {#ON_CALL.With} +++ +++`.With(`*`multi_argument_matcher`*`)` +++ +++Restricts the specification to only mock function calls whose arguments as a +++whole match the multi-argument matcher *`multi_argument_matcher`*. +++ +++GoogleTest passes all of the arguments as one tuple into the matcher. The +++parameter *`multi_argument_matcher`* must thus be a matcher of type +++`Matcher>`, where `A1, ..., An` are the types of the +++function arguments. +++ +++For example, the following code sets the default behavior when +++`my_mock.SetPosition()` is called with any two arguments, the first argument +++being less than the second: +++ +++```cpp +++using ::testing::_; +++using ::testing::Lt; +++using ::testing::Return; +++... +++ON_CALL(my_mock, SetPosition(_, _)) +++ .With(Lt()) +++ .WillByDefault(Return(true)); +++``` +++ +++GoogleTest provides some built-in matchers for 2-tuples, including the `Lt()` +++matcher above. See [Multi-argument Matchers](matchers.md#MultiArgMatchers). +++ +++The `With` clause can be used at most once with each `ON_CALL` statement. +++ +++#### WillByDefault {#ON_CALL.WillByDefault} +++ +++`.WillByDefault(`*`action`*`)` +++ +++Specifies the default behavior of a matching mock function call. +++ +++The parameter *`action`* represents the +++[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function +++call will perform. See the [Actions Reference](actions.md) for a list of +++built-in actions. +++ +++For example, the following code specifies that by default, a call to +++`my_mock.Greet()` will return `"hello"`: +++ +++```cpp +++using ::testing::Return; +++... +++ON_CALL(my_mock, Greet()) +++ .WillByDefault(Return("hello")); +++``` +++ +++The action specified by `WillByDefault` is superseded by the actions specified +++on a matching `EXPECT_CALL` statement, if any. See the +++[`WillOnce`](#EXPECT_CALL.WillOnce) and +++[`WillRepeatedly`](#EXPECT_CALL.WillRepeatedly) clauses of `EXPECT_CALL`. +++ +++The `WillByDefault` clause must be used exactly once with each `ON_CALL` +++statement. +++ +++## Classes {#classes} +++ +++GoogleTest defines the following classes for working with mocks. +++ +++### DefaultValue {#DefaultValue} +++ +++`::testing::DefaultValue` +++ +++Allows a user to specify the default value for a type `T` that is both copyable +++and publicly destructible (i.e. anything that can be used as a function return +++type). For mock functions with a return type of `T`, this default value is +++returned from function calls that do not specify an action. +++ +++Provides the static methods `Set()`, `SetFactory()`, and `Clear()` to manage the +++default value: +++ +++```cpp +++// Sets the default value to be returned. T must be copy constructible. +++DefaultValue::Set(value); +++ +++// Sets a factory. Will be invoked on demand. T must be move constructible. +++T MakeT(); +++DefaultValue::SetFactory(&MakeT); +++ +++// Unsets the default value. +++DefaultValue::Clear(); +++``` +++ +++### NiceMock {#NiceMock} +++ +++`::testing::NiceMock` +++ +++Represents a mock object that suppresses warnings on +++[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The +++template parameter `T` is any mock class, except for another `NiceMock`, +++`NaggyMock`, or `StrictMock`. +++ +++Usage of `NiceMock` is analogous to usage of `T`. `NiceMock` is a subclass +++of `T`, so it can be used wherever an object of type `T` is accepted. In +++addition, `NiceMock` can be constructed with any arguments that a constructor +++of `T` accepts. +++ +++For example, the following code suppresses warnings on the mock `my_mock` of +++type `MockClass` if a method other than `DoSomething()` is called: +++ +++```cpp +++using ::testing::NiceMock; +++... +++NiceMock my_mock("some", "args"); +++EXPECT_CALL(my_mock, DoSomething()); +++... code that uses my_mock ... +++``` +++ +++`NiceMock` only works for mock methods defined using the `MOCK_METHOD` macro +++directly in the definition of class `T`. If a mock method is defined in a base +++class of `T`, a warning might still be generated. +++ +++`NiceMock` might not work correctly if the destructor of `T` is not virtual. +++ +++### NaggyMock {#NaggyMock} +++ +++`::testing::NaggyMock` +++ +++Represents a mock object that generates warnings on +++[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The +++template parameter `T` is any mock class, except for another `NiceMock`, +++`NaggyMock`, or `StrictMock`. +++ +++Usage of `NaggyMock` is analogous to usage of `T`. `NaggyMock` is a +++subclass of `T`, so it can be used wherever an object of type `T` is accepted. +++In addition, `NaggyMock` can be constructed with any arguments that a +++constructor of `T` accepts. +++ +++For example, the following code generates warnings on the mock `my_mock` of type +++`MockClass` if a method other than `DoSomething()` is called: +++ +++```cpp +++using ::testing::NaggyMock; +++... +++NaggyMock my_mock("some", "args"); +++EXPECT_CALL(my_mock, DoSomething()); +++... code that uses my_mock ... +++``` +++ +++Mock objects of type `T` by default behave the same way as `NaggyMock`. +++ +++### StrictMock {#StrictMock} +++ +++`::testing::StrictMock` +++ +++Represents a mock object that generates test failures on +++[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The +++template parameter `T` is any mock class, except for another `NiceMock`, +++`NaggyMock`, or `StrictMock`. +++ +++Usage of `StrictMock` is analogous to usage of `T`. `StrictMock` is a +++subclass of `T`, so it can be used wherever an object of type `T` is accepted. +++In addition, `StrictMock` can be constructed with any arguments that a +++constructor of `T` accepts. +++ +++For example, the following code generates a test failure on the mock `my_mock` +++of type `MockClass` if a method other than `DoSomething()` is called: +++ +++```cpp +++using ::testing::StrictMock; +++... +++StrictMock my_mock("some", "args"); +++EXPECT_CALL(my_mock, DoSomething()); +++... code that uses my_mock ... +++``` +++ +++`StrictMock` only works for mock methods defined using the `MOCK_METHOD` +++macro directly in the definition of class `T`. If a mock method is defined in a +++base class of `T`, a failure might not be generated. +++ +++`StrictMock` might not work correctly if the destructor of `T` is not +++virtual. +++ +++### Sequence {#Sequence} +++ +++`::testing::Sequence` +++ +++Represents a chronological sequence of expectations. See the +++[`InSequence`](#EXPECT_CALL.InSequence) clause of `EXPECT_CALL` for usage. +++ +++### InSequence {#InSequence} +++ +++`::testing::InSequence` +++ +++An object of this type causes all expectations encountered in its scope to be +++put in an anonymous sequence. +++ +++This allows more convenient expression of multiple expectations in a single +++sequence: +++ +++```cpp +++using ::testing::InSequence; +++{ +++ InSequence seq; +++ +++ // The following are expected to occur in the order declared. +++ EXPECT_CALL(...); +++ EXPECT_CALL(...); +++ ... +++ EXPECT_CALL(...); +++} +++``` +++ +++The name of the `InSequence` object does not matter. +++ +++### Expectation {#Expectation} +++ +++`::testing::Expectation` +++ +++Represents a mock function call expectation as created by +++[`EXPECT_CALL`](#EXPECT_CALL): +++ +++```cpp +++using ::testing::Expectation; +++Expectation my_expectation = EXPECT_CALL(...); +++``` +++ +++Useful for specifying sequences of expectations; see the +++[`After`](#EXPECT_CALL.After) clause of `EXPECT_CALL`. +++ +++### ExpectationSet {#ExpectationSet} +++ +++`::testing::ExpectationSet` +++ +++Represents a set of mock function call expectations. +++ +++Use the `+=` operator to add [`Expectation`](#Expectation) objects to the set: +++ +++```cpp +++using ::testing::ExpectationSet; +++ExpectationSet my_expectations; +++my_expectations += EXPECT_CALL(...); +++``` +++ +++Useful for specifying sequences of expectations; see the +++[`After`](#EXPECT_CALL.After) clause of `EXPECT_CALL`. diff --cc googletest/docs/reference/testing.md index 000000000,000000000,000000000..17225a682 new file mode 100644 --- /dev/null +++ b/googletest/docs/reference/testing.md @@@@ -1,0 -1,0 -1,0 +1,1432 @@@@ +++# Testing Reference +++ +++ +++ +++This page lists the facilities provided by GoogleTest for writing test programs. +++To use them, include the header `gtest/gtest.h`. +++ +++## Macros +++ +++GoogleTest defines the following macros for writing tests. +++ +++### TEST {#TEST} +++ +++
+++TEST(TestSuiteName, TestName) {
+++  ... statements ...
+++}
+++
+++ +++Defines an individual test named *`TestName`* in the test suite +++*`TestSuiteName`*, consisting of the given statements. +++ +++Both arguments *`TestSuiteName`* and *`TestName`* must be valid C++ identifiers +++and must not contain underscores (`_`). Tests in different test suites can have +++the same individual name. +++ +++The statements within the test body can be any code under test. +++[Assertions](assertions.md) used within the test body determine the outcome of +++the test. +++ +++### TEST_F {#TEST_F} +++ +++
+++TEST_F(TestFixtureName, TestName) {
+++  ... statements ...
+++}
+++
+++ +++Defines an individual test named *`TestName`* that uses the test fixture class +++*`TestFixtureName`*. The test suite name is *`TestFixtureName`*. +++ +++Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++ +++identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be +++the name of a test fixture class—see +++[Test Fixtures](../primer.md#same-data-multiple-tests). +++ +++The statements within the test body can be any code under test. +++[Assertions](assertions.md) used within the test body determine the outcome of +++the test. +++ +++### TEST_P {#TEST_P} +++ +++
+++TEST_P(TestFixtureName, TestName) {
+++  ... statements ...
+++}
+++
+++ +++Defines an individual value-parameterized test named *`TestName`* that uses the +++test fixture class *`TestFixtureName`*. The test suite name is +++*`TestFixtureName`*. +++ +++Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++ +++identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be +++the name of a value-parameterized test fixture class—see +++[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). +++ +++The statements within the test body can be any code under test. Within the test +++body, the test parameter can be accessed with the `GetParam()` function (see +++[`WithParamInterface`](#WithParamInterface)). For example: +++ +++```cpp +++TEST_P(MyTestSuite, DoesSomething) { +++ ... +++ EXPECT_TRUE(DoSomething(GetParam())); +++ ... +++} +++``` +++ +++[Assertions](assertions.md) used within the test body determine the outcome of +++the test. +++ +++See also [`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P). +++ +++### INSTANTIATE_TEST_SUITE_P {#INSTANTIATE_TEST_SUITE_P} +++ +++`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`)` +++\ +++`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`,`*`name_generator`*`)` +++ +++Instantiates the value-parameterized test suite *`TestSuiteName`* (defined with +++[`TEST_P`](#TEST_P)). +++ +++The argument *`InstantiationName`* is a unique name for the instantiation of the +++test suite, to distinguish between multiple instantiations. In test output, the +++instantiation name is added as a prefix to the test suite name +++*`TestSuiteName`*. +++ +++The argument *`param_generator`* is one of the following GoogleTest-provided +++functions that generate the test parameters, all defined in the `::testing` +++namespace: +++ +++ +++ +++| Parameter Generator | Behavior | +++| ------------------- | ---------------------------------------------------- | +++| `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. | +++| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. | +++| `ValuesIn(container)` or `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. | +++| `Bool()` | Yields sequence `{false, true}`. | +++| `Combine(g1, g2, ..., gN)` | Yields as `std::tuple` *n*-tuples all combinations (Cartesian product) of the values generated by the given *n* generators `g1`, `g2`, ..., `gN`. | +++| `ConvertGenerator(g)` | Yields values generated by generator `g`, `static_cast` to `T`. | +++ +++The optional last argument *`name_generator`* is a function or functor that +++generates custom test name suffixes based on the test parameters. The function +++must accept an argument of type +++[`TestParamInfo`](#TestParamInfo) and return a `std::string`. +++The test name suffix can only contain alphanumeric characters and underscores. +++GoogleTest provides [`PrintToStringParamName`](#PrintToStringParamName), or a +++custom function can be used for more control: +++ +++```cpp +++INSTANTIATE_TEST_SUITE_P( +++ MyInstantiation, MyTestSuite, +++ testing::Values(...), +++ [](const testing::TestParamInfo& info) { +++ // Can use info.param here to generate the test suffix +++ std::string name = ... +++ return name; +++ }); +++``` +++ +++For more information, see +++[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). +++ +++See also +++[`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST`](#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST). +++ +++### TYPED_TEST_SUITE {#TYPED_TEST_SUITE} +++ +++`TYPED_TEST_SUITE(`*`TestFixtureName`*`,`*`Types`*`)` +++ +++Defines a typed test suite based on the test fixture *`TestFixtureName`*. The +++test suite name is *`TestFixtureName`*. +++ +++The argument *`TestFixtureName`* is a fixture class template, parameterized by a +++type, for example: +++ +++```cpp +++template +++class MyFixture : public testing::Test { +++ public: +++ ... +++ using List = std::list; +++ static T shared_; +++ T value_; +++}; +++``` +++ +++The argument *`Types`* is a [`Types`](#Types) object representing the list of +++types to run the tests on, for example: +++ +++```cpp +++using MyTypes = ::testing::Types; +++TYPED_TEST_SUITE(MyFixture, MyTypes); +++``` +++ +++The type alias (`using` or `typedef`) is necessary for the `TYPED_TEST_SUITE` +++macro to parse correctly. +++ +++See also [`TYPED_TEST`](#TYPED_TEST) and +++[Typed Tests](../advanced.md#typed-tests) for more information. +++ +++### TYPED_TEST {#TYPED_TEST} +++ +++
+++TYPED_TEST(TestSuiteName, TestName) {
+++  ... statements ...
+++}
+++
+++ +++Defines an individual typed test named *`TestName`* in the typed test suite +++*`TestSuiteName`*. The test suite must be defined with +++[`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE). +++ +++Within the test body, the special name `TypeParam` refers to the type parameter, +++and `TestFixture` refers to the fixture class. See the following example: +++ +++```cpp +++TYPED_TEST(MyFixture, Example) { +++ // Inside a test, refer to the special name TypeParam to get the type +++ // parameter. Since we are inside a derived class template, C++ requires +++ // us to visit the members of MyFixture via 'this'. +++ TypeParam n = this->value_; +++ +++ // To visit static members of the fixture, add the 'TestFixture::' +++ // prefix. +++ n += TestFixture::shared_; +++ +++ // To refer to typedefs in the fixture, add the 'typename TestFixture::' +++ // prefix. The 'typename' is required to satisfy the compiler. +++ typename TestFixture::List values; +++ +++ values.push_back(n); +++ ... +++} +++``` +++ +++For more information, see [Typed Tests](../advanced.md#typed-tests). +++ +++### TYPED_TEST_SUITE_P {#TYPED_TEST_SUITE_P} +++ +++`TYPED_TEST_SUITE_P(`*`TestFixtureName`*`)` +++ +++Defines a type-parameterized test suite based on the test fixture +++*`TestFixtureName`*. The test suite name is *`TestFixtureName`*. +++ +++The argument *`TestFixtureName`* is a fixture class template, parameterized by a +++type. See [`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE) for an example. +++ +++See also [`TYPED_TEST_P`](#TYPED_TEST_P) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more +++information. +++ +++### TYPED_TEST_P {#TYPED_TEST_P} +++ +++
+++TYPED_TEST_P(TestSuiteName, TestName) {
+++  ... statements ...
+++}
+++
+++ +++Defines an individual type-parameterized test named *`TestName`* in the +++type-parameterized test suite *`TestSuiteName`*. The test suite must be defined +++with [`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P). +++ +++Within the test body, the special name `TypeParam` refers to the type parameter, +++and `TestFixture` refers to the fixture class. See [`TYPED_TEST`](#TYPED_TEST) +++for an example. +++ +++See also [`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more +++information. +++ +++### REGISTER_TYPED_TEST_SUITE_P {#REGISTER_TYPED_TEST_SUITE_P} +++ +++`REGISTER_TYPED_TEST_SUITE_P(`*`TestSuiteName`*`,`*`TestNames...`*`)` +++ +++Registers the type-parameterized tests *`TestNames...`* of the test suite +++*`TestSuiteName`*. The test suite and tests must be defined with +++[`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P) and [`TYPED_TEST_P`](#TYPED_TEST_P). +++ +++For example: +++ +++```cpp +++// Define the test suite and tests. +++TYPED_TEST_SUITE_P(MyFixture); +++TYPED_TEST_P(MyFixture, HasPropertyA) { ... } +++TYPED_TEST_P(MyFixture, HasPropertyB) { ... } +++ +++// Register the tests in the test suite. +++REGISTER_TYPED_TEST_SUITE_P(MyFixture, HasPropertyA, HasPropertyB); +++``` +++ +++See also [`INSTANTIATE_TYPED_TEST_SUITE_P`](#INSTANTIATE_TYPED_TEST_SUITE_P) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more +++information. +++ +++### INSTANTIATE_TYPED_TEST_SUITE_P {#INSTANTIATE_TYPED_TEST_SUITE_P} +++ +++`INSTANTIATE_TYPED_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`Types`*`)` +++ +++Instantiates the type-parameterized test suite *`TestSuiteName`*. The test suite +++must be registered with +++[`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P). +++ +++The argument *`InstantiationName`* is a unique name for the instantiation of the +++test suite, to distinguish between multiple instantiations. In test output, the +++instantiation name is added as a prefix to the test suite name +++*`TestSuiteName`*. +++ +++The argument *`Types`* is a [`Types`](#Types) object representing the list of +++types to run the tests on, for example: +++ +++```cpp +++using MyTypes = ::testing::Types; +++INSTANTIATE_TYPED_TEST_SUITE_P(MyInstantiation, MyFixture, MyTypes); +++``` +++ +++The type alias (`using` or `typedef`) is necessary for the +++`INSTANTIATE_TYPED_TEST_SUITE_P` macro to parse correctly. +++ +++For more information, see +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). +++ +++### FRIEND_TEST {#FRIEND_TEST} +++ +++`FRIEND_TEST(`*`TestSuiteName`*`,`*`TestName`*`)` +++ +++Within a class body, declares an individual test as a friend of the class, +++enabling the test to access private class members. +++ +++If the class is defined in a namespace, then in order to be friends of the +++class, test fixtures and tests must be defined in the exact same namespace, +++without inline or anonymous namespaces. +++ +++For example, if the class definition looks like the following: +++ +++```cpp +++namespace my_namespace { +++ +++class MyClass { +++ friend class MyClassTest; +++ FRIEND_TEST(MyClassTest, HasPropertyA); +++ FRIEND_TEST(MyClassTest, HasPropertyB); +++ ... definition of class MyClass ... +++}; +++ +++} // namespace my_namespace +++``` +++ +++Then the test code should look like: +++ +++```cpp +++namespace my_namespace { +++ +++class MyClassTest : public testing::Test { +++ ... +++}; +++ +++TEST_F(MyClassTest, HasPropertyA) { ... } +++TEST_F(MyClassTest, HasPropertyB) { ... } +++ +++} // namespace my_namespace +++``` +++ +++See [Testing Private Code](../advanced.md#testing-private-code) for more +++information. +++ +++### SCOPED_TRACE {#SCOPED_TRACE} +++ +++`SCOPED_TRACE(`*`message`*`)` +++ +++Causes the current file name, line number, and the given message *`message`* to +++be added to the failure message for each assertion failure that occurs in the +++scope. +++ +++For more information, see +++[Adding Traces to Assertions](../advanced.md#adding-traces-to-assertions). +++ +++See also the [`ScopedTrace` class](#ScopedTrace). +++ +++### GTEST_SKIP {#GTEST_SKIP} +++ +++`GTEST_SKIP()` +++ +++Prevents further test execution at runtime. +++ +++Can be used in individual test cases or in the `SetUp()` methods of test +++environments or test fixtures (classes derived from the +++[`Environment`](#Environment) or [`Test`](#Test) classes). If used in a global +++test environment `SetUp()` method, it skips all tests in the test program. If +++used in a test fixture `SetUp()` method, it skips all tests in the corresponding +++test suite. +++ +++Similar to assertions, `GTEST_SKIP` allows streaming a custom message into it. +++ +++See [Skipping Test Execution](../advanced.md#skipping-test-execution) for more +++information. +++ +++### GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST {#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST} +++ +++`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(`*`TestSuiteName`*`)` +++ +++Allows the value-parameterized test suite *`TestSuiteName`* to be +++uninstantiated. +++ +++By default, every [`TEST_P`](#TEST_P) call without a corresponding +++[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P) call causes a failing +++test in the test suite `GoogleTestVerification`. +++`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST` suppresses this failure for the +++given test suite. +++ +++## Classes and types +++ +++GoogleTest defines the following classes and types to help with writing tests. +++ +++### AssertionResult {#AssertionResult} +++ +++`testing::AssertionResult` +++ +++A class for indicating whether an assertion was successful. +++ +++When the assertion wasn't successful, the `AssertionResult` object stores a +++non-empty failure message that can be retrieved with the object's `message()` +++method. +++ +++To create an instance of this class, use one of the factory functions +++[`AssertionSuccess()`](#AssertionSuccess) or +++[`AssertionFailure()`](#AssertionFailure). +++ +++### AssertionException {#AssertionException} +++ +++`testing::AssertionException` +++ +++Exception which can be thrown from +++[`TestEventListener::OnTestPartResult`](#TestEventListener::OnTestPartResult). +++ +++### EmptyTestEventListener {#EmptyTestEventListener} +++ +++`testing::EmptyTestEventListener` +++ +++Provides an empty implementation of all methods in the +++[`TestEventListener`](#TestEventListener) interface, such that a subclass only +++needs to override the methods it cares about. +++ +++### Environment {#Environment} +++ +++`testing::Environment` +++ +++Represents a global test environment. See +++[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down). +++ +++#### Protected Methods {#Environment-protected} +++ +++##### SetUp {#Environment::SetUp} +++ +++`virtual void Environment::SetUp()` +++ +++Override this to define how to set up the environment. +++ +++##### TearDown {#Environment::TearDown} +++ +++`virtual void Environment::TearDown()` +++ +++Override this to define how to tear down the environment. +++ +++### ScopedTrace {#ScopedTrace} +++ +++`testing::ScopedTrace` +++ +++An instance of this class causes a trace to be included in every test failure +++message generated by code in the scope of the lifetime of the `ScopedTrace` +++instance. The effect is undone with the destruction of the instance. +++ +++The `ScopedTrace` constructor has the following form: +++ +++```cpp +++template +++ScopedTrace(const char* file, int line, const T& message) +++``` +++ +++Example usage: +++ +++```cpp +++testing::ScopedTrace trace("file.cc", 123, "message"); +++``` +++ +++The resulting trace includes the given source file path and line number, and the +++given message. The `message` argument can be anything streamable to +++`std::ostream`. +++ +++See also [`SCOPED_TRACE`](#SCOPED_TRACE). +++ +++### Test {#Test} +++ +++`testing::Test` +++ +++The abstract class that all tests inherit from. `Test` is not copyable. +++ +++#### Public Methods {#Test-public} +++ +++##### SetUpTestSuite {#Test::SetUpTestSuite} +++ +++`static void Test::SetUpTestSuite()` +++ +++Performs shared setup for all tests in the test suite. GoogleTest calls +++`SetUpTestSuite()` before running the first test in the test suite. +++ +++##### TearDownTestSuite {#Test::TearDownTestSuite} +++ +++`static void Test::TearDownTestSuite()` +++ +++Performs shared teardown for all tests in the test suite. GoogleTest calls +++`TearDownTestSuite()` after running the last test in the test suite. +++ +++##### HasFatalFailure {#Test::HasFatalFailure} +++ +++`static bool Test::HasFatalFailure()` +++ +++Returns true if and only if the current test has a fatal failure. +++ +++##### HasNonfatalFailure {#Test::HasNonfatalFailure} +++ +++`static bool Test::HasNonfatalFailure()` +++ +++Returns true if and only if the current test has a nonfatal failure. +++ +++##### HasFailure {#Test::HasFailure} +++ +++`static bool Test::HasFailure()` +++ +++Returns true if and only if the current test has any failure, either fatal or +++nonfatal. +++ +++##### IsSkipped {#Test::IsSkipped} +++ +++`static bool Test::IsSkipped()` +++ +++Returns true if and only if the current test was skipped. +++ +++##### RecordProperty {#Test::RecordProperty} +++ +++`static void Test::RecordProperty(const std::string& key, const std::string& +++value)` \ +++`static void Test::RecordProperty(const std::string& key, int value)` +++ +++Logs a property for the current test, test suite, or entire invocation of the +++test program. Only the last value for a given key is logged. +++ +++The key must be a valid XML attribute name, and cannot conflict with the ones +++already used by GoogleTest (`name`, `file`, `line`, `status`, `time`, +++`classname`, `type_param`, and `value_param`). +++ +++`RecordProperty` is `public static` so it can be called from utility functions +++that are not members of the test fixture. +++ +++Calls to `RecordProperty` made during the lifespan of the test (from the moment +++its constructor starts to the moment its destructor finishes) are output in XML +++as attributes of the `` element. Properties recorded from a fixture's +++`SetUpTestSuite` or `TearDownTestSuite` methods are logged as attributes of the +++corresponding `` element. Calls to `RecordProperty` made in the +++global context (before or after invocation of `RUN_ALL_TESTS` or from the +++`SetUp`/`TearDown` methods of registered `Environment` objects) are output as +++attributes of the `` element. +++ +++#### Protected Methods {#Test-protected} +++ +++##### SetUp {#Test::SetUp} +++ +++`virtual void Test::SetUp()` +++ +++Override this to perform test fixture setup. GoogleTest calls `SetUp()` before +++running each individual test. +++ +++##### TearDown {#Test::TearDown} +++ +++`virtual void Test::TearDown()` +++ +++Override this to perform test fixture teardown. GoogleTest calls `TearDown()` +++after running each individual test. +++ +++### TestWithParam {#TestWithParam} +++ +++`testing::TestWithParam` +++ +++A convenience class which inherits from both [`Test`](#Test) and +++[`WithParamInterface`](#WithParamInterface). +++ +++### TestSuite {#TestSuite} +++ +++Represents a test suite. `TestSuite` is not copyable. +++ +++#### Public Methods {#TestSuite-public} +++ +++##### name {#TestSuite::name} +++ +++`const char* TestSuite::name() const` +++ +++Gets the name of the test suite. +++ +++##### type_param {#TestSuite::type_param} +++ +++`const char* TestSuite::type_param() const` +++ +++Returns the name of the parameter type, or `NULL` if this is not a typed or +++type-parameterized test suite. See [Typed Tests](../advanced.md#typed-tests) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). +++ +++##### should_run {#TestSuite::should_run} +++ +++`bool TestSuite::should_run() const` +++ +++Returns true if any test in this test suite should run. +++ +++##### successful_test_count {#TestSuite::successful_test_count} +++ +++`int TestSuite::successful_test_count() const` +++ +++Gets the number of successful tests in this test suite. +++ +++##### skipped_test_count {#TestSuite::skipped_test_count} +++ +++`int TestSuite::skipped_test_count() const` +++ +++Gets the number of skipped tests in this test suite. +++ +++##### failed_test_count {#TestSuite::failed_test_count} +++ +++`int TestSuite::failed_test_count() const` +++ +++Gets the number of failed tests in this test suite. +++ +++##### reportable_disabled_test_count {#TestSuite::reportable_disabled_test_count} +++ +++`int TestSuite::reportable_disabled_test_count() const` +++ +++Gets the number of disabled tests that will be reported in the XML report. +++ +++##### disabled_test_count {#TestSuite::disabled_test_count} +++ +++`int TestSuite::disabled_test_count() const` +++ +++Gets the number of disabled tests in this test suite. +++ +++##### reportable_test_count {#TestSuite::reportable_test_count} +++ +++`int TestSuite::reportable_test_count() const` +++ +++Gets the number of tests to be printed in the XML report. +++ +++##### test_to_run_count {#TestSuite::test_to_run_count} +++ +++`int TestSuite::test_to_run_count() const` +++ +++Get the number of tests in this test suite that should run. +++ +++##### total_test_count {#TestSuite::total_test_count} +++ +++`int TestSuite::total_test_count() const` +++ +++Gets the number of all tests in this test suite. +++ +++##### Passed {#TestSuite::Passed} +++ +++`bool TestSuite::Passed() const` +++ +++Returns true if and only if the test suite passed. +++ +++##### Failed {#TestSuite::Failed} +++ +++`bool TestSuite::Failed() const` +++ +++Returns true if and only if the test suite failed. +++ +++##### elapsed_time {#TestSuite::elapsed_time} +++ +++`TimeInMillis TestSuite::elapsed_time() const` +++ +++Returns the elapsed time, in milliseconds. +++ +++##### start_timestamp {#TestSuite::start_timestamp} +++ +++`TimeInMillis TestSuite::start_timestamp() const` +++ +++Gets the time of the test suite start, in ms from the start of the UNIX epoch. +++ +++##### GetTestInfo {#TestSuite::GetTestInfo} +++ +++`const TestInfo* TestSuite::GetTestInfo(int i) const` +++ +++Returns the [`TestInfo`](#TestInfo) for the `i`-th test among all the tests. `i` +++can range from 0 to `total_test_count() - 1`. If `i` is not in that range, +++returns `NULL`. +++ +++##### ad_hoc_test_result {#TestSuite::ad_hoc_test_result} +++ +++`const TestResult& TestSuite::ad_hoc_test_result() const` +++ +++Returns the [`TestResult`](#TestResult) that holds test properties recorded +++during execution of `SetUpTestSuite` and `TearDownTestSuite`. +++ +++### TestInfo {#TestInfo} +++ +++`testing::TestInfo` +++ +++Stores information about a test. +++ +++#### Public Methods {#TestInfo-public} +++ +++##### test_suite_name {#TestInfo::test_suite_name} +++ +++`const char* TestInfo::test_suite_name() const` +++ +++Returns the test suite name. +++ +++##### name {#TestInfo::name} +++ +++`const char* TestInfo::name() const` +++ +++Returns the test name. +++ +++##### type_param {#TestInfo::type_param} +++ +++`const char* TestInfo::type_param() const` +++ +++Returns the name of the parameter type, or `NULL` if this is not a typed or +++type-parameterized test. See [Typed Tests](../advanced.md#typed-tests) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests). +++ +++##### value_param {#TestInfo::value_param} +++ +++`const char* TestInfo::value_param() const` +++ +++Returns the text representation of the value parameter, or `NULL` if this is not +++a value-parameterized test. See +++[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). +++ +++##### file {#TestInfo::file} +++ +++`const char* TestInfo::file() const` +++ +++Returns the file name where this test is defined. +++ +++##### line {#TestInfo::line} +++ +++`int TestInfo::line() const` +++ +++Returns the line where this test is defined. +++ +++##### is_in_another_shard {#TestInfo::is_in_another_shard} +++ +++`bool TestInfo::is_in_another_shard() const` +++ +++Returns true if this test should not be run because it's in another shard. +++ +++##### should_run {#TestInfo::should_run} +++ +++`bool TestInfo::should_run() const` +++ +++Returns true if this test should run, that is if the test is not disabled (or it +++is disabled but the `also_run_disabled_tests` flag has been specified) and its +++full name matches the user-specified filter. +++ +++GoogleTest allows the user to filter the tests by their full names. Only the +++tests that match the filter will run. See +++[Running a Subset of the Tests](../advanced.md#running-a-subset-of-the-tests) +++for more information. +++ +++##### is_reportable {#TestInfo::is_reportable} +++ +++`bool TestInfo::is_reportable() const` +++ +++Returns true if and only if this test will appear in the XML report. +++ +++##### result {#TestInfo::result} +++ +++`const TestResult* TestInfo::result() const` +++ +++Returns the result of the test. See [`TestResult`](#TestResult). +++ +++### TestParamInfo {#TestParamInfo} +++ +++`testing::TestParamInfo` +++ +++Describes a parameter to a value-parameterized test. The type `T` is the type of +++the parameter. +++ +++Contains the fields `param` and `index` which hold the value of the parameter +++and its integer index respectively. +++ +++### UnitTest {#UnitTest} +++ +++`testing::UnitTest` +++ +++This class contains information about the test program. +++ +++`UnitTest` is a singleton class. The only instance is created when +++`UnitTest::GetInstance()` is first called. This instance is never deleted. +++ +++`UnitTest` is not copyable. +++ +++#### Public Methods {#UnitTest-public} +++ +++##### GetInstance {#UnitTest::GetInstance} +++ +++`static UnitTest* UnitTest::GetInstance()` +++ +++Gets the singleton `UnitTest` object. The first time this method is called, a +++`UnitTest` object is constructed and returned. Consecutive calls will return the +++same object. +++ +++##### original_working_dir {#UnitTest::original_working_dir} +++ +++`const char* UnitTest::original_working_dir() const` +++ +++Returns the working directory when the first [`TEST()`](#TEST) or +++[`TEST_F()`](#TEST_F) was executed. The `UnitTest` object owns the string. +++ +++##### current_test_suite {#UnitTest::current_test_suite} +++ +++`const TestSuite* UnitTest::current_test_suite() const` +++ +++Returns the [`TestSuite`](#TestSuite) object for the test that's currently +++running, or `NULL` if no test is running. +++ +++##### current_test_info {#UnitTest::current_test_info} +++ +++`const TestInfo* UnitTest::current_test_info() const` +++ +++Returns the [`TestInfo`](#TestInfo) object for the test that's currently +++running, or `NULL` if no test is running. +++ +++##### random_seed {#UnitTest::random_seed} +++ +++`int UnitTest::random_seed() const` +++ +++Returns the random seed used at the start of the current test run. +++ +++##### successful_test_suite_count {#UnitTest::successful_test_suite_count} +++ +++`int UnitTest::successful_test_suite_count() const` +++ +++Gets the number of successful test suites. +++ +++##### failed_test_suite_count {#UnitTest::failed_test_suite_count} +++ +++`int UnitTest::failed_test_suite_count() const` +++ +++Gets the number of failed test suites. +++ +++##### total_test_suite_count {#UnitTest::total_test_suite_count} +++ +++`int UnitTest::total_test_suite_count() const` +++ +++Gets the number of all test suites. +++ +++##### test_suite_to_run_count {#UnitTest::test_suite_to_run_count} +++ +++`int UnitTest::test_suite_to_run_count() const` +++ +++Gets the number of all test suites that contain at least one test that should +++run. +++ +++##### successful_test_count {#UnitTest::successful_test_count} +++ +++`int UnitTest::successful_test_count() const` +++ +++Gets the number of successful tests. +++ +++##### skipped_test_count {#UnitTest::skipped_test_count} +++ +++`int UnitTest::skipped_test_count() const` +++ +++Gets the number of skipped tests. +++ +++##### failed_test_count {#UnitTest::failed_test_count} +++ +++`int UnitTest::failed_test_count() const` +++ +++Gets the number of failed tests. +++ +++##### reportable_disabled_test_count {#UnitTest::reportable_disabled_test_count} +++ +++`int UnitTest::reportable_disabled_test_count() const` +++ +++Gets the number of disabled tests that will be reported in the XML report. +++ +++##### disabled_test_count {#UnitTest::disabled_test_count} +++ +++`int UnitTest::disabled_test_count() const` +++ +++Gets the number of disabled tests. +++ +++##### reportable_test_count {#UnitTest::reportable_test_count} +++ +++`int UnitTest::reportable_test_count() const` +++ +++Gets the number of tests to be printed in the XML report. +++ +++##### total_test_count {#UnitTest::total_test_count} +++ +++`int UnitTest::total_test_count() const` +++ +++Gets the number of all tests. +++ +++##### test_to_run_count {#UnitTest::test_to_run_count} +++ +++`int UnitTest::test_to_run_count() const` +++ +++Gets the number of tests that should run. +++ +++##### start_timestamp {#UnitTest::start_timestamp} +++ +++`TimeInMillis UnitTest::start_timestamp() const` +++ +++Gets the time of the test program start, in ms from the start of the UNIX epoch. +++ +++##### elapsed_time {#UnitTest::elapsed_time} +++ +++`TimeInMillis UnitTest::elapsed_time() const` +++ +++Gets the elapsed time, in milliseconds. +++ +++##### Passed {#UnitTest::Passed} +++ +++`bool UnitTest::Passed() const` +++ +++Returns true if and only if the unit test passed (i.e. all test suites passed). +++ +++##### Failed {#UnitTest::Failed} +++ +++`bool UnitTest::Failed() const` +++ +++Returns true if and only if the unit test failed (i.e. some test suite failed or +++something outside of all tests failed). +++ +++##### GetTestSuite {#UnitTest::GetTestSuite} +++ +++`const TestSuite* UnitTest::GetTestSuite(int i) const` +++ +++Gets the [`TestSuite`](#TestSuite) object for the `i`-th test suite among all +++the test suites. `i` can range from 0 to `total_test_suite_count() - 1`. If `i` +++is not in that range, returns `NULL`. +++ +++##### ad_hoc_test_result {#UnitTest::ad_hoc_test_result} +++ +++`const TestResult& UnitTest::ad_hoc_test_result() const` +++ +++Returns the [`TestResult`](#TestResult) containing information on test failures +++and properties logged outside of individual test suites. +++ +++##### listeners {#UnitTest::listeners} +++ +++`TestEventListeners& UnitTest::listeners()` +++ +++Returns the list of event listeners that can be used to track events inside +++GoogleTest. See [`TestEventListeners`](#TestEventListeners). +++ +++### TestEventListener {#TestEventListener} +++ +++`testing::TestEventListener` +++ +++The interface for tracing execution of tests. The methods below are listed in +++the order the corresponding events are fired. +++ +++#### Public Methods {#TestEventListener-public} +++ +++##### OnTestProgramStart {#TestEventListener::OnTestProgramStart} +++ +++`virtual void TestEventListener::OnTestProgramStart(const UnitTest& unit_test)` +++ +++Fired before any test activity starts. +++ +++##### OnTestIterationStart {#TestEventListener::OnTestIterationStart} +++ +++`virtual void TestEventListener::OnTestIterationStart(const UnitTest& unit_test, +++int iteration)` +++ +++Fired before each iteration of tests starts. There may be more than one +++iteration if `GTEST_FLAG(repeat)` is set. `iteration` is the iteration index, +++starting from 0. +++ +++##### OnEnvironmentsSetUpStart {#TestEventListener::OnEnvironmentsSetUpStart} +++ +++`virtual void TestEventListener::OnEnvironmentsSetUpStart(const UnitTest& +++unit_test)` +++ +++Fired before environment set-up for each iteration of tests starts. +++ +++##### OnEnvironmentsSetUpEnd {#TestEventListener::OnEnvironmentsSetUpEnd} +++ +++`virtual void TestEventListener::OnEnvironmentsSetUpEnd(const UnitTest& +++unit_test)` +++ +++Fired after environment set-up for each iteration of tests ends. +++ +++##### OnTestSuiteStart {#TestEventListener::OnTestSuiteStart} +++ +++`virtual void TestEventListener::OnTestSuiteStart(const TestSuite& test_suite)` +++ +++Fired before the test suite starts. +++ +++##### OnTestStart {#TestEventListener::OnTestStart} +++ +++`virtual void TestEventListener::OnTestStart(const TestInfo& test_info)` +++ +++Fired before the test starts. +++ +++##### OnTestPartResult {#TestEventListener::OnTestPartResult} +++ +++`virtual void TestEventListener::OnTestPartResult(const TestPartResult& +++test_part_result)` +++ +++Fired after a failed assertion or a `SUCCEED()` invocation. If you want to throw +++an exception from this function to skip to the next test, it must be an +++[`AssertionException`](#AssertionException) or inherited from it. +++ +++##### OnTestEnd {#TestEventListener::OnTestEnd} +++ +++`virtual void TestEventListener::OnTestEnd(const TestInfo& test_info)` +++ +++Fired after the test ends. +++ +++##### OnTestSuiteEnd {#TestEventListener::OnTestSuiteEnd} +++ +++`virtual void TestEventListener::OnTestSuiteEnd(const TestSuite& test_suite)` +++ +++Fired after the test suite ends. +++ +++##### OnEnvironmentsTearDownStart {#TestEventListener::OnEnvironmentsTearDownStart} +++ +++`virtual void TestEventListener::OnEnvironmentsTearDownStart(const UnitTest& +++unit_test)` +++ +++Fired before environment tear-down for each iteration of tests starts. +++ +++##### OnEnvironmentsTearDownEnd {#TestEventListener::OnEnvironmentsTearDownEnd} +++ +++`virtual void TestEventListener::OnEnvironmentsTearDownEnd(const UnitTest& +++unit_test)` +++ +++Fired after environment tear-down for each iteration of tests ends. +++ +++##### OnTestIterationEnd {#TestEventListener::OnTestIterationEnd} +++ +++`virtual void TestEventListener::OnTestIterationEnd(const UnitTest& unit_test, +++int iteration)` +++ +++Fired after each iteration of tests finishes. +++ +++##### OnTestProgramEnd {#TestEventListener::OnTestProgramEnd} +++ +++`virtual void TestEventListener::OnTestProgramEnd(const UnitTest& unit_test)` +++ +++Fired after all test activities have ended. +++ +++### TestEventListeners {#TestEventListeners} +++ +++`testing::TestEventListeners` +++ +++Lets users add listeners to track events in GoogleTest. +++ +++#### Public Methods {#TestEventListeners-public} +++ +++##### Append {#TestEventListeners::Append} +++ +++`void TestEventListeners::Append(TestEventListener* listener)` +++ +++Appends an event listener to the end of the list. GoogleTest assumes ownership +++of the listener (i.e. it will delete the listener when the test program +++finishes). +++ +++##### Release {#TestEventListeners::Release} +++ +++`TestEventListener* TestEventListeners::Release(TestEventListener* listener)` +++ +++Removes the given event listener from the list and returns it. It then becomes +++the caller's responsibility to delete the listener. Returns `NULL` if the +++listener is not found in the list. +++ +++##### default_result_printer {#TestEventListeners::default_result_printer} +++ +++`TestEventListener* TestEventListeners::default_result_printer() const` +++ +++Returns the standard listener responsible for the default console output. Can be +++removed from the listeners list to shut down default console output. Note that +++removing this object from the listener list with +++[`Release()`](#TestEventListeners::Release) transfers its ownership to the +++caller and makes this function return `NULL` the next time. +++ +++##### default_xml_generator {#TestEventListeners::default_xml_generator} +++ +++`TestEventListener* TestEventListeners::default_xml_generator() const` +++ +++Returns the standard listener responsible for the default XML output controlled +++by the `--gtest_output=xml` flag. Can be removed from the listeners list by +++users who want to shut down the default XML output controlled by this flag and +++substitute it with custom one. Note that removing this object from the listener +++list with [`Release()`](#TestEventListeners::Release) transfers its ownership to +++the caller and makes this function return `NULL` the next time. +++ +++### TestPartResult {#TestPartResult} +++ +++`testing::TestPartResult` +++ +++A copyable object representing the result of a test part (i.e. an assertion or +++an explicit `FAIL()`, `ADD_FAILURE()`, or `SUCCESS()`). +++ +++#### Public Methods {#TestPartResult-public} +++ +++##### type {#TestPartResult::type} +++ +++`Type TestPartResult::type() const` +++ +++Gets the outcome of the test part. +++ +++The return type `Type` is an enum defined as follows: +++ +++```cpp +++enum Type { +++ kSuccess, // Succeeded. +++ kNonFatalFailure, // Failed but the test can continue. +++ kFatalFailure, // Failed and the test should be terminated. +++ kSkip // Skipped. +++}; +++``` +++ +++##### file_name {#TestPartResult::file_name} +++ +++`const char* TestPartResult::file_name() const` +++ +++Gets the name of the source file where the test part took place, or `NULL` if +++it's unknown. +++ +++##### line_number {#TestPartResult::line_number} +++ +++`int TestPartResult::line_number() const` +++ +++Gets the line in the source file where the test part took place, or `-1` if it's +++unknown. +++ +++##### summary {#TestPartResult::summary} +++ +++`const char* TestPartResult::summary() const` +++ +++Gets the summary of the failure message. +++ +++##### message {#TestPartResult::message} +++ +++`const char* TestPartResult::message() const` +++ +++Gets the message associated with the test part. +++ +++##### skipped {#TestPartResult::skipped} +++ +++`bool TestPartResult::skipped() const` +++ +++Returns true if and only if the test part was skipped. +++ +++##### passed {#TestPartResult::passed} +++ +++`bool TestPartResult::passed() const` +++ +++Returns true if and only if the test part passed. +++ +++##### nonfatally_failed {#TestPartResult::nonfatally_failed} +++ +++`bool TestPartResult::nonfatally_failed() const` +++ +++Returns true if and only if the test part non-fatally failed. +++ +++##### fatally_failed {#TestPartResult::fatally_failed} +++ +++`bool TestPartResult::fatally_failed() const` +++ +++Returns true if and only if the test part fatally failed. +++ +++##### failed {#TestPartResult::failed} +++ +++`bool TestPartResult::failed() const` +++ +++Returns true if and only if the test part failed. +++ +++### TestProperty {#TestProperty} +++ +++`testing::TestProperty` +++ +++A copyable object representing a user-specified test property which can be +++output as a key/value string pair. +++ +++#### Public Methods {#TestProperty-public} +++ +++##### key {#key} +++ +++`const char* key() const` +++ +++Gets the user-supplied key. +++ +++##### value {#value} +++ +++`const char* value() const` +++ +++Gets the user-supplied value. +++ +++##### SetValue {#SetValue} +++ +++`void SetValue(const std::string& new_value)` +++ +++Sets a new value, overriding the previous one. +++ +++### TestResult {#TestResult} +++ +++`testing::TestResult` +++ +++Contains information about the result of a single test. +++ +++`TestResult` is not copyable. +++ +++#### Public Methods {#TestResult-public} +++ +++##### total_part_count {#TestResult::total_part_count} +++ +++`int TestResult::total_part_count() const` +++ +++Gets the number of all test parts. This is the sum of the number of successful +++test parts and the number of failed test parts. +++ +++##### test_property_count {#TestResult::test_property_count} +++ +++`int TestResult::test_property_count() const` +++ +++Returns the number of test properties. +++ +++##### Passed {#TestResult::Passed} +++ +++`bool TestResult::Passed() const` +++ +++Returns true if and only if the test passed (i.e. no test part failed). +++ +++##### Skipped {#TestResult::Skipped} +++ +++`bool TestResult::Skipped() const` +++ +++Returns true if and only if the test was skipped. +++ +++##### Failed {#TestResult::Failed} +++ +++`bool TestResult::Failed() const` +++ +++Returns true if and only if the test failed. +++ +++##### HasFatalFailure {#TestResult::HasFatalFailure} +++ +++`bool TestResult::HasFatalFailure() const` +++ +++Returns true if and only if the test fatally failed. +++ +++##### HasNonfatalFailure {#TestResult::HasNonfatalFailure} +++ +++`bool TestResult::HasNonfatalFailure() const` +++ +++Returns true if and only if the test has a non-fatal failure. +++ +++##### elapsed_time {#TestResult::elapsed_time} +++ +++`TimeInMillis TestResult::elapsed_time() const` +++ +++Returns the elapsed time, in milliseconds. +++ +++##### start_timestamp {#TestResult::start_timestamp} +++ +++`TimeInMillis TestResult::start_timestamp() const` +++ +++Gets the time of the test case start, in ms from the start of the UNIX epoch. +++ +++##### GetTestPartResult {#TestResult::GetTestPartResult} +++ +++`const TestPartResult& TestResult::GetTestPartResult(int i) const` +++ +++Returns the [`TestPartResult`](#TestPartResult) for the `i`-th test part result +++among all the results. `i` can range from 0 to `total_part_count() - 1`. If `i` +++is not in that range, aborts the program. +++ +++##### GetTestProperty {#TestResult::GetTestProperty} +++ +++`const TestProperty& TestResult::GetTestProperty(int i) const` +++ +++Returns the [`TestProperty`](#TestProperty) object for the `i`-th test property. +++`i` can range from 0 to `test_property_count() - 1`. If `i` is not in that +++range, aborts the program. +++ +++### TimeInMillis {#TimeInMillis} +++ +++`testing::TimeInMillis` +++ +++An integer type representing time in milliseconds. +++ +++### Types {#Types} +++ +++`testing::Types` +++ +++Represents a list of types for use in typed tests and type-parameterized tests. +++ +++The template argument `T...` can be any number of types, for example: +++ +++``` +++testing::Types +++``` +++ +++See [Typed Tests](../advanced.md#typed-tests) and +++[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more +++information. +++ +++### WithParamInterface {#WithParamInterface} +++ +++`testing::WithParamInterface` +++ +++The pure interface class that all value-parameterized tests inherit from. +++ +++A value-parameterized test fixture class must inherit from both [`Test`](#Test) +++and `WithParamInterface`. In most cases that just means inheriting from +++[`TestWithParam`](#TestWithParam), but more complicated test hierarchies may +++need to inherit from `Test` and `WithParamInterface` at different levels. +++ +++This interface defines the type alias `ParamType` for the parameter type `T` and +++has support for accessing the test parameter value via the `GetParam()` method: +++ +++``` +++static const ParamType& GetParam() +++``` +++ +++For more information, see +++[Value-Parameterized Tests](../advanced.md#value-parameterized-tests). +++ +++## Functions +++ +++GoogleTest defines the following functions to help with writing and running +++tests. +++ +++### InitGoogleTest {#InitGoogleTest} +++ +++`void testing::InitGoogleTest(int* argc, char** argv)` \ +++`void testing::InitGoogleTest(int* argc, wchar_t** argv)` \ +++`void testing::InitGoogleTest()` +++ +++Initializes GoogleTest. This must be called before calling +++[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line +++for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it +++is removed from `argv`, and `*argc` is decremented. +++ +++No value is returned. Instead, the GoogleTest flag variables are updated. +++ +++The `InitGoogleTest(int* argc, wchar_t** argv)` overload can be used in Windows +++programs compiled in `UNICODE` mode. +++ +++The argument-less `InitGoogleTest()` overload can be used on Arduino/embedded +++platforms where there is no `argc`/`argv`. +++ +++### AddGlobalTestEnvironment {#AddGlobalTestEnvironment} +++ +++`Environment* testing::AddGlobalTestEnvironment(Environment* env)` +++ +++Adds a test environment to the test program. Must be called before +++[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is called. See +++[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down) for +++more information. +++ +++See also [`Environment`](#Environment). +++ +++### RegisterTest {#RegisterTest} +++ +++```cpp +++template +++TestInfo* testing::RegisterTest(const char* test_suite_name, const char* test_name, +++ const char* type_param, const char* value_param, +++ const char* file, int line, Factory factory) +++``` +++ +++Dynamically registers a test with the framework. +++ +++The `factory` argument is a factory callable (move-constructible) object or +++function pointer that creates a new instance of the `Test` object. It handles +++ownership to the caller. The signature of the callable is `Fixture*()`, where +++`Fixture` is the test fixture class for the test. All tests registered with the +++same `test_suite_name` must return the same fixture type. This is checked at +++runtime. +++ +++The framework will infer the fixture class from the factory and will call the +++`SetUpTestSuite` and `TearDownTestSuite` methods for it. +++ +++Must be called before [`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is invoked, otherwise +++behavior is undefined. +++ +++See +++[Registering tests programmatically](../advanced.md#registering-tests-programmatically) +++for more information. +++ +++### RUN_ALL_TESTS {#RUN_ALL_TESTS} +++ +++`int RUN_ALL_TESTS()` +++ +++Use this function in `main()` to run all tests. It returns `0` if all tests are +++successful, or `1` otherwise. +++ +++`RUN_ALL_TESTS()` should be invoked after the command line has been parsed by +++[`InitGoogleTest()`](#InitGoogleTest). +++ +++This function was formerly a macro; thus, it is in the global namespace and has +++an all-caps name. +++ +++### AssertionSuccess {#AssertionSuccess} +++ +++`AssertionResult testing::AssertionSuccess()` +++ +++Creates a successful assertion result. See +++[`AssertionResult`](#AssertionResult). +++ +++### AssertionFailure {#AssertionFailure} +++ +++`AssertionResult testing::AssertionFailure()` +++ +++Creates a failed assertion result. Use the `<<` operator to store a failure +++message: +++ +++```cpp +++testing::AssertionFailure() << "My failure message"; +++``` +++ +++See [`AssertionResult`](#AssertionResult). +++ +++### StaticAssertTypeEq {#StaticAssertTypeEq} +++ +++`testing::StaticAssertTypeEq()` +++ +++Compile-time assertion for type equality. Compiles if and only if `T1` and `T2` +++are the same type. The value it returns is irrelevant. +++ +++See [Type Assertions](../advanced.md#type-assertions) for more information. +++ +++### PrintToString {#PrintToString} +++ +++`std::string testing::PrintToString(x)` +++ +++Prints any value `x` using GoogleTest's value printer. +++ +++See +++[Teaching GoogleTest How to Print Your Values](../advanced.md#teaching-googletest-how-to-print-your-values) +++for more information. +++ +++### PrintToStringParamName {#PrintToStringParamName} +++ +++`std::string testing::PrintToStringParamName(TestParamInfo& info)` +++ +++A built-in parameterized test name generator which returns the result of +++[`PrintToString`](#PrintToString) called on `info.param`. Does not work when the +++test parameter is a `std::string` or C string. See +++[Specifying Names for Value-Parameterized Test Parameters](../advanced.md#specifying-names-for-value-parameterized-test-parameters) +++for more information. +++ +++See also [`TestParamInfo`](#TestParamInfo) and +++[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P). diff --cc googletest/docs/samples.md index 000000000,000000000,000000000..dedc59098 new file mode 100644 --- /dev/null +++ b/googletest/docs/samples.md @@@@ -1,0 -1,0 -1,0 +1,22 @@@@ +++# Googletest Samples +++ +++If you're like us, you'd like to look at +++[googletest samples.](https://github.com/google/googletest/blob/main/googletest/samples) +++The sample directory has a number of well-commented samples showing how to use a +++variety of googletest features. +++ +++* Sample #1 shows the basic steps of using googletest to test C++ functions. +++* Sample #2 shows a more complex unit test for a class with multiple member +++ functions. +++* Sample #3 uses a test fixture. +++* Sample #4 teaches you how to use googletest and `googletest.h` together to +++ get the best of both libraries. +++* Sample #5 puts shared testing logic in a base test fixture, and reuses it in +++ derived fixtures. +++* Sample #6 demonstrates type-parameterized tests. +++* Sample #7 teaches the basics of value-parameterized tests. +++* Sample #8 shows using `Combine()` in value-parameterized tests. +++* Sample #9 shows use of the listener API to modify Google Test's console +++ output and the use of its reflection API to inspect test results. +++* Sample #10 shows use of the listener API to implement a primitive memory +++ leak checker. diff --cc googletest/googlemock/CMakeLists.txt index 000000000,000000000,000000000..a9aa0723f new file mode 100644 --- /dev/null +++ b/googletest/googlemock/CMakeLists.txt @@@@ -1,0 -1,0 -1,0 +1,209 @@@@ +++######################################################################## +++# Note: CMake support is community-based. The maintainers do not use CMake +++# internally. +++# +++# CMake build script for Google Mock. +++# +++# To run the tests for Google Mock itself on Linux, use 'make test' or +++# ctest. You can select which tests to run using 'ctest -R regex'. +++# For more options, run 'ctest --help'. +++ +++option(gmock_build_tests "Build all of Google Mock's own tests." OFF) +++ +++# A directory to find Google Test sources. +++if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt") +++ set(gtest_dir gtest) +++else() +++ set(gtest_dir ../googletest) +++endif() +++ +++# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). +++include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL) +++ +++if (COMMAND pre_project_set_up_hermetic_build) +++ # Google Test also calls hermetic setup functions from add_subdirectory, +++ # although its changes will not affect things at the current scope. +++ pre_project_set_up_hermetic_build() +++endif() +++ +++######################################################################## +++# +++# Project-wide settings +++ +++# Name of the project. +++# +++# CMake files in this project can refer to the root source directory +++# as ${gmock_SOURCE_DIR} and to the root binary directory as +++# ${gmock_BINARY_DIR}. +++# Language "C" is required for find_package(Threads). +++cmake_minimum_required(VERSION 3.13) +++project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) +++ +++if (COMMAND set_up_hermetic_build) +++ set_up_hermetic_build() +++endif() +++ +++# Instructs CMake to process Google Test's CMakeLists.txt and add its +++# targets to the current scope. We are placing Google Test's binary +++# directory in a subdirectory of our own as VC compilation may break +++# if they are the same (the default). +++add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}") +++ +++ +++# These commands only run if this is the main project +++if(CMAKE_PROJECT_NAME STREQUAL "gmock" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution") +++ # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to +++ # make it prominent in the GUI. +++ option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) +++else() +++ mark_as_advanced(gmock_build_tests) +++endif() +++ +++# Although Google Test's CMakeLists.txt calls this function, the +++# changes there don't affect the current scope. Therefore we have to +++# call it again here. +++config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake +++ +++# Adds Google Mock's and Google Test's header directories to the search path. +++set(gmock_build_include_dirs +++ "${gmock_SOURCE_DIR}/include" +++ "${gmock_SOURCE_DIR}" +++ "${gtest_SOURCE_DIR}/include" +++ # This directory is needed to build directly from Google Test sources. +++ "${gtest_SOURCE_DIR}") +++include_directories(${gmock_build_include_dirs}) +++ +++######################################################################## +++# +++# Defines the gmock & gmock_main libraries. User tests should link +++# with one of them. +++ +++# Google Mock libraries. We build them using more strict warnings than what +++# are used for other targets, to ensure that Google Mock can be compiled by +++# a user aggressive about warnings. +++if (MSVC) +++ cxx_library(gmock +++ "${cxx_strict}" +++ "${gtest_dir}/src/gtest-all.cc" +++ src/gmock-all.cc) +++ +++ cxx_library(gmock_main +++ "${cxx_strict}" +++ "${gtest_dir}/src/gtest-all.cc" +++ src/gmock-all.cc +++ src/gmock_main.cc) +++else() +++ cxx_library(gmock "${cxx_strict}" src/gmock-all.cc) +++ target_link_libraries(gmock PUBLIC gtest) +++ set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION}) +++ cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc) +++ target_link_libraries(gmock_main PUBLIC gmock) +++ set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) +++endif() +++ +++string(REPLACE ";" "$" dirs "${gmock_build_include_dirs}") +++target_include_directories(gmock SYSTEM INTERFACE +++ "$" +++ "$/${CMAKE_INSTALL_INCLUDEDIR}>") +++target_include_directories(gmock_main SYSTEM INTERFACE +++ "$" +++ "$/${CMAKE_INSTALL_INCLUDEDIR}>") +++ +++######################################################################## +++# +++# Install rules +++install_project(gmock gmock_main) +++ +++######################################################################## +++# +++# Google Mock's own tests. +++# +++# You can skip this section if you aren't interested in testing +++# Google Mock itself. +++# +++# The tests are not built by default. To build them, set the +++# gmock_build_tests option to ON. You can do it by running ccmake +++# or specifying the -Dgmock_build_tests=ON flag when running cmake. +++ +++if (gmock_build_tests) +++ # This must be set in the root directory for the tests to be run by +++ # 'make test' or ctest. +++ enable_testing() +++ +++ if (MINGW OR CYGWIN) +++ add_compile_options("-Wa,-mbig-obj") +++ endif() +++ +++ ############################################################ +++ # C++ tests built with standard compiler flags. +++ +++ cxx_test(gmock-actions_test gmock_main) +++ cxx_test(gmock-cardinalities_test gmock_main) +++ cxx_test(gmock_ex_test gmock_main) +++ cxx_test(gmock-function-mocker_test gmock_main) +++ cxx_test(gmock-internal-utils_test gmock_main) +++ cxx_test(gmock-matchers-arithmetic_test gmock_main) +++ cxx_test(gmock-matchers-comparisons_test gmock_main) +++ cxx_test(gmock-matchers-containers_test gmock_main) +++ cxx_test(gmock-matchers-misc_test gmock_main) +++ cxx_test(gmock-more-actions_test gmock_main) +++ cxx_test(gmock-nice-strict_test gmock_main) +++ cxx_test(gmock-port_test gmock_main) +++ cxx_test(gmock-spec-builders_test gmock_main) +++ cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) +++ cxx_test(gmock_test gmock_main) +++ +++ if (DEFINED GTEST_HAS_PTHREAD) +++ cxx_test(gmock_stress_test gmock) +++ endif() +++ +++ # gmock_all_test is commented to save time building and running tests. +++ # Uncomment if necessary. +++ # cxx_test(gmock_all_test gmock_main) +++ +++ ############################################################ +++ # C++ tests built with non-standard compiler flags. +++ +++ if (MSVC) +++ cxx_library(gmock_main_no_exception "${cxx_no_exception}" +++ "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) +++ +++ cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" +++ "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) +++ +++ else() +++ cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc) +++ target_link_libraries(gmock_main_no_exception PUBLIC gmock) +++ +++ cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc) +++ target_link_libraries(gmock_main_no_rtti PUBLIC gmock) +++ endif() +++ cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}" +++ gmock_main_no_exception test/gmock-more-actions_test.cc) +++ +++ cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}" +++ gmock_main_no_rtti test/gmock-spec-builders_test.cc) +++ +++ cxx_shared_library(shared_gmock_main "${cxx_default}" +++ "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) +++ +++ # Tests that a binary can be built with Google Mock as a shared library. On +++ # some system configurations, it may not possible to run the binary without +++ # knowing more details about the system configurations. We do not try to run +++ # this binary. To get a more robust shared library coverage, configure with +++ # -DBUILD_SHARED_LIBS=ON. +++ cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}" +++ shared_gmock_main test/gmock-spec-builders_test.cc) +++ set_target_properties(shared_gmock_test_ +++ PROPERTIES +++ COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") +++ +++ ############################################################ +++ # Python tests. +++ +++ cxx_executable(gmock_leak_test_ test gmock_main) +++ py_test(gmock_leak_test) +++ +++ cxx_executable(gmock_output_test_ test gmock) +++ py_test(gmock_output_test) +++endif() diff --cc googletest/googlemock/README.md index 000000000,000000000,000000000..7da60655d new file mode 100644 --- /dev/null +++ b/googletest/googlemock/README.md @@@@ -1,0 -1,0 -1,0 +1,40 @@@@ +++# Googletest Mocking (gMock) Framework +++ +++### Overview +++ +++Google's framework for writing and using C++ mock classes. It can help you +++derive better designs of your system and write better tests. +++ +++It is inspired by: +++ +++* [jMock](http://www.jmock.org/) +++* [EasyMock](http://www.easymock.org/) +++* [Hamcrest](http://code.google.com/p/hamcrest/) +++ +++It is designed with C++'s specifics in mind. +++ +++gMock: +++ +++- Provides a declarative syntax for defining mocks. +++- Can define partial (hybrid) mocks, which are a cross of real and mock +++ objects. +++- Handles functions of arbitrary types and overloaded functions. +++- Comes with a rich set of matchers for validating function arguments. +++- Uses an intuitive syntax for controlling the behavior of a mock. +++- Does automatic verification of expectations (no record-and-replay needed). +++- Allows arbitrary (partial) ordering constraints on function calls to be +++ expressed. +++- Lets a user extend it by defining new matchers and actions. +++- Does not use exceptions. +++- Is easy to learn and use. +++ +++Details and examples can be found here: +++ +++* [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) +++* [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) +++* [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) +++* [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) +++ +++GoogleMock is a part of +++[GoogleTest C++ testing framework](http://github.com/google/googletest/) and a +++subject to the same requirements. diff --cc googletest/googlemock/cmake/gmock.pc.in index 000000000,000000000,000000000..23c67b5c8 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/cmake/gmock.pc.in @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +++ +++Name: gmock +++Description: GoogleMock (without main() function) +++Version: @PROJECT_VERSION@ +++URL: https://github.com/google/googletest +++Requires: gtest = @PROJECT_VERSION@ +++Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ +++Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ diff --cc googletest/googlemock/cmake/gmock_main.pc.in index 000000000,000000000,000000000..66ffea7f4 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/cmake/gmock_main.pc.in @@@@ -1,0 -1,0 -1,0 +1,10 @@@@ +++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +++ +++Name: gmock_main +++Description: GoogleMock (with main() function) +++Version: @PROJECT_VERSION@ +++URL: https://github.com/google/googletest +++Requires: gmock = @PROJECT_VERSION@ +++Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ +++Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ diff --cc googletest/googlemock/docs/README.md index 000000000,000000000,000000000..1bc57b799 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/docs/README.md @@@@ -1,0 -1,0 -1,0 +1,4 @@@@ +++# Content Moved +++ +++We are working on updates to the GoogleTest documentation, which has moved to +++the top-level [docs](../../docs) directory. diff --cc googletest/googlemock/include/gmock/gmock-actions.h index 000000000,000000000,000000000..bd9ba73ee new file mode 100644 --- /dev/null +++ b/googletest/googlemock/include/gmock/gmock-actions.h @@@@ -1,0 -1,0 -1,0 +1,2297 @@@@ +++// Copyright 2007, Google Inc. +++// All rights reserved. +++// +++// Redistribution and use in source and binary forms, with or without +++// modification, are permitted provided that the following conditions are +++// met: +++// +++// * Redistributions of source code must retain the above copyright +++// notice, this list of conditions and the following disclaimer. +++// * Redistributions in binary form must reproduce the above +++// copyright notice, this list of conditions and the following disclaimer +++// in the documentation and/or other materials provided with the +++// distribution. +++// * Neither the name of Google Inc. nor the names of its +++// contributors may be used to endorse or promote products derived from +++// this software without specific prior written permission. +++// +++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++// Google Mock - a framework for writing C++ mock classes. +++// +++// The ACTION* family of macros can be used in a namespace scope to +++// define custom actions easily. The syntax: +++// +++// ACTION(name) { statements; } +++// +++// will define an action with the given name that executes the +++// statements. The value returned by the statements will be used as +++// the return value of the action. Inside the statements, you can +++// refer to the K-th (0-based) argument of the mock function by +++// 'argK', and refer to its type by 'argK_type'. For example: +++// +++// ACTION(IncrementArg1) { +++// arg1_type temp = arg1; +++// return ++(*temp); +++// } +++// +++// allows you to write +++// +++// ...WillOnce(IncrementArg1()); +++// +++// You can also refer to the entire argument tuple and its type by +++// 'args' and 'args_type', and refer to the mock function type and its +++// return type by 'function_type' and 'return_type'. +++// +++// Note that you don't need to specify the types of the mock function +++// arguments. However rest assured that your code is still type-safe: +++// you'll get a compiler error if *arg1 doesn't support the ++ +++// operator, or if the type of ++(*arg1) isn't compatible with the +++// mock function's return type, for example. +++// +++// Sometimes you'll want to parameterize the action. For that you can use +++// another macro: +++// +++// ACTION_P(name, param_name) { statements; } +++// +++// For example: +++// +++// ACTION_P(Add, n) { return arg0 + n; } +++// +++// will allow you to write: +++// +++// ...WillOnce(Add(5)); +++// +++// Note that you don't need to provide the type of the parameter +++// either. If you need to reference the type of a parameter named +++// 'foo', you can write 'foo_type'. For example, in the body of +++// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type +++// of 'n'. +++// +++// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support +++// multi-parameter actions. +++// +++// For the purpose of typing, you can view +++// +++// ACTION_Pk(Foo, p1, ..., pk) { ... } +++// +++// as shorthand for +++// +++// template +++// FooActionPk Foo(p1_type p1, ..., pk_type pk) { ... } +++// +++// In particular, you can provide the template type arguments +++// explicitly when invoking Foo(), as in Foo(5, false); +++// although usually you can rely on the compiler to infer the types +++// for you automatically. You can assign the result of expression +++// Foo(p1, ..., pk) to a variable of type FooActionPk. This can be useful when composing actions. +++// +++// You can also overload actions with different numbers of parameters: +++// +++// ACTION_P(Plus, a) { ... } +++// ACTION_P2(Plus, a, b) { ... } +++// +++// While it's tempting to always use the ACTION* macros when defining +++// a new action, you should also consider implementing ActionInterface +++// or using MakePolymorphicAction() instead, especially if you need to +++// use the action a lot. While these approaches require more work, +++// they give you more control on the types of the mock function +++// arguments and the action parameters, which in general leads to +++// better compiler error messages that pay off in the long run. They +++// also allow overloading actions based on parameter types (as opposed +++// to just based on the number of parameters). +++// +++// CAVEAT: +++// +++// ACTION*() can only be used in a namespace scope as templates cannot be +++// declared inside of a local class. +++// Users can, however, define any local functors (e.g. a lambda) that +++// can be used as actions. +++// +++// MORE INFORMATION: +++// +++// To learn more about using these macros, please search for 'ACTION' on +++// https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md +++ +++// IWYU pragma: private, include "gmock/gmock.h" +++// IWYU pragma: friend gmock/.* +++ +++#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ +++#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ +++ +++#ifndef _WIN32_WCE +++#include +++#endif +++ +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++ +++#include "gmock/internal/gmock-internal-utils.h" +++#include "gmock/internal/gmock-port.h" +++#include "gmock/internal/gmock-pp.h" +++ +++GTEST_DISABLE_MSC_WARNINGS_PUSH_(4100) +++ +++namespace testing { +++ +++// To implement an action Foo, define: +++// 1. a class FooAction that implements the ActionInterface interface, and +++// 2. a factory function that creates an Action object from a +++// const FooAction*. +++// +++// The two-level delegation design follows that of Matcher, providing +++// consistency for extension developers. It also eases ownership +++// management as Action objects can now be copied like plain values. +++ +++namespace internal { +++ +++// BuiltInDefaultValueGetter::Get() returns a +++// default-constructed T value. BuiltInDefaultValueGetter::Get() crashes with an error. +++// +++// This primary template is used when kDefaultConstructible is true. +++template +++struct BuiltInDefaultValueGetter { +++ static T Get() { return T(); } +++}; +++template +++struct BuiltInDefaultValueGetter { +++ static T Get() { +++ Assert(false, __FILE__, __LINE__, +++ "Default action undefined for the function return type."); +++ return internal::Invalid(); +++ // The above statement will never be reached, but is required in +++ // order for this function to compile. +++ } +++}; +++ +++// BuiltInDefaultValue::Get() returns the "built-in" default value +++// for type T, which is NULL when T is a raw pointer type, 0 when T is +++// a numeric type, false when T is bool, or "" when T is string or +++// std::string. In addition, in C++11 and above, it turns a +++// default-constructed T value if T is default constructible. For any +++// other type T, the built-in default T value is undefined, and the +++// function will abort the process. +++template +++class BuiltInDefaultValue { +++ public: +++ // This function returns true if and only if type T has a built-in default +++ // value. +++ static bool Exists() { return ::std::is_default_constructible::value; } +++ +++ static T Get() { +++ return BuiltInDefaultValueGetter< +++ T, ::std::is_default_constructible::value>::Get(); +++ } +++}; +++ +++// This partial specialization says that we use the same built-in +++// default value for T and const T. +++template +++class BuiltInDefaultValue { +++ public: +++ static bool Exists() { return BuiltInDefaultValue::Exists(); } +++ static T Get() { return BuiltInDefaultValue::Get(); } +++}; +++ +++// This partial specialization defines the default values for pointer +++// types. +++template +++class BuiltInDefaultValue { +++ public: +++ static bool Exists() { return true; } +++ static T* Get() { return nullptr; } +++}; +++ +++// The following specializations define the default values for +++// specific types we care about. +++#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \ +++ template <> \ +++ class BuiltInDefaultValue { \ +++ public: \ +++ static bool Exists() { return true; } \ +++ static type Get() { return value; } \ +++ } +++ +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, ""); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0'); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0'); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0'); +++ +++// There's no need for a default action for signed wchar_t, as that +++// type is the same as wchar_t for gcc, and invalid for MSVC. +++// +++// There's also no need for a default action for unsigned wchar_t, as +++// that type is the same as unsigned int for gcc, and invalid for +++// MSVC. +++#if GMOCK_WCHAR_T_IS_NATIVE_ +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT +++#endif +++ +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long long, 0); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long long, 0); // NOLINT +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0); +++GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0); +++ +++#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ +++ +++// Partial implementations of metaprogramming types from the standard library +++// not available in C++11. +++ +++template +++struct negation +++ // NOLINTNEXTLINE +++ : std::integral_constant {}; +++ +++// Base case: with zero predicates the answer is always true. +++template +++struct conjunction : std::true_type {}; +++ +++// With a single predicate, the answer is that predicate. +++template +++struct conjunction : P1 {}; +++ +++// With multiple predicates the answer is the first predicate if that is false, +++// and we recurse otherwise. +++template +++struct conjunction +++ : std::conditional, P1>::type {}; +++ +++template +++struct disjunction : std::false_type {}; +++ +++template +++struct disjunction : P1 {}; +++ +++template +++struct disjunction +++ // NOLINTNEXTLINE +++ : std::conditional, P1>::type {}; +++ +++template +++using void_t = void; +++ +++// Detects whether an expression of type `From` can be implicitly converted to +++// `To` according to [conv]. In C++17, [conv]/3 defines this as follows: +++// +++// An expression e can be implicitly converted to a type T if and only if +++// the declaration T t=e; is well-formed, for some invented temporary +++// variable t ([dcl.init]). +++// +++// [conv]/2 implies we can use function argument passing to detect whether this +++// initialization is valid. +++// +++// Note that this is distinct from is_convertible, which requires this be valid: +++// +++// To test() { +++// return declval(); +++// } +++// +++// In particular, is_convertible doesn't give the correct answer when `To` and +++// `From` are the same non-moveable type since `declval` will be an rvalue +++// reference, defeating the guaranteed copy elision that would otherwise make +++// this function work. +++// +++// REQUIRES: `From` is not cv void. +++template +++struct is_implicitly_convertible { +++ private: +++ // A function that accepts a parameter of type T. This can be called with type +++ // U successfully only if U is implicitly convertible to T. +++ template +++ static void Accept(T); +++ +++ // A function that creates a value of type T. +++ template +++ static T Make(); +++ +++ // An overload be selected when implicit conversion from T to To is possible. +++ template (Make()))> +++ static std::true_type TestImplicitConversion(int); +++ +++ // A fallback overload selected in all other cases. +++ template +++ static std::false_type TestImplicitConversion(...); +++ +++ public: +++ using type = decltype(TestImplicitConversion(0)); +++ static constexpr bool value = type::value; +++}; +++ +++// Like std::invoke_result_t from C++17, but works only for objects with call +++// operators (not e.g. member function pointers, which we don't need specific +++// support for in OnceAction because std::function deals with them). +++template +++using call_result_t = decltype(std::declval()(std::declval()...)); +++ +++template +++struct is_callable_r_impl : std::false_type {}; +++ +++// Specialize the struct for those template arguments where call_result_t is +++// well-formed. When it's not, the generic template above is chosen, resulting +++// in std::false_type. +++template +++struct is_callable_r_impl>, R, F, Args...> +++ : std::conditional< +++ std::is_void::value, // +++ std::true_type, // +++ is_implicitly_convertible, R>>::type {}; +++ +++// Like std::is_invocable_r from C++17, but works only for objects with call +++// operators. See the note on call_result_t. +++template +++using is_callable_r = is_callable_r_impl; +++ +++// Like std::as_const from C++17. +++template +++typename std::add_const::type& as_const(T& t) { +++ return t; +++} +++ +++} // namespace internal +++ +++// Specialized for function types below. +++template +++class OnceAction; +++ +++// An action that can only be used once. +++// +++// This is accepted by WillOnce, which doesn't require the underlying action to +++// be copy-constructible (only move-constructible), and promises to invoke it as +++// an rvalue reference. This allows the action to work with move-only types like +++// std::move_only_function in a type-safe manner. +++// +++// For example: +++// +++// // Assume we have some API that needs to accept a unique pointer to some +++// // non-copyable object Foo. +++// void AcceptUniquePointer(std::unique_ptr foo); +++// +++// // We can define an action that provides a Foo to that API. Because It +++// // has to give away its unique pointer, it must not be called more than +++// // once, so its call operator is &&-qualified. +++// struct ProvideFoo { +++// std::unique_ptr foo; +++// +++// void operator()() && { +++// AcceptUniquePointer(std::move(Foo)); +++// } +++// }; +++// +++// // This action can be used with WillOnce. +++// EXPECT_CALL(mock, Call) +++// .WillOnce(ProvideFoo{std::make_unique(...)}); +++// +++// // But a call to WillRepeatedly will fail to compile. This is correct, +++// // since the action cannot correctly be used repeatedly. +++// EXPECT_CALL(mock, Call) +++// .WillRepeatedly(ProvideFoo{std::make_unique(...)}); +++// +++// A less-contrived example would be an action that returns an arbitrary type, +++// whose &&-qualified call operator is capable of dealing with move-only types. +++template +++class OnceAction final { +++ private: +++ // True iff we can use the given callable type (or lvalue reference) directly +++ // via StdFunctionAdaptor. +++ template +++ using IsDirectlyCompatible = internal::conjunction< +++ // It must be possible to capture the callable in StdFunctionAdaptor. +++ std::is_constructible::type, Callable>, +++ // The callable must be compatible with our signature. +++ internal::is_callable_r::type, +++ Args...>>; +++ +++ // True iff we can use the given callable type via StdFunctionAdaptor once we +++ // ignore incoming arguments. +++ template +++ using IsCompatibleAfterIgnoringArguments = internal::conjunction< +++ // It must be possible to capture the callable in a lambda. +++ std::is_constructible::type, Callable>, +++ // The callable must be invocable with zero arguments, returning something +++ // convertible to Result. +++ internal::is_callable_r::type>>; +++ +++ public: +++ // Construct from a callable that is directly compatible with our mocked +++ // signature: it accepts our function type's arguments and returns something +++ // convertible to our result type. +++ template ::type>>, +++ IsDirectlyCompatible> // +++ ::value, +++ int>::type = 0> +++ OnceAction(Callable&& callable) // NOLINT +++ : function_(StdFunctionAdaptor::type>( +++ {}, std::forward(callable))) {} +++ +++ // As above, but for a callable that ignores the mocked function's arguments. +++ template ::type>>, +++ // Exclude callables for which the overload above works. +++ // We'd rather provide the arguments if possible. +++ internal::negation>, +++ IsCompatibleAfterIgnoringArguments>::value, +++ int>::type = 0> +++ OnceAction(Callable&& callable) // NOLINT +++ // Call the constructor above with a callable +++ // that ignores the input arguments. +++ : OnceAction(IgnoreIncomingArguments::type>{ +++ std::forward(callable)}) {} +++ +++ // We are naturally copyable because we store only an std::function, but +++ // semantically we should not be copyable. +++ OnceAction(const OnceAction&) = delete; +++ OnceAction& operator=(const OnceAction&) = delete; +++ OnceAction(OnceAction&&) = default; +++ +++ // Invoke the underlying action callable with which we were constructed, +++ // handing it the supplied arguments. +++ Result Call(Args... args) && { +++ return function_(std::forward(args)...); +++ } +++ +++ private: +++ // An adaptor that wraps a callable that is compatible with our signature and +++ // being invoked as an rvalue reference so that it can be used as an +++ // StdFunctionAdaptor. This throws away type safety, but that's fine because +++ // this is only used by WillOnce, which we know calls at most once. +++ // +++ // Once we have something like std::move_only_function from C++23, we can do +++ // away with this. +++ template +++ class StdFunctionAdaptor final { +++ public: +++ // A tag indicating that the (otherwise universal) constructor is accepting +++ // the callable itself, instead of e.g. stealing calls for the move +++ // constructor. +++ struct CallableTag final {}; +++ +++ template +++ explicit StdFunctionAdaptor(CallableTag, F&& callable) +++ : callable_(std::make_shared(std::forward(callable))) {} +++ +++ // Rather than explicitly returning Result, we return whatever the wrapped +++ // callable returns. This allows for compatibility with existing uses like +++ // the following, when the mocked function returns void: +++ // +++ // EXPECT_CALL(mock_fn_, Call) +++ // .WillOnce([&] { +++ // [...] +++ // return 0; +++ // }); +++ // +++ // Such a callable can be turned into std::function. If we use an +++ // explicit return type of Result here then it *doesn't* work with +++ // std::function, because we'll get a "void function should not return a +++ // value" error. +++ // +++ // We need not worry about incompatible result types because the SFINAE on +++ // OnceAction already checks this for us. std::is_invocable_r_v itself makes +++ // the same allowance for void result types. +++ template +++ internal::call_result_t operator()( +++ ArgRefs&&... args) const { +++ return std::move(*callable_)(std::forward(args)...); +++ } +++ +++ private: +++ // We must put the callable on the heap so that we are copyable, which +++ // std::function needs. +++ std::shared_ptr callable_; +++ }; +++ +++ // An adaptor that makes a callable that accepts zero arguments callable with +++ // our mocked arguments. +++ template +++ struct IgnoreIncomingArguments { +++ internal::call_result_t operator()(Args&&...) { +++ return std::move(callable)(); +++ } +++ +++ Callable callable; +++ }; +++ +++ std::function function_; +++}; +++ +++// When an unexpected function call is encountered, Google Mock will +++// let it return a default value if the user has specified one for its +++// return type, or if the return type has a built-in default value; +++// otherwise Google Mock won't know what value to return and will have +++// to abort the process. +++// +++// The DefaultValue class allows a user to specify the +++// default value for a type T that is both copyable and publicly +++// destructible (i.e. anything that can be used as a function return +++// type). The usage is: +++// +++// // Sets the default value for type T to be foo. +++// DefaultValue::Set(foo); +++template +++class DefaultValue { +++ public: +++ // Sets the default value for type T; requires T to be +++ // copy-constructable and have a public destructor. +++ static void Set(T x) { +++ delete producer_; +++ producer_ = new FixedValueProducer(x); +++ } +++ +++ // Provides a factory function to be called to generate the default value. +++ // This method can be used even if T is only move-constructible, but it is not +++ // limited to that case. +++ typedef T (*FactoryFunction)(); +++ static void SetFactory(FactoryFunction factory) { +++ delete producer_; +++ producer_ = new FactoryValueProducer(factory); +++ } +++ +++ // Unsets the default value for type T. +++ static void Clear() { +++ delete producer_; +++ producer_ = nullptr; +++ } +++ +++ // Returns true if and only if the user has set the default value for type T. +++ static bool IsSet() { return producer_ != nullptr; } +++ +++ // Returns true if T has a default return value set by the user or there +++ // exists a built-in default value. +++ static bool Exists() { +++ return IsSet() || internal::BuiltInDefaultValue::Exists(); +++ } +++ +++ // Returns the default value for type T if the user has set one; +++ // otherwise returns the built-in default value. Requires that Exists() +++ // is true, which ensures that the return value is well-defined. +++ static T Get() { +++ return producer_ == nullptr ? internal::BuiltInDefaultValue::Get() +++ : producer_->Produce(); +++ } +++ +++ private: +++ class ValueProducer { +++ public: +++ virtual ~ValueProducer() = default; +++ virtual T Produce() = 0; +++ }; +++ +++ class FixedValueProducer : public ValueProducer { +++ public: +++ explicit FixedValueProducer(T value) : value_(value) {} +++ T Produce() override { return value_; } +++ +++ private: +++ const T value_; +++ FixedValueProducer(const FixedValueProducer&) = delete; +++ FixedValueProducer& operator=(const FixedValueProducer&) = delete; +++ }; +++ +++ class FactoryValueProducer : public ValueProducer { +++ public: +++ explicit FactoryValueProducer(FactoryFunction factory) +++ : factory_(factory) {} +++ T Produce() override { return factory_(); } +++ +++ private: +++ const FactoryFunction factory_; +++ FactoryValueProducer(const FactoryValueProducer&) = delete; +++ FactoryValueProducer& operator=(const FactoryValueProducer&) = delete; +++ }; +++ +++ static ValueProducer* producer_; +++}; +++ +++// This partial specialization allows a user to set default values for +++// reference types. +++template +++class DefaultValue { +++ public: +++ // Sets the default value for type T&. +++ static void Set(T& x) { // NOLINT +++ address_ = &x; +++ } +++ +++ // Unsets the default value for type T&. +++ static void Clear() { address_ = nullptr; } +++ +++ // Returns true if and only if the user has set the default value for type T&. +++ static bool IsSet() { return address_ != nullptr; } +++ +++ // Returns true if T has a default return value set by the user or there +++ // exists a built-in default value. +++ static bool Exists() { +++ return IsSet() || internal::BuiltInDefaultValue::Exists(); +++ } +++ +++ // Returns the default value for type T& if the user has set one; +++ // otherwise returns the built-in default value if there is one; +++ // otherwise aborts the process. +++ static T& Get() { +++ return address_ == nullptr ? internal::BuiltInDefaultValue::Get() +++ : *address_; +++ } +++ +++ private: +++ static T* address_; +++}; +++ +++// This specialization allows DefaultValue::Get() to +++// compile. +++template <> +++class DefaultValue { +++ public: +++ static bool Exists() { return true; } +++ static void Get() {} +++}; +++ +++// Points to the user-set default value for type T. +++template +++typename DefaultValue::ValueProducer* DefaultValue::producer_ = nullptr; +++ +++// Points to the user-set default value for type T&. +++template +++T* DefaultValue::address_ = nullptr; +++ +++// Implement this interface to define an action for function type F. +++template +++class ActionInterface { +++ public: +++ typedef typename internal::Function::Result Result; +++ typedef typename internal::Function::ArgumentTuple ArgumentTuple; +++ +++ ActionInterface() = default; +++ virtual ~ActionInterface() = default; +++ +++ // Performs the action. This method is not const, as in general an +++ // action can have side effects and be stateful. For example, a +++ // get-the-next-element-from-the-collection action will need to +++ // remember the current element. +++ virtual Result Perform(const ArgumentTuple& args) = 0; +++ +++ private: +++ ActionInterface(const ActionInterface&) = delete; +++ ActionInterface& operator=(const ActionInterface&) = delete; +++}; +++ +++template +++class Action; +++ +++// An Action is a copyable and IMMUTABLE (except by assignment) +++// object that represents an action to be taken when a mock function of type +++// R(Args...) is called. The implementation of Action is just a +++// std::shared_ptr to const ActionInterface. Don't inherit from Action! You +++// can view an object implementing ActionInterface as a concrete action +++// (including its current state), and an Action object as a handle to it. +++template +++class Action { +++ private: +++ using F = R(Args...); +++ +++ // Adapter class to allow constructing Action from a legacy ActionInterface. +++ // New code should create Actions from functors instead. +++ struct ActionAdapter { +++ // Adapter must be copyable to satisfy std::function requirements. +++ ::std::shared_ptr> impl_; +++ +++ template +++ typename internal::Function::Result operator()(InArgs&&... args) { +++ return impl_->Perform( +++ ::std::forward_as_tuple(::std::forward(args)...)); +++ } +++ }; +++ +++ template +++ using IsCompatibleFunctor = std::is_constructible, G>; +++ +++ public: +++ typedef typename internal::Function::Result Result; +++ typedef typename internal::Function::ArgumentTuple ArgumentTuple; +++ +++ // Constructs a null Action. Needed for storing Action objects in +++ // STL containers. +++ Action() = default; +++ +++ // Construct an Action from a specified callable. +++ // This cannot take std::function directly, because then Action would not be +++ // directly constructible from lambda (it would require two conversions). +++ template < +++ typename G, +++ typename = typename std::enable_if, std::is_constructible, +++ G>>::value>::type> +++ Action(G&& fun) { // NOLINT +++ Init(::std::forward(fun), IsCompatibleFunctor()); +++ } +++ +++ // Constructs an Action from its implementation. +++ explicit Action(ActionInterface* impl) +++ : fun_(ActionAdapter{::std::shared_ptr>(impl)}) {} +++ +++ // This constructor allows us to turn an Action object into an +++ // Action, as long as F's arguments can be implicitly converted +++ // to Func's and Func's return type can be implicitly converted to F's. +++ template +++ Action(const Action& action) // NOLINT +++ : fun_(action.fun_) {} +++ +++ // Returns true if and only if this is the DoDefault() action. +++ bool IsDoDefault() const { return fun_ == nullptr; } +++ +++ // Performs the action. Note that this method is const even though +++ // the corresponding method in ActionInterface is not. The reason +++ // is that a const Action means that it cannot be re-bound to +++ // another concrete action, not that the concrete action it binds to +++ // cannot change state. (Think of the difference between a const +++ // pointer and a pointer to const.) +++ Result Perform(ArgumentTuple args) const { +++ if (IsDoDefault()) { +++ internal::IllegalDoDefault(__FILE__, __LINE__); +++ } +++ return internal::Apply(fun_, ::std::move(args)); +++ } +++ +++ // An action can be used as a OnceAction, since it's obviously safe to call it +++ // once. +++ operator OnceAction() const { // NOLINT +++ // Return a OnceAction-compatible callable that calls Perform with the +++ // arguments it is provided. We could instead just return fun_, but then +++ // we'd need to handle the IsDoDefault() case separately. +++ struct OA { +++ Action action; +++ +++ R operator()(Args... args) && { +++ return action.Perform( +++ std::forward_as_tuple(std::forward(args)...)); +++ } +++ }; +++ +++ return OA{*this}; +++ } +++ +++ private: +++ template +++ friend class Action; +++ +++ template +++ void Init(G&& g, ::std::true_type) { +++ fun_ = ::std::forward(g); +++ } +++ +++ template +++ void Init(G&& g, ::std::false_type) { +++ fun_ = IgnoreArgs::type>{::std::forward(g)}; +++ } +++ +++ template +++ struct IgnoreArgs { +++ template +++ Result operator()(const InArgs&...) const { +++ return function_impl(); +++ } +++ +++ FunctionImpl function_impl; +++ }; +++ +++ // fun_ is an empty function if and only if this is the DoDefault() action. +++ ::std::function fun_; +++}; +++ +++// The PolymorphicAction class template makes it easy to implement a +++// polymorphic action (i.e. an action that can be used in mock +++// functions of than one type, e.g. Return()). +++// +++// To define a polymorphic action, a user first provides a COPYABLE +++// implementation class that has a Perform() method template: +++// +++// class FooAction { +++// public: +++// template +++// Result Perform(const ArgumentTuple& args) const { +++// // Processes the arguments and returns a result, using +++// // std::get(args) to get the N-th (0-based) argument in the tuple. +++// } +++// ... +++// }; +++// +++// Then the user creates the polymorphic action using +++// MakePolymorphicAction(object) where object has type FooAction. See +++// the definition of Return(void) and SetArgumentPointee(value) for +++// complete examples. +++template +++class PolymorphicAction { +++ public: +++ explicit PolymorphicAction(const Impl& impl) : impl_(impl) {} +++ +++ template +++ operator Action() const { +++ return Action(new MonomorphicImpl(impl_)); +++ } +++ +++ private: +++ template +++ class MonomorphicImpl : public ActionInterface { +++ public: +++ typedef typename internal::Function::Result Result; +++ typedef typename internal::Function::ArgumentTuple ArgumentTuple; +++ +++ explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} +++ +++ Result Perform(const ArgumentTuple& args) override { +++ return impl_.template Perform(args); +++ } +++ +++ private: +++ Impl impl_; +++ }; +++ +++ Impl impl_; +++}; +++ +++// Creates an Action from its implementation and returns it. The +++// created Action object owns the implementation. +++template +++Action MakeAction(ActionInterface* impl) { +++ return Action(impl); +++} +++ +++// Creates a polymorphic action from its implementation. This is +++// easier to use than the PolymorphicAction constructor as it +++// doesn't require you to explicitly write the template argument, e.g. +++// +++// MakePolymorphicAction(foo); +++// vs +++// PolymorphicAction(foo); +++template +++inline PolymorphicAction MakePolymorphicAction(const Impl& impl) { +++ return PolymorphicAction(impl); +++} +++ +++namespace internal { +++ +++// Helper struct to specialize ReturnAction to execute a move instead of a copy +++// on return. Useful for move-only types, but could be used on any type. +++template +++struct ByMoveWrapper { +++ explicit ByMoveWrapper(T value) : payload(std::move(value)) {} +++ T payload; +++}; +++ +++// The general implementation of Return(R). Specializations follow below. +++template +++class ReturnAction final { +++ public: +++ explicit ReturnAction(R value) : value_(std::move(value)) {} +++ +++ template >, // +++ negation>, // +++ std::is_convertible, // +++ std::is_move_constructible>::value>::type> +++ operator OnceAction() && { // NOLINT +++ return Impl(std::move(value_)); +++ } +++ +++ template >, // +++ negation>, // +++ std::is_convertible, // +++ std::is_copy_constructible>::value>::type> +++ operator Action() const { // NOLINT +++ return Impl(value_); +++ } +++ +++ private: +++ // Implements the Return(x) action for a mock function that returns type U. +++ template +++ class Impl final { +++ public: +++ // The constructor used when the return value is allowed to move from the +++ // input value (i.e. we are converting to OnceAction). +++ explicit Impl(R&& input_value) +++ : state_(new State(std::move(input_value))) {} +++ +++ // The constructor used when the return value is not allowed to move from +++ // the input value (i.e. we are converting to Action). +++ explicit Impl(const R& input_value) : state_(new State(input_value)) {} +++ +++ U operator()() && { return std::move(state_->value); } +++ U operator()() const& { return state_->value; } +++ +++ private: +++ // We put our state on the heap so that the compiler-generated copy/move +++ // constructors work correctly even when U is a reference-like type. This is +++ // necessary only because we eagerly create State::value (see the note on +++ // that symbol for details). If we instead had only the input value as a +++ // member then the default constructors would work fine. +++ // +++ // For example, when R is std::string and U is std::string_view, value is a +++ // reference to the string backed by input_value. The copy constructor would +++ // copy both, so that we wind up with a new input_value object (with the +++ // same contents) and a reference to the *old* input_value object rather +++ // than the new one. +++ struct State { +++ explicit State(const R& input_value_in) +++ : input_value(input_value_in), +++ // Make an implicit conversion to Result before initializing the U +++ // object we store, avoiding calling any explicit constructor of U +++ // from R. +++ // +++ // This simulates the language rules: a function with return type U +++ // that does `return R()` requires R to be implicitly convertible to +++ // U, and uses that path for the conversion, even U Result has an +++ // explicit constructor from R. +++ value(ImplicitCast_(internal::as_const(input_value))) {} +++ +++ // As above, but for the case where we're moving from the ReturnAction +++ // object because it's being used as a OnceAction. +++ explicit State(R&& input_value_in) +++ : input_value(std::move(input_value_in)), +++ // For the same reason as above we make an implicit conversion to U +++ // before initializing the value. +++ // +++ // Unlike above we provide the input value as an rvalue to the +++ // implicit conversion because this is a OnceAction: it's fine if it +++ // wants to consume the input value. +++ value(ImplicitCast_(std::move(input_value))) {} +++ +++ // A copy of the value originally provided by the user. We retain this in +++ // addition to the value of the mock function's result type below in case +++ // the latter is a reference-like type. See the std::string_view example +++ // in the documentation on Return. +++ R input_value; +++ +++ // The value we actually return, as the type returned by the mock function +++ // itself. +++ // +++ // We eagerly initialize this here, rather than lazily doing the implicit +++ // conversion automatically each time Perform is called, for historical +++ // reasons: in 2009-11, commit a070cbd91c (Google changelist 13540126) +++ // made the Action conversion operator eagerly convert the R value to +++ // U, but without keeping the R alive. This broke the use case discussed +++ // in the documentation for Return, making reference-like types such as +++ // std::string_view not safe to use as U where the input type R is a +++ // value-like type such as std::string. +++ // +++ // The example the commit gave was not very clear, nor was the issue +++ // thread (https://github.com/google/googlemock/issues/86), but it seems +++ // the worry was about reference-like input types R that flatten to a +++ // value-like type U when being implicitly converted. An example of this +++ // is std::vector::reference, which is often a proxy type with an +++ // reference to the underlying vector: +++ // +++ // // Helper method: have the mock function return bools according +++ // // to the supplied script. +++ // void SetActions(MockFunction& mock, +++ // const std::vector& script) { +++ // for (size_t i = 0; i < script.size(); ++i) { +++ // EXPECT_CALL(mock, Call(i)).WillOnce(Return(script[i])); +++ // } +++ // } +++ // +++ // TEST(Foo, Bar) { +++ // // Set actions using a temporary vector, whose operator[] +++ // // returns proxy objects that references that will be +++ // // dangling once the call to SetActions finishes and the +++ // // vector is destroyed. +++ // MockFunction mock; +++ // SetActions(mock, {false, true}); +++ // +++ // EXPECT_FALSE(mock.AsStdFunction()(0)); +++ // EXPECT_TRUE(mock.AsStdFunction()(1)); +++ // } +++ // +++ // This eager conversion helps with a simple case like this, but doesn't +++ // fully make these types work in general. For example the following still +++ // uses a dangling reference: +++ // +++ // TEST(Foo, Baz) { +++ // MockFunction()> mock; +++ // +++ // // Return the same vector twice, and then the empty vector +++ // // thereafter. +++ // auto action = Return(std::initializer_list{ +++ // "taco", "burrito", +++ // }); +++ // +++ // EXPECT_CALL(mock, Call) +++ // .WillOnce(action) +++ // .WillOnce(action) +++ // .WillRepeatedly(Return(std::vector{})); +++ // +++ // EXPECT_THAT(mock.AsStdFunction()(), +++ // ElementsAre("taco", "burrito")); +++ // EXPECT_THAT(mock.AsStdFunction()(), +++ // ElementsAre("taco", "burrito")); +++ // EXPECT_THAT(mock.AsStdFunction()(), IsEmpty()); +++ // } +++ // +++ U value; +++ }; +++ +++ const std::shared_ptr state_; +++ }; +++ +++ R value_; +++}; +++ +++// A specialization of ReturnAction when R is ByMoveWrapper for some T. +++// +++// This version applies the type system-defeating hack of moving from T even in +++// the const call operator, checking at runtime that it isn't called more than +++// once, since the user has declared their intent to do so by using ByMove. +++template +++class ReturnAction> final { +++ public: +++ explicit ReturnAction(ByMoveWrapper wrapper) +++ : state_(new State(std::move(wrapper.payload))) {} +++ +++ T operator()() const { +++ GTEST_CHECK_(!state_->called) +++ << "A ByMove() action must be performed at most once."; +++ +++ state_->called = true; +++ return std::move(state_->value); +++ } +++ +++ private: +++ // We store our state on the heap so that we are copyable as required by +++ // Action, despite the fact that we are stateful and T may not be copyable. +++ struct State { +++ explicit State(T&& value_in) : value(std::move(value_in)) {} +++ +++ T value; +++ bool called = false; +++ }; +++ +++ const std::shared_ptr state_; +++}; +++ +++// Implements the ReturnNull() action. +++class ReturnNullAction { +++ public: +++ // Allows ReturnNull() to be used in any pointer-returning function. In C++11 +++ // this is enforced by returning nullptr, and in non-C++11 by asserting a +++ // pointer type on compile time. +++ template +++ static Result Perform(const ArgumentTuple&) { +++ return nullptr; +++ } +++}; +++ +++// Implements the Return() action. +++class ReturnVoidAction { +++ public: +++ // Allows Return() to be used in any void-returning function. +++ template +++ static void Perform(const ArgumentTuple&) { +++ static_assert(std::is_void::value, "Result should be void."); +++ } +++}; +++ +++// Implements the polymorphic ReturnRef(x) action, which can be used +++// in any function that returns a reference to the type of x, +++// regardless of the argument types. +++template +++class ReturnRefAction { +++ public: +++ // Constructs a ReturnRefAction object from the reference to be returned. +++ explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT +++ +++ // This template type conversion operator allows ReturnRef(x) to be +++ // used in ANY function that returns a reference to x's type. +++ template +++ operator Action() const { +++ typedef typename Function::Result Result; +++ // Asserts that the function return type is a reference. This +++ // catches the user error of using ReturnRef(x) when Return(x) +++ // should be used, and generates some helpful error message. +++ static_assert(std::is_reference::value, +++ "use Return instead of ReturnRef to return a value"); +++ return Action(new Impl(ref_)); +++ } +++ +++ private: +++ // Implements the ReturnRef(x) action for a particular function type F. +++ template +++ class Impl : public ActionInterface { +++ public: +++ typedef typename Function::Result Result; +++ typedef typename Function::ArgumentTuple ArgumentTuple; +++ +++ explicit Impl(T& ref) : ref_(ref) {} // NOLINT +++ +++ Result Perform(const ArgumentTuple&) override { return ref_; } +++ +++ private: +++ T& ref_; +++ }; +++ +++ T& ref_; +++}; +++ +++// Implements the polymorphic ReturnRefOfCopy(x) action, which can be +++// used in any function that returns a reference to the type of x, +++// regardless of the argument types. +++template +++class ReturnRefOfCopyAction { +++ public: +++ // Constructs a ReturnRefOfCopyAction object from the reference to +++ // be returned. +++ explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT +++ +++ // This template type conversion operator allows ReturnRefOfCopy(x) to be +++ // used in ANY function that returns a reference to x's type. +++ template +++ operator Action() const { +++ typedef typename Function::Result Result; +++ // Asserts that the function return type is a reference. This +++ // catches the user error of using ReturnRefOfCopy(x) when Return(x) +++ // should be used, and generates some helpful error message. +++ static_assert(std::is_reference::value, +++ "use Return instead of ReturnRefOfCopy to return a value"); +++ return Action(new Impl(value_)); +++ } +++ +++ private: +++ // Implements the ReturnRefOfCopy(x) action for a particular function type F. +++ template +++ class Impl : public ActionInterface { +++ public: +++ typedef typename Function::Result Result; +++ typedef typename Function::ArgumentTuple ArgumentTuple; +++ +++ explicit Impl(const T& value) : value_(value) {} // NOLINT +++ +++ Result Perform(const ArgumentTuple&) override { return value_; } +++ +++ private: +++ T value_; +++ }; +++ +++ const T value_; +++}; +++ +++// Implements the polymorphic ReturnRoundRobin(v) action, which can be +++// used in any function that returns the element_type of v. +++template +++class ReturnRoundRobinAction { +++ public: +++ explicit ReturnRoundRobinAction(std::vector values) { +++ GTEST_CHECK_(!values.empty()) +++ << "ReturnRoundRobin requires at least one element."; +++ state_->values = std::move(values); +++ } +++ +++ template +++ T operator()(Args&&...) const { +++ return state_->Next(); +++ } +++ +++ private: +++ struct State { +++ T Next() { +++ T ret_val = values[i++]; +++ if (i == values.size()) i = 0; +++ return ret_val; +++ } +++ +++ std::vector values; +++ size_t i = 0; +++ }; +++ std::shared_ptr state_ = std::make_shared(); +++}; +++ +++// Implements the polymorphic DoDefault() action. +++class DoDefaultAction { +++ public: +++ // This template type conversion operator allows DoDefault() to be +++ // used in any function. +++ template +++ operator Action() const { +++ return Action(); +++ } // NOLINT +++}; +++ +++// Implements the Assign action to set a given pointer referent to a +++// particular value. +++template +++class AssignAction { +++ public: +++ AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {} +++ +++ template +++ void Perform(const ArgumentTuple& /* args */) const { +++ *ptr_ = value_; +++ } +++ +++ private: +++ T1* const ptr_; +++ const T2 value_; +++}; +++ +++#ifndef GTEST_OS_WINDOWS_MOBILE +++ +++// Implements the SetErrnoAndReturn action to simulate return from +++// various system calls and libc functions. +++template +++class SetErrnoAndReturnAction { +++ public: +++ SetErrnoAndReturnAction(int errno_value, T result) +++ : errno_(errno_value), result_(result) {} +++ template +++ Result Perform(const ArgumentTuple& /* args */) const { +++ errno = errno_; +++ return result_; +++ } +++ +++ private: +++ const int errno_; +++ const T result_; +++}; +++ +++#endif // !GTEST_OS_WINDOWS_MOBILE +++ +++// Implements the SetArgumentPointee(x) action for any function +++// whose N-th argument (0-based) is a pointer to x's type. +++template +++struct SetArgumentPointeeAction { +++ A value; +++ +++ template +++ void operator()(const Args&... args) const { +++ *::std::get(std::tie(args...)) = value; +++ } +++}; +++ +++// Implements the Invoke(object_ptr, &Class::Method) action. +++template +++struct InvokeMethodAction { +++ Class* const obj_ptr; +++ const MethodPtr method_ptr; +++ +++ template +++ auto operator()(Args&&... args) const +++ -> decltype((obj_ptr->*method_ptr)(std::forward(args)...)) { +++ return (obj_ptr->*method_ptr)(std::forward(args)...); +++ } +++}; +++ +++// Implements the InvokeWithoutArgs(f) action. The template argument +++// FunctionImpl is the implementation type of f, which can be either a +++// function pointer or a functor. InvokeWithoutArgs(f) can be used as an +++// Action as long as f's type is compatible with F. +++template +++struct InvokeWithoutArgsAction { +++ FunctionImpl function_impl; +++ +++ // Allows InvokeWithoutArgs(f) to be used as any action whose type is +++ // compatible with f. +++ template +++ auto operator()(const Args&...) -> decltype(function_impl()) { +++ return function_impl(); +++ } +++}; +++ +++// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action. +++template +++struct InvokeMethodWithoutArgsAction { +++ Class* const obj_ptr; +++ const MethodPtr method_ptr; +++ +++ using ReturnType = +++ decltype((std::declval()->*std::declval())()); +++ +++ template +++ ReturnType operator()(const Args&...) const { +++ return (obj_ptr->*method_ptr)(); +++ } +++}; +++ +++// Implements the IgnoreResult(action) action. +++template +++class IgnoreResultAction { +++ public: +++ explicit IgnoreResultAction(const A& action) : action_(action) {} +++ +++ template +++ operator Action() const { +++ // Assert statement belongs here because this is the best place to verify +++ // conditions on F. It produces the clearest error messages +++ // in most compilers. +++ // Impl really belongs in this scope as a local class but can't +++ // because MSVC produces duplicate symbols in different translation units +++ // in this case. Until MS fixes that bug we put Impl into the class scope +++ // and put the typedef both here (for use in assert statement) and +++ // in the Impl class. But both definitions must be the same. +++ typedef typename internal::Function::Result Result; +++ +++ // Asserts at compile time that F returns void. +++ static_assert(std::is_void::value, "Result type should be void."); +++ +++ return Action(new Impl(action_)); +++ } +++ +++ private: +++ template +++ class Impl : public ActionInterface { +++ public: +++ typedef typename internal::Function::Result Result; +++ typedef typename internal::Function::ArgumentTuple ArgumentTuple; +++ +++ explicit Impl(const A& action) : action_(action) {} +++ +++ void Perform(const ArgumentTuple& args) override { +++ // Performs the action and ignores its result. +++ action_.Perform(args); +++ } +++ +++ private: +++ // Type OriginalFunction is the same as F except that its return +++ // type is IgnoredValue. +++ typedef +++ typename internal::Function::MakeResultIgnoredValue OriginalFunction; +++ +++ const Action action_; +++ }; +++ +++ const A action_; +++}; +++ +++template +++struct WithArgsAction { +++ InnerAction inner_action; +++ +++ // The signature of the function as seen by the inner action, given an out +++ // action with the given result and argument types. +++ template +++ using InnerSignature = +++ R(typename std::tuple_element>::type...); +++ +++ // Rather than a call operator, we must define conversion operators to +++ // particular action types. This is necessary for embedded actions like +++ // DoDefault(), which rely on an action conversion operators rather than +++ // providing a call operator because even with a particular set of arguments +++ // they don't have a fixed return type. +++ +++ template < +++ typename R, typename... Args, +++ typename std::enable_if< +++ std::is_convertible>...)>>::value, +++ int>::type = 0> +++ operator OnceAction() && { // NOLINT +++ struct OA { +++ OnceAction> inner_action; +++ +++ R operator()(Args&&... args) && { +++ return std::move(inner_action) +++ .Call(std::get( +++ std::forward_as_tuple(std::forward(args)...))...); +++ } +++ }; +++ +++ return OA{std::move(inner_action)}; +++ } +++ +++ template < +++ typename R, typename... Args, +++ typename std::enable_if< +++ std::is_convertible>...)>>::value, +++ int>::type = 0> +++ operator Action() const { // NOLINT +++ Action> converted(inner_action); +++ +++ return [converted](Args&&... args) -> R { +++ return converted.Perform(std::forward_as_tuple( +++ std::get(std::forward_as_tuple(std::forward(args)...))...)); +++ }; +++ } +++}; +++ +++template +++class DoAllAction; +++ +++// Base case: only a single action. +++template +++class DoAllAction { +++ public: +++ struct UserConstructorTag {}; +++ +++ template +++ explicit DoAllAction(UserConstructorTag, T&& action) +++ : final_action_(std::forward(action)) {} +++ +++ // Rather than a call operator, we must define conversion operators to +++ // particular action types. This is necessary for embedded actions like +++ // DoDefault(), which rely on an action conversion operators rather than +++ // providing a call operator because even with a particular set of arguments +++ // they don't have a fixed return type. +++ +++ template >::value, +++ int>::type = 0> +++ operator OnceAction() && { // NOLINT +++ return std::move(final_action_); +++ } +++ +++ template < +++ typename R, typename... Args, +++ typename std::enable_if< +++ std::is_convertible>::value, +++ int>::type = 0> +++ operator Action() const { // NOLINT +++ return final_action_; +++ } +++ +++ private: +++ FinalAction final_action_; +++}; +++ +++// Recursive case: support N actions by calling the initial action and then +++// calling through to the base class containing N-1 actions. +++template +++class DoAllAction +++ : private DoAllAction { +++ private: +++ using Base = DoAllAction; +++ +++ // The type of reference that should be provided to an initial action for a +++ // mocked function parameter of type T. +++ // +++ // There are two quirks here: +++ // +++ // * Unlike most forwarding functions, we pass scalars through by value. +++ // This isn't strictly necessary because an lvalue reference would work +++ // fine too and be consistent with other non-reference types, but it's +++ // perhaps less surprising. +++ // +++ // For example if the mocked function has signature void(int), then it +++ // might seem surprising for the user's initial action to need to be +++ // convertible to Action. This is perhaps less +++ // surprising for a non-scalar type where there may be a performance +++ // impact, or it might even be impossible, to pass by value. +++ // +++ // * More surprisingly, `const T&` is often not a const reference type. +++ // By the reference collapsing rules in C++17 [dcl.ref]/6, if T refers to +++ // U& or U&& for some non-scalar type U, then InitialActionArgType is +++ // U&. In other words, we may hand over a non-const reference. +++ // +++ // So for example, given some non-scalar type Obj we have the following +++ // mappings: +++ // +++ // T InitialActionArgType +++ // ------- ----------------------- +++ // Obj const Obj& +++ // Obj& Obj& +++ // Obj&& Obj& +++ // const Obj const Obj& +++ // const Obj& const Obj& +++ // const Obj&& const Obj& +++ // +++ // In other words, the initial actions get a mutable view of an non-scalar +++ // argument if and only if the mock function itself accepts a non-const +++ // reference type. They are never given an rvalue reference to an +++ // non-scalar type. +++ // +++ // This situation makes sense if you imagine use with a matcher that is +++ // designed to write through a reference. For example, if the caller wants +++ // to fill in a reference argument and then return a canned value: +++ // +++ // EXPECT_CALL(mock, Call) +++ // .WillOnce(DoAll(SetArgReferee<0>(17), Return(19))); +++ // +++ template +++ using InitialActionArgType = +++ typename std::conditional::value, T, const T&>::type; +++ +++ public: +++ struct UserConstructorTag {}; +++ +++ template +++ explicit DoAllAction(UserConstructorTag, T&& initial_action, +++ U&&... other_actions) +++ : Base({}, std::forward(other_actions)...), +++ initial_action_(std::forward(initial_action)) {} +++ +++ template ...)>>, +++ std::is_convertible>>::value, +++ int>::type = 0> +++ operator OnceAction() && { // NOLINT +++ // Return an action that first calls the initial action with arguments +++ // filtered through InitialActionArgType, then forwards arguments directly +++ // to the base class to deal with the remaining actions. +++ struct OA { +++ OnceAction...)> initial_action; +++ OnceAction remaining_actions; +++ +++ R operator()(Args... args) && { +++ std::move(initial_action) +++ .Call(static_cast>(args)...); +++ +++ return std::move(remaining_actions).Call(std::forward(args)...); +++ } +++ }; +++ +++ return OA{ +++ std::move(initial_action_), +++ std::move(static_cast(*this)), +++ }; +++ } +++ +++ template < +++ typename R, typename... Args, +++ typename std::enable_if< +++ conjunction< +++ // Both the initial action and the rest must support conversion to +++ // Action. +++ std::is_convertible...)>>, +++ std::is_convertible>>::value, +++ int>::type = 0> +++ operator Action() const { // NOLINT +++ // Return an action that first calls the initial action with arguments +++ // filtered through InitialActionArgType, then forwards arguments directly +++ // to the base class to deal with the remaining actions. +++ struct OA { +++ Action...)> initial_action; +++ Action remaining_actions; +++ +++ R operator()(Args... args) const { +++ initial_action.Perform(std::forward_as_tuple( +++ static_cast>(args)...)); +++ +++ return remaining_actions.Perform( +++ std::forward_as_tuple(std::forward(args)...)); +++ } +++ }; +++ +++ return OA{ +++ initial_action_, +++ static_cast(*this), +++ }; +++ } +++ +++ private: +++ InitialAction initial_action_; +++}; +++ +++template +++struct ReturnNewAction { +++ T* operator()() const { +++ return internal::Apply( +++ [](const Params&... unpacked_params) { +++ return new T(unpacked_params...); +++ }, +++ params); +++ } +++ std::tuple params; +++}; +++ +++template +++struct ReturnArgAction { +++ template ::type> +++ auto operator()(Args&&... args) const -> decltype(std::get( +++ std::forward_as_tuple(std::forward(args)...))) { +++ return std::get(std::forward_as_tuple(std::forward(args)...)); +++ } +++}; +++ +++template +++struct SaveArgAction { +++ Ptr pointer; +++ +++ template +++ void operator()(const Args&... args) const { +++ *pointer = std::get(std::tie(args...)); +++ } +++}; +++ +++template +++struct SaveArgPointeeAction { +++ Ptr pointer; +++ +++ template +++ void operator()(const Args&... args) const { +++ *pointer = *std::get(std::tie(args...)); +++ } +++}; +++ +++template +++struct SetArgRefereeAction { +++ T value; +++ +++ template +++ void operator()(Args&&... args) const { +++ using argk_type = +++ typename ::std::tuple_element>::type; +++ static_assert(std::is_lvalue_reference::value, +++ "Argument must be a reference type."); +++ std::get(std::tie(args...)) = value; +++ } +++}; +++ +++template +++struct SetArrayArgumentAction { +++ I1 first; +++ I2 last; +++ +++ template +++ void operator()(const Args&... args) const { +++ auto value = std::get(std::tie(args...)); +++ for (auto it = first; it != last; ++it, (void)++value) { +++ *value = *it; +++ } +++ } +++}; +++ +++template +++struct DeleteArgAction { +++ template +++ void operator()(const Args&... args) const { +++ delete std::get(std::tie(args...)); +++ } +++}; +++ +++template +++struct ReturnPointeeAction { +++ Ptr pointer; +++ template +++ auto operator()(const Args&...) const -> decltype(*pointer) { +++ return *pointer; +++ } +++}; +++ +++#if GTEST_HAS_EXCEPTIONS +++template +++struct ThrowAction { +++ T exception; +++ // We use a conversion operator to adapt to any return type. +++ template +++ operator Action() const { // NOLINT +++ T copy = exception; +++ return [copy](Args...) -> R { throw copy; }; +++ } +++}; +++#endif // GTEST_HAS_EXCEPTIONS +++ +++} // namespace internal +++ +++// An Unused object can be implicitly constructed from ANY value. +++// This is handy when defining actions that ignore some or all of the +++// mock function arguments. For example, given +++// +++// MOCK_METHOD3(Foo, double(const string& label, double x, double y)); +++// MOCK_METHOD3(Bar, double(int index, double x, double y)); +++// +++// instead of +++// +++// double DistanceToOriginWithLabel(const string& label, double x, double y) { +++// return sqrt(x*x + y*y); +++// } +++// double DistanceToOriginWithIndex(int index, double x, double y) { +++// return sqrt(x*x + y*y); +++// } +++// ... +++// EXPECT_CALL(mock, Foo("abc", _, _)) +++// .WillOnce(Invoke(DistanceToOriginWithLabel)); +++// EXPECT_CALL(mock, Bar(5, _, _)) +++// .WillOnce(Invoke(DistanceToOriginWithIndex)); +++// +++// you could write +++// +++// // We can declare any uninteresting argument as Unused. +++// double DistanceToOrigin(Unused, double x, double y) { +++// return sqrt(x*x + y*y); +++// } +++// ... +++// EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin)); +++// EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin)); +++typedef internal::IgnoredValue Unused; +++ +++// Creates an action that does actions a1, a2, ..., sequentially in +++// each invocation. All but the last action will have a readonly view of the +++// arguments. +++template +++internal::DoAllAction::type...> DoAll( +++ Action&&... action) { +++ return internal::DoAllAction::type...>( +++ {}, std::forward(action)...); +++} +++ +++// WithArg(an_action) creates an action that passes the k-th +++// (0-based) argument of the mock function to an_action and performs +++// it. It adapts an action accepting one argument to one that accepts +++// multiple arguments. For convenience, we also provide +++// WithArgs(an_action) (defined below) as a synonym. +++template +++internal::WithArgsAction::type, k> WithArg( +++ InnerAction&& action) { +++ return {std::forward(action)}; +++} +++ +++// WithArgs(an_action) creates an action that passes +++// the selected arguments of the mock function to an_action and +++// performs it. It serves as an adaptor between actions with +++// different argument lists. +++template +++internal::WithArgsAction::type, k, ks...> +++WithArgs(InnerAction&& action) { +++ return {std::forward(action)}; +++} +++ +++// WithoutArgs(inner_action) can be used in a mock function with a +++// non-empty argument list to perform inner_action, which takes no +++// argument. In other words, it adapts an action accepting no +++// argument to one that accepts (and ignores) arguments. +++template +++internal::WithArgsAction::type> WithoutArgs( +++ InnerAction&& action) { +++ return {std::forward(action)}; +++} +++ +++// Creates an action that returns a value. +++// +++// The returned type can be used with a mock function returning a non-void, +++// non-reference type U as follows: +++// +++// * If R is convertible to U and U is move-constructible, then the action can +++// be used with WillOnce. +++// +++// * If const R& is convertible to U and U is copy-constructible, then the +++// action can be used with both WillOnce and WillRepeatedly. +++// +++// The mock expectation contains the R value from which the U return value is +++// constructed (a move/copy of the argument to Return). This means that the R +++// value will survive at least until the mock object's expectations are cleared +++// or the mock object is destroyed, meaning that U can safely be a +++// reference-like type such as std::string_view: +++// +++// // The mock function returns a view of a copy of the string fed to +++// // Return. The view is valid even after the action is performed. +++// MockFunction mock; +++// EXPECT_CALL(mock, Call).WillOnce(Return(std::string("taco"))); +++// const std::string_view result = mock.AsStdFunction()(); +++// EXPECT_EQ("taco", result); +++// +++template +++internal::ReturnAction Return(R value) { +++ return internal::ReturnAction(std::move(value)); +++} +++ +++// Creates an action that returns NULL. +++inline PolymorphicAction ReturnNull() { +++ return MakePolymorphicAction(internal::ReturnNullAction()); +++} +++ +++// Creates an action that returns from a void function. +++inline PolymorphicAction Return() { +++ return MakePolymorphicAction(internal::ReturnVoidAction()); +++} +++ +++// Creates an action that returns the reference to a variable. +++template +++inline internal::ReturnRefAction ReturnRef(R& x) { // NOLINT +++ return internal::ReturnRefAction(x); +++} +++ +++// Prevent using ReturnRef on reference to temporary. +++template +++internal::ReturnRefAction ReturnRef(R&&) = delete; +++ +++// Creates an action that returns the reference to a copy of the +++// argument. The copy is created when the action is constructed and +++// lives as long as the action. +++template +++inline internal::ReturnRefOfCopyAction ReturnRefOfCopy(const R& x) { +++ return internal::ReturnRefOfCopyAction(x); +++} +++ +++// DEPRECATED: use Return(x) directly with WillOnce. +++// +++// Modifies the parent action (a Return() action) to perform a move of the +++// argument instead of a copy. +++// Return(ByMove()) actions can only be executed once and will assert this +++// invariant. +++template +++internal::ByMoveWrapper ByMove(R x) { +++ return internal::ByMoveWrapper(std::move(x)); +++} +++ +++// Creates an action that returns an element of `vals`. Calling this action will +++// repeatedly return the next value from `vals` until it reaches the end and +++// will restart from the beginning. +++template +++internal::ReturnRoundRobinAction ReturnRoundRobin(std::vector vals) { +++ return internal::ReturnRoundRobinAction(std::move(vals)); +++} +++ +++// Creates an action that returns an element of `vals`. Calling this action will +++// repeatedly return the next value from `vals` until it reaches the end and +++// will restart from the beginning. +++template +++internal::ReturnRoundRobinAction ReturnRoundRobin( +++ std::initializer_list vals) { +++ return internal::ReturnRoundRobinAction(std::vector(vals)); +++} +++ +++// Creates an action that does the default action for the give mock function. +++inline internal::DoDefaultAction DoDefault() { +++ return internal::DoDefaultAction(); +++} +++ +++// Creates an action that sets the variable pointed by the N-th +++// (0-based) function argument to 'value'. +++template +++internal::SetArgumentPointeeAction SetArgPointee(T value) { +++ return {std::move(value)}; +++} +++ +++// The following version is DEPRECATED. +++template +++internal::SetArgumentPointeeAction SetArgumentPointee(T value) { +++ return {std::move(value)}; +++} +++ +++// Creates an action that sets a pointer referent to a given value. +++template +++PolymorphicAction> Assign(T1* ptr, T2 val) { +++ return MakePolymorphicAction(internal::AssignAction(ptr, val)); +++} +++ +++#ifndef GTEST_OS_WINDOWS_MOBILE +++ +++// Creates an action that sets errno and returns the appropriate error. +++template +++PolymorphicAction> SetErrnoAndReturn( +++ int errval, T result) { +++ return MakePolymorphicAction( +++ internal::SetErrnoAndReturnAction(errval, result)); +++} +++ +++#endif // !GTEST_OS_WINDOWS_MOBILE +++ +++// Various overloads for Invoke(). +++ +++// Legacy function. +++// Actions can now be implicitly constructed from callables. No need to create +++// wrapper objects. +++// This function exists for backwards compatibility. +++template +++typename std::decay::type Invoke(FunctionImpl&& function_impl) { +++ return std::forward(function_impl); +++} +++ +++// Creates an action that invokes the given method on the given object +++// with the mock function's arguments. +++template +++internal::InvokeMethodAction Invoke(Class* obj_ptr, +++ MethodPtr method_ptr) { +++ return {obj_ptr, method_ptr}; +++} +++ +++// Creates an action that invokes 'function_impl' with no argument. +++template +++internal::InvokeWithoutArgsAction::type> +++InvokeWithoutArgs(FunctionImpl function_impl) { +++ return {std::move(function_impl)}; +++} +++ +++// Creates an action that invokes the given method on the given object +++// with no argument. +++template +++internal::InvokeMethodWithoutArgsAction InvokeWithoutArgs( +++ Class* obj_ptr, MethodPtr method_ptr) { +++ return {obj_ptr, method_ptr}; +++} +++ +++// Creates an action that performs an_action and throws away its +++// result. In other words, it changes the return type of an_action to +++// void. an_action MUST NOT return void, or the code won't compile. +++template +++inline internal::IgnoreResultAction IgnoreResult(const A& an_action) { +++ return internal::IgnoreResultAction(an_action); +++} +++ +++// Creates a reference wrapper for the given L-value. If necessary, +++// you can explicitly specify the type of the reference. For example, +++// suppose 'derived' is an object of type Derived, ByRef(derived) +++// would wrap a Derived&. If you want to wrap a const Base& instead, +++// where Base is a base class of Derived, just write: +++// +++// ByRef(derived) +++// +++// N.B. ByRef is redundant with std::ref, std::cref and std::reference_wrapper. +++// However, it may still be used for consistency with ByMove(). +++template +++inline ::std::reference_wrapper ByRef(T& l_value) { // NOLINT +++ return ::std::reference_wrapper(l_value); +++} +++ +++// The ReturnNew(a1, a2, ..., a_k) action returns a pointer to a new +++// instance of type T, constructed on the heap with constructor arguments +++// a1, a2, ..., and a_k. The caller assumes ownership of the returned value. +++template +++internal::ReturnNewAction::type...> ReturnNew( +++ Params&&... params) { +++ return {std::forward_as_tuple(std::forward(params)...)}; +++} +++ +++// Action ReturnArg() returns the k-th argument of the mock function. +++template +++internal::ReturnArgAction ReturnArg() { +++ return {}; +++} +++ +++// Action SaveArg(pointer) saves the k-th (0-based) argument of the +++// mock function to *pointer. +++template +++internal::SaveArgAction SaveArg(Ptr pointer) { +++ return {pointer}; +++} +++ +++// Action SaveArgPointee(pointer) saves the value pointed to +++// by the k-th (0-based) argument of the mock function to *pointer. +++template +++internal::SaveArgPointeeAction SaveArgPointee(Ptr pointer) { +++ return {pointer}; +++} +++ +++// Action SetArgReferee(value) assigns 'value' to the variable +++// referenced by the k-th (0-based) argument of the mock function. +++template +++internal::SetArgRefereeAction::type> SetArgReferee( +++ T&& value) { +++ return {std::forward(value)}; +++} +++ +++// Action SetArrayArgument(first, last) copies the elements in +++// source range [first, last) to the array pointed to by the k-th +++// (0-based) argument, which can be either a pointer or an +++// iterator. The action does not take ownership of the elements in the +++// source range. +++template +++internal::SetArrayArgumentAction SetArrayArgument(I1 first, +++ I2 last) { +++ return {first, last}; +++} +++ +++// Action DeleteArg() deletes the k-th (0-based) argument of the mock +++// function. +++template +++internal::DeleteArgAction DeleteArg() { +++ return {}; +++} +++ +++// This action returns the value pointed to by 'pointer'. +++template +++internal::ReturnPointeeAction ReturnPointee(Ptr pointer) { +++ return {pointer}; +++} +++ +++// Action Throw(exception) can be used in a mock function of any type +++// to throw the given exception. Any copyable value can be thrown. +++#if GTEST_HAS_EXCEPTIONS +++template +++internal::ThrowAction::type> Throw(T&& exception) { +++ return {std::forward(exception)}; +++} +++#endif // GTEST_HAS_EXCEPTIONS +++ +++namespace internal { +++ +++// A macro from the ACTION* family (defined later in gmock-generated-actions.h) +++// defines an action that can be used in a mock function. Typically, +++// these actions only care about a subset of the arguments of the mock +++// function. For example, if such an action only uses the second +++// argument, it can be used in any mock function that takes >= 2 +++// arguments where the type of the second argument is compatible. +++// +++// Therefore, the action implementation must be prepared to take more +++// arguments than it needs. The ExcessiveArg type is used to +++// represent those excessive arguments. In order to keep the compiler +++// error messages tractable, we define it in the testing namespace +++// instead of testing::internal. However, this is an INTERNAL TYPE +++// and subject to change without notice, so a user MUST NOT USE THIS +++// TYPE DIRECTLY. +++struct ExcessiveArg {}; +++ +++// Builds an implementation of an Action<> for some particular signature, using +++// a class defined by an ACTION* macro. +++template +++struct ActionImpl; +++ +++template +++struct ImplBase { +++ struct Holder { +++ // Allows each copy of the Action<> to get to the Impl. +++ explicit operator const Impl&() const { return *ptr; } +++ std::shared_ptr ptr; +++ }; +++ using type = typename std::conditional::value, +++ Impl, Holder>::type; +++}; +++ +++template +++struct ActionImpl : ImplBase::type { +++ using Base = typename ImplBase::type; +++ using function_type = R(Args...); +++ using args_type = std::tuple; +++ +++ ActionImpl() = default; // Only defined if appropriate for Base. +++ explicit ActionImpl(std::shared_ptr impl) : Base{std::move(impl)} {} +++ +++ R operator()(Args&&... arg) const { +++ static constexpr size_t kMaxArgs = +++ sizeof...(Args) <= 10 ? sizeof...(Args) : 10; +++ return Apply(MakeIndexSequence{}, +++ MakeIndexSequence<10 - kMaxArgs>{}, +++ args_type{std::forward(arg)...}); +++ } +++ +++ template +++ R Apply(IndexSequence, IndexSequence, +++ const args_type& args) const { +++ // Impl need not be specific to the signature of action being implemented; +++ // only the implementing function body needs to have all of the specific +++ // types instantiated. Up to 10 of the args that are provided by the +++ // args_type get passed, followed by a dummy of unspecified type for the +++ // remainder up to 10 explicit args. +++ static constexpr ExcessiveArg kExcessArg{}; +++ return static_cast(*this) +++ .template gmock_PerformImpl< +++ /*function_type=*/function_type, /*return_type=*/R, +++ /*args_type=*/args_type, +++ /*argN_type=*/ +++ typename std::tuple_element::type...>( +++ /*args=*/args, std::get(args)..., +++ ((void)excess_id, kExcessArg)...); +++ } +++}; +++ +++// Stores a default-constructed Impl as part of the Action<>'s +++// std::function<>. The Impl should be trivial to copy. +++template +++::testing::Action MakeAction() { +++ return ::testing::Action(ActionImpl()); +++} +++ +++// Stores just the one given instance of Impl. +++template +++::testing::Action MakeAction(std::shared_ptr impl) { +++ return ::testing::Action(ActionImpl(std::move(impl))); +++} +++ +++#define GMOCK_INTERNAL_ARG_UNUSED(i, data, el) \ +++ , const arg##i##_type& arg##i GTEST_ATTRIBUTE_UNUSED_ +++#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_ \ +++ const args_type& args GTEST_ATTRIBUTE_UNUSED_ GMOCK_PP_REPEAT( \ +++ GMOCK_INTERNAL_ARG_UNUSED, , 10) +++ +++#define GMOCK_INTERNAL_ARG(i, data, el) , const arg##i##_type& arg##i +++#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_ \ +++ const args_type& args GMOCK_PP_REPEAT(GMOCK_INTERNAL_ARG, , 10) +++ +++#define GMOCK_INTERNAL_TEMPLATE_ARG(i, data, el) , typename arg##i##_type +++#define GMOCK_ACTION_TEMPLATE_ARGS_NAMES_ \ +++ GMOCK_PP_TAIL(GMOCK_PP_REPEAT(GMOCK_INTERNAL_TEMPLATE_ARG, , 10)) +++ +++#define GMOCK_INTERNAL_TYPENAME_PARAM(i, data, param) , typename param##_type +++#define GMOCK_ACTION_TYPENAME_PARAMS_(params) \ +++ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPENAME_PARAM, , params)) +++ +++#define GMOCK_INTERNAL_TYPE_PARAM(i, data, param) , param##_type +++#define GMOCK_ACTION_TYPE_PARAMS_(params) \ +++ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_PARAM, , params)) +++ +++#define GMOCK_INTERNAL_TYPE_GVALUE_PARAM(i, data, param) \ +++ , param##_type gmock_p##i +++#define GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params) \ +++ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_GVALUE_PARAM, , params)) +++ +++#define GMOCK_INTERNAL_GVALUE_PARAM(i, data, param) \ +++ , std::forward(gmock_p##i) +++#define GMOCK_ACTION_GVALUE_PARAMS_(params) \ +++ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GVALUE_PARAM, , params)) +++ +++#define GMOCK_INTERNAL_INIT_PARAM(i, data, param) \ +++ , param(::std::forward(gmock_p##i)) +++#define GMOCK_ACTION_INIT_PARAMS_(params) \ +++ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_INIT_PARAM, , params)) +++ +++#define GMOCK_INTERNAL_FIELD_PARAM(i, data, param) param##_type param; +++#define GMOCK_ACTION_FIELD_PARAMS_(params) \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_FIELD_PARAM, , params) +++ +++#define GMOCK_INTERNAL_ACTION(name, full_name, params) \ +++ template \ +++ class full_name { \ +++ public: \ +++ explicit full_name(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \ +++ : impl_(std::make_shared( \ +++ GMOCK_ACTION_GVALUE_PARAMS_(params))) {} \ +++ full_name(const full_name&) = default; \ +++ full_name(full_name&&) noexcept = default; \ +++ template \ +++ operator ::testing::Action() const { \ +++ return ::testing::internal::MakeAction(impl_); \ +++ } \ +++ \ +++ private: \ +++ class gmock_Impl { \ +++ public: \ +++ explicit gmock_Impl(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \ +++ : GMOCK_ACTION_INIT_PARAMS_(params) {} \ +++ template \ +++ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ +++ GMOCK_ACTION_FIELD_PARAMS_(params) \ +++ }; \ +++ std::shared_ptr impl_; \ +++ }; \ +++ template \ +++ inline full_name name( \ +++ GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) GTEST_MUST_USE_RESULT_; \ +++ template \ +++ inline full_name name( \ +++ GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) { \ +++ return full_name( \ +++ GMOCK_ACTION_GVALUE_PARAMS_(params)); \ +++ } \ +++ template \ +++ template \ +++ return_type \ +++ full_name::gmock_Impl::gmock_PerformImpl( \ +++ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const +++ +++} // namespace internal +++ +++// Similar to GMOCK_INTERNAL_ACTION, but no bound parameters are stored. +++#define ACTION(name) \ +++ class name##Action { \ +++ public: \ +++ explicit name##Action() noexcept {} \ +++ name##Action(const name##Action&) noexcept {} \ +++ template \ +++ operator ::testing::Action() const { \ +++ return ::testing::internal::MakeAction(); \ +++ } \ +++ \ +++ private: \ +++ class gmock_Impl { \ +++ public: \ +++ template \ +++ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ +++ }; \ +++ }; \ +++ inline name##Action name() GTEST_MUST_USE_RESULT_; \ +++ inline name##Action name() { return name##Action(); } \ +++ template \ +++ return_type name##Action::gmock_Impl::gmock_PerformImpl( \ +++ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const +++ +++#define ACTION_P(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP, (__VA_ARGS__)) +++ +++#define ACTION_P2(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP2, (__VA_ARGS__)) +++ +++#define ACTION_P3(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP3, (__VA_ARGS__)) +++ +++#define ACTION_P4(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP4, (__VA_ARGS__)) +++ +++#define ACTION_P5(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP5, (__VA_ARGS__)) +++ +++#define ACTION_P6(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP6, (__VA_ARGS__)) +++ +++#define ACTION_P7(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP7, (__VA_ARGS__)) +++ +++#define ACTION_P8(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP8, (__VA_ARGS__)) +++ +++#define ACTION_P9(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP9, (__VA_ARGS__)) +++ +++#define ACTION_P10(name, ...) \ +++ GMOCK_INTERNAL_ACTION(name, name##ActionP10, (__VA_ARGS__)) +++ +++} // namespace testing +++ +++GTEST_DISABLE_MSC_WARNINGS_POP_() // 4100 +++ +++#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ diff --cc googletest/googlemock/include/gmock/gmock-cardinalities.h index 000000000,000000000,000000000..533e604f3 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/include/gmock/gmock-cardinalities.h @@@@ -1,0 -1,0 -1,0 +1,159 @@@@ +++// Copyright 2007, Google Inc. +++// All rights reserved. +++// +++// Redistribution and use in source and binary forms, with or without +++// modification, are permitted provided that the following conditions are +++// met: +++// +++// * Redistributions of source code must retain the above copyright +++// notice, this list of conditions and the following disclaimer. +++// * Redistributions in binary form must reproduce the above +++// copyright notice, this list of conditions and the following disclaimer +++// in the documentation and/or other materials provided with the +++// distribution. +++// * Neither the name of Google Inc. nor the names of its +++// contributors may be used to endorse or promote products derived from +++// this software without specific prior written permission. +++// +++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++// Google Mock - a framework for writing C++ mock classes. +++// +++// This file implements some commonly used cardinalities. More +++// cardinalities can be defined by the user implementing the +++// CardinalityInterface interface if necessary. +++ +++// IWYU pragma: private, include "gmock/gmock.h" +++// IWYU pragma: friend gmock/.* +++ +++#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ +++#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ +++ +++#include +++ +++#include +++#include // NOLINT +++ +++#include "gmock/internal/gmock-port.h" +++#include "gtest/gtest.h" +++ +++GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +++/* class A needs to have dll-interface to be used by clients of class B */) +++ +++namespace testing { +++ +++// To implement a cardinality Foo, define: +++// 1. a class FooCardinality that implements the +++// CardinalityInterface interface, and +++// 2. a factory function that creates a Cardinality object from a +++// const FooCardinality*. +++// +++// The two-level delegation design follows that of Matcher, providing +++// consistency for extension developers. It also eases ownership +++// management as Cardinality objects can now be copied like plain values. +++ +++// The implementation of a cardinality. +++class CardinalityInterface { +++ public: +++ virtual ~CardinalityInterface() = default; +++ +++ // Conservative estimate on the lower/upper bound of the number of +++ // calls allowed. +++ virtual int ConservativeLowerBound() const { return 0; } +++ virtual int ConservativeUpperBound() const { return INT_MAX; } +++ +++ // Returns true if and only if call_count calls will satisfy this +++ // cardinality. +++ virtual bool IsSatisfiedByCallCount(int call_count) const = 0; +++ +++ // Returns true if and only if call_count calls will saturate this +++ // cardinality. +++ virtual bool IsSaturatedByCallCount(int call_count) const = 0; +++ +++ // Describes self to an ostream. +++ virtual void DescribeTo(::std::ostream* os) const = 0; +++}; +++ +++// A Cardinality is a copyable and IMMUTABLE (except by assignment) +++// object that specifies how many times a mock function is expected to +++// be called. The implementation of Cardinality is just a std::shared_ptr +++// to const CardinalityInterface. Don't inherit from Cardinality! +++class GTEST_API_ Cardinality { +++ public: +++ // Constructs a null cardinality. Needed for storing Cardinality +++ // objects in STL containers. +++ Cardinality() = default; +++ +++ // Constructs a Cardinality from its implementation. +++ explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} +++ +++ // Conservative estimate on the lower/upper bound of the number of +++ // calls allowed. +++ int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); } +++ int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); } +++ +++ // Returns true if and only if call_count calls will satisfy this +++ // cardinality. +++ bool IsSatisfiedByCallCount(int call_count) const { +++ return impl_->IsSatisfiedByCallCount(call_count); +++ } +++ +++ // Returns true if and only if call_count calls will saturate this +++ // cardinality. +++ bool IsSaturatedByCallCount(int call_count) const { +++ return impl_->IsSaturatedByCallCount(call_count); +++ } +++ +++ // Returns true if and only if call_count calls will over-saturate this +++ // cardinality, i.e. exceed the maximum number of allowed calls. +++ bool IsOverSaturatedByCallCount(int call_count) const { +++ return impl_->IsSaturatedByCallCount(call_count) && +++ !impl_->IsSatisfiedByCallCount(call_count); +++ } +++ +++ // Describes self to an ostream +++ void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } +++ +++ // Describes the given actual call count to an ostream. +++ static void DescribeActualCallCountTo(int actual_call_count, +++ ::std::ostream* os); +++ +++ private: +++ std::shared_ptr impl_; +++}; +++ +++// Creates a cardinality that allows at least n calls. +++GTEST_API_ Cardinality AtLeast(int n); +++ +++// Creates a cardinality that allows at most n calls. +++GTEST_API_ Cardinality AtMost(int n); +++ +++// Creates a cardinality that allows any number of calls. +++GTEST_API_ Cardinality AnyNumber(); +++ +++// Creates a cardinality that allows between min and max calls. +++GTEST_API_ Cardinality Between(int min, int max); +++ +++// Creates a cardinality that allows exactly n calls. +++GTEST_API_ Cardinality Exactly(int n); +++ +++// Creates a cardinality from its implementation. +++inline Cardinality MakeCardinality(const CardinalityInterface* c) { +++ return Cardinality(c); +++} +++ +++} // namespace testing +++ +++GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 +++ +++#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ diff --cc googletest/googlemock/include/gmock/gmock-function-mocker.h index 000000000,000000000,000000000..1a1f126e4 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/include/gmock/gmock-function-mocker.h @@@@ -1,0 -1,0 -1,0 +1,518 @@@@ +++// Copyright 2007, Google Inc. +++// All rights reserved. +++// +++// Redistribution and use in source and binary forms, with or without +++// modification, are permitted provided that the following conditions are +++// met: +++// +++// * Redistributions of source code must retain the above copyright +++// notice, this list of conditions and the following disclaimer. +++// * Redistributions in binary form must reproduce the above +++// copyright notice, this list of conditions and the following disclaimer +++// in the documentation and/or other materials provided with the +++// distribution. +++// * Neither the name of Google Inc. nor the names of its +++// contributors may be used to endorse or promote products derived from +++// this software without specific prior written permission. +++// +++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++// Google Mock - a framework for writing C++ mock classes. +++// +++// This file implements MOCK_METHOD. +++ +++// IWYU pragma: private, include "gmock/gmock.h" +++// IWYU pragma: friend gmock/.* +++ +++#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_ +++#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_ +++ +++#include // IWYU pragma: keep +++#include // IWYU pragma: keep +++ +++#include "gmock/gmock-spec-builders.h" +++#include "gmock/internal/gmock-internal-utils.h" +++#include "gmock/internal/gmock-pp.h" +++ +++namespace testing { +++namespace internal { +++template +++using identity_t = T; +++ +++template +++struct ThisRefAdjuster { +++ template +++ using AdjustT = typename std::conditional< +++ std::is_const::type>::value, +++ typename std::conditional::value, +++ const T&, const T&&>::type, +++ typename std::conditional::value, T&, +++ T&&>::type>::type; +++ +++ template +++ static AdjustT Adjust(const MockType& mock) { +++ return static_cast>(const_cast(mock)); +++ } +++}; +++ +++constexpr bool PrefixOf(const char* a, const char* b) { +++ return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1)); +++} +++ +++template +++constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) { +++ return N <= M && internal::PrefixOf(prefix, str); +++} +++ +++template +++constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) { +++ return N <= M && internal::PrefixOf(suffix, str + M - N); +++} +++ +++template +++constexpr bool Equals(const char (&a)[N], const char (&b)[M]) { +++ return N == M && internal::PrefixOf(a, b); +++} +++ +++template +++constexpr bool ValidateSpec(const char (&spec)[N]) { +++ return internal::Equals("const", spec) || +++ internal::Equals("override", spec) || +++ internal::Equals("final", spec) || +++ internal::Equals("noexcept", spec) || +++ (internal::StartsWith("noexcept(", spec) && +++ internal::EndsWith(")", spec)) || +++ internal::Equals("ref(&)", spec) || +++ internal::Equals("ref(&&)", spec) || +++ (internal::StartsWith("Calltype(", spec) && +++ internal::EndsWith(")", spec)); +++} +++ +++} // namespace internal +++ +++// The style guide prohibits "using" statements in a namespace scope +++// inside a header file. However, the FunctionMocker class template +++// is meant to be defined in the ::testing namespace. The following +++// line is just a trick for working around a bug in MSVC 8.0, which +++// cannot handle it if we define FunctionMocker in ::testing. +++using internal::FunctionMocker; +++} // namespace testing +++ +++#define MOCK_METHOD(...) \ +++ GMOCK_INTERNAL_WARNING_PUSH() \ +++ GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-member-function") \ +++ GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__) \ +++ GMOCK_INTERNAL_WARNING_POP() +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...) \ +++ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...) \ +++ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args) \ +++ GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, ()) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec) \ +++ GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Args); \ +++ GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Spec); \ +++ GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \ +++ GMOCK_PP_NARG0 _Args, GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)); \ +++ GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \ +++ GMOCK_INTERNAL_MOCK_METHOD_IMPL( \ +++ GMOCK_PP_NARG0 _Args, _MethodName, GMOCK_INTERNAL_HAS_CONST(_Spec), \ +++ GMOCK_INTERNAL_HAS_OVERRIDE(_Spec), GMOCK_INTERNAL_HAS_FINAL(_Spec), \ +++ GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Spec), \ +++ GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Spec), \ +++ GMOCK_INTERNAL_GET_REF_SPEC(_Spec), \ +++ (GMOCK_INTERNAL_SIGNATURE(_Ret, _Args))) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...) \ +++ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...) \ +++ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...) \ +++ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) +++ +++#define GMOCK_INTERNAL_WRONG_ARITY(...) \ +++ static_assert( \ +++ false, \ +++ "MOCK_METHOD must be called with 3 or 4 arguments. _Ret, " \ +++ "_MethodName, _Args and optionally _Spec. _Args and _Spec must be " \ +++ "enclosed in parentheses. If _Ret is a type with unprotected commas, " \ +++ "it must also be enclosed in parentheses.") +++ +++#define GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple) \ +++ static_assert( \ +++ GMOCK_PP_IS_ENCLOSED_PARENS(_Tuple), \ +++ GMOCK_PP_STRINGIZE(_Tuple) " should be enclosed in parentheses.") +++ +++#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...) \ +++ static_assert( \ +++ std::is_function<__VA_ARGS__>::value, \ +++ "Signature must be a function type, maybe return type contains " \ +++ "unprotected comma."); \ +++ static_assert( \ +++ ::testing::tuple_size::ArgumentTuple>::value == _N, \ +++ "This method does not take " GMOCK_PP_STRINGIZE( \ +++ _N) " arguments. Parenthesize all types with unprotected commas.") +++ +++#define GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT, ~, _Spec) +++ +++#define GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, \ +++ _Override, _Final, _NoexceptSpec, \ +++ _CallType, _RefSpec, _Signature) \ +++ typename ::testing::internal::Function::Result \ +++ GMOCK_INTERNAL_EXPAND(_CallType) \ +++ _MethodName(GMOCK_PP_REPEAT(GMOCK_INTERNAL_PARAMETER, _Signature, _N)) \ +++ GMOCK_PP_IF(_Constness, const, ) \ +++ _RefSpec _NoexceptSpec GMOCK_PP_IF(_Override, override, ) \ +++ GMOCK_PP_IF(_Final, final, ) { \ +++ GMOCK_MOCKER_(_N, _Constness, _MethodName) \ +++ .SetOwnerAndName(this, #_MethodName); \ +++ return GMOCK_MOCKER_(_N, _Constness, _MethodName) \ +++ .Invoke(GMOCK_PP_REPEAT(GMOCK_INTERNAL_FORWARD_ARG, _Signature, _N)); \ +++ } \ +++ ::testing::MockSpec gmock_##_MethodName( \ +++ GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_PARAMETER, _Signature, _N)) \ +++ GMOCK_PP_IF(_Constness, const, ) _RefSpec { \ +++ GMOCK_MOCKER_(_N, _Constness, _MethodName).RegisterOwner(this); \ +++ return GMOCK_MOCKER_(_N, _Constness, _MethodName) \ +++ .With(GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_ARGUMENT, , _N)); \ +++ } \ +++ ::testing::MockSpec gmock_##_MethodName( \ +++ const ::testing::internal::WithoutMatchers&, \ +++ GMOCK_PP_IF(_Constness, const, )::testing::internal::Function< \ +++ GMOCK_PP_REMOVE_PARENS(_Signature)>*) const _RefSpec _NoexceptSpec { \ +++ return ::testing::internal::ThisRefAdjuster::Adjust(*this) \ +++ .gmock_##_MethodName(GMOCK_PP_REPEAT( \ +++ GMOCK_INTERNAL_A_MATCHER_ARGUMENT, _Signature, _N)); \ +++ } \ +++ mutable ::testing::FunctionMocker \ +++ GMOCK_MOCKER_(_N, _Constness, _MethodName) +++ +++#define GMOCK_INTERNAL_EXPAND(...) __VA_ARGS__ +++ +++// Valid modifiers. +++#define GMOCK_INTERNAL_HAS_CONST(_Tuple) \ +++ GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_CONST, ~, _Tuple)) +++ +++#define GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple) \ +++ GMOCK_PP_HAS_COMMA( \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_OVERRIDE, ~, _Tuple)) +++ +++#define GMOCK_INTERNAL_HAS_FINAL(_Tuple) \ +++ GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_FINAL, ~, _Tuple)) +++ +++#define GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Tuple) \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT, ~, _Tuple) +++ +++#define GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT(_i, _, _elem) \ +++ GMOCK_PP_IF( \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)), \ +++ _elem, ) +++ +++#define GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Tuple) \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE, ~, _Tuple) +++ +++#define GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE(_i, _, _elem) \ +++ GMOCK_PP_IF( \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem)), \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), ) +++ +++#define GMOCK_INTERNAL_GET_REF_SPEC(_Tuple) \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_REF_SPEC_IF_REF, ~, _Tuple) +++ +++#define GMOCK_INTERNAL_REF_SPEC_IF_REF(_i, _, _elem) \ +++ GMOCK_PP_IF(GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)), \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), ) +++ +++#ifdef GMOCK_INTERNAL_STRICT_SPEC_ASSERT +++#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \ +++ static_assert( \ +++ ::testing::internal::ValidateSpec(GMOCK_PP_STRINGIZE(_elem)), \ +++ "Token \'" GMOCK_PP_STRINGIZE( \ +++ _elem) "\' cannot be recognized as a valid specification " \ +++ "modifier. Is a ',' missing?"); +++#else +++#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \ +++ static_assert( \ +++ (GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)) + \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)) + \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)) + \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)) + \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)) + \ +++ GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem))) == 1, \ +++ GMOCK_PP_STRINGIZE( \ +++ _elem) " cannot be recognized as a valid specification modifier."); +++#endif // GMOCK_INTERNAL_STRICT_SPEC_ASSERT +++ +++// Modifiers implementation. +++#define GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CONST_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_CONST_I_const , +++ +++#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_OVERRIDE_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_OVERRIDE_I_override , +++ +++#define GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_FINAL_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_FINAL_I_final , +++ +++#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_NOEXCEPT_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept , +++ +++#define GMOCK_INTERNAL_DETECT_REF(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_REF_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_REF_I_ref , +++ +++#define GMOCK_INTERNAL_UNPACK_ref(x) x +++ +++#define GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem) \ +++ GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CALLTYPE_I_, _elem) +++ +++#define GMOCK_INTERNAL_DETECT_CALLTYPE_I_Calltype , +++ +++#define GMOCK_INTERNAL_UNPACK_Calltype(...) __VA_ARGS__ +++ +++// Note: The use of `identity_t` here allows _Ret to represent return types that +++// would normally need to be specified in a different way. For example, a method +++// returning a function pointer must be written as +++// +++// fn_ptr_return_t (*method(method_args_t...))(fn_ptr_args_t...) +++// +++// But we only support placing the return type at the beginning. To handle this, +++// we wrap all calls in identity_t, so that a declaration will be expanded to +++// +++// identity_t method(method_args_t...) +++// +++// This allows us to work around the syntactic oddities of function/method +++// types. +++#define GMOCK_INTERNAL_SIGNATURE(_Ret, _Args) \ +++ ::testing::internal::identity_t( \ +++ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GET_TYPE, _, _Args)) +++ +++#define GMOCK_INTERNAL_GET_TYPE(_i, _, _elem) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(_elem), GMOCK_PP_REMOVE_PARENS, \ +++ GMOCK_PP_IDENTITY) \ +++ (_elem) +++ +++#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ GMOCK_INTERNAL_ARG_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \ +++ gmock_a##_i +++ +++#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ ::std::forward(gmock_a##_i) +++ +++#define GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ GMOCK_INTERNAL_MATCHER_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \ +++ gmock_a##_i +++ +++#define GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ gmock_a##_i +++ +++#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _) \ +++ GMOCK_PP_COMMA_IF(_i) \ +++ ::testing::A() +++ +++#define GMOCK_INTERNAL_ARG_O(_i, ...) \ +++ typename ::testing::internal::Function<__VA_ARGS__>::template Arg<_i>::type +++ +++#define GMOCK_INTERNAL_MATCHER_O(_i, ...) \ +++ const ::testing::Matcher::template Arg<_i>::type>& +++ +++#define MOCK_METHOD0(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 0, __VA_ARGS__) +++#define MOCK_METHOD1(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 1, __VA_ARGS__) +++#define MOCK_METHOD2(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 2, __VA_ARGS__) +++#define MOCK_METHOD3(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 3, __VA_ARGS__) +++#define MOCK_METHOD4(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 4, __VA_ARGS__) +++#define MOCK_METHOD5(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 5, __VA_ARGS__) +++#define MOCK_METHOD6(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 6, __VA_ARGS__) +++#define MOCK_METHOD7(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 7, __VA_ARGS__) +++#define MOCK_METHOD8(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 8, __VA_ARGS__) +++#define MOCK_METHOD9(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 9, __VA_ARGS__) +++#define MOCK_METHOD10(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, , m, 10, __VA_ARGS__) +++ +++#define MOCK_CONST_METHOD0(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 0, __VA_ARGS__) +++#define MOCK_CONST_METHOD1(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 1, __VA_ARGS__) +++#define MOCK_CONST_METHOD2(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 2, __VA_ARGS__) +++#define MOCK_CONST_METHOD3(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 3, __VA_ARGS__) +++#define MOCK_CONST_METHOD4(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 4, __VA_ARGS__) +++#define MOCK_CONST_METHOD5(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 5, __VA_ARGS__) +++#define MOCK_CONST_METHOD6(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 6, __VA_ARGS__) +++#define MOCK_CONST_METHOD7(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 7, __VA_ARGS__) +++#define MOCK_CONST_METHOD8(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 8, __VA_ARGS__) +++#define MOCK_CONST_METHOD9(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 9, __VA_ARGS__) +++#define MOCK_CONST_METHOD10(m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, , m, 10, __VA_ARGS__) +++ +++#define MOCK_METHOD0_T(m, ...) MOCK_METHOD0(m, __VA_ARGS__) +++#define MOCK_METHOD1_T(m, ...) MOCK_METHOD1(m, __VA_ARGS__) +++#define MOCK_METHOD2_T(m, ...) MOCK_METHOD2(m, __VA_ARGS__) +++#define MOCK_METHOD3_T(m, ...) MOCK_METHOD3(m, __VA_ARGS__) +++#define MOCK_METHOD4_T(m, ...) MOCK_METHOD4(m, __VA_ARGS__) +++#define MOCK_METHOD5_T(m, ...) MOCK_METHOD5(m, __VA_ARGS__) +++#define MOCK_METHOD6_T(m, ...) MOCK_METHOD6(m, __VA_ARGS__) +++#define MOCK_METHOD7_T(m, ...) MOCK_METHOD7(m, __VA_ARGS__) +++#define MOCK_METHOD8_T(m, ...) MOCK_METHOD8(m, __VA_ARGS__) +++#define MOCK_METHOD9_T(m, ...) MOCK_METHOD9(m, __VA_ARGS__) +++#define MOCK_METHOD10_T(m, ...) MOCK_METHOD10(m, __VA_ARGS__) +++ +++#define MOCK_CONST_METHOD0_T(m, ...) MOCK_CONST_METHOD0(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD1_T(m, ...) MOCK_CONST_METHOD1(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD2_T(m, ...) MOCK_CONST_METHOD2(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD3_T(m, ...) MOCK_CONST_METHOD3(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD4_T(m, ...) MOCK_CONST_METHOD4(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD5_T(m, ...) MOCK_CONST_METHOD5(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD6_T(m, ...) MOCK_CONST_METHOD6(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD7_T(m, ...) MOCK_CONST_METHOD7(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD8_T(m, ...) MOCK_CONST_METHOD8(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD9_T(m, ...) MOCK_CONST_METHOD9(m, __VA_ARGS__) +++#define MOCK_CONST_METHOD10_T(m, ...) MOCK_CONST_METHOD10(m, __VA_ARGS__) +++ +++#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 0, __VA_ARGS__) +++#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 1, __VA_ARGS__) +++#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 2, __VA_ARGS__) +++#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 3, __VA_ARGS__) +++#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 4, __VA_ARGS__) +++#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 5, __VA_ARGS__) +++#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 6, __VA_ARGS__) +++#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 7, __VA_ARGS__) +++#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 8, __VA_ARGS__) +++#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 9, __VA_ARGS__) +++#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 10, __VA_ARGS__) +++ +++#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 0, __VA_ARGS__) +++#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 1, __VA_ARGS__) +++#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 2, __VA_ARGS__) +++#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 3, __VA_ARGS__) +++#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 4, __VA_ARGS__) +++#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 5, __VA_ARGS__) +++#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 6, __VA_ARGS__) +++#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 7, __VA_ARGS__) +++#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 8, __VA_ARGS__) +++#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 9, __VA_ARGS__) +++#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ +++ GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 10, __VA_ARGS__) +++ +++#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++ +++#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ +++ MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__) +++ +++#define GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...) \ +++ GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \ +++ args_num, ::testing::internal::identity_t<__VA_ARGS__>); \ +++ GMOCK_INTERNAL_MOCK_METHOD_IMPL( \ +++ args_num, Method, GMOCK_PP_NARG0(constness), 0, 0, , ct, , \ +++ (::testing::internal::identity_t<__VA_ARGS__>)) +++ +++#define GMOCK_MOCKER_(arity, constness, Method) \ +++ GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) +++ +++#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_ diff --cc googletest/googlemock/include/gmock/gmock-matchers.h index 000000000,000000000,000000000..0f6771377 new file mode 100644 --- /dev/null +++ b/googletest/googlemock/include/gmock/gmock-matchers.h @@@@ -1,0 -1,0 -1,0 +1,5623 @@@@ +++// Copyright 2007, Google Inc. +++// All rights reserved. +++// +++// Redistribution and use in source and binary forms, with or without +++// modification, are permitted provided that the following conditions are +++// met: +++// +++// * Redistributions of source code must retain the above copyright +++// notice, this list of conditions and the following disclaimer. +++// * Redistributions in binary form must reproduce the above +++// copyright notice, this list of conditions and the following disclaimer +++// in the documentation and/or other materials provided with the +++// distribution. +++// * Neither the name of Google Inc. nor the names of its +++// contributors may be used to endorse or promote products derived from +++// this software without specific prior written permission. +++// +++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +++ +++// Google Mock - a framework for writing C++ mock classes. +++// +++// The MATCHER* family of macros can be used in a namespace scope to +++// define custom matchers easily. +++// +++// Basic Usage +++// =========== +++// +++// The syntax +++// +++// MATCHER(name, description_string) { statements; } +++// +++// defines a matcher with the given name that executes the statements, +++// which must return a bool to indicate if the match succeeds. Inside +++// the statements, you can refer to the value being matched by 'arg', +++// and refer to its type by 'arg_type'. +++// +++// The description string documents what the matcher does, and is used +++// to generate the failure message when the match fails. Since a +++// MATCHER() is usually defined in a header file shared by multiple +++// C++ source files, we require the description to be a C-string +++// literal to avoid possible side effects. It can be empty, in which +++// case we'll use the sequence of words in the matcher name as the +++// description. +++// +++// For example: +++// +++// MATCHER(IsEven, "") { return (arg % 2) == 0; } +++// +++// allows you to write +++// +++// // Expects mock_foo.Bar(n) to be called where n is even. +++// EXPECT_CALL(mock_foo, Bar(IsEven())); +++// +++// or, +++// +++// // Verifies that the value of some_expression is even. +++// EXPECT_THAT(some_expression, IsEven()); +++// +++// If the above assertion fails, it will print something like: +++// +++// Value of: some_expression +++// Expected: is even +++// Actual: 7 +++// +++// where the description "is even" is automatically calculated from the +++// matcher name IsEven. +++// +++// Argument Type +++// ============= +++// +++// Note that the type of the value being matched (arg_type) is +++// determined by the context in which you use the matcher and is +++// supplied to you by the compiler, so you don't need to worry about +++// declaring it (nor can you). This allows the matcher to be +++// polymorphic. For example, IsEven() can be used to match any type +++// where the value of "(arg % 2) == 0" can be implicitly converted to +++// a bool. In the "Bar(IsEven())" example above, if method Bar() +++// takes an int, 'arg_type' will be int; if it takes an unsigned long, +++// 'arg_type' will be unsigned long; and so on. +++// +++// Parameterizing Matchers +++// ======================= +++// +++// Sometimes you'll want to parameterize the matcher. For that you +++// can use another macro: +++// +++// MATCHER_P(name, param_name, description_string) { statements; } +++// +++// For example: +++// +++// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } +++// +++// will allow you to write: +++// +++// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); +++// +++// which may lead to this message (assuming n is 10): +++// +++// Value of: Blah("a") +++// Expected: has absolute value 10 +++// Actual: -9 +++// +++// Note that both the matcher description and its parameter are +++// printed, making the message human-friendly. +++// +++// In the matcher definition body, you can write 'foo_type' to +++// reference the type of a parameter named 'foo'. For example, in the +++// body of MATCHER_P(HasAbsoluteValue, value) above, you can write +++// 'value_type' to refer to the type of 'value'. +++// +++// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to +++// support multi-parameter matchers. +++// +++// Describing Parameterized Matchers +++// ================================= +++// +++// The last argument to MATCHER*() is a string-typed expression. The +++// expression can reference all of the matcher's parameters and a +++// special bool-typed variable named 'negation'. When 'negation' is +++// false, the expression should evaluate to the matcher's description; +++// otherwise it should evaluate to the description of the negation of +++// the matcher. For example, +++// +++// using testing::PrintToString; +++// +++// MATCHER_P2(InClosedRange, low, hi, +++// std::string(negation ? "is not" : "is") + " in range [" + +++// PrintToString(low) + ", " + PrintToString(hi) + "]") { +++// return low <= arg && arg <= hi; +++// } +++// ... +++// EXPECT_THAT(3, InClosedRange(4, 6)); +++// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +++// +++// would generate two failures that contain the text: +++// +++// Expected: is in range [4, 6] +++// ... +++// Expected: is not in range [2, 4] +++// +++// If you specify "" as the description, the failure message will +++// contain the sequence of words in the matcher name followed by the +++// parameter values printed as a tuple. For example, +++// +++// MATCHER_P2(InClosedRange, low, hi, "") { ... } +++// ... +++// EXPECT_THAT(3, InClosedRange(4, 6)); +++// EXPECT_THAT(3, Not(InClosedRange(2, 4))); +++// +++// would generate two failures that contain the text: +++// +++// Expected: in closed range (4, 6) +++// ... +++// Expected: not (in closed range (2, 4)) +++// +++// Types of Matcher Parameters +++// =========================== +++// +++// For the purpose of typing, you can view +++// +++// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } +++// +++// as shorthand for +++// +++// template +++// FooMatcherPk +++// Foo(p1_type p1, ..., pk_type pk) { ... } +++// +++// When you write Foo(v1, ..., vk), the compiler infers the types of +++// the parameters v1, ..., and vk for you. If you are not happy with +++// the result of the type inference, you can specify the types by +++// explicitly instantiating the template, as in Foo(5, +++// false). As said earlier, you don't get to (or need to) specify +++// 'arg_type' as that's determined by the context in which the matcher +++// is used. You can assign the result of expression Foo(p1, ..., pk) +++// to a variable of type FooMatcherPk. This +++// can be useful when composing matchers. +++// +++// While you can instantiate a matcher template with reference types, +++// passing the parameters by pointer usually makes your code more +++// readable. If, however, you still want to pass a parameter by +++// reference, be aware that in the failure message generated by the +++// matcher you will see the value of the referenced object but not its +++// address. +++// +++// Explaining Match Results +++// ======================== +++// +++// Sometimes the matcher description alone isn't enough to explain why +++// the match has failed or succeeded. For example, when expecting a +++// long string, it can be very helpful to also print the diff between +++// the expected string and the actual one. To achieve that, you can +++// optionally stream additional information to a special variable +++// named result_listener, whose type is a pointer to class +++// MatchResultListener: +++// +++// MATCHER_P(EqualsLongString, str, "") { +++// if (arg == str) return true; +++// +++// *result_listener << "the difference: " +++/// << DiffStrings(str, arg); +++// return false; +++// } +++// +++// Overloading Matchers +++// ==================== +++// +++// You can overload matchers with different numbers of parameters: +++// +++// MATCHER_P(Blah, a, description_string1) { ... } +++// MATCHER_P2(Blah, a, b, description_string2) { ... } +++// +++// Caveats +++// ======= +++// +++// When defining a new matcher, you should also consider implementing +++// MatcherInterface or using MakePolymorphicMatcher(). These +++// approaches require more work than the MATCHER* macros, but also +++// give you more control on the types of the value being matched and +++// the matcher parameters, which may leads to better compiler error +++// messages when the matcher is used wrong. They also allow +++// overloading matchers based on parameter types (as opposed to just +++// based on the number of parameters). +++// +++// MATCHER*() can only be used in a namespace scope as templates cannot be +++// declared inside of a local class. +++// +++// More Information +++// ================ +++// +++// To learn more about using these macros, please search for 'MATCHER' +++// on +++// https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md +++// +++// This file also implements some commonly used argument matchers. More +++// matchers can be defined by the user implementing the +++// MatcherInterface interface if necessary. +++// +++// See googletest/include/gtest/gtest-matchers.h for the definition of class +++// Matcher, class MatcherInterface, and others. +++ +++// IWYU pragma: private, include "gmock/gmock.h" +++// IWYU pragma: friend gmock/.* +++ +++#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ +++#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ +++ +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++#include +++#include // NOLINT +++#include +++#include +++#include +++#include +++#include +++ +++#include "gmock/internal/gmock-internal-utils.h" +++#include "gmock/internal/gmock-port.h" +++#include "gmock/internal/gmock-pp.h" +++#include "gtest/gtest.h" +++ +++// MSVC warning C5046 is new as of VS2017 version 15.8. +++#if defined(_MSC_VER) && _MSC_VER >= 1915 +++#define GMOCK_MAYBE_5046_ 5046 +++#else +++#define GMOCK_MAYBE_5046_ +++#endif +++ +++GTEST_DISABLE_MSC_WARNINGS_PUSH_( +++ 4251 GMOCK_MAYBE_5046_ /* class A needs to have dll-interface to be used by +++ clients of class B */ +++ /* Symbol involving type with internal linkage not defined */) +++ +++namespace testing { +++ +++// To implement a matcher Foo for type T, define: +++// 1. a class FooMatcherImpl that implements the +++// MatcherInterface interface, and +++// 2. a factory function that creates a Matcher object from a +++// FooMatcherImpl*. +++// +++// The two-level delegation design makes it possible to allow a user +++// to write "v" instead of "Eq(v)" where a Matcher is expected, which +++// is impossible if we pass matchers by pointers. It also eases +++// ownership management as Matcher objects can now be copied like +++// plain values. +++ +++// A match result listener that stores the explanation in a string. +++class StringMatchResultListener : public MatchResultListener { +++ public: +++ StringMatchResultListener() : MatchResultListener(&ss_) {} +++ +++ // Returns the explanation accumulated so far. +++ std::string str() const { return ss_.str(); } +++ +++ // Clears the explanation accumulated so far. +++ void Clear() { ss_.str(""); } +++ +++ private: +++ ::std::stringstream ss_; +++ +++ StringMatchResultListener(const StringMatchResultListener&) = delete; +++ StringMatchResultListener& operator=(const StringMatchResultListener&) = +++ delete; +++}; +++ +++// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION +++// and MUST NOT BE USED IN USER CODE!!! +++namespace internal { +++ +++// The MatcherCastImpl class template is a helper for implementing +++// MatcherCast(). We need this helper in order to partially +++// specialize the implementation of MatcherCast() (C++ allows +++// class/struct templates to be partially specialized, but not +++// function templates.). +++ +++// This general version is used when MatcherCast()'s argument is a +++// polymorphic matcher (i.e. something that can be converted to a +++// Matcher but is not one yet; for example, Eq(value)) or a value (for +++// example, "hello"). +++template +++class MatcherCastImpl { +++ public: +++ static Matcher Cast(const M& polymorphic_matcher_or_value) { +++ // M can be a polymorphic matcher, in which case we want to use +++ // its conversion operator to create Matcher. Or it can be a value +++ // that should be passed to the Matcher's constructor. +++ // +++ // We can't call Matcher(polymorphic_matcher_or_value) when M is a +++ // polymorphic matcher because it'll be ambiguous if T has an implicit +++ // constructor from M (this usually happens when T has an implicit +++ // constructor from any type). +++ // +++ // It won't work to unconditionally implicit_cast +++ // polymorphic_matcher_or_value to Matcher because it won't trigger +++ // a user-defined conversion from M to T if one exists (assuming M is +++ // a value). +++ return CastImpl(polymorphic_matcher_or_value, +++ std::is_convertible>{}, +++ std::is_convertible{}); +++ } +++ +++ private: +++ template +++ static Matcher CastImpl(const M& polymorphic_matcher_or_value, +++ std::true_type /* convertible_to_matcher */, +++ std::integral_constant) { +++ // M is implicitly convertible to Matcher, which means that either +++ // M is a polymorphic matcher or Matcher has an implicit constructor +++ // from M. In both cases using the implicit conversion will produce a +++ // matcher. +++ // +++ // Even if T has an implicit constructor from M, it won't be called because +++ // creating Matcher would require a chain of two user-defined conversions +++ // (first to create T from M and then to create Matcher from T). +++ return polymorphic_matcher_or_value; +++ } +++ +++ // M can't be implicitly converted to Matcher, so M isn't a polymorphic +++ // matcher. It's a value of a type implicitly convertible to T. Use direct +++ // initialization to create a matcher. +++ static Matcher CastImpl(const M& value, +++ std::false_type /* convertible_to_matcher */, +++ std::true_type /* convertible_to_T */) { +++ return Matcher(ImplicitCast_(value)); +++ } +++ +++ // M can't be implicitly converted to either Matcher or T. Attempt to use +++ // polymorphic matcher Eq(value) in this case. +++ // +++ // Note that we first attempt to perform an implicit cast on the value and +++ // only fall back to the polymorphic Eq() matcher afterwards because the +++ // latter calls bool operator==(const Lhs& lhs, const Rhs& rhs) in the end +++ // which might be undefined even when Rhs is implicitly convertible to Lhs +++ // (e.g. std::pair vs. std::pair). +++ // +++ // We don't define this method inline as we need the declaration of Eq(). +++ static Matcher CastImpl(const M& value, +++ std::false_type /* convertible_to_matcher */, +++ std::false_type /* convertible_to_T */); +++}; +++ +++// This more specialized version is used when MatcherCast()'s argument +++// is already a Matcher. This only compiles when type T can be +++// statically converted to type U. +++template +++class MatcherCastImpl> { +++ public: +++ static Matcher Cast(const Matcher& source_matcher) { +++ return Matcher(new Impl(source_matcher)); +++ } +++ +++ private: +++ class Impl : public MatcherInterface { +++ public: +++ explicit Impl(const Matcher& source_matcher) +++ : source_matcher_(source_matcher) {} +++ +++ // We delegate the matching logic to the source matcher. +++ bool MatchAndExplain(T x, MatchResultListener* listener) const override { +++ using FromType = typename std::remove_cv::type>::type>::type; +++ using ToType = typename std::remove_cv::type>::type>::type; +++ // Do not allow implicitly converting base*/& to derived*/&. +++ static_assert( +++ // Do not trigger if only one of them is a pointer. That implies a +++ // regular conversion and not a down_cast. +++ (std::is_pointer::type>::value != +++ std::is_pointer::type>::value) || +++ std::is_same::value || +++ !std::is_base_of::value, +++ "Can't implicitly convert from to "); +++ +++ // Do the cast to `U` explicitly if necessary. +++ // Otherwise, let implicit conversions do the trick. +++ using CastType = +++ typename std::conditional::value, +++ T&, U>::type; +++ +++ return source_matcher_.MatchAndExplain(static_cast(x), +++ listener); +++ } +++ +++ void DescribeTo(::std::ostream* os) const override { +++ source_matcher_.DescribeTo(os); +++ } +++ +++ void DescribeNegationTo(::std::ostream* os) const override { +++ source_matcher_.DescribeNegationTo(os); +++ } +++ +++ private: +++ const Matcher source_matcher_; +++ }; +++}; +++ +++// This even more specialized version is used for efficiently casting +++// a matcher to its own type. +++template +++class MatcherCastImpl> { +++ public: +++ static Matcher Cast(const Matcher& matcher) { return matcher; } +++}; +++ +++// Template specialization for parameterless Matcher. +++template +++class MatcherBaseImpl { +++ public: +++ MatcherBaseImpl() = default; +++ +++ template +++ operator ::testing::Matcher() const { // NOLINT(runtime/explicit) +++ return ::testing::Matcher(new +++ typename Derived::template gmock_Impl()); +++ } +++}; +++ +++// Template specialization for Matcher with parameters. +++template