for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
{
+ unsigned int nr;
+
if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
continue;
if ( ctxt.addr_size == sizeof(void *) * CHAR_BIT )
{
- i = printf("Testing %s native execution...", blobs[j].name);
+ nr = printf("Testing %s native execution...", blobs[j].name);
+
if ( blobs[j].set_regs )
blobs[j].set_regs(®s);
asm volatile (
);
if ( !blobs[j].check_regs(®s) )
goto fail;
- printf("%*sokay\n", i < 40 ? 40 - i : 0, "");
+
+ printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
}
- printf("Testing %s %u-bit code sequence",
- blobs[j].name, ctxt.addr_size);
+ nr = printf("Testing %s %u-bit code sequence",
+ blobs[j].name, ctxt.addr_size);
+
if ( blobs[j].set_regs )
blobs[j].set_regs(®s);
regs.eip = (unsigned long)res;
regs.eip < (unsigned long)res + blobs[j].size )
{
if ( (i++ & 8191) == 0 )
+ {
printf(".");
+ ++nr;
+ }
rc = x86_emulate(&ctxt, &emulops);
if ( rc != X86EMUL_OKAY )
{
return 1;
}
}
- for ( ; i < 2 * 8192; i += 8192 )
+ for ( ; i < 2 * 8192; i += 8192 ) {
printf(".");
+ ++nr;
+ }
+
if ( (regs.eip != 0x12345678) ||
(regs.esp != ((unsigned long)res + MMAP_SZ)) ||
!blobs[j].check_regs(®s) )
goto fail;
- printf("okay\n");
+
+ printf("%*sokay\n", nr < 40 ? 40 - nr : 0, "");
}
return 0;