From: Jiri Srain Date: Thu, 1 Dec 2005 13:27:46 +0000 (+0000) Subject: added testcase for patches parser X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~3620 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=162b402e21e9a4bea6ecb3a9be0be8f77c7611e4;p=platform%2Fupstream%2Flibzypp.git added testcase for patches parser more complete repomd.xml --- diff --git a/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml b/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml index 3f34400..99fb851 100644 --- a/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml +++ b/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml @@ -1,19 +1,37 @@ - + e7ba668ab0d49486f0a3e7a0b168406a88a46ed9 1119534896 394bb178eb19423f1c9f255acfd50719809cabba - + 603594e2dd7d875a876babaf1b39f3aede460ef1 1119534896 047041a0149308416aa1b62eb5e11a191ca6c2e9 - + + 20f45621426fcd74364d6fabe6929d1164797801 + 1119534896 + e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a + + + + 20f45621426fcd74364d6fabe6929d1164797801 + 1119534896 + e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a + + + + 20f45621426fcd74364d6fabe6929d1164797801 + 1119534896 + e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a + + + 20f45621426fcd74364d6fabe6929d1164797801 1119534896 e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a diff --git a/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml.ref b/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml.ref index e4e1bd6..3357d23 100644 --- a/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml.ref +++ b/devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml.ref @@ -1,6 +1,6 @@ Repomd Data: type: 'other' - location: 'repodata/other.xml.gz' + location: 'repodata/other.xml' checksumType: 'sha' checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9' timestamp: '1119534896' @@ -8,7 +8,7 @@ Repomd Data: openChecksum: '394bb178eb19423f1c9f255acfd50719809cabba' Repomd Data: type: 'filelists' - location: 'repodata/filelists.xml.gz' + location: 'repodata/filelists.xml' checksumType: 'sha' checksum: '603594e2dd7d875a876babaf1b39f3aede460ef1' timestamp: '1119534896' @@ -16,7 +16,31 @@ Repomd Data: openChecksum: '047041a0149308416aa1b62eb5e11a191ca6c2e9' Repomd Data: type: 'primary' - location: 'repodata/primary.xml.gz' + location: 'repodata/primary.xml' + checksumType: 'sha' + checksum: '20f45621426fcd74364d6fabe6929d1164797801' + timestamp: '1119534896' + openChecksumType: 'sha' + openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a' +Repomd Data: + type: 'product' + location: 'repodata/product.xml' + checksumType: 'sha' + checksum: '20f45621426fcd74364d6fabe6929d1164797801' + timestamp: '1119534896' + openChecksumType: 'sha' + openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a' +Repomd Data: + type: 'group' + location: 'repodata/group.xml' + checksumType: 'sha' + checksum: '20f45621426fcd74364d6fabe6929d1164797801' + timestamp: '1119534896' + openChecksumType: 'sha' + openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a' +Repomd Data: + type: 'patches' + location: 'repodata/patches.xml' checksumType: 'sha' checksum: '20f45621426fcd74364d6fabe6929d1164797801' timestamp: '1119534896' diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml new file mode 100644 index 0000000..e148913 --- /dev/null +++ b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml @@ -0,0 +1,11 @@ + + + + e7ba668ab0d49486f0a3e7a0b168406a88a46ed9 + + + + e7ba668ab0d49486f0a3e7a0b168406a88a46ed9 + + + diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.err.ref b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.err.ref new file mode 100644 index 0000000..e69de29 diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref new file mode 100644 index 0000000..c6ddd4e --- /dev/null +++ b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref @@ -0,0 +1,13 @@ +------------------------------------------------- +Patches Entry Data: + patch ID: 12345 + location: repodata/patch.xml + checksumType: 'sha' + checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9' +------------------------------------------------- +Patches Entry Data: + patch ID: 54321 + location: repodata/patch2.xml + checksumType: 'md5' + checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9' +Exit Code: 0 diff --git a/devel/devel.jsrain/yum/YUMtest.cc b/devel/devel.jsrain/yum/YUMtest.cc index a5f58ad..8e78361 100644 --- a/devel/devel.jsrain/yum/YUMtest.cc +++ b/devel/devel.jsrain/yum/YUMtest.cc @@ -30,7 +30,7 @@ namespace { void usage() { cerr << "YUMtest usage: "<< endl << "YUMtest TYPE" << endl - << "TYPE: repomd|primary|group|filelist|other|patch|product" << endl; + << "TYPE: repomd|primary|group|filelist|other|patch|patches|product" << endl; } } @@ -105,6 +105,16 @@ int main(int argc, char **argv) if (iter.errorStatus()) throw *iter.errorStatus(); } + else if (!strcmp(argv[1],"patches")) { + YUMPatchesParser iter(cin,""); + for (; + !iter.atEnd(); + ++iter) { + cout << **iter; + } + if (iter.errorStatus()) + throw *iter.errorStatus(); + } else if (!strcmp(argv[1],"product")) { YUMProductParser iter(cin,""); for (;