You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
adept/adept/tests/libcapture/celem-test.cpp

35 lines
1019 B

#include <test-util.h>
#include <libcapture/celem.h>
#include <libcapture/pkgmanager.h>
#include <string>
namespace tut {
using namespace std;
using namespace capture;
struct celem_shar {
};
typedef test_group<celem_shar> tg;
typedef tg::object to;
tg celem_tg ("celem");
template<> template<>
void to::test<1> ()
{
cacheInit ();
PkgCElemPtr a = cElem (PkgManager::cache () -> FindPkg ("postfix"));
ensure (a -> id () == string ("postfix"));
cerr << "a -> id () = " << a -> id () << endl;
ensure (a -> Name () == string ("postfix"));
cerr << "a -> Name () = " << a -> id () << endl;
VerCElemPtr b = a -> VersionList ();
cerr << "b -> id () = " << b -> id () << endl;
pkgCache::PkgIterator bp = (PkgManager::cache () -> FindPkg
("postfix"));
string bver = bp . VersionList () . VerStr ();
ensure (bver == b -> id ());
ensure (bver == b -> VerStr ());
}
};