Skip to content

Commit 1d28315

Browse files
hjmjohnsonclaude
andcommitted
STYLE: Use EXPECT_THROW instead of manual try/catch for ProcessAborted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5580da8 commit 1d28315

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

Modules/Core/Common/test/itkAbortProcessObjectGTest.cxx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ TEST(AbortProcessObject, ConvertedLegacyTest)
9999

100100
std::cout << extract << std::endl;
101101

102-
bool exceptionCaught = false;
103-
try
104-
{
105-
extract->UpdateLargestPossibleRegion();
106-
}
107-
catch (const itk::ProcessAborted &)
108-
{
109-
exceptionCaught = true;
110-
}
111-
EXPECT_TRUE(exceptionCaught) << "Expected ProcessAborted exception to be thrown.";
102+
EXPECT_THROW(extract->UpdateLargestPossibleRegion(), itk::ProcessAborted);
112103
EXPECT_TRUE(onAbortCalled) << "Expected Abort Event callback to be called.";
113104
}

0 commit comments

Comments
 (0)