Skip to content

Test plugin for servus#77

Merged
eile merged 3 commits intoHBPVIS:masterfrom
eile:master
Sep 1, 2017
Merged

Test plugin for servus#77
eile merged 3 commits intoHBPVIS:masterfrom
eile:master

Conversation

@eile
Copy link
Copy Markdown
Contributor

@eile eile commented Aug 31, 2017

No description provided.

@eile eile requested review from dnachbaur and rdumusc August 31, 2017 12:52
eile pushed a commit to eile/ZeroEQ that referenced this pull request Aug 31, 2017
eile pushed a commit to eile/ZeroEQ that referenced this pull request Aug 31, 2017
@dnachbaur
Copy link
Copy Markdown
Contributor

Changelog?

Copy link
Copy Markdown

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

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

+1, good in general!

browse(browseTime);
if (result != servus::Servus::Result::PENDING)
endBrowsing();
return getInstances();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm, I've been struggling to understand this function.
It is not immediately clear for the reader why Result has both a bool operator and an int comparison operator, and that the bool is equivalent to result == servus::Servus::Result::SUCCESS. Anyway, how about the following form which avoids the multiple return and negative checks?

    const auto result = beginBrowsing(addr);
    const bool canBrowse = result == servus::Servus::Result::SUCCESS;
    const bool browsePending = result == servus::Servus::Result::PENDING;
    if (canBrowse || browsePending)
    {
        browse(browseTime);
        if (!browsePending)
            endBrowsing();
    }
    return getInstances();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even simpler. See a18cffe

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

yes, +1 for eliminating the duplication, this felt like it should be a function of the parent class.

@eile
Copy link
Copy Markdown
Contributor Author

eile commented Sep 1, 2017

Re Changelog: Is this a user feature, aka should we document it?

eile pushed a commit to eile/Servus that referenced this pull request Sep 1, 2017
eile pushed a commit to eile/Servus that referenced this pull request Sep 1, 2017
@rdumusc
Copy link
Copy Markdown

rdumusc commented Sep 1, 2017

I would also add a changelog entry, it doesn't cost anything and this is a new feature if you want to write unit tests like in ZeroEQ ;-)

eile pushed a commit to eile/Servus that referenced this pull request Sep 1, 2017
@dnachbaur
Copy link
Copy Markdown
Contributor

Definitely a user feature, as the user is a developer who uses Servus as library and he/she wants to write unit tests using servus.

@eile eile merged commit 8f652f6 into HBPVIS:master Sep 1, 2017
eile pushed a commit to eile/ZeroEQ that referenced this pull request Sep 1, 2017
@rdumusc
Copy link
Copy Markdown

rdumusc commented Sep 1, 2017

@eile the changelog is still missing... ;-)

eile added a commit to HBPVIS/ZeroEQ that referenced this pull request Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants