|
@@ -1,6 +1,6 @@
|
|
|
#include "tests/BitArrayTests.h"
|
|
|
+#include "data/BitArray.h"
|
|
|
#include "tests/Test.h"
|
|
|
-#include "utils/BitArray.h"
|
|
|
#include "utils/StringBuffer.h"
|
|
|
|
|
|
typedef StringBuffer<50> String;
|
|
@@ -20,7 +20,8 @@ static void testBigSetRead(Test& test) {
|
|
|
bits.set(i, i);
|
|
|
}
|
|
|
for(int i = 0; i < bits.getLength(); i++) {
|
|
|
- test.checkEqual(i, bits.get(i), "set and read correct value over long array");
|
|
|
+ test.checkEqual(i, bits.get(i),
|
|
|
+ "set and read correct value over long array");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -37,13 +38,16 @@ static void testRandomSetReadResize(Test& test) {
|
|
|
}
|
|
|
}
|
|
|
for(int i = 0; i < bits.getLength(); i++) {
|
|
|
- test.checkEqual(data[i], bits.get(i), "set and read correct value with random input");
|
|
|
+ test.checkEqual(data[i], bits.get(i),
|
|
|
+ "set and read correct value with random input");
|
|
|
}
|
|
|
bits.resize(bits.getBits() + 1);
|
|
|
test.checkEqual(14, bits.getBits(), "corrects bits after resize");
|
|
|
test.checkEqual(100, bits.getLength(), "correct length after resize");
|
|
|
for(int i = 0; i < bits.getLength(); i++) {
|
|
|
- test.checkEqual(data[i], bits.get(i), "set and read correct value with random input after resize");
|
|
|
+ test.checkEqual(
|
|
|
+ data[i], bits.get(i),
|
|
|
+ "set and read correct value with random input after resize");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -60,7 +64,8 @@ static void testReadOnly(Test& test) {
|
|
|
static void testToString1(Test& test) {
|
|
|
BitArray bits(4, 3);
|
|
|
bits.set(0, 1).set(1, 2).set(2, 3).set(3, 4);
|
|
|
- test.checkEqual(String("[1, 2, 3, 4]"), String(bits), "bit array to string 1");
|
|
|
+ test.checkEqual(String("[1, 2, 3, 4]"), String(bits),
|
|
|
+ "bit array to string 1");
|
|
|
}
|
|
|
|
|
|
static void testToString2(Test& test) {
|