Skip to content

Commit

Permalink
Merge branch 'topic/fix_java_arrays_test' into 'master'
Browse files Browse the repository at this point in the history
Java: change array types in tests to native java arrays

See merge request eng/libadalang/libadalang!1625
  • Loading branch information
Rémi Segard committed Apr 29, 2024
2 parents 9c8c0fc + ecdb795 commit 4f3c6c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions testsuite/tests/java_api/config_pragmas/ConfigPragmas.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class ConfigPragmas {

private static AnalysisUnit load(String filename) {
AnalysisUnit u = ctx.getUnitFromFile(filename);
List<Diagnostic> diagnostics = u.getDiagnostics();
if (!diagnostics.isEmpty())
Diagnostic[] diagnostics = u.getDiagnostics();
if (diagnostics.length != 0)
{
for (Diagnostic d : diagnostics)
System.out.println(d.toString());
Expand All @@ -34,7 +34,7 @@ private static void check_pragmas() {
System.out.println("Pragmas for " + filename + ":");
AnalysisUnit u = load(filename);
CompilationUnit cu = (CompilationUnit) u.getRoot();
AdaNodeArray pragmas;
AdaNode[] pragmas;
try {
pragmas = cu.pAllConfigPragmas();
} catch (LangkitException exc) {
Expand All @@ -43,8 +43,8 @@ private static void check_pragmas() {
);
continue;
}
for (int i = 0; i < pragmas.size(); ++i)
System.out.println("Config pragma: " + pragmas.get(i));
for (AdaNode pragma : pragmas)
System.out.println("Config pragma: " + pragma);
}
}

Expand Down
10 changes: 5 additions & 5 deletions testsuite/tests/java_api/gpr_context/GPRContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ private static void check(
Libadalang.Text.create("pkg"),
Libadalang.AnalysisUnitKind.UNIT_BODY
);
List<Libadalang.Diagnostic> diagnostics = u.getDiagnostics();
if (!diagnostics.isEmpty())
Libadalang.Diagnostic[] diagnostics = u.getDiagnostics();
if (diagnostics.length != 0)
{
for (Libadalang.Diagnostic d : diagnostics)
System.out.println(d.toString());
Expand Down Expand Up @@ -83,9 +83,9 @@ private static void check(

// To show that configuration pragmas are properly detected from the
// project, print their list.
Libadalang.AdaNodeArray pragmas = cu.pAllConfigPragmas();
for (int i = 0; i < pragmas.size(); ++i)
System.out.println("Config pragma: " + pragmas.get(i));
Libadalang.AdaNode[] pragmas = cu.pAllConfigPragmas();
for (Libadalang.AdaNode pragma : pragmas)
System.out.println("Config pragma: " + pragma);

System.out.println("");
}
Expand Down

0 comments on commit 4f3c6c9

Please sign in to comment.