1 // SPDX-License-Identifier: GPL-2.0
5 #include <linux/kernel.h>
9 #include "demangle-java.h"
11 static int test__demangle_java(struct test_suite
*test __maybe_unused
, int subtest __maybe_unused
)
18 const char *mangled
, *demangled
;
20 { "Ljava/lang/StringLatin1;equals([B[B)Z",
21 "boolean java.lang.StringLatin1.equals(byte[], byte[])" },
22 { "Ljava/util/zip/ZipUtils;CENSIZ([BI)J",
23 "long java.util.zip.ZipUtils.CENSIZ(byte[], int)" },
24 { "Ljava/util/regex/Pattern$BmpCharProperty;match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z",
25 "boolean java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence)" },
26 { "Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V",
27 "void java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int)" },
28 { "Ljava/lang/Object;<init>()V",
29 "void java.lang.Object<init>()" },
32 for (i
= 0; i
< ARRAY_SIZE(test_cases
); i
++) {
33 buf
= java_demangle_sym(test_cases
[i
].mangled
, 0);
34 if (strcmp(buf
, test_cases
[i
].demangled
)) {
35 pr_debug("FAILED: %s: %s != %s\n", test_cases
[i
].mangled
,
36 buf
, test_cases
[i
].demangled
);
45 DEFINE_SUITE("Demangle Java", demangle_java
);