Make TestSynchBarrier verbose
@@ -182,6 +182,10 @@ int TestSynchBarrier(int argc, char* argv[])
DWORD dwMaxThreads;
DWORD dwMinThreads;
DWORD dwNumLoops = 200;
+
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
GetNativeSystemInfo(&sysinfo);
printf("%s: Number of processors: %" PRIu32 "\n", __FUNCTION__, sysinfo.dwNumberOfProcessors);
dwMinThreads = sysinfo.dwNumberOfProcessors;
@@ -193,7 +197,8 @@ int TestSynchBarrier(int argc, char* argv[])
/* Test invalid parameters */
if (InitializeSynchronizationBarrier(&gBarrier, 0, -1))
{
- printf(
+ fprintf(
+ stderr,
"%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = 0\n",
__FUNCTION__);
return -1;
@@ -201,7 +206,8 @@ int TestSynchBarrier(int argc, char* argv[])
if (InitializeSynchronizationBarrier(&gBarrier, -1, -1))
{
- printf(
+ fprintf(
+ stderr,
"%s: InitializeSynchronizationBarrier unecpectedly succeeded with lTotalThreads = -1\n",
__FUNCTION__);
return -1;
@@ -209,7 +215,9 @@ int TestSynchBarrier(int argc, char* argv[])
if (InitializeSynchronizationBarrier(&gBarrier, 1, -2))
{
- printf("%s: InitializeSynchronizationBarrier unecpectedly succeeded with lSpinCount = -2\n",
+ fprintf(
+ stderr,
+ "%s: InitializeSynchronizationBarrier unecpectedly succeeded with lSpinCount = -2\n",
__FUNCTION__);
return -1;
}
@@ -217,15 +225,32 @@ int TestSynchBarrier(int argc, char* argv[])
/* Functional tests */
if (!TestSynchBarrierWithFlags(0, dwMaxThreads, dwNumLoops))
+ {
+ fprintf(stderr,
+ "%s: TestSynchBarrierWithFlags(0) unecpectedly succeeded with lTotalThreads = -1\n",
+ __FUNCTION__);
return -1;
+ }
if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY, dwMinThreads,
dwNumLoops))
+ {
+ fprintf(stderr,
+ "%s: TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY) "
+ "unecpectedly succeeded with lTotalThreads = -1\n",
+ __FUNCTION__);
return -1;
+ }
if (!TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY, dwMaxThreads,
dwNumLoops))
+ {
+ fprintf(stderr,
+ "%s: TestSynchBarrierWithFlags(SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY) "
+ "unecpectedly succeeded with lTotalThreads = -1\n",
+ __FUNCTION__);
return -1;
+ }
printf("%s: Test successfully completed\n", __FUNCTION__);
return 0;
