remove RemovePath

Generally:
- we do overwrite files (perhaps should stop, but for legacy
constraints)
- we ask build systems to clean the output directory before we run code
- if an error happens in a backend, it should be AIDL_FATAL, and we
  should attempt to fix things in the validation phase of the compiler
- if there is an I/O error, we should crash/report a fatal error, but
  avoid removing paths (for debuggability, and since there is an I/O
  issue, avoid doing additional I/O)
- if a user tries to use this file, and it's incomplete, then this is
  a way they can discover they aren't checking the error code from their
  compiler

Fixes: 201507504
Test: aidl_unittests
Change-Id: Id0360c2253d4e53a5e76bfbc1b5c83dc0aa491c4
diff --git a/generate_cpp_unittest.cpp b/generate_cpp_unittest.cpp
index a1be5d8..96d85c6 100644
--- a/generate_cpp_unittest.cpp
+++ b/generate_cpp_unittest.cpp
@@ -131,11 +131,10 @@
       StringPrintf("%s%c%s", kHeaderDir, OS_PATH_SEPARATOR,
                    kInterfaceHeaderRelPath);
   io_delegate_.AddBrokenFilePath(header_path);
-  ASSERT_FALSE(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_));
+  ASSERT_DEATH(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_),
+               "I/O Error!");
   // We should never attempt to write the C++ file if we fail writing headers.
   ASSERT_FALSE(io_delegate_.GetWrittenContents(kOutputPath, nullptr));
-  // We should remove partial results.
-  ASSERT_TRUE(io_delegate_.PathWasRemoved(header_path));
 }
 
 TEST_F(IoErrorHandlingTest, HandlesBadCppWrite) {
@@ -145,9 +144,8 @@
 
   // Simulate issues closing the cpp file.
   io_delegate_.AddBrokenFilePath(kOutputPath);
-  ASSERT_FALSE(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_));
-  // We should remove partial results.
-  ASSERT_TRUE(io_delegate_.PathWasRemoved(kOutputPath));
+  ASSERT_DEATH(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_),
+               "I/O Error!");
 }
 
 }  // namespace cpp