3
3
4
4
import io .github .notstirred .dasm .api .annotations .Dasm ;
5
5
import io .github .notstirred .dasm .api .annotations .redirect .redirects .AddMethodToSets ;
6
+ import io .github .notstirred .dasm .api .annotations .redirect .redirects .ConstructorToFactoryRedirect ;
7
+ import io .github .notstirred .dasm .api .annotations .redirect .redirects .MethodRedirect ;
6
8
import io .github .notstirred .dasm .api .annotations .redirect .redirects .TypeRedirect ;
7
9
import io .github .notstirred .dasm .api .annotations .redirect .sets .RedirectSet ;
10
+ import io .github .notstirred .dasm .api .annotations .selector .ConstructorMethodSig ;
8
11
import io .github .notstirred .dasm .api .annotations .selector .MethodSig ;
9
12
import io .github .notstirred .dasm .api .annotations .selector .Ref ;
10
13
import io .github .notstirred .dasm .api .annotations .transform .TransformFromMethod ;
11
14
import io .github .notstirred .dasm .test .targets .CubePos ;
15
+ import io .github .notstirred .dasm .test .targets .Vec3i ;
12
16
import io .github .notstirred .dasm .test .tests .BaseMethodTest ;
13
17
14
18
import static io .github .notstirred .dasm .test .tests .TestData .single ;
15
19
16
20
/**
17
21
* A trivial test for a static {@link AddMethodToSets}
18
22
*/
19
- @ Dasm (io . github . notstirred . dasm . test . tests . add_to_sets . TestAddToSets .Set .class )
23
+ @ Dasm (TestCombinedFieldMethodRedirects .Set .class )
20
24
public class TestCombinedFieldMethodRedirects extends BaseMethodTest {
21
25
public TestCombinedFieldMethodRedirects () {
22
26
super (single (CombinedFieldMethodRedirectsInput .class , CombinedFieldMethodRedirectsOutput .class , TestCombinedFieldMethodRedirects .class ));
@@ -25,13 +29,28 @@ public TestCombinedFieldMethodRedirects() {
25
29
@ TransformFromMethod (value = @ MethodSig ("method1()V" ))
26
30
native String method1out ();
27
31
32
+ @ TransformFromMethod (value = @ MethodSig ("method2()V" ))
33
+ native String method2out ();
34
+
28
35
@ RedirectSet
29
36
public interface Set {
30
- @ TypeRedirect (from = @ Ref (Object .class ), to = @ Ref (String .class ))
31
- abstract class A { }
37
+ @ TypeRedirect (from = @ Ref (Vec3i .class ), to = @ Ref (CubePos .class ))
38
+ abstract class A {
39
+ @ MethodRedirect (@ MethodSig (name = "getX" , args = { }, ret = @ Ref (int .class )))
40
+ native int x ();
41
+
42
+ @ MethodRedirect (@ MethodSig (name = "getY" , args = { }, ret = @ Ref (int .class )))
43
+ native int y ();
44
+
45
+ @ MethodRedirect (@ MethodSig (name = "getZ" , args = { }, ret = @ Ref (int .class )))
46
+ native int z ();
47
+
48
+ @ ConstructorToFactoryRedirect (@ ConstructorMethodSig (args = { @ Ref (long .class ) }))
49
+ native CubePos from ();
50
+ }
32
51
}
33
52
34
- @ AddMethodToSets (owner = @ Ref (CubePos .class ), method = @ MethodSig (name = "fromLong" , ret = @ Ref (CubePos .class ), args = { @ Ref (long .class ) }), sets = io . github . notstirred . dasm . test . tests . add_to_sets . TestAddToSets . Set .class )
53
+ @ AddMethodToSets (owner = @ Ref (CubePos .class ), method = @ MethodSig (name = "fromLong" , ret = @ Ref (CubePos .class ), args = { @ Ref (long .class ) }), sets = Set .class )
35
54
public static CubePos testFoo (long l ) {
36
55
return null ;
37
56
}
0 commit comments