Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11817 - in /trunk/libzypp: tests/repo/ tests/repo/yum/data/extensions/repodata/ zypp/
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Thu, 27 Nov 2008 13:45:37 -0000
  • Message-id: <20081127134538.065A5B7C49@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Thu Nov 27 14:45:37 2008
New Revision: 11817

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11817&view=rev
Log:
- fix maybeUnsuported() method returning wrong result
- add testcase for future coverage

Added:
trunk/libzypp/tests/repo/yum/data/extensions/repodata/susedata.xml.gz
Modified:
trunk/libzypp/tests/repo/ExtendedMetadata_test.cc
trunk/libzypp/tests/repo/yum/data/extensions/repodata/filelists.xml.gz
trunk/libzypp/tests/repo/yum/data/extensions/repodata/other.xml.gz
trunk/libzypp/tests/repo/yum/data/extensions/repodata/primary.xml.gz
trunk/libzypp/tests/repo/yum/data/extensions/repodata/repomd.xml
trunk/libzypp/zypp/Package.cc

Modified: trunk/libzypp/tests/repo/ExtendedMetadata_test.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/ExtendedMetadata_test.cc?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
--- trunk/libzypp/tests/repo/ExtendedMetadata_test.cc (original)
+++ trunk/libzypp/tests/repo/ExtendedMetadata_test.cc Thu Nov 27 14:45:37 2008
@@ -10,6 +10,7 @@
#include "zypp/base/Exception.h"
#include "zypp/PathInfo.h"
#include "zypp/TmpPath.h"
+#include "zypp/Package.h"
#include "zypp/RepoManager.h"
#include "zypp/sat/Pool.h"
#include "KeyRingTestReceiver.h"
@@ -91,4 +92,53 @@
BOOST_CHECK( repo.providesUpdatesFor("cpe://o:sle") );
BOOST_CHECK( ! repo.providesUpdatesFor("cpe://o:windows") );

+ // reuse to count solvables
+ count = 0;
+
+ /**
+ * Now check for the extended metadata of the packages
+ */
+ for_( it, repo.solvablesBegin(), repo.solvablesEnd() )
+ {
+ sat::Solvable s = *it;
+ MIL << s << endl;
+ MIL << s.kind() << endl;
+ if ( s.ident() == "wt" )
+ {
+ count++;
+ Package::Ptr p = asKind<Package>(makeResObject(s));
+ BOOST_CHECK(p);
+ BOOST_CHECK(p->maybeUnsupported() );
+ BOOST_CHECK_EQUAL(p->vendorSupport(), VendorSupportUnknown );
+
+ }
+ else if ( s.ident() == "foobar" )
+ {
+ count++;
+ Package::Ptr p = asKind<Package>(makeResObject(s));
+ BOOST_CHECK(p);
+ BOOST_CHECK_EQUAL(p->vendorSupport(), VendorSupportUnsupported );
+ BOOST_CHECK(p->maybeUnsupported() );
+ }
+ else if ( s.ident() == "foofoo" )
+ {
+ count++;
+ Package::Ptr p = asKind<Package>(makeResObject(s));
+ BOOST_CHECK(p);
+ // if it is level 3 support it cant be unsupported
+ BOOST_CHECK_EQUAL(p->vendorSupport(), VendorSupportLevel3 );
+ BOOST_CHECK(! p->maybeUnsupported() );
+
+ }
+ else
+ {
+ BOOST_FAIL(str::form("Repo has package not contemplated in test:
%s", s.ident().c_str()).c_str());
+ }
+
+ }
+
+ // check that we actually found all testeable
+ // resolvables
+ BOOST_CHECK_EQUAL(count, 3);
+
}

Modified: trunk/libzypp/tests/repo/yum/data/extensions/repodata/filelists.xml.gz
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/data/extensions/repodata/filelists.xml.gz?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
Files trunk/libzypp/tests/repo/yum/data/extensions/repodata/filelists.xml.gz
(original) and
trunk/libzypp/tests/repo/yum/data/extensions/repodata/filelists.xml.gz Thu Nov
27 14:45:37 2008 differ

Modified: trunk/libzypp/tests/repo/yum/data/extensions/repodata/other.xml.gz
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/data/extensions/repodata/other.xml.gz?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
Files trunk/libzypp/tests/repo/yum/data/extensions/repodata/other.xml.gz
(original) and
trunk/libzypp/tests/repo/yum/data/extensions/repodata/other.xml.gz Thu Nov 27
14:45:37 2008 differ

Modified: trunk/libzypp/tests/repo/yum/data/extensions/repodata/primary.xml.gz
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/data/extensions/repodata/primary.xml.gz?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
Files trunk/libzypp/tests/repo/yum/data/extensions/repodata/primary.xml.gz
(original) and
trunk/libzypp/tests/repo/yum/data/extensions/repodata/primary.xml.gz Thu Nov 27
14:45:37 2008 differ

Modified: trunk/libzypp/tests/repo/yum/data/extensions/repodata/repomd.xml
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/data/extensions/repodata/repomd.xml?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
--- trunk/libzypp/tests/repo/yum/data/extensions/repodata/repomd.xml (original)
+++ trunk/libzypp/tests/repo/yum/data/extensions/repodata/repomd.xml Thu Nov 27
14:45:37 2008
@@ -2,23 +2,29 @@
<repomd xmlns="http://linux.duke.edu/metadata/repo";>
<data type="other">
<location href="repodata/other.xml.gz"/>
- <checksum type="sha">73917678784071a9e1f66d333a3a265d01469098</checksum>
+ <checksum type="sha">603807e12e7418911fa9f158ef66b9c20f1df567</checksum>
<timestamp>1215823452</timestamp>
<open-checksum
type="sha">34cde52910a161664291bd93e8a9cd24f751af6b</open-checksum>
</data>
<data type="filelists">
<location href="repodata/filelists.xml.gz"/>
- <checksum type="sha">5df72494136a4e4b608ce3119802d6aa8d0f1167</checksum>
+ <checksum type="sha">06660c856facf17822102d09d849d42fad79d28e</checksum>
<timestamp>1215823453</timestamp>
<open-checksum
type="sha">fdabcfd9c056109ab25acf0644823bdec94b6cfd</open-checksum>
</data>
<data type="primary">
<location href="repodata/primary.xml.gz"/>
- <checksum type="sha">52969c92f9c595108376cd37df7d5ada41851f6a</checksum>
+ <checksum type="sha">2eccb910f933ee28fd5f5223e05eab6c5b08db67</checksum>
<timestamp>1215823454</timestamp>
<open-checksum
type="sha">c6bd3c6099de74d97ed045163235be10ffa8a85f</open-checksum>
</data>

+ <data type="susedata">
+ <location href="repodata/susedata.xml.gz"/>
+ <checksum type="sha">359396be40992603aecf6e2832839111e09eb080</checksum>
+ <timestamp>1227279057.0</timestamp>
+ <open-checksum
type="sha">b17c055bef95bca397faffdf028cfa91dd1b24bc</open-checksum>
+ </data>

<data type="suseinfo">
<location href="repodata/suseinfo.xml.gz"/>

Added: trunk/libzypp/tests/repo/yum/data/extensions/repodata/susedata.xml.gz
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/data/extensions/repodata/susedata.xml.gz?rev=11817&view=auto
==============================================================================
Files trunk/libzypp/tests/repo/yum/data/extensions/repodata/susedata.xml.gz
(added) and
trunk/libzypp/tests/repo/yum/data/extensions/repodata/susedata.xml.gz Thu Nov
27 14:45:37 2008 differ

Modified: trunk/libzypp/zypp/Package.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Package.cc?rev=11817&r1=11816&r2=11817&view=diff
==============================================================================
--- trunk/libzypp/zypp/Package.cc (original)
+++ trunk/libzypp/zypp/Package.cc Thu Nov 27 14:45:37 2008
@@ -65,7 +65,11 @@

bool Package::maybeUnsupported() const
{
- return ( vendorSupport() & ( VendorSupportACC | VendorSupportUnsupported
| VendorSupportUnknown ) );
+ if ( ( vendorSupport() == VendorSupportUnknown ) ||
+ ( vendorSupport() == VendorSupportACC ) ||
+ ( vendorSupport() == VendorSupportUnsupported ) )
+ return true;
+ return false;
}

Changelog Package::changelog() const

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages