Skip to content

Commit

Permalink
Add test for type inference (todo)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Grosse committed May 24, 2016
1 parent dd8af22 commit 82d72ee
Show file tree
Hide file tree
Showing 10 changed files with 885 additions and 0 deletions.
1 change: 1 addition & 0 deletions enjarify/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ def executeTest(name, opts):

for opts in [options.NONE, options.PRETTY, options.ALL]:
for i in range(1, 7):
# for i in range(1, 8): # todo
executeTest('test{}'.format(i), opts)
print('all tests passed!')
Binary file added tests/test7/classes.dex
Binary file not shown.
36 changes: 36 additions & 0 deletions tests/test7/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
_init_
testTypes
class 01
class 0
class 00
class 1
class 00
class 01
[class 01 ]
[class 01 ]
[class 01 ]
[class 01 [class 01 ] ]
class 1
class 1
[class 0 class 00 ]
[class 00 class 00 ]
[class 0 class 0 ]
[class 0 class 0 ]
class 00
class 01
class 0
class 0
class 00
class 01
[class 00 ]
[class 00 class 00 ]
class 00
[class 00 class 00 ]
[class 01 ]
[class 01 ]
[class 01 ]
class java.lang.ArrayStoreException
[[-1, 1, 1, 0, 6] [-1, 1, 1, 0, 0, 0] [true, true, true, false, false, false] ]
[[-1, 1, 1, 0, 6] [1, 1, 0, -14, 0, 0] [true, true, false, true, false, false] ]
[[-1, 1, 1, 0, 6] [-1, 1, 1, 0, 0, 0] [true, true, true, false, false, false] ]
[[-1, 1, 1, 0, 6] [1, 1, 0, -14, 0, 0] [true, true, false, true, false, false] ]
21 changes: 21 additions & 0 deletions tests/test7/smali/0.smali
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.class public L0;
.super Ljava/lang/Throwable;

.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Throwable;-><init>()V
return-void
.end method
21 changes: 21 additions & 0 deletions tests/test7/smali/00.smali
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.class public L00;
.super L0;

.method public constructor <init>()V
.locals 0
invoke-direct {p0}, L0;-><init>()V
return-void
.end method
21 changes: 21 additions & 0 deletions tests/test7/smali/01.smali
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.class public L01;
.super L0;

.method public constructor <init>()V
.locals 0
invoke-direct {p0}, L0;-><init>()V
return-void
.end method
21 changes: 21 additions & 0 deletions tests/test7/smali/1.smali
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.class public L1;
.super Ljava/lang/Throwable;

.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Throwable;-><init>()V
return-void
.end method
25 changes: 25 additions & 0 deletions tests/test7/smali/_.smali
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.class interface public L_;
.super Ljava/lang/Object;

.method abstract public testMovesSub(IDCJF)V
.end method

# Java requires all interface methods to be implemented but Android doesn't
#.method abstract public notImplemented()V
#.end method

.method abstract public toString()Ljava/lang/String;
.end method
Loading

0 comments on commit 82d72ee

Please sign in to comment.