Skip to content
Snippets Groups Projects
Commit ec240331 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

fix linux build&tests

parent 2329a1e6
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,8 @@ class ErrorTemplateInterface {
virtual Error Generate() const noexcept = 0;
virtual Error Generate(const std::string& suffix) const noexcept = 0;
virtual inline bool operator==(const Error& rhs) const = 0;
virtual inline bool operator!=(const Error& rhs) const = 0;
virtual bool operator==(const Error& rhs) const = 0;
virtual bool operator!=(const Error& rhs) const = 0;
};
......@@ -113,21 +113,21 @@ class ServiceErrorTemplate : public ErrorTemplateInterface {
return error_type_;
}
Error Generate() const noexcept {
Error Generate() const noexcept override{
auto err = new ServiceError<ServiceErrorType>(error_, error_type_);
return Error(err);
}
Error Generate(const std::string& suffix) const noexcept {
Error Generate(const std::string& suffix) const noexcept override {
return Error(new ServiceError<ServiceErrorType>(error_ + (error_.empty() ? "" : ": ") + suffix, error_type_));
}
inline bool operator==(const Error& rhs) const {
inline bool operator==(const Error& rhs) const override {
return rhs != nullptr
&& GetServiceErrorType() == ((ServiceError<ServiceErrorType>*) rhs.get())->GetServiceErrorType();
}
inline bool operator!=(const Error& rhs) const {
inline bool operator!=(const Error& rhs) const override {
return rhs != nullptr
&& GetServiceErrorType() != ((ServiceError<ServiceErrorType>*) rhs.get())->GetServiceErrorType();
}
......
......@@ -30,7 +30,7 @@ TEST(ErrorTemplate, Explain) {
TEST(ErrorTemplate, Append) {
Error error = asapo::GeneralErrorTemplates::kEndOfFile.Generate("test");
ASSERT_THAT(error->Explain(), HasSubstr("test2"));
ASSERT_THAT(error->Explain(), HasSubstr("test"));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment