MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testSetLength

Method testSetLength

JSAT/test/jsat/linear/SparseVectorTest.java:78–99  ·  view source on GitHub ↗

Test of setLength method, of class SparseVector.

()

Source from the content-addressed store, hash-verified

76 * Test of setLength method, of class SparseVector.
77 */
78 @Test
79 public void testSetLength()
80 {
81 System.out.println("setLength");
82 assertEquals(20, x.length());
83 assertEquals(20, y.length());
84
85 y.setLength(25);
86
87 assertEquals(20, x.length());
88 assertEquals(25, y.length());
89
90 try
91 {
92 y.setLength(5);
93 fail("Set length should have been too small");
94 }
95 catch(Exception ex)
96 {
97
98 }
99 }
100
101 /**
102 * Test of nnz method, of class SparseVector.

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.45
setLengthMethod · 0.45

Tested by

no test coverage detected