summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-04-24 21:01:14 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-04-24 21:01:14 +0200
commitb35fb1cf7b56e589617d0c0db288333e1211fbf0 (patch)
treeb52e4ec9577c1449f0dbd2c9168d31ec36c33f2e /tests
parentMerge "librecovery: Remove -Wno-unused-parameter and add -Wall." am: b6c9c41a3d am: 0cf72f0f14 (diff)
parentMerge "tests: Remove obsolete classes in applypatch_test." am: f17aa960db (diff)
downloadandroid_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar.gz
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar.bz2
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar.lz
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar.xz
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.tar.zst
android_bootable_recovery-b35fb1cf7b56e589617d0c0db288333e1211fbf0.zip
Diffstat (limited to 'tests')
-rw-r--r--tests/component/applypatch_test.cpp51
1 files changed, 2 insertions, 49 deletions
diff --git a/tests/component/applypatch_test.cpp b/tests/component/applypatch_test.cpp
index 5cba68f8a..6fdf78e47 100644
--- a/tests/component/applypatch_test.cpp
+++ b/tests/component/applypatch_test.cpp
@@ -105,9 +105,6 @@ class ApplyPatchTest : public ::testing::Test {
static size_t new_size;
};
-std::string ApplyPatchTest::old_file;
-std::string ApplyPatchTest::new_file;
-
static void cp(const std::string& src, const std::string& tgt) {
std::string cmd = "cp " + src + " " + tgt;
system(cmd.c_str());
@@ -132,48 +129,8 @@ class ApplyPatchCacheTest : public ApplyPatchTest {
}
};
-class ApplyPatchFullTest : public ApplyPatchCacheTest {
- public:
- static void SetUpTestCase() {
- ApplyPatchTest::SetUpTestCase();
-
- output_f = new TemporaryFile();
- output_loc = std::string(output_f->path);
-
- struct FileContents fc;
-
- ASSERT_EQ(0, LoadFileContents(&rand_file[0], &fc));
- patches.push_back(
- std::make_unique<Value>(VAL_BLOB, std::string(fc.data.begin(), fc.data.end())));
-
- ASSERT_EQ(0, LoadFileContents(&patch_file[0], &fc));
- patches.push_back(
- std::make_unique<Value>(VAL_BLOB, std::string(fc.data.begin(), fc.data.end())));
- }
-
- static void TearDownTestCase() {
- delete output_f;
- patches.clear();
- }
-
- static std::vector<std::unique_ptr<Value>> patches;
- static TemporaryFile* output_f;
- static std::string output_loc;
-};
-
-class ApplyPatchDoubleCacheTest : public ApplyPatchFullTest {
- public:
- virtual void SetUp() {
- ApplyPatchCacheTest::SetUp();
- cp(cache_file, "/cache/reallysaved.file");
- }
-
- virtual void TearDown() {
- cp("/cache/reallysaved.file", cache_file);
- ApplyPatchCacheTest::TearDown();
- }
-};
-
+std::string ApplyPatchTest::old_file;
+std::string ApplyPatchTest::new_file;
std::string ApplyPatchTest::rand_file;
std::string ApplyPatchTest::patch_file;
std::string ApplyPatchTest::cache_file;
@@ -184,10 +141,6 @@ std::string ApplyPatchTest::bad_sha1_b;
size_t ApplyPatchTest::old_size;
size_t ApplyPatchTest::new_size;
-std::vector<std::unique_ptr<Value>> ApplyPatchFullTest::patches;
-TemporaryFile* ApplyPatchFullTest::output_f;
-std::string ApplyPatchFullTest::output_loc;
-
TEST_F(ApplyPatchTest, CheckModeSkip) {
std::vector<std::string> sha1s;
ASSERT_EQ(0, applypatch_check(&old_file[0], sha1s));