Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: mi_exe_stub/x86_encoder/bcj2_encoder_unittest.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mi_exe_stub/x86_encoder/bcj2_encoder.cc ('k') | mi_exe_stub/x86_encoder/build.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mi_exe_stub/x86_encoder/bcj2_encoder_unittest.cc
diff --git a/mi_exe_stub/x86_encoder/bcj2_encoder_unittest.cc b/mi_exe_stub/x86_encoder/bcj2_encoder_unittest.cc
deleted file mode 100644
index 164d94bfbc687aeaaf8d83b280dabcd24ddf1d2c..0000000000000000000000000000000000000000
--- a/mi_exe_stub/x86_encoder/bcj2_encoder_unittest.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#include "omaha/mi_exe_stub/x86_encoder/bcj2_encoder.h"
-#include <string>
-#include <vector>
-#include "omaha/base/utils.h"
-#include "omaha/testing/unit_test.h"
-extern "C" {
-#include "omaha/third_party/lzma/v4_65/files/C/Bcj2.h"
-}
-
-namespace omaha {
-
-TEST(Bcj2EncoderTest, EmptyBuffer) {
- std::string input;
- std::string output1;
- std::string output2;
- std::string output3;
- std::string output4;
- ASSERT_TRUE(Bcj2Encode(input, &output1, &output2, &output3, &output4));
- EXPECT_EQ("", output1);
- EXPECT_EQ("", output2);
- EXPECT_EQ("", output3);
- EXPECT_EQ(std::string(5, '\0'), output4);
-}
-
-// Test that the transform is reversible.
-TEST(Bcj2EncoderTest, Reversible) {
- // The victim program is the unit test itself.
- WCHAR module_path[MAX_PATH];
- ASSERT_LT(static_cast<DWORD>(0), ::GetModuleFileName(NULL,
- module_path,
- arraysize(module_path)));
- std::vector<byte> raw_file;
- ASSERT_HRESULT_SUCCEEDED(
- ReadEntireFileShareMode(module_path, 0, FILE_SHARE_READ, &raw_file));
- const std::string input(reinterpret_cast<char*>(&raw_file[0]),
- raw_file.size());
- std::string output1;
- std::string output2;
- std::string output3;
- std::string output4;
- ASSERT_TRUE(Bcj2Encode(input, &output1, &output2, &output3, &output4));
-
- std::string decoded_output;
- decoded_output.resize(raw_file.size());
- ASSERT_EQ(SZ_OK, Bcj2_Decode(reinterpret_cast<const uint8*>(output1.data()),
- output1.size(),
- reinterpret_cast<const uint8*>(output2.data()),
- output2.size(),
- reinterpret_cast<const uint8*>(output3.data()),
- output2.size(),
- reinterpret_cast<const uint8*>(output4.data()),
- output4.size(),
- reinterpret_cast<uint8*>(&decoded_output[0]),
- decoded_output.size()));
- EXPECT_EQ(input, decoded_output);
-}
-
-} // namespace omaha
« no previous file with comments | « mi_exe_stub/x86_encoder/bcj2_encoder.cc ('k') | mi_exe_stub/x86_encoder/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698