commit 1828d0b75f133db53faa327fafbc64edc355d5b1
parent f9c8bdb315582e2a2ad8f7db557461cc620d3fc0
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 25 Feb 2017 21:56:44 -0500
registry: small bit of refactoring
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/registry.hpp b/src/registry.hpp
@@ -39,7 +39,7 @@ public:
std::string author;
bool pinned;
- operator bool() const { return id != 0; }
+ operator bool() const { return id > 0; }
bool operator==(const Entry &o) const { return id == o.id; }
};
diff --git a/test/registry.cpp b/test/registry.cpp
@@ -155,7 +155,8 @@ TEST_CASE("file conflicts", M) {
CHECK(reg.getEntry(&pkg).id == 0); // still uninstalled
vector<Path> conflicts;
- reg.push(&ver, &conflicts);
+ const auto &pushResult = reg.push(&ver, &conflicts);
+ CHECK(pushResult.id == 0);
REQUIRE(conflicts.size() == 1);
REQUIRE(conflicts[0] == src1->targetPath());