void check_zero_bit_detection()
{
unsigned i;
- printf("Checking zero bit detection.\n");
+ printf("Checking zero bit detection.");
+ fflush(stdout);
for (i = 0; i < NUM_DATA_WORDS; ++i) {
unsigned code = make_codeword(i);
+
+ if ((i & 0xfffff) == 0) {
+ printf(".");
+ fflush(stdout);
+ }
+
if (has_error(code)) {
printf("ERROR: Failed zero-bit test 1 for %x\n", i);
}
printf("ERROR: Failed zero-bit test 2 for %x\n", i);
}
}
+
+ printf("\n");
}
void check_single_bit_detection()
{
unsigned i, j;
- printf("Checking single bit detection and correction.\n");
+ printf("Checking single bit detection and correction.");
+ fflush(stdout);
for (i = 0; i < NUM_DATA_WORDS; ++i) {
unsigned code = make_codeword(i);
+
+ if ((i & 0xfffff) == 0) {
+ printf(".");
+ fflush(stdout);
+ }
+
for (j = 0; j < CODE_BITS; ++j) {
unsigned corrupted_code = code ^ (1 << j);
}
}
}
+
+ printf("\n");
}
void check_double_bit_detection()
{
unsigned i, j, k;
- printf("Checking double bit detection.\n");
+ printf("Checking double bit detection.");
+ fflush(stdout);
for (i = 0; i < NUM_DATA_WORDS; ++i) {
unsigned code = make_codeword(i);
+
+ if ((i & 0xfffff) == 0) {
+ printf(".");
+ fflush(stdout);
+ }
+
for (j = 0; j < CODE_BITS; ++j) {
for (k = 0; k < CODE_BITS; ++k) {
unsigned corrupted_code = code ^ (1 << j) ^ (1 << k);
}
}
}
+
+ printf("\n");
}
int main()