22
22
public class MySwiftClassTest {
23
23
@ Test
24
24
void init_noParameters () {
25
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
25
+ try (var arena = new ConfinedSwiftMemorySession ()) {
26
26
MySwiftClass c = MySwiftClass .init (arena );
27
27
assertNotNull (c );
28
28
}
29
29
}
30
30
31
31
@ Test
32
32
void init_withParameters () {
33
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
33
+ try (var arena = new ConfinedSwiftMemorySession ()) {
34
34
MySwiftClass c = MySwiftClass .init (1337 , 42 , arena );
35
35
assertNotNull (c );
36
36
}
37
37
}
38
38
39
39
@ Test
40
40
void sum () {
41
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
41
+ try (var arena = new ConfinedSwiftMemorySession ()) {
42
42
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
43
43
assertEquals (30 , c .sum ());
44
44
}
45
45
}
46
46
47
47
@ Test
48
48
void xMultiplied () {
49
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
49
+ try (var arena = new ConfinedSwiftMemorySession ()) {
50
50
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
51
51
assertEquals (200 , c .xMultiplied (10 ));
52
52
}
53
53
}
54
54
55
55
@ Test
56
56
void throwingFunction () {
57
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
57
+ try (var arena = new ConfinedSwiftMemorySession ()) {
58
58
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
59
59
Exception exception = assertThrows (Exception .class , () -> c .throwingFunction ());
60
60
@@ -64,15 +64,15 @@ void throwingFunction() {
64
64
65
65
@ Test
66
66
void constant () {
67
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
67
+ try (var arena = new ConfinedSwiftMemorySession ()) {
68
68
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
69
69
assertEquals (100 , c .getConstant ());
70
70
}
71
71
}
72
72
73
73
@ Test
74
74
void mutable () {
75
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
75
+ try (var arena = new ConfinedSwiftMemorySession ()) {
76
76
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
77
77
assertEquals (0 , c .getMutable ());
78
78
c .setMutable (42 );
@@ -82,15 +82,15 @@ void mutable() {
82
82
83
83
@ Test
84
84
void product () {
85
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
85
+ try (var arena = new ConfinedSwiftMemorySession ()) {
86
86
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
87
87
assertEquals (200 , c .getProduct ());
88
88
}
89
89
}
90
90
91
91
@ Test
92
92
void throwingVariable () {
93
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
93
+ try (var arena = new ConfinedSwiftMemorySession ()) {
94
94
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
95
95
96
96
Exception exception = assertThrows (Exception .class , () -> c .getThrowingVariable ());
@@ -101,7 +101,7 @@ void throwingVariable() {
101
101
102
102
@ Test
103
103
void mutableDividedByTwo () {
104
- try (var arena = new ConfinedSwiftMemorySession (Thread . currentThread () )) {
104
+ try (var arena = new ConfinedSwiftMemorySession ()) {
105
105
MySwiftClass c = MySwiftClass .init (20 , 10 , arena );
106
106
assertEquals (0 , c .getMutableDividedByTwo ());
107
107
c .setMutable (20 );
0 commit comments