[PATCH] D112751: [llvm] [Support] Add HTTP Client Support library.

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 04:26:04 PST 2021


labath added inline comments.


================
Comment at: llvm/unittests/Support/HTTPClient.cpp:140-141
+  using HTTPClient::perform;
+  Error perform(const HTTPRequest Request,
+                HTTPResponseHandler &Handler) override {
+    if (Error Err = Handler.handleStatusCode(200))
----------------
noajshu wrote:
> labath wrote:
> > `MOCK_METHOD2(perform, Error(HTTPRequest, HTTPResponseHandler))`, and then just set expectations in the test. The entire `MockHTTPResponseHandler` business can go away.
> Thanks! It seems the only library code we hit with these tests is the small convenience methods `perform(Request)` and `get(Url)`. Is it worth making the perform method virtual to be able to create the mock class?
Probably not. It made sense while curl was implemented in a separate class, but I don't think it's worth going out of our way to make this work.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112751/new/

https://reviews.llvm.org/D112751



More information about the llvm-commits mailing list