-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make unit test more reliable, fix resulting failure #794
Conversation
Ok, this test seems to pass on Mac, but fails on Windows. Something is screwy here. |
This passes on Linux, too. |
This unit test was not catching a defect on Mac/Linux because of the way that the compiler can optionally optimize out write operations that occur in the destructor. Change the test to make use of a static member instead so as to avoid this.
8b22099
to
7723f77
Compare
I still get the same error on Windows. In fact, outer(&OuterType::sig) += [this] {...} is not called on Mac and Linux because outer is already destroyed and not autowired any more. That's why this test passes on Mac and Linux. |
Good insight. Let me see if I can make this test more reliable. |
In this case, because the context is gone, we actually don't want the signal to be asserted. We are fine with breaking the normal requirement of `autowiring::signal` because the registration strategy is different.
Make unit test more reliable, fix resulting failure
Looks great!! |
This unit test was not catching a defect on Mac/Linux because of the way that the compiler can optionally optimize out write operations that occur in the destructor. Change the test to make use of a static member instead so as to avoid this.