# Trouble with External Module Tests

**URL:** <https://discourse.itk.org/t/trouble-with-external-module-tests/6098>\
**Category:** Engineering\
**Created:** [July 26, 2023, 8:31pm UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098 "2023-07-26T20:31:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyoll](https://discourse.itk.org/user_avatar/discourse.itk.org/dyoll/32/2311_2.png) [@dyoll](https://discourse.itk.org/u/dyoll)\
**Post date:** [July 26, 2023, 8:31pm UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/1 "2023-07-26T20:31:28Z")

</div>

I want to upgrade my external module to use the new re-usable github actions before adding a new filter.

> <https://github.com/dyollb/ITKTopologyControl/pull/6>
>
> \- refactor FixTopologyCarveOutside, so code can be shared
> \- add FixTopologyCarv…eInside: grow from inside under topological constraints (#3)

However, I am having trouble with the baseline data.

- first I was storing the data in the git repository (as in the main branch), but the windows cxx text build was failing to load the baseline image (could not create ImageIO factory). Locally, on my mac it works. On the CI only the windows job fails, the ubuntu and mac job passed.
- I also tried using ExternalData: I uploaded the data to [https://data.kitware.com/#folder/64c15003b4d956782eee8ee3](https://data.kitware.com/#folder/64c15003b4d956782eee8ee3). But I get the same symptoms.

> Exception detected while reading D:/a/ITKTopologyControl/build/ExternalData/test/Baseline/itkFixTopologyCarveOutsideTestOutput.mha : Could not create IO object for reading file D:/a/ITKTopologyControl/build/Testing/Temporary/itkFixTopologyCarveOutsideTestOutput.mha  
> [add FixTopologyCarveInside: grow from inside under topological constraints · dyollb/ITKTopologyControl@19f0c47 · GitHub](https://github.com/dyollb/ITKTopologyControl/actions/runs/5673530375/job/15375195024?pr=6)

Any idea what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![dyoll](https://discourse.itk.org/user_avatar/discourse.itk.org/dyoll/32/2311_2.png) [@dyoll](https://discourse.itk.org/u/dyoll)\
**Post date:** [July 27, 2023, 9:01am UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/2 "2023-07-27T09:01:35Z")

</div>

interesting: I changed the base class of my filter and ITK\_EXERCISE\_BASIC\_OBJECT\_METHODS failed. But only in the windows build. I wonder why this test is disabled for gcc…

The error message above was just a consequence, since the test didn’t finish executing and didn’t write an output file.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [July 27, 2023, 1:27pm UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/3 "2023-07-27T13:27:35Z")

</div>

> [@dyoll](#):
>
> interesting: I changed the base class of my filter and ITK\_EXERCISE\_BASIC\_OBJECT\_METHODS failed. But only in the windows build. I wonder why this test is disabled for gcc…

These may explain it:  
[COMP: Avoid Superclass type alias GCC compile errors by thewtex · Pull Request #2720 · InsightSoftwareConsortium/ITK · GitHub](https://github.com/InsightSoftwareConsortium/ITK/pull/2720)  
[ITK/Modules/Core/TestKernel/include/itkTestingMacros.h at master · InsightSoftwareConsortium/ITK · GitHub](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/TestKernel/include/itkTestingMacros.h#L81)

---

<div class="post-metadata">

**Author:** ![dyoll](https://discourse.itk.org/user_avatar/discourse.itk.org/dyoll/32/2311_2.png) [@dyoll](https://discourse.itk.org/u/dyoll)\
**Post date:** [July 27, 2023, 2:23pm UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/4 "2023-07-27T14:23:44Z")

</div>

yes.

I wonder if (in this [PR](https://github.com/InsightSoftwareConsortium/ITK/pull/2720)) you tried something like:

```auto
#if defined( __GNUC__ )
#define ITK_EXERCISE_BASIC_OBJECT_METHODS(object, ClassName, SuperclassName) \
  object->Print(std::cout); \
  std::cout << "Name of Class = " << object->GetNameOfClass() << std::endl; \
  using self_t = std::remove_reference<decltype(*object)>::type; \
  using parent_t = typename self_t::Superclass; \
  std::cout << "Name of Superclass = " << dynamic_cast<parent_t&>(*object).GetNameOfClass() << std::endl; \
  ITK_MACROEND_NOOP_STATEMENT

```

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [July 27, 2023, 2:38pm UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/5 "2023-07-27T14:38:41Z")

</div>

Not sure about the benefit; would that allow making the macro be quantitative for GCC ?

You may want to submit a PR.

---

<div class="post-metadata">

**Author:** ![dyoll](https://discourse.itk.org/user_avatar/discourse.itk.org/dyoll/32/2311_2.png) [@dyoll](https://discourse.itk.org/u/dyoll)\
**Post date:** [July 28, 2023, 5:07am UTC](https://discourse.itk.org/t/trouble-with-external-module-tests/6098/6 "2023-07-28T05:07:13Z")

</div>

I realize GetNameOfClass is virtual, so no benefit, and no PR.
