geopro/tests/net/FakeApiCall.hpp

16 lines
472 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "IApiCall.hpp"
namespace geopro::net::test {
// 测试假 call。不加 Q_OBJECT —— 仅发射继承自 IApiCall 的 finished 信号、override abort。
class FakeApiCall : public IApiCall {
public:
using IApiCall::IApiCall;
bool aborted = false;
void abort() override { aborted = true; }
void fire(const ApiResponse& r) { emit finished(r); } // 发射继承的信号(无需自身 moc
};
} // namespace geopro::net::test