Skip to content

Commit

Permalink
[GR-15593] Make HostAccessTest#testRecursion more lenient wrt. except…
Browse files Browse the repository at this point in the history
…ion type.

PullRequest: graal/3547
  • Loading branch information
lukasstadler committed May 3, 2019
2 parents 5f82f1d + d78f1fc commit 7cd4f3c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
Expand Down Expand Up @@ -957,8 +957,13 @@ public void testRecursion() {
assertNull(context.asValue(42).as(Integer.class));
fail();
} catch (PolyglotException e) {
assertTrue(e.isHostException());
assertTrue(e.asHostException() instanceof StackOverflowError);
// which type of exception ends up here depends on where the stack overflow happens
if (e.isGuestException()) {
assertTrue(e.isInternalError());
} else {
assertTrue(e.isHostException());
assertTrue(e.asHostException() instanceof StackOverflowError);
}
}
}

Expand Down

0 comments on commit 7cd4f3c

Please sign in to comment.