Skip to content

Commit b173722

Browse files
phaitingHaiting Pu
and
Haiting Pu
authored
Introduce assertj test lib to make the throw exception test more accu… (#10779)
### Summary This change introduced the assertj test lib to make the throw exception testing more accurate ### Test plan ./gradlew :executorch_android:testDebugUnitTest --------- Co-authored-by: Haiting Pu <[email protected]>
1 parent 1c2b7ba commit b173722

File tree

4 files changed

+439
-462
lines changed

4 files changed

+439
-462
lines changed

extension/android/executorch_android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dependencies {
4949
implementation 'com.facebook.soloader:nativeloader:0.10.5'
5050
implementation libs.core.ktx
5151
testImplementation 'junit:junit:4.12'
52+
testImplementation 'org.assertj:assertj-core:3.27.2'
5253
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
5354
androidTestImplementation 'androidx.test:rules:1.2.0'
5455
androidTestImplementation 'commons-io:commons-io:2.4'

extension/android/executorch_android/src/main/java/org/pytorch/executorch/Tensor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ public byte[] getDataAsByteArray() {
394394
*/
395395
public byte[] getDataAsUnsignedByteArray() {
396396
throw new IllegalStateException(
397-
"Tensor of type " + getClass().getSimpleName() + " cannot return data as byte array.");
397+
"Tensor of type "
398+
+ getClass().getSimpleName()
399+
+ " cannot return data as unsigned byte array.");
398400
}
399401

400402
/**

0 commit comments

Comments
 (0)