summaryrefslogtreecommitdiff
path: root/xdelta3/testing/regtest.cc
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2008-08-09 15:24:05 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2008-08-09 15:24:05 +0000
commit3f6c6bfbaf34894a6e879a39bd66491525fd552c (patch)
tree1428a6bd9fd38e9e180c14fd65dad5e85ec7bc3f /xdelta3/testing/regtest.cc
parent0cece8d64b78073424d481e5b9f788c6f886ed44 (diff)
Merge test actually finding problems now.
Diffstat (limited to 'xdelta3/testing/regtest.cc')
-rw-r--r--xdelta3/testing/regtest.cc64
1 files changed, 43 insertions, 21 deletions
diff --git a/xdelta3/testing/regtest.cc b/xdelta3/testing/regtest.cc
index 254d2ce..87c6b55 100644
--- a/xdelta3/testing/regtest.cc
+++ b/xdelta3/testing/regtest.cc
@@ -644,16 +644,38 @@ void FourWayMergeTest(const TestOptions &options,
644 644
645 // Merge 2 645 // Merge 2
646 TmpFile out; 646 TmpFile out;
647 const char* argv[] = { 647 vector<const char*> mcmd;
648 "xdelta3", 648 mcmd.push_back("xdelta3");
649 "merge", 649 mcmd.push_back("merge");
650 "-m", (char*)d01.Name(), 650 mcmd.push_back("-m");
651 (char*)d12.Name(), 651 mcmd.push_back(d01.Name());
652 (char*)out.Name(), 652 mcmd.push_back(d12.Name());
653 NULL, 653 mcmd.push_back(out.Name());
654 }; 654 mcmd.push_back(NULL);
655 655
656 CHECK_EQ(0, xd3_main_cmdline(SIZEOF_ARRAY(argv) - 1, (char**)argv)); 656 CHECK_EQ(0, xd3_main_cmdline(mcmd.size() - 1,
657 const_cast<char**>(&mcmd[0])));
658 DP(RINT "Ran one merge! %s\n", CommandToString(mcmd).c_str());
659
660 TmpFile recon;
661 vector<const char*> tcmd;
662 tcmd.push_back("xdelta3");
663 tcmd.push_back("-d");
664 tcmd.push_back("-s");
665 tcmd.push_back(f0.Name());
666 tcmd.push_back(out.Name());
667 tcmd.push_back(recon.Name());
668 tcmd.push_back(NULL);
669
670 CHECK_EQ(0, xd3_main_cmdline(tcmd.size() - 1,
671 const_cast<char**>(&tcmd[0])));
672 DP(RINT "Ran one recon! %s\n", CommandToString(tcmd).c_str());
673
674 TmpFile f2;
675 spec2.WriteTmpFile(&f2);
676 DP(RINT "Should equal! %s\n", f2.Name());
677
678 CHECK(recon.EqualsSpec(spec2));
657} 679}
658 680
659void TestMergeCommand() { 681void TestMergeCommand() {
@@ -718,17 +740,17 @@ void TestMergeCommand() {
718 740
719int main(int argc, char **argv) { 741int main(int argc, char **argv) {
720#define TEST(x) cerr << #x << "..." << endl; x() 742#define TEST(x) cerr << #x << "..." << endl; x()
721 TEST(TestRandomNumbers); 743// TEST(TestRandomNumbers);
722 TEST(TestRandomFile); 744// TEST(TestRandomFile);
723 TEST(TestFirstByte); 745// TEST(TestFirstByte);
724 TEST(TestModifyMutator); 746// TEST(TestModifyMutator);
725 TEST(TestAddMutator); 747// TEST(TestAddMutator);
726 TEST(TestDeleteMutator); 748// TEST(TestDeleteMutator);
727 TEST(TestCopyMutator); 749// TEST(TestCopyMutator);
728 TEST(TestMoveMutator); 750// TEST(TestMoveMutator);
729 TEST(TestOverwriteMutator); 751// TEST(TestOverwriteMutator);
730 TEST(TestNonBlockingProgress); 752// TEST(TestNonBlockingProgress);
731 TEST(TestEmptyInMemory); 753// TEST(TestEmptyInMemory);
732 TEST(TestMergeCommand); 754 TEST(TestMergeCommand);
733 return 0; 755 return 0;
734} 756}