Closed Christywl closed 5 years ago
Should add more check for the details of operand based on Android NN API
@Christywl Fixed. Please verify
@sunlin-link , I tried the chromium nightly build 313c1c2, most negative tests passed except for the following case:
Steps:
Run https://brucedai.github.io/nt/testm/index-local.html?backend=mps, check the tests in #addOperand API
:
The SyntaxError is thrown while the code is being parsed and not while it's running. you can use window.onerror and figure out that there's an error.
<script>
window.onerror = function (e) {
console.log('Error: ', e);
};
</script>
@fujunwei About "addOperand() only requires one argument, passing two arguments should raise an error....", we find it doesn't throw any error, so we couldn't catch it by test case. Please help to handle this exception to throw error, thanks
It's not a issue for javascript, remaining parameters will be ignored but don't raise a error, for example
<textarea id="textarea" rows=100 cols=100></textarea>
var textarea = document.getElementById("textarea", "normal");
but var textarea
will be null if the first parameter is not found
<textarea id="textarea" rows=100 cols=100></textarea>
var textarea = document.getElementById("notFound", "textarea");
Test Env: Chromium Version : nightly build 65.0.3324.0 (revision f9e1a31) OS : Mac OS X 10.13.4
Expected Result: Pass an invalid argument to addOperand(), it should throw an exception
Actual Result: No exception is thrown when passing an invalid argument to addOperand()
How to reproduce: Pass the following invalid arguments to addOperand():
For example: 1.TENSOR_FLOAT32 type: no "dimensions":
2.addOperand() only requires one argument, passing two arguments should raise an error: pass two scalars