Zebediah Figura (@zfigura) commented about dlls/kernel32/tests/file.c:
+static void check_progress_output(ProgressOutput progress_output, int expected_stream_count) +{
- int i, current_stream_number = 0, last_call = progress_output.call_count-1;
- LARGE_INTEGER transfer_sum = {{0}}, stream_sum = {{0}};
- ok(progress_output.call_count > 0,"Expected some progress calls, received %d\n", progress_output.call_count);
- for (i = 0; i < progress_output.call_count; i++) {
ProgressCall call = progress_output.calls[i];
trace("i=%d %s TotalFileSize=%lld TotalBytesTransferred=%lld dwStreamNumber=%lu StreamBytesTransferred=%lld StreamSize=%lld\n",
i, reasons[call.dwCallbackReason], call.TotalFileSize.QuadPart, call.TotalBytesTransferred.QuadPart, call.dwStreamNumber,
call.StreamBytesTransferred.QuadPart, progress_output.calls[0].StreamSize.QuadPart);
if (call.dwCallbackReason == CALLBACK_STREAM_SWITCH) {
Shouldn't we validate that the first callback is always a CALLBACK_STREAM_SWITCH, and that there's only one of them?
In general if you find yourself writing "if" in tests, that seems a sign that your test is not restrictive enough.