Zebediah Figura (@zfigura) commented about dlls/cfgmgr32/tests/cfgmgr32.c:
- SetLastError(0xdeadbeef);
- ret = 0;
- ret = CM_MapCrToWin32Err( 0xdeadbeef, DEFAULT_ERROR );
- ok( ret == DEFAULT_ERROR, "expected default error, got %ld.\n", ret );
- ok( GetLastError() == 0xdeadbeef, "unexpected error %ld.\n", GetLastError() );
- for ( i = 0; i < sizeof(map_codes) / sizeof(map_codes[0]); i++ )
- {
ret = 0xdeadbeef;
ret = CM_MapCrToWin32Err( map_codes[i].code, DEFAULT_ERROR );
expected = map_codes[i].win32_error;
if (expected == DEFAULT_ERROR)
ok( ret == DEFAULT_ERROR, "expected default error, got %ld.\n", ret );
else
ok( ret == expected, "expected %ld, got %ld.\n", expected, ret );
This seems excessive; I'd just make it a single ok() statement. For that matter, I wouldn't bother with an "expected" variable.