crash_reporter: Clean up symlinks in unit test
The user collector test creates several symlinks to the temporary
directory that it doesn't unlink. Fix it.
BUG=27365098
TEST=run `crash_reporter_tests`, tests pass, no symlinks are left behind
Change-Id: I7ad24c528dc842e17fa3569ea010f43d34e0bd75
diff --git a/crash_reporter/user_collector_test.cc b/crash_reporter/user_collector_test.cc
index d9c9a5b..ab94879 100644
--- a/crash_reporter/user_collector_test.cc
+++ b/crash_reporter/user_collector_test.cc
@@ -186,10 +186,10 @@
test_dir_.path().Append("test/this_link").value().c_str();
this_link.assign(long_link.c_str(), len);
ASSERT_EQ(len, this_link.size());
- unlink(kLink);
ASSERT_EQ(0, symlink(this_link.c_str(), kLink));
ASSERT_TRUE(collector_.GetSymlinkTarget(FilePath(kLink), &result));
ASSERT_EQ(this_link, result.value());
+ unlink(kLink);
}
}