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

Adds a warning if the Server method of a TestFixture is called before Finalize #2047

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/TestFixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ TestFixture &TestFixture::OnPostUpdate(std::function<void(
//////////////////////////////////////////////////
std::shared_ptr<Server> TestFixture::Server() const
{
if (!this->dataPtr->finalized)
{
ignwarn << "Fixture has not been finalized, any functions you attempted"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use gzwarn instead to make forward porting easier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think gzwarn is available in citadel. It might be worth considering back porting the functionality to reduce the maintenance overhead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not. If we go ahead and do the forward port while it's "fresh" we can minimize some pain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. For some reason I thought they were. @mjcarroll would there be an issue if we added those to gz-common3 at some point?

<< "to hook into will not be run. It is recommended to call Finalize()"
<< "before accessing the server."
<< std::endl;
}
return this->dataPtr->server;
}