xujuntwt95329 added a comment.

Thanks a lot for your comments, they are very useful and I learned a lot about 
C++ by talking with you.

I'll address these comments and submit a patch and request your review.

Much appreciated!



================
Comment at: lldb/unittests/Target/FindFileTest.cpp:36
+  void SetUp() override {
+    FileSystem::Initialize();
+    HostInfo::Initialize();
----------------
teemperor wrote:
> You can simplify this code by giving this test struct a member 
> `SubsystemRAII<FileSystem, HostInfo> subsystems;`. It will automatically call 
> these functions for you in the right order on test setUp/tearDown. It also 
> automatically adds error handling for init errors to your test. So this whole 
> class can all be:
> 
> ```
> lang=c++
> struct FindFileTest : public testing::Test {
>   SubsystemRAII<FileSystem, HostInfo> subsystems;
> };
> ```
> You can simplify this code by giving this test struct a member 
> `SubsystemRAII<FileSystem, HostInfo> subsystems;`. It will automatically call 
> these functions for you in the right order on test setUp/tearDown. It also 
> automatically adds error handling for init errors to your test. So this whole 
> class can all be:
> 
> ```
> lang=c++
> struct FindFileTest : public testing::Test {
>   SubsystemRAII<FileSystem, HostInfo> subsystems;
> };
> ```




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to