MCPcopy Create free account
hub / github.com/apple/coremltools / doTestIo

Method doTestIo

deps/protobuf/conformance/ConformanceJava.java:374–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372 }
373
374 private boolean doTestIo() throws Exception {
375 int bytes = readLittleEndianIntFromStdin();
376
377 if (bytes == -1) {
378 return false; // EOF
379 }
380
381 byte[] serializedInput = new byte[bytes];
382
383 if (!readFromStdin(serializedInput, bytes)) {
384 throw new RuntimeException("Unexpected EOF from test program.");
385 }
386
387 Conformance.ConformanceRequest request =
388 Conformance.ConformanceRequest.parseFrom(serializedInput);
389 Conformance.ConformanceResponse response = doTest(request);
390 byte[] serializedOutput = response.toByteArray();
391
392 writeLittleEndianIntToStdout(serializedOutput.length);
393 writeToStdout(serializedOutput);
394
395 return true;
396 }
397
398 public void run() throws Exception {
399 typeRegistry =

Callers 1

runMethod · 0.95

Calls 7

readFromStdinMethod · 0.95
doTestMethod · 0.95
writeToStdoutMethod · 0.95
parseFromMethod · 0.65
toByteArrayMethod · 0.65

Tested by

no test coverage detected