MCPcopy Create free account
hub / github.com/diffplug/matfilerw / testBenchmarkUInt8

Method testBenchmarkUInt8

src/test/java/com/jmatio/io/MatIOTest.java:103–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 }
102
103 @Test
104 public void testBenchmarkUInt8() throws Exception {
105 final String fileName = "bigbyte.mat";
106 final String name = "bigbyte";
107 final int SIZE = 1024;
108
109 MLUInt8 mluint8 = new MLUInt8(name, new int[]{SIZE, SIZE});
110
111 // write array to file
112 ArrayList<MLArray> list = new ArrayList<MLArray>();
113 list.add(mluint8);
114
115 // write arrays to file
116 new MatFileWriter(getTempFile(fileName), list);
117
118 // read array form file
119 MatFileReader mfr = new MatFileReader(getTempFile(fileName));
120 MLArray mlArrayRetrived = mfr.getMLArray(name);
121
122 for (int i = 0; i < mlArrayRetrived.getSize(); i++) {
123 ((MLNumericArray<?>) mlArrayRetrived).get(i);
124 }
125
126 // test if MLArray objects are equal
127 assertEquals("Test if value red from file equals value stored", mluint8, mlArrayRetrived);
128 }
129
130 @Test
131 public void testMultipleDimArrayRealFromMatlabCreatedFile() throws IOException {

Callers

nothing calls this directly

Calls 5

getTempFileMethod · 0.95
getMLArrayMethod · 0.95
getSizeMethod · 0.95
addMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected