From f00832cc273e52a47fb88e49849891b771de4e17 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 16 Apr 2014 17:09:37 +0200 Subject: use Google C++ Testing Framework for libapt tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- test/libapt/cdromreducesourcelist_test.cc | 86 ------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 test/libapt/cdromreducesourcelist_test.cc (limited to 'test/libapt/cdromreducesourcelist_test.cc') 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 - -#include - -#include -#include - -#include "assert.h" - -class Cdrom : public pkgCdrom { -public: - std::vector ReduceSourcelist(std::string CD,std::vector List) { - pkgCdrom::ReduceSourcelist(CD, List); - return List; - } -}; - -int main() { - Cdrom cd; - std::vector List; - std::string CD("/media/cdrom/"); - - std::vector 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; -} -- cgit v1.2.3