Apply CleanPath() before comparing paths
Paths are sometimes prefixed with "./". CleanPath() is moved from
FakeIoDelegate to IoDelegate so that Parser uses it before comparing
paths.
Ideally, we should use std::filesystem::path::lexically_normal(), but
it's not available on windows platform which we support.
Removing "./" is good enough for most cases. To be specific, this
happens when we pass "-I.".
Bug: n/a
Test: m (aidl_unittests)
Change-Id: Ied6eaf1b264102d997306ac0cc2c32934056b27c
diff --git a/aidl_unittest.cpp b/aidl_unittest.cpp
index 0218561..81931a1 100644
--- a/aidl_unittest.cpp
+++ b/aidl_unittest.cpp
@@ -962,7 +962,7 @@
TEST_P(AidlTest, StructuredFailOnUnstructuredParcelable) {
const string expected_stderr =
- "ERROR: ./o/WhoKnowsWhat.aidl:1.22-35: o.WhoKnowsWhat is not structured, but this is a "
+ "ERROR: o/WhoKnowsWhat.aidl:1.22-35: o.WhoKnowsWhat is not structured, but this is a "
"structured interface.\n";
io_delegate_.SetFileContents("o/WhoKnowsWhat.aidl", "package o; parcelable WhoKnowsWhat;");
import_paths_.emplace("");