Skip to content

Commit

Permalink
Change Array types in tests to native java arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi SEGARD committed Apr 29, 2024
1 parent 9c8c0fc commit ecdb795
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 ecdb795

Please sign in to comment.