add test for what provides, still disabled
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 14 Mar 2008 17:25:25 +0000 (17:25 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 14 Mar 2008 17:25:25 +0000 (17:25 +0000)
tests/CMakeLists.txt
tests/sat/CMakeLists.txt [new file with mode: 0644]
tests/sat/WhatProvides_test.cc [new file with mode: 0644]

index 46d8f6e..d445686 100644 (file)
@@ -6,3 +6,4 @@ ADD_DEFINITIONS( -DTESTS_SRC_DIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" -DTESTS_BUI
 ADD_SUBDIRECTORY( zypp )
 ADD_SUBDIRECTORY( parser )
 ADD_SUBDIRECTORY( repo )
+#ADD_SUBDIRECTORY( sat )
diff --git a/tests/sat/CMakeLists.txt b/tests/sat/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9b995e2
--- /dev/null
@@ -0,0 +1,6 @@
+
+ADD_TESTS(WhatProvides)
+
+
+
+
diff --git a/tests/sat/WhatProvides_test.cc b/tests/sat/WhatProvides_test.cc
new file mode 100644 (file)
index 0000000..2df74ad
--- /dev/null
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <iostream>
+#include <boost/test/auto_unit_test.hpp>
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/Easy.h"
+#include "zypp/ZYppFactory.h"
+#include "zypp/sat/WhatProvides.h"
+
+#define BOOST_TEST_MODULE WhatProvides
+
+using std::cout;
+using std::endl;
+using std::string;
+using namespace zypp;
+using namespace boost::unit_test;
+
+BOOST_AUTO_TEST_CASE(pool_query)
+{
+  Pathname dir(TESTS_SRC_DIR);
+  dir += "/zypp/data/PoolQuery";
+
+  ZYpp::Ptr z = getZYpp();
+
+  sat::Pool::instance().addRepoSolv(dir + "foo.solv");
+
+  Capability cap("amarok < 1.13");
+  sat::WhatProvides q( cap );
+  if ( ! q.empty() )
+  {
+    MIL << "Found " << q.size() << " matches for " << cap << ":" << endl;
+    for_( it, q.begin(), q.end() )
+    MIL << *it << endl;
+  }
+}