Skip to content
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

Merged
merged 7 commits into from Oct 22, 2015

Conversation

codemercenary
Copy link
Contributor

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.

@codemercenary
Copy link
Contributor Author

Ok, this test seems to pass on Mac, but fails on Windows. Something is screwy here.

@hham
Copy link
Contributor

hham commented Oct 22, 2015

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.
@codemercenary
Copy link
Contributor Author

I just rebased to 18f4907, which ensures this PR is building #774. Still it passes. I am going to try something else.

@hham
Copy link
Contributor

hham commented Oct 22, 2015

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.

@codemercenary
Copy link
Contributor Author

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.
veronicaz41 pushed a commit that referenced this pull request Oct 22, 2015
Make unit test more reliable, fix resulting failure
@veronicaz41 veronicaz41 merged commit f94b88d into develop Oct 22, 2015
@veronicaz41 veronicaz41 deleted the fix-awafterdestroy branch October 22, 2015 21:02
@hham
Copy link
Contributor

hham commented Oct 22, 2015

Looks great!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants