summaryrefslogtreecommitdiffstats
path: root/courgette/ensemble_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'courgette/ensemble_unittest.cc')
-rw-r--r--courgette/ensemble_unittest.cc56
1 files changed, 51 insertions, 5 deletions
diff --git a/courgette/ensemble_unittest.cc b/courgette/ensemble_unittest.cc
index d35622f..e2f1198 100644
--- a/courgette/ensemble_unittest.cc
+++ b/courgette/ensemble_unittest.cc
@@ -12,6 +12,8 @@ class EnsembleTest : public BaseTest {
void TestEnsemble(std::string src_bytes, std::string tgt_bytes) const;
void PeEnsemble() const;
+ void Pe64Ensemble() const;
+ void Elf32Ensemble() const;
};
void EnsembleTest::TestEnsemble(std::string src_bytes,
@@ -44,18 +46,52 @@ void EnsembleTest::TestEnsemble(std::string src_bytes,
target.OriginalLength()));
}
+void EnsembleTest::Elf32Ensemble() const {
+ std::list<std::string> src_ensemble;
+ std::list<std::string> tgt_ensemble;
+
+ src_ensemble.push_back("elf-32-1");
+
+ tgt_ensemble.push_back("elf-32-2");
+
+ std::string src_bytes = FilesContents(src_ensemble);
+ std::string tgt_bytes = FilesContents(tgt_ensemble);
+
+ src_bytes = "aaabbbccc" + src_bytes + "dddeeefff";
+ tgt_bytes = "aaagggccc" + tgt_bytes + "dddeeefff";
+
+ TestEnsemble(src_bytes, tgt_bytes);
+}
+
void EnsembleTest::PeEnsemble() const {
std::list<std::string> src_ensemble;
std::list<std::string> tgt_ensemble;
src_ensemble.push_back("en-US.dll");
src_ensemble.push_back("setup1.exe");
- src_ensemble.push_back("elf-32-1");
- src_ensemble.push_back("pe-64.exe");
tgt_ensemble.push_back("en-US.dll");
tgt_ensemble.push_back("setup2.exe");
- tgt_ensemble.push_back("elf-32-2");
+
+ std::string src_bytes = FilesContents(src_ensemble);
+ std::string tgt_bytes = FilesContents(tgt_ensemble);
+
+ src_bytes = "aaabbbccc" + src_bytes + "dddeeefff";
+ tgt_bytes = "aaagggccc" + tgt_bytes + "dddeeefff";
+
+ TestEnsemble(src_bytes, tgt_bytes);
+}
+
+void EnsembleTest::Pe64Ensemble() const {
+ std::list<std::string> src_ensemble;
+ std::list<std::string> tgt_ensemble;
+
+ src_ensemble.push_back("en-US-64.dll");
+ src_ensemble.push_back("chrome64_1.exe");
+ src_ensemble.push_back("pe-64.exe");
+
+ tgt_ensemble.push_back("en-US-64.dll");
+ tgt_ensemble.push_back("chrome64_2.exe");
tgt_ensemble.push_back("pe-64.exe");
std::string src_bytes = FilesContents(src_ensemble);
@@ -67,7 +103,17 @@ void EnsembleTest::PeEnsemble() const {
TestEnsemble(src_bytes, tgt_bytes);
}
-TEST_F(EnsembleTest, DISABLED_All) {
- // TODO(dgarrett) http://code.google.com/p/chromium/issues/detail?id=101614
+// Ensemble tests still take too long on Windows so disabling for now
+// TODO(dgarrett) http://code.google.com/p/chromium/issues/detail?id=101614
+
+TEST_F(EnsembleTest, DISABLED_PE) {
PeEnsemble();
}
+
+TEST_F(EnsembleTest, DISABLED_PE64) {
+ Pe64Ensemble();
+}
+
+TEST_F(EnsembleTest, DISABLED_Elf32) {
+ Elf32Ensemble();
+}