# Operator group registration

**URL:** https://discourse.kitware.com/t/operator-group-registration/90
**Category:** Using SMTK
**Created:** [April 13, 2018, 10:46pm UTC](https://discourse.kitware.com/t/operator-group-registration/90 "2018-04-13T22:46:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [April 13, 2018, 10:46pm UTC](https://discourse.kitware.com/t/operator-group-registration/90/1 "2018-04-13T22:46:03Z")

</div>

While working to get a list of available operators from the selection, I’ve run across a curious issue in `smtk/bridge/polygon/RegisterSession.cxx` at line 61:

[https://gitlab.kitware.com/cmb/smtk/blob/master/smtk/bridge/polygon/RegisterSession.cxx#L61](https://gitlab.kitware.com/cmb/smtk/blob/master/smtk/bridge/polygon/RegisterSession.cxx#L61)

It looks like only 2 arguments are passed to the registerOperation method and the last (fileItemName) defaults to an empty string. When I run the `UnitTestPolygonEnvironment` test from within ctest, everything appears to run fine but when I run it from the command line, the test fails, apparently because it does not find the legacy polygon read operator. When I modify RegisterSession to pass “filename” as the 3rd argument to registerOperation(), then everything works properly no matter I run it.

@tj.corona Does any of this code strike you as using an uninitialized value somewhere?

---

<div class="post-metadata">

### Author: ![tj.corona](https://discourse.kitware.com/user_avatar/discourse.kitware.com/tj.corona/32/35_2.png) [@tj.corona](https://discourse.kitware.com/u/tj.corona)
#### Post date: [April 16, 2018, 12:42pm UTC](https://discourse.kitware.com/t/operator-group-registration/90/2 "2018-04-16T12:42:35Z")

</div>

I think that the default argument for the third parameter is `m_defaultFileItemName`, which is set in `ResourceIOGroup.cxx` to be `"filename"`.

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [April 16, 2018, 12:44pm UTC](https://discourse.kitware.com/t/operator-group-registration/90/3 "2018-04-16T12:44:27Z")

</div>

> [@tj.corona](#):
>
> I think that the default argument for the third parameter is m\_defaultFileItemName…

Any idea why adding a non-default value that is also `"filename"` changes the behavior?

---

<div class="post-metadata">

### Author: ![tj.corona](https://discourse.kitware.com/user_avatar/discourse.kitware.com/tj.corona/32/35_2.png) [@tj.corona](https://discourse.kitware.com/u/tj.corona)
#### Post date: [April 16, 2018, 12:46pm UTC](https://discourse.kitware.com/t/operator-group-registration/90/4 "2018-04-16T12:46:14Z")

</div>

Nope. I am compiling master now to see if I can reproduce your results.

---

<div class="post-metadata">

### Author: ![tj.corona](https://discourse.kitware.com/user_avatar/discourse.kitware.com/tj.corona/32/35_2.png) [@tj.corona](https://discourse.kitware.com/u/tj.corona)
#### Post date: [April 16, 2018, 12:54pm UTC](https://discourse.kitware.com/t/operator-group-registration/90/5 "2018-04-16T12:54:05Z")

</div>

When I run `UnitTestPolygonEnvironment` from the command line I get the same results as when I run it using ctest. In both cases, the test passes.
