Skip to content

Commit e5835df

Browse files
blowekamphjmjohnson
authored andcommitted
Update tests for throwing exception with inputs
Inputs slots can have multiple types, current behavior is to throw an exception when the getter does not match the current type. For example if a image is asked for when a constant is set.
1 parent 47d8001 commit e5835df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/itkMaskedAssignImageFilterGTest.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ TEST_F(MaskedAssignFixture, SetGetPrint)
136136
EXPECT_ANY_THROW(filter->GetConstant1());
137137

138138
EXPECT_NO_THROW(filter->SetConstant1(1));
139-
EXPECT_NO_THROW(filter->GetInput());
139+
EXPECT_ANY_THROW(filter->GetInput());
140140
EXPECT_EQ(1, filter->GetConstant1());
141141

142142

@@ -151,7 +151,7 @@ TEST_F(MaskedAssignFixture, SetGetPrint)
151151
EXPECT_ANY_THROW(filter->GetConstant2());
152152

153153
EXPECT_NO_THROW(filter->SetConstant2(2));
154-
EXPECT_NO_THROW(filter->GetMaskImage());
154+
EXPECT_ANY_THROW(filter->GetMaskImage());
155155
EXPECT_EQ(2, filter->GetConstant2());
156156

157157

@@ -168,12 +168,12 @@ TEST_F(MaskedAssignFixture, SetGetPrint)
168168
EXPECT_ANY_THROW(filter->GetAssignConstant());
169169

170170
EXPECT_NO_THROW(filter->SetConstant3(3));
171-
EXPECT_NO_THROW(filter->GetMaskImage());
171+
EXPECT_ANY_THROW(filter->GetMaskImage());
172172
EXPECT_EQ(3, filter->GetConstant3());
173173

174174

175175
EXPECT_NO_THROW(filter->SetAssignConstant(4));
176-
EXPECT_NO_THROW(filter->GetMaskImage());
176+
EXPECT_ANY_THROW(filter->GetMaskImage());
177177
EXPECT_EQ(4, filter->GetConstant3());
178178
EXPECT_EQ(4, filter->GetAssignConstant());
179179
}

0 commit comments

Comments
 (0)