Skip to content

Commit 905ccd0

Browse files
committed
update test
1 parent 8caebca commit 905ccd0

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch/ModuleInstrumentationTest.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,9 @@ public void testModuleLoadForwardExplicit() throws IOException{
9696
assertTrue(results[0].isTensor());
9797
}
9898

99-
@Test
99+
@Test(expected = RuntimeException.class)
100100
public void testModuleLoadNonExistantFile() throws IOException{
101101
Module module = Module.load(getTestFilePath(MISSING_FILE_NAME));
102-
103-
EValue[] results = module.forward();
104-
assertEquals(null, results);
105-
}
106-
107-
@Test
108-
public void testModuleLoadMethodNonExistantFile() throws IOException{
109-
Module module = Module.load(getTestFilePath(MISSING_FILE_NAME));
110-
111-
int loadMethod = module.loadMethod(FORWARD_METHOD);
112-
assertEquals(loadMethod, ACCESS_FAILED);
113102
}
114103

115104
@Test
@@ -146,11 +135,11 @@ public void testForwardOnDestroyedModule() throws IOException{
146135
assertEquals(loadMethod, OK);
147136

148137
module.destroy();
149-
138+
150139
EValue[] results = module.forward();
151140
assertEquals(0, results.length);
152141
}
153-
142+
154143
@Test
155144
public void testForwardFromMultipleThreads() throws InterruptedException, IOException {
156145
Module module = Module.load(getTestFilePath(TEST_FILE_NAME));
@@ -169,7 +158,7 @@ public void run() {
169158
assertTrue(results[0].isTensor());
170159
completed.incrementAndGet();
171160
} catch (InterruptedException e) {
172-
161+
173162
}
174163
}
175164
};

0 commit comments

Comments
 (0)