mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
![Ian Rogers](/assets/img/avatar_default.png)
This is to align with kunit's terminology. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Brendan Higgins <brendanhiggins@google.com> Cc: Daniel Latypov <dlatypov@google.com> Cc: David Gow <davidgow@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: John Garry <john.garry@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20211104064208.3156807-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
44 lines
1.4 KiB
C
44 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include "tests.h"
|
|
#include "session.h"
|
|
#include "debug.h"
|
|
#include "demangle-java.h"
|
|
|
|
static int test__demangle_java(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
|
|
{
|
|
int ret = TEST_OK;
|
|
char *buf = NULL;
|
|
size_t i;
|
|
|
|
struct {
|
|
const char *mangled, *demangled;
|
|
} test_cases[] = {
|
|
{ "Ljava/lang/StringLatin1;equals([B[B)Z",
|
|
"boolean java.lang.StringLatin1.equals(byte[], byte[])" },
|
|
{ "Ljava/util/zip/ZipUtils;CENSIZ([BI)J",
|
|
"long java.util.zip.ZipUtils.CENSIZ(byte[], int)" },
|
|
{ "Ljava/util/regex/Pattern$BmpCharProperty;match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z",
|
|
"boolean java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence)" },
|
|
{ "Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V",
|
|
"void java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int)" },
|
|
{ "Ljava/lang/Object;<init>()V",
|
|
"void java.lang.Object<init>()" },
|
|
};
|
|
|
|
for (i = 0; i < sizeof(test_cases) / sizeof(test_cases[0]); i++) {
|
|
buf = java_demangle_sym(test_cases[i].mangled, 0);
|
|
if (strcmp(buf, test_cases[i].demangled)) {
|
|
pr_debug("FAILED: %s: %s != %s\n", test_cases[i].mangled,
|
|
buf, test_cases[i].demangled);
|
|
ret = TEST_FAIL;
|
|
}
|
|
free(buf);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
DEFINE_SUITE("Demangle Java", demangle_java);
|