File tree Expand file tree Collapse file tree 5 files changed +21
-9
lines changed
truffle/src/com.oracle.truffle.api.object.test/src/com/oracle/truffle/object Expand file tree Collapse file tree 5 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 40
40
*/
41
41
package com .oracle .truffle .object .basic .test ;
42
42
43
+ import static org .hamcrest .CoreMatchers .either ;
44
+ import static org .hamcrest .CoreMatchers .endsWith ;
45
+ import static org .hamcrest .MatcherAssert .assertThat ;
43
46
import static org .junit .Assert .assertEquals ;
44
47
import static org .junit .Assert .assertTrue ;
45
48
@@ -141,6 +144,14 @@ public static Class<?> getLocationType(Location location) {
141
144
}
142
145
}
143
146
147
+ public static void assumeExtLayout () {
148
+ Shape shape = Shape .newBuilder ().build ();
149
+ assertThat ("Unexpected Shape class name (the assertion may need to be updated if the code is refactored)" ,
150
+ shape .getClass ().getName (), either (endsWith ("ShapeExt" )).or (endsWith ("ShapeBasic" )));
151
+ Assume .assumeTrue ("Test is specific to the Extended Dynamic Object Layout" ,
152
+ shape .getClass ().getName ().endsWith ("ShapeExt" ));
153
+ }
154
+
144
155
public static Location assumeCoreLocation (Location location ) {
145
156
Assume .assumeTrue (isCoreLocation (location ));
146
157
return location ;
Original file line number Diff line number Diff line change 40
40
*/
41
41
package com .oracle .truffle .object .ext .test ;
42
42
43
+ import static com .oracle .truffle .object .basic .test .DOTestAsserts .assumeExtLayout ;
44
+
43
45
import java .util .ArrayList ;
44
46
import java .util .List ;
45
47
import java .util .concurrent .ExecutionException ;
54
56
import com .oracle .truffle .api .object .DynamicObjectLibrary ;
55
57
import com .oracle .truffle .api .object .Shape ;
56
58
import com .oracle .truffle .object .ext .test .ObjectModelRegressionTest .TestDynamicObject ;
57
- import com .oracle .truffle .tck .tests .TruffleTestAssumptions ;
58
59
59
60
public class GR42603 {
60
61
@@ -63,7 +64,7 @@ public class GR42603 {
63
64
64
65
@ Test
65
66
public void testReplacePropertyRace () throws Throwable {
66
- TruffleTestAssumptions . assumeEnterpriseRuntime ();
67
+ assumeExtLayout ();
67
68
for (int i = 0 ; i < 100 ; i ++) {
68
69
testConcurrentReplaceProperty ();
69
70
}
Original file line number Diff line number Diff line change 40
40
*/
41
41
package com .oracle .truffle .object .ext .test ;
42
42
43
+ import static com .oracle .truffle .object .basic .test .DOTestAsserts .assumeExtLayout ;
43
44
import static com .oracle .truffle .object .basic .test .DOTestAsserts .getTypeAssumption ;
44
45
import static com .oracle .truffle .object .basic .test .DOTestAsserts .getTypeAssumptionRecord ;
45
46
import static org .junit .Assert .assertFalse ;
55
56
import com .oracle .truffle .api .object .DynamicObject ;
56
57
import com .oracle .truffle .api .object .DynamicObjectLibrary ;
57
58
import com .oracle .truffle .api .object .Shape ;
58
- import com .oracle .truffle .tck .tests .TruffleTestAssumptions ;
59
59
60
60
public class GR52036 {
61
61
@@ -70,7 +70,7 @@ public class GR52036 {
70
70
@ SuppressWarnings ("try" )
71
71
@ Test
72
72
public void testGR52036Reproducer () throws Throwable {
73
- TruffleTestAssumptions . assumeEnterpriseRuntime ();
73
+ assumeExtLayout ();
74
74
75
75
class ObjType1 extends DynamicObject {
76
76
protected ObjType1 (Shape shape ) {
Original file line number Diff line number Diff line change 42
42
43
43
import static com .oracle .truffle .object .basic .test .DOTestAsserts .assertObjectLocation ;
44
44
import static com .oracle .truffle .object .basic .test .DOTestAsserts .assertPrimitiveLocation ;
45
+ import static com .oracle .truffle .object .basic .test .DOTestAsserts .assumeExtLayout ;
45
46
import static com .oracle .truffle .object .basic .test .DOTestAsserts .invokeGetter ;
46
47
import static org .junit .Assert .assertEquals ;
47
48
import static org .junit .Assert .assertFalse ;
67
68
import com .oracle .truffle .api .object .DynamicObjectLibrary ;
68
69
import com .oracle .truffle .api .object .Shape ;
69
70
import com .oracle .truffle .api .test .AbstractParametrizedLibraryTest ;
70
- import com .oracle .truffle .tck .tests .TruffleTestAssumptions ;
71
71
72
72
@ SuppressWarnings ("deprecation" )
73
73
@ RunWith (Parameterized .class )
@@ -386,7 +386,7 @@ public void testChangeFlagsConstantToNonConstant() {
386
386
387
387
@ Test
388
388
public void testTryMergeShapes () {
389
- TruffleTestAssumptions . assumeEnterpriseRuntime ();
389
+ assumeExtLayout ();
390
390
391
391
// Assume (MaxMergeDepth >= 5)
392
392
Shape emptyShape = Shape .newBuilder ().allowImplicitCastIntToDouble (true ).build ();
@@ -437,7 +437,7 @@ public void testTryMergeShapes() {
437
437
438
438
@ Test
439
439
public void testTryMergeShapes2 () {
440
- TruffleTestAssumptions . assumeEnterpriseRuntime ();
440
+ assumeExtLayout ();
441
441
442
442
// Assume (MaxMergeDepth >= 5 && MaxMergeDiff >= 2)
443
443
Original file line number Diff line number Diff line change 42
42
43
43
import static com .oracle .truffle .object .basic .test .DOTestAsserts .assertObjectLocation ;
44
44
import static com .oracle .truffle .object .basic .test .DOTestAsserts .assertPrimitiveLocation ;
45
+ import static com .oracle .truffle .object .basic .test .DOTestAsserts .assumeExtLayout ;
45
46
import static org .junit .Assert .assertEquals ;
46
47
import static org .junit .Assert .assertSame ;
47
48
import static org .junit .Assert .assertTrue ;
61
62
import com .oracle .truffle .api .object .Shape ;
62
63
import com .oracle .truffle .api .test .AbstractParametrizedLibraryTest ;
63
64
import com .oracle .truffle .object .ext .test .ObjectModelRegressionTest .TestDynamicObject ;
64
- import com .oracle .truffle .tck .tests .TruffleTestAssumptions ;
65
65
66
66
@ SuppressWarnings ("deprecation" )
67
67
@ RunWith (Parameterized .class )
@@ -86,7 +86,7 @@ private static DynamicObject newInstance(Shape emptyShape) {
86
86
87
87
@ Before
88
88
public void before () {
89
- TruffleTestAssumptions . assumeEnterpriseRuntime ();
89
+ assumeExtLayout ();
90
90
}
91
91
92
92
@ Test
You can’t perform that action at this time.
0 commit comments