-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PathMatcher Test : Demonstrate potential issue with find & Iterators. #728
Conversation
beb46e2
to
b0efaac
Compare
Thanks Don. I did look at making the I've been moving away from using boost for the c++ unit tests, because having them split off elsewhere is awkward (I often forget to run the C++ tests), and boost unit_test has been a royal pain anyway. In Gaffer we just bind C++ tests in GafferTest etc so they can be called from the python tests. In Cortex this is a bit less clean because we don't have an IECoreTest module yet (we should do one day), but I've still adopted the same basic approach. |
Perhaps an optional argument on PathMatcher::Iterator::Iterator which defines if it moves to the next explicit path or not? Good spot a few comments to explain what's going on also? Let's just bin these changes, just wanted to see if there was any utility in keeping them. |
The whole purpose of the Iterator is to only visit explicit paths, so having an option to break that constraint seems wrong... I take it you didn't like the
I'd like to keep the PR open if that's OK. There are some definite traps here, and I do want to improve the situation somehow. |
It doesn't break that constraint. It just constructs to ::end() when you attempt to construct on a non explicit path.
I like it but thought it didn't avoid the trap I ran in to, where used find to get an Iterator and didn't expect it move to the next explicit path on construction of a RawIterator. Perhaps if we also have a rawFind? |
Ah, I see what you mean. That sounds like an option. But then as things stand
It would be in conjunction with making |
Lets move this to an Issue (#851) rather than a PR. |
C++ unit tests to demonstrate what I considered unexpected behaviour in PathMatcher.
Perhaps it's not worth keeping this code but it might be useful if we change functionality and it does document the current behaviour.