File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/test/java/gr/geompokon/bitarray Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 2626
2727class BitArrayTest {
2828
29- final static int MAX_TEST_SIZE = 500 ;
29+ final static int MAX_TEST_SIZE = 200 ;
3030
3131 static BitArray bitArray ;
3232 static ArrayList <Boolean > boolArray ;
3333 static Random random ;
3434
35+ /**
36+ * Start each test with a fresh array
37+ */
3538 @ BeforeEach
3639 void setUp () {
3740 bitArray = new BitArray ();
@@ -62,12 +65,23 @@ void myAssertSameArrays() {
6265 assertEquals (boolArray , bitArray );
6366 }
6467
68+ /**
69+ * Make the bit array from the boolean array
70+ */
71+ @ Test
72+ void testCopyConstructor () {
73+ initArrays (MAX_TEST_SIZE );
74+ bitArray .clear ();
75+
76+ bitArray = new BitArray (boolArray );
77+ myAssertSameArrays ();
78+ }
79+
6580 @ Test
6681 void testClone () {
6782 initArrays (MAX_TEST_SIZE );
6883 BitArray clone = bitArray .clone ();
6984
70- assertEquals (clone , bitArray );
7185 assertEquals (bitArray , clone );
7286 }
7387
You can’t perform that action at this time.
0 commit comments