InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.47k stars 686 forks source link

BUG: fixed test that made bad assumptions of GetGlobalDefaultNumberOf… #5191

Closed seanm closed 1 week ago

seanm commented 1 week ago

…Threads()

seanm commented 1 week ago

@dzenanz how would I solve the case with the ITK_TEST_SET_GET_VALUE macro? I'm not sure what to use instead...

N-Dekker commented 1 week ago

Thanks @seanm !

seanm commented 1 week ago

There's one more failing test that I hope to figure out and add here...

seanm commented 1 week ago

OK, I don't get it... need help :)

It's this code:

https://github.com/InsightSoftwareConsortium/ITK/blob/5df209ffdd2b351939631219de14c782754691ca/Modules/Core/Common/test/itkMultiThreaderExceptionsTest.cxx#L102

The test fails with Failed to catch expected exception.

The call to dummySrc->SetNumberOfWorkUnits(4) will be clamped down from 4 to 2 (my ITK_DEFAULT_MAX_THREADS), so I thought changing the hardedcoded for loop from 4 would fix it, but alas no (though that change maybe necessary too, but insufficient).

dzenanz commented 1 week ago

Nothing jumps at me. I guess some digging is needed into DummyImageSource.

seanm commented 1 week ago

I took a wild guess: there was another 4 in the code. Changing that fixed it.

seanm commented 1 week ago

If this looks good to y'all, would be nice to merge, as it will green up cdash a bit.

seanm commented 1 week ago

Seems this broke the build, depending on build options: https://open.cdash.org/viewBuildError.php?buildid=10179364

fix: https://github.com/InsightSoftwareConsortium/ITK/pull/5200