summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2020-03-30 21:47:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-30 21:47:30 +0000
commitbfebb261f54b874fc7a927a9592fbf3ccdf3fdfb (patch)
treee8349a5551fbba06c25549ad1fd7240fb22dc982
parent29b0308f3978267e609188ea59e98e1f2ebe56ca (diff)
parent4346dc68d053cab4e4b17b94405eaf6bbfba065a (diff)
downloadbsdiff-platform-tools-30.0.0.tar.gz
Merge "Snap for 6348162 from 090c86526c8ed3cbf674e87ccec58220c576675d to sdk-release" into sdk-releaseplatform-tools-30.0.1platform-tools-30.0.0
l---------NOTICE1
-rw-r--r--TEST_MAPPING7
-rw-r--r--extents_file_unittest.cc3
-rw-r--r--test_utils.cc7
4 files changed, 11 insertions, 7 deletions
diff --git a/NOTICE b/NOTICE
deleted file mode 120000
index 7a694c9..0000000
--- a/NOTICE
+++ /dev/null
@@ -1 +0,0 @@
-LICENSE \ No newline at end of file
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..598f4c9
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "presubmit": [
+ {
+ "name": "bsdiff_unittest"
+ }
+ ]
+}
diff --git a/extents_file_unittest.cc b/extents_file_unittest.cc
index 7dc23be..38f288a 100644
--- a/extents_file_unittest.cc
+++ b/extents_file_unittest.cc
@@ -178,8 +178,9 @@ TEST_F(ExtentsFileTest, ReadFailureFails) {
// A second read that fails will succeed if there was partial data read.
EXPECT_CALL(*mock_file_, Read(_, 10, _)).WillOnce(Return(false));
+ char* buf = reinterpret_cast<char*>(0x1234);
size_t bytes_read = 0;
- EXPECT_TRUE(file.Read(nullptr, 100, &bytes_read));
+ EXPECT_TRUE(file.Read(buf, 100, &bytes_read));
EXPECT_EQ(1U, bytes_read);
}
diff --git a/test_utils.cc b/test_utils.cc
index eb079d5..c1350eb 100644
--- a/test_utils.cc
+++ b/test_utils.cc
@@ -53,11 +53,8 @@ namespace test_utils {
void BsdiffTestEnvironment::SetUp() {
#ifdef BSDIFF_TARGET_UNITTEST
-#define BSDIFF_TARGET_TMP_BASE "/data/tmp"
- if (access(BSDIFF_TARGET_TMP_BASE, F_OK) == -1) {
- mkdir(BSDIFF_TARGET_TMP_BASE, S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH);
- }
- setenv("TMPDIR", BSDIFF_TARGET_TMP_BASE, 1);
+#define BSDIFF_TARGET_TMP_BASE "/data/local/tmp"
+ setenv("TMPDIR", BSDIFF_TARGET_TMP_BASE, 1);
#endif // defined (BSDIFF_TARGET_UNITTEST)
}