mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
Fix up jumbo string tests
This commit is contained in:
parent
9c5ea8fa92
commit
d064d69992
@ -28,37 +28,76 @@
|
|||||||
<dumpFile>target/junit-tests/classes.dump</dumpFile>
|
<dumpFile>target/junit-tests/classes.dump</dumpFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-string-tests</id>
|
||||||
|
<goals>
|
||||||
|
<goal>assemble</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirectory>src/test/smali/jumbo-string-tests</sourceDirectory>
|
||||||
|
<outputFile>target/jumbo-string-tests/classes.dex</outputFile>
|
||||||
|
<dumpFile>target/jumbo-string-tests/classes.dump</dumpFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>junit-tests</id>
|
||||||
<phase>test</phase>
|
<phase>test</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>single</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<finalName>junit-tests</finalName>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assemble/zip.xml</descriptor>
|
<descriptor>src/assemble/junit-tests.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-string-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<finalName>jumbo-string-tests</finalName>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/assemble/jumbo-string-tests.xml</descriptor>
|
||||||
</descriptors>
|
</descriptors>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jvending.masa.plugins</groupId>
|
<groupId>com.jayway.maven.plugins.android.generation1.plugins</groupId>
|
||||||
<artifactId>maven-adb-plugin</artifactId>
|
<artifactId>maven-adb-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>junit-tests</id>
|
||||||
<phase>test</phase>
|
<phase>test</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>push</goal>
|
<goal>push</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sourceFileOrDirectory>${project.build.directory}/${project.build.finalName}-zip.zip
|
<sourceFileOrDirectory>${project.build.directory}/junit-tests.zip</sourceFileOrDirectory>
|
||||||
</sourceFileOrDirectory>
|
<destinationFileOrDirectory>/data/local/junit-tests.zip</destinationFileOrDirectory>
|
||||||
<destinationFileOrDirectory>/data/local/test.zip</destinationFileOrDirectory>
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-string-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceFileOrDirectory>${project.build.directory}/jumbo-string-tests.zip</sourceFileOrDirectory>
|
||||||
|
<destinationFileOrDirectory>/data/local/jumbo-string-tests.zip</destinationFileOrDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@ -69,23 +108,42 @@
|
|||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>junit-tests</id>
|
||||||
<phase>test</phase>
|
<phase>test</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>exec</goal>
|
<goal>exec</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>adb</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>shell</argument>
|
||||||
|
<argument>dalvikvm</argument>
|
||||||
|
<argument>-cp</argument>
|
||||||
|
<argument>/data/local/junit-4.6.zip:/data/local/junit-tests.zip</argument>
|
||||||
|
<argument>org/junit/runner/JUnitCore</argument>
|
||||||
|
<argument>AllTests</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-string-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>adb</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>shell</argument>
|
||||||
|
<argument>dalvikvm</argument>
|
||||||
|
<argument>-cp</argument>
|
||||||
|
<argument>/data/local/junit-4.6.zip:/data/local/jumbo-string-tests.zip</argument>
|
||||||
|
<argument>org/junit/runner/JUnitCore</argument>
|
||||||
|
<argument>AllTests</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
|
||||||
<executable>adb</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>shell</argument>
|
|
||||||
<argument>dalvikvm</argument>
|
|
||||||
<argument>-cp</argument>
|
|
||||||
<argument>/data/local/junit-4.6.zip:/data/local/test.zip</argument>
|
|
||||||
<argument>org/junit/runner/JUnitCore</argument>
|
|
||||||
<argument>AllTests</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
13
smali-integration-tests/src/assemble/jumbo-string-tests.xml
Normal file
13
smali-integration-tests/src/assemble/jumbo-string-tests.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<assembly>
|
||||||
|
<id>zip</id>
|
||||||
|
<formats>
|
||||||
|
<format>zip</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
<files>
|
||||||
|
<file>
|
||||||
|
<source>target/jumbo-string-tests/classes.dex</source>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
</file>
|
||||||
|
</files>
|
||||||
|
</assembly>
|
@ -6,8 +6,8 @@
|
|||||||
<includeBaseDirectory>false</includeBaseDirectory>
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
<files>
|
<files>
|
||||||
<file>
|
<file>
|
||||||
<source>target/junit-tests/classes.dex</source>
|
<source>target/junit-tests/classes.dex</source>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
</file>
|
</file>
|
||||||
</files>
|
</files>
|
||||||
</assembly>
|
</assembly>
|
@ -1,3 +1,31 @@
|
|||||||
|
# Copyright 2011, Google Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following disclaimer
|
||||||
|
# in the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# * Neither the name of Google Inc. nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived from
|
||||||
|
# this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
.class public LFormat31c;
|
.class public LFormat31c;
|
||||||
.super Ljava/lang/Object;
|
.super Ljava/lang/Object;
|
||||||
.source "Format31c.smali"
|
.source "Format31c.smali"
|
||||||
@ -9,10 +37,61 @@
|
|||||||
.end method
|
.end method
|
||||||
|
|
||||||
.method public test_const-string-jumbo()V
|
.method public test_const-string-jumbo()V
|
||||||
.registers 2
|
.registers 9
|
||||||
.annotation runtime Lorg/junit/Test;
|
.annotation runtime Lorg/junit/Test;
|
||||||
.end annotation
|
.end annotation
|
||||||
|
|
||||||
|
const-string/jumbo v0, "99999"
|
||||||
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
||||||
|
move-result v1
|
||||||
|
|
||||||
|
const v2, 0
|
||||||
|
const-wide v3, '9'
|
||||||
|
|
||||||
|
:loop
|
||||||
|
invoke-virtual {v0, v2}, Ljava/lang/String;->charAt(I)C
|
||||||
|
move-result v5
|
||||||
|
|
||||||
|
int-to-long v6, v5
|
||||||
|
|
||||||
|
invoke-static {v3, v4, v6, v7}, Lorg/junit/Assert;->assertEquals(JJ)V
|
||||||
|
|
||||||
|
add-int/lit8 v2, v2, 1
|
||||||
|
if-ne v1, v2, :loop
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test_const-string-jumbo-autofix()V
|
||||||
|
.registers 9
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const-string v0, "99999"
|
||||||
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
||||||
|
move-result v1
|
||||||
|
|
||||||
|
const v2, 0
|
||||||
|
const-wide v3, '9'
|
||||||
|
|
||||||
|
:loop
|
||||||
|
invoke-virtual {v0, v2}, Ljava/lang/String;->charAt(I)C
|
||||||
|
move-result v5
|
||||||
|
|
||||||
|
int-to-long v6, v5
|
||||||
|
|
||||||
|
invoke-static {v3, v4, v6, v7}, Lorg/junit/Assert;->assertEquals(JJ)V
|
||||||
|
|
||||||
|
add-int/lit8 v2, v2, 1
|
||||||
|
if-ne v1, v2, :loop
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
#this method is not directly used in any of the tests. It's purpose is to fill out the type table past 64k entries
|
||||||
|
.method public not-used-1()V
|
||||||
|
.registers 1
|
||||||
|
|
||||||
const-string/jumbo v0, "0"
|
const-string/jumbo v0, "0"
|
||||||
const-string/jumbo v0, "1"
|
const-string/jumbo v0, "1"
|
||||||
const-string/jumbo v0, "2"
|
const-string/jumbo v0, "2"
|
||||||
@ -32782,6 +32861,14 @@
|
|||||||
const-string/jumbo v0, "32766"
|
const-string/jumbo v0, "32766"
|
||||||
const-string/jumbo v0, "32767"
|
const-string/jumbo v0, "32767"
|
||||||
const-string/jumbo v0, "32768"
|
const-string/jumbo v0, "32768"
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
#this method is not directly used in any of the tests. It's purpose is to fill out the type table past 64k entries
|
||||||
|
.method public not-used-2()V
|
||||||
|
.registers 1
|
||||||
|
|
||||||
const-string/jumbo v0, "32769"
|
const-string/jumbo v0, "32769"
|
||||||
const-string/jumbo v0, "32770"
|
const-string/jumbo v0, "32770"
|
||||||
const-string/jumbo v0, "32771"
|
const-string/jumbo v0, "32771"
|
||||||
@ -65550,13 +65637,6 @@
|
|||||||
const-string/jumbo v0, "65534"
|
const-string/jumbo v0, "65534"
|
||||||
const-string/jumbo v0, "65535"
|
const-string/jumbo v0, "65535"
|
||||||
const-string/jumbo v0, "65536"
|
const-string/jumbo v0, "65536"
|
||||||
const-string/jumbo v0, "65537"
|
|
||||||
const-string/jumbo v0, "65538"
|
|
||||||
const-string/jumbo v0, "65539"
|
|
||||||
const-string/jumbo v0, "65540"
|
|
||||||
|
|
||||||
const-string/jumbo v1, "65535"
|
|
||||||
|
|
||||||
invoke-static {v0, v1}, Lorg/junit/Assert;->assertEquals(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
||||||
return-void
|
return-void
|
||||||
.end method
|
.end method
|
@ -0,0 +1,10 @@
|
|||||||
|
.class public LAllTests;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
|
||||||
|
.annotation runtime Lorg/junit/runner/RunWith;
|
||||||
|
value = Lorg/junit/runners/Suite;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
.annotation runtime Lorg/junit/runners/Suite$SuiteClasses;
|
||||||
|
value = { LFormat31c; }
|
||||||
|
.end annotation
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user