[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

Xu Jun via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 2 05:50:18 PDT 2021


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



More information about the lldb-commits mailing list