diff options
Diffstat (limited to 'rep/ept/popcon/popcon.test.h.gcov.html')
-rw-r--r-- | rep/ept/popcon/popcon.test.h.gcov.html | 175 |
1 files changed, 0 insertions, 175 deletions
diff --git a/rep/ept/popcon/popcon.test.h.gcov.html b/rep/ept/popcon/popcon.test.h.gcov.html deleted file mode 100644 index 65387fc..0000000 --- a/rep/ept/popcon/popcon.test.h.gcov.html +++ /dev/null @@ -1,175 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> - -<html lang="en"> - -<head> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> - <title>LCOV - lcov.info - ept/popcon/popcon.test.h</title> - <link rel="stylesheet" type="text/css" href="../../gcov.css"> -</head> - -<body> - - <table width="100%" border=0 cellspacing=0 cellpadding=0> - <tr><td class="title">LTP GCOV extension - code coverage report</td></tr> - <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr> - - <tr> - <td width="100%"> - <table cellpadding=1 border=0 width="100%"> - <tr> - <td class="headerItem" width="20%">Current view:</td> - <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">ept/popcon</a> - popcon.test.h</td> - </tr> - <tr> - <td class="headerItem" width="20%">Test:</td> - <td class="headerValue" width="80%" colspan=4>lcov.info</td> - </tr> - <tr> - <td class="headerItem" width="20%">Date:</td> - <td class="headerValue" width="20%">2008-08-14</td> - <td width="20%"></td> - <td class="headerItem" width="20%">Instrumented lines:</td> - <td class="headerValue" width="20%">38</td> - </tr> - <tr> - <td class="headerItem" width="20%">Code covered:</td> - <td class="headerValue" width="20%">100.0 %</td> - <td width="20%"></td> - <td class="headerItem" width="20%">Executed lines:</td> - <td class="headerValue" width="20%">38</td> - </tr> - </table> - </td> - </tr> - <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr> - </table> - - <table cellpadding=0 cellspacing=0 border=0> - <tr> - <td><br></td> - </tr> - <tr> - <td><pre class="source"> -<span class="lineNum"> 1 </span> : // -*- mode: c++; tab-width: 4; indent-tabs-mode: t -*- -<span class="lineNum"> 2 </span> : /* -<span class="lineNum"> 3 </span> : * popcon test -<span class="lineNum"> 4 </span> : * -<span class="lineNum"> 5 </span> : * Copyright (C) 2007 Enrico Zini <enrico@debian.org> -<span class="lineNum"> 6 </span> : * -<span class="lineNum"> 7 </span> : * This program is free software; you can redistribute it and/or modify -<span class="lineNum"> 8 </span> : * it under the terms of the GNU General Public License as published by -<span class="lineNum"> 9 </span> : * the Free Software Foundation; either version 2 of the License, or -<span class="lineNum"> 10 </span> : * (at your option) any later version. -<span class="lineNum"> 11 </span> : * -<span class="lineNum"> 12 </span> : * This program is distributed in the hope that it will be useful, -<span class="lineNum"> 13 </span> : * but WITHOUT ANY WARRANTY; without even the implied warranty of -<span class="lineNum"> 14 </span> : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -<span class="lineNum"> 15 </span> : * GNU General Public License for more details. -<span class="lineNum"> 16 </span> : * -<span class="lineNum"> 17 </span> : * You should have received a copy of the GNU General Public License -<span class="lineNum"> 18 </span> : * along with this program; if not, write to the Free Software -<span class="lineNum"> 19 </span> : * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -<span class="lineNum"> 20 </span> : */ -<span class="lineNum"> 21 </span> : -<span class="lineNum"> 22 </span> : #include <ept/popcon/popcon.h> -<span class="lineNum"> 23 </span> : #include <ept/popcon/maint/path.h> -<span class="lineNum"> 24 </span> : #include <ept/apt/apt.h> -<span class="lineNum"> 25 </span> : #include <set> -<span class="lineNum"> 26 </span> : -<span class="lineNum"> 27 </span> : #include <ept/test.h> -<span class="lineNum"> 28 </span> : -<span class="lineNum"> 29 </span> : using namespace std; -<span class="lineNum"> 30 </span> : using namespace ept; -<span class="lineNum"> 31 </span> : using namespace ept::popcon; -<span class="lineNum"> 32 </span> : using namespace ept::apt; -<span class="lineNum"> 33 </span> : -<span class="lineNum"> 34 </span> : struct TestPopcon -<span class="lineNum"> 35 </span><span class="lineCov"> 5 : {</span> -<span class="lineNum"> 36 </span> : popcon::Path::OverridePopconSourceDir odsd; -<span class="lineNum"> 37 </span> : popcon::Path::OverridePopconIndexDir odid; -<span class="lineNum"> 38 </span> : popcon::Path::OverridePopconUserSourceDir odusd; -<span class="lineNum"> 39 </span> : popcon::Path::OverridePopconUserIndexDir oduid; -<span class="lineNum"> 40 </span> : -<span class="lineNum"> 41 </span> : Apt apt; -<span class="lineNum"> 42 </span> : Popcon popcon; -<span class="lineNum"> 43 </span> : -<span class="lineNum"> 44 </span><span class="lineCov"> 5 : TestPopcon()</span> -<span class="lineNum"> 45 </span> : : odsd( TEST_ENV_DIR "popcon" ), -<span class="lineNum"> 46 </span> : odid( TEST_ENV_DIR "popcon" ), -<span class="lineNum"> 47 </span> : odusd( TEST_ENV_DIR "popcon" ), -<span class="lineNum"> 48 </span><span class="lineCov"> 5 : oduid( TEST_ENV_DIR "popcon" )</span> -<span class="lineNum"> 49 </span><span class="lineCov"> 5 : {}</span> -<span class="lineNum"> 50 </span> : -<span class="lineNum"> 51 </span><span class="lineCov"> 1 : Test basicAccess()</span> -<span class="lineNum"> 52 </span> : { -<span class="lineNum"> 53 </span><span class="lineCov"> 1 : assert_eq(popcon.submissions(), 52024);</span> -<span class="lineNum"> 54 </span><span class="lineCov"> 2 : assert(popcon.size() > 0);</span> -<span class="lineNum"> 55 </span><span class="lineCov"> 2 : assert(popcon.score(0) > 0);</span> -<span class="lineNum"> 56 </span><span class="lineCov"> 2 : assert(!popcon.name(0).empty());</span> -<span class="lineNum"> 57 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 58 </span> : -<span class="lineNum"> 59 </span> : // Check that every valid index is accessible -<span class="lineNum"> 60 </span><span class="lineCov"> 1 : Test accessibility()</span> -<span class="lineNum"> 61 </span> : { -<span class="lineNum"> 62 </span><span class="lineCov"> 139822 : for (size_t i = 0; i < popcon.size(); ++i)</span> -<span class="lineNum"> 63 </span> : { -<span class="lineNum"> 64 </span> : //cerr << popcon.name(i) << " " << popcon.score(i) << endl; -<span class="lineNum"> 65 </span><span class="lineCov"> 69910 : assert(popcon.score(i) > 0);</span> -<span class="lineNum"> 66 </span> : } -<span class="lineNum"> 67 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 68 </span> : -<span class="lineNum"> 69 </span> : // Check that we can get a score for every package -<span class="lineNum"> 70 </span><span class="lineCov"> 1 : Test haveScores()</span> -<span class="lineNum"> 71 </span> : { -<span class="lineNum"> 72 </span><span class="lineCov"> 1 : int has = 0;</span> -<span class="lineNum"> 73 </span><span class="lineCov"> 1789 : for (Apt::iterator i = apt.begin(); i != apt.end(); ++i)</span> -<span class="lineNum"> 74 </span> : { -<span class="lineNum"> 75 </span><span class="lineCov"> 1788 : float score = popcon.score(*i);</span> -<span class="lineNum"> 76 </span><span class="lineCov"> 1788 : if (score > 0)</span> -<span class="lineNum"> 77 </span><span class="lineCov"> 1758 : ++has;</span> -<span class="lineNum"> 78 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 79 </span> : // At least 1000 packages should have a score -<span class="lineNum"> 80 </span><span class="lineCov"> 2 : assert(has > 1000);</span> -<span class="lineNum"> 81 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 82 </span> : -<span class="lineNum"> 83 </span> : // Check that scores are meaningful -<span class="lineNum"> 84 </span><span class="lineCov"> 1 : Test validScores()</span> -<span class="lineNum"> 85 </span> : { -<span class="lineNum"> 86 </span><span class="lineCov"> 1 : assert(popcon["apt"] > popcon["libapt-pkg-dev"]);</span> -<span class="lineNum"> 87 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 88 </span> : -<span class="lineNum"> 89 </span> : // If there is no data, Popcon should work as if all scores were 0 -<span class="lineNum"> 90 </span><span class="lineCov"> 1 : Test fallbackValues()</span> -<span class="lineNum"> 91 </span> : { -<span class="lineNum"> 92 </span><span class="lineCov"> 1 : popcon::Path::OverridePopconSourceDir odsd("./empty");</span> -<span class="lineNum"> 93 </span><span class="lineCov"> 2 : popcon::Path::OverridePopconIndexDir odid("./empty");</span> -<span class="lineNum"> 94 </span><span class="lineCov"> 2 : popcon::Path::OverridePopconUserSourceDir odusd("./empty");</span> -<span class="lineNum"> 95 </span><span class="lineCov"> 2 : popcon::Path::OverridePopconUserIndexDir oduid("./empty");</span> -<span class="lineNum"> 96 </span><span class="lineCov"> 1 : Popcon empty;</span> -<span class="lineNum"> 97 </span> : -<span class="lineNum"> 98 </span><span class="lineCov"> 1 : assert_eq(empty.timestamp(), 0);</span> -<span class="lineNum"> 99 </span><span class="lineCov"> 2 : assert(!empty.hasData());</span> -<span class="lineNum"> 100 </span> : -<span class="lineNum"> 101 </span><span class="lineCov"> 2 : assert_eq(empty.submissions(), 0);</span> -<span class="lineNum"> 102 </span><span class="lineCov"> 2 : assert(empty.size() == 0);</span> -<span class="lineNum"> 103 </span><span class="lineCov"> 2 : assert(empty.score("apt") == 0.0);</span> -<span class="lineNum"> 104 </span><span class="lineCov"> 1 : }</span> -<span class="lineNum"> 105 </span> : -<span class="lineNum"> 106 </span> : }; -<span class="lineNum"> 107 </span> : -<span class="lineNum"> 108 </span> : // vim:set ts=4 sw=4: -</pre> - </td> - </tr> - </table> - <br> - - <table width="100%" border=0 cellspacing=0 cellpadding=0> - <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr> - <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr> - </table> - <br> - -</body> -</html> |