diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-04-16 17:09:37 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-04-16 18:36:14 +0200 |
commit | f00832cc273e52a47fb88e49849891b771de4e17 (patch) | |
tree | eedd6b1e1c873c7e3e8f614a0ac8ca5c3b7e37b9 /test/libapt/cdromreducesourcelist_test.cc | |
parent | bb93178b8b5c2f8021977dbc34066f0d0fb8b9b9 (diff) |
use Google C++ Testing Framework for libapt tests
My commit 45df0ad2 from 26. Nov 2009 had a little remark:
"The commit also includes a very very simple testapp."
This was never intended to be permanent, but as usually…
The commit adds the needed make magic to compile gtest statically
as it is required and links it against a small runner. All previous
testcase binaries are reimplemented in gtest and combined in this
runner. While most code is a 1:1 translation some had to be rewritten
like compareversion_test.cc, but the coverage remains the same.
Diffstat (limited to 'test/libapt/cdromreducesourcelist_test.cc')
-rw-r--r-- | test/libapt/cdromreducesourcelist_test.cc | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/test/libapt/cdromreducesourcelist_test.cc b/test/libapt/cdromreducesourcelist_test.cc deleted file mode 100644 index 196d0136e..000000000 --- a/test/libapt/cdromreducesourcelist_test.cc +++ /dev/null @@ -1,86 +0,0 @@ -#include <config.h> - -#include <apt-pkg/cdrom.h> - -#include <string> -#include <vector> - -#include "assert.h" - -class Cdrom : public pkgCdrom { -public: - std::vector<std::string> ReduceSourcelist(std::string CD,std::vector<std::string> List) { - pkgCdrom::ReduceSourcelist(CD, List); - return List; - } -}; - -int main() { - Cdrom cd; - std::vector<std::string> List; - std::string CD("/media/cdrom/"); - - std::vector<std::string> R = cd.ReduceSourcelist(CD, List); - equals(R.empty(), true); - - List.push_back(" wheezy main"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 1); - equals(R[0], " wheezy main"); - - List.push_back(" wheezy main"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 1); - equals(R[0], " wheezy main"); - - List.push_back(" wheezy contrib"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 1); - equals(R[0], " wheezy contrib main"); - - List.push_back(" wheezy-update contrib"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 2); - equals(R[0], " wheezy contrib main"); - equals(R[1], " wheezy-update contrib"); - - List.push_back(" wheezy-update contrib"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 2); - equals(R[0], " wheezy contrib main"); - equals(R[1], " wheezy-update contrib"); - - List.push_back(" wheezy-update non-free"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 2); - equals(R[0], " wheezy contrib main"); - equals(R[1], " wheezy-update contrib non-free"); - - List.push_back(" wheezy-update main"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 2); - equals(R[0], " wheezy contrib main"); - equals(R[1], " wheezy-update contrib main non-free"); - - List.push_back(" wheezy non-free"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 2); - equals(R[0], " wheezy contrib main non-free"); - equals(R[1], " wheezy-update contrib main non-free"); - - List.push_back(" sid main"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 3); - equals(R[0], " sid main"); - equals(R[1], " wheezy contrib main non-free"); - equals(R[2], " wheezy-update contrib main non-free"); - - List.push_back(" sid main-reduce"); - R = cd.ReduceSourcelist(CD, List); - equals(R.size(), 3); - equals(R[0], " sid main main-reduce"); - equals(R[1], " wheezy contrib main non-free"); - equals(R[2], " wheezy-update contrib main non-free"); - - return 0; -} |