summaryrefslogtreecommitdiff
path: root/rep/ept/apt/packagerecord.test.h.gcov.html
blob: c2c270925d381fa682833381ef77fcf19a813f26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!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/apt/packagerecord.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&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">ept/apt</a> - packagerecord.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&nbsp;lines:</td>
          <td class="headerValue" width="20%">52</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">88.5 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">46</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>                : /*
<span class="lineNum">       2 </span>                :  * Copyright (C) 2007  Enrico Zini &lt;enrico@enricozini.org&gt;
<span class="lineNum">       3 </span>                :  *
<span class="lineNum">       4 </span>                :  * This library is free software; you can redistribute it and/or
<span class="lineNum">       5 </span>                :  * modify it under the terms of the GNU Lesser General Public
<span class="lineNum">       6 </span>                :  * License as published by the Free Software Foundation; either
<span class="lineNum">       7 </span>                :  * version 2.1 of the License, or (at your option) any later version.
<span class="lineNum">       8 </span>                :  *
<span class="lineNum">       9 </span>                :  * This library is distributed in the hope that it will be useful,
<span class="lineNum">      10 </span>                :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      11 </span>                :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
<span class="lineNum">      12 </span>                :  * Lesser General Public License for more details.
<span class="lineNum">      13 </span>                :  *
<span class="lineNum">      14 </span>                :  * You should have received a copy of the GNU Lesser General Public
<span class="lineNum">      15 </span>                :  * License along with this library; if not, write to the Free Software
<span class="lineNum">      16 </span>                :  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
<span class="lineNum">      17 </span>                :  */
<span class="lineNum">      18 </span>                : 
<span class="lineNum">      19 </span>                : #include &lt;ept/test.h&gt;
<span class="lineNum">      20 </span>                : #include &lt;ept/apt/packagerecord.h&gt;
<span class="lineNum">      21 </span>                : 
<span class="lineNum">      22 </span>                : namespace std {
<span class="lineNum">      23 </span><span class="lineNoCov">              0 :     ostream&amp; operator&lt;&lt;(ostream&amp; out, const set&lt;string&gt;&amp; s)</span>
<span class="lineNum">      24 </span>                :         {
<span class="lineNum">      25 </span><span class="lineNoCov">              0 :             for (set&lt;string&gt;::const_iterator i = s.begin();</span>
<span class="lineNum">      26 </span>                :                  i != s.end(); ++i)
<span class="lineNum">      27 </span><span class="lineNoCov">              0 :                 if (i == s.begin())</span>
<span class="lineNum">      28 </span><span class="lineNoCov">              0 :                     out &lt;&lt; *i;</span>
<span class="lineNum">      29 </span>                :                 else
<span class="lineNum">      30 </span><span class="lineNoCov">              0 :                     out &lt;&lt; &quot;, &quot; &lt;&lt; *i;</span>
<span class="lineNum">      31 </span><span class="lineNoCov">              0 :             return out;</span>
<span class="lineNum">      32 </span>                :         }
<span class="lineNum">      33 </span>                : }
<span class="lineNum">      34 </span>                : 
<span class="lineNum">      35 </span>                : using namespace std;
<span class="lineNum">      36 </span>                : using namespace ept;
<span class="lineNum">      37 </span>                : using namespace ept::apt;
<span class="lineNum">      38 </span>                : 
<span class="lineNum">      39 </span>                : struct TestAptPackagerecord {
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                :     // Check that the supported fields are understood
<span class="lineNum">      42 </span><span class="lineCov">              1 :     Test supportedFields()</span>
<span class="lineNum">      43 </span>                :     {
<span class="lineNum">      44 </span>                :         string record =
<span class="lineNum">      45 </span>                :             &quot;Package: apt\n&quot;
<span class="lineNum">      46 </span>                :             &quot;Priority: important\n&quot;
<span class="lineNum">      47 </span>                :             &quot;Section: admin\n&quot;
<span class="lineNum">      48 </span>                :             &quot;Installed-Size: 4368\n&quot;
<span class="lineNum">      49 </span>                :             &quot;Maintainer: APT Development Team &lt;deity@lists.debian.org&gt;\n&quot;
<span class="lineNum">      50 </span>                :             &quot;Architecture: amd64\n&quot;
<span class="lineNum">      51 </span>                :             &quot;Source: apt\n&quot;
<span class="lineNum">      52 </span>                :             &quot;Version: 0.6.46.4-0.1\n&quot;
<span class="lineNum">      53 </span>                :             &quot;Replaces: libapt-pkg-doc (&lt;&lt; 0.3.7), libapt-pkg-dev (&lt;&lt; 0.3.7)\n&quot;
<span class="lineNum">      54 </span>                :             &quot;Provides: libapt-pkg-libc6.3-6-3.11\n&quot;
<span class="lineNum">      55 </span>                :             &quot;Depends: libc6 (&gt;= 2.3.5-1), libgcc1 (&gt;= 1:4.1.1-12), libstdc++6 (&gt;= 4.1.1-12), debian-archive-keyring\n&quot;
<span class="lineNum">      56 </span>                :             &quot;Pre-Depends: debtags (maybe)\n&quot;
<span class="lineNum">      57 </span>                :             &quot;Suggests: aptitude | synaptic | gnome-apt | wajig, dpkg-dev, apt-doc, bzip2\n&quot;
<span class="lineNum">      58 </span>                :             &quot;Recommends: debtags (maybe)\n&quot;
<span class="lineNum">      59 </span>                :             &quot;Enhances: debian\n&quot;
<span class="lineNum">      60 </span>                :             &quot;Conflicts: marameo\n&quot;
<span class="lineNum">      61 </span>                :             &quot;Filename: pool/main/a/apt/apt_0.6.46.4-0.1_amd64.deb\n&quot;
<span class="lineNum">      62 </span>                :             &quot;Size: 1436478\n&quot;
<span class="lineNum">      63 </span>                :             &quot;MD5sum: 1776421f80d6300c77a608e77a9f4a15\n&quot;
<span class="lineNum">      64 </span>                :             &quot;SHA1: 1bd7337d2df56d267632cf72ac930c0a4895898f\n&quot;
<span class="lineNum">      65 </span>                :             &quot;SHA256: b92442ab60046b4d0728245f39cc932f26e17db9f7933a5ec9aaa63172f51fda\n&quot;
<span class="lineNum">      66 </span>                :             &quot;Description: Advanced front-end for dpkg\n&quot;
<span class="lineNum">      67 </span>                :             &quot; This is Debian's next generation front-end for the dpkg package manager.\n&quot;
<span class="lineNum">      68 </span>                :             &quot; It provides the apt-get utility and APT dselect method that provides a\n&quot;
<span class="lineNum">      69 </span>                :             &quot; simpler, safer way to install and upgrade packages.\n&quot;
<span class="lineNum">      70 </span>                :             &quot; .\n&quot;
<span class="lineNum">      71 </span>                :             &quot; APT features complete installation ordering, multiple source capability\n&quot;
<span class="lineNum">      72 </span>                :             &quot; and several other unique features, see the Users Guide in apt-doc.\n&quot;
<span class="lineNum">      73 </span>                :             &quot;Build-Essential: yes\n&quot;
<span class="lineNum">      74 </span><span class="lineCov">              1 :             &quot;Tag: admin::package-management, filetransfer::ftp, filetransfer::http, hardware::storage:cd, interface::commandline, network::client, protocol::{ftp,http,ipv6}, role::program, suite::debian, use::downloading, use::searching, works-with::software:package\n&quot;;</span>
<span class="lineNum">      75 </span>                : 
<span class="lineNum">      76 </span><span class="lineCov">              1 :         PackageRecord p(record);</span>
<span class="lineNum">      77 </span>                : 
<span class="lineNum">      78 </span><span class="lineCov">              1 :         assert_eq(p.size(), 24u);</span>
<span class="lineNum">      79 </span>                : 
<span class="lineNum">      80 </span><span class="lineCov">              2 :         assert_eq(p.package(), &quot;apt&quot;);</span>
<span class="lineNum">      81 </span><span class="lineCov">              1 :         assert_eq(p.priority(), &quot;important&quot;);</span>
<span class="lineNum">      82 </span><span class="lineCov">              1 :         assert_eq(p.section(), &quot;admin&quot;);</span>
<span class="lineNum">      83 </span><span class="lineCov">              1 :         assert_eq(p.installedSize(), 4368u);</span>
<span class="lineNum">      84 </span><span class="lineCov">              2 :         assert_eq(p.maintainer(), &quot;APT Development Team &lt;deity@lists.debian.org&gt;&quot;);</span>
<span class="lineNum">      85 </span><span class="lineCov">              1 :         assert_eq(p.architecture(), &quot;amd64&quot;);</span>
<span class="lineNum">      86 </span><span class="lineCov">              1 :         assert_eq(p.source(), &quot;apt&quot;);</span>
<span class="lineNum">      87 </span><span class="lineCov">              1 :         assert_eq(p.version(), &quot;0.6.46.4-0.1&quot;);</span>
<span class="lineNum">      88 </span><span class="lineCov">              1 :         assert_eq(p.replaces(), &quot;libapt-pkg-doc (&lt;&lt; 0.3.7), libapt-pkg-dev (&lt;&lt; 0.3.7)&quot;);</span>
<span class="lineNum">      89 </span><span class="lineCov">              1 :         assert_eq(p.provides(), &quot;libapt-pkg-libc6.3-6-3.11&quot;);</span>
<span class="lineNum">      90 </span><span class="lineCov">              1 :         assert_eq(p.depends(), &quot;libc6 (&gt;= 2.3.5-1), libgcc1 (&gt;= 1:4.1.1-12), libstdc++6 (&gt;= 4.1.1-12), debian-archive-keyring&quot;);</span>
<span class="lineNum">      91 </span><span class="lineCov">              1 :         assert_eq(p.preDepends(), &quot;debtags (maybe)&quot;);</span>
<span class="lineNum">      92 </span><span class="lineCov">              1 :         assert_eq(p.recommends(), &quot;debtags (maybe)&quot;);</span>
<span class="lineNum">      93 </span><span class="lineCov">              1 :         assert_eq(p.suggests(), &quot;aptitude | synaptic | gnome-apt | wajig, dpkg-dev, apt-doc, bzip2&quot;);</span>
<span class="lineNum">      94 </span><span class="lineCov">              1 :         assert_eq(p.enhances(), &quot;debian&quot;);</span>
<span class="lineNum">      95 </span><span class="lineCov">              1 :         assert_eq(p.conflicts(), &quot;marameo&quot;);</span>
<span class="lineNum">      96 </span><span class="lineCov">              1 :         assert_eq(p.filename(), &quot;pool/main/a/apt/apt_0.6.46.4-0.1_amd64.deb&quot;);</span>
<span class="lineNum">      97 </span><span class="lineCov">              1 :         assert_eq(p.packageSize(), 1436478u);</span>
<span class="lineNum">      98 </span><span class="lineCov">              2 :         assert_eq(p.md5sum(), &quot;1776421f80d6300c77a608e77a9f4a15&quot;);</span>
<span class="lineNum">      99 </span><span class="lineCov">              1 :         assert_eq(p.sha1(), &quot;1bd7337d2df56d267632cf72ac930c0a4895898f&quot;);</span>
<span class="lineNum">     100 </span><span class="lineCov">              1 :         assert_eq(p.sha256(), &quot;b92442ab60046b4d0728245f39cc932f26e17db9f7933a5ec9aaa63172f51fda&quot;);</span>
<span class="lineNum">     101 </span>                :         assert_eq(p.description(), &quot;Advanced front-end for dpkg\n&quot;
<span class="lineNum">     102 </span>                :                       &quot; This is Debian's next generation front-end for the dpkg package manager.\n&quot;
<span class="lineNum">     103 </span>                :                       &quot; It provides the apt-get utility and APT dselect method that provides a\n&quot;
<span class="lineNum">     104 </span>                :                       &quot; simpler, safer way to install and upgrade packages.\n&quot;
<span class="lineNum">     105 </span>                :                       &quot; .\n&quot;
<span class="lineNum">     106 </span>                :                       &quot; APT features complete installation ordering, multiple source capability\n&quot;
<span class="lineNum">     107 </span><span class="lineCov">              1 :                       &quot; and several other unique features, see the Users Guide in apt-doc.&quot;);</span>
<span class="lineNum">     108 </span><span class="lineCov">              1 :         assert_eq(p.shortDescription(), &quot;Advanced front-end for dpkg&quot;);</span>
<span class="lineNum">     109 </span>                :         assert_eq(p.longDescription(),
<span class="lineNum">     110 </span>                :                       &quot;This is Debian's next generation front-end for the dpkg package manager.\n&quot;
<span class="lineNum">     111 </span>                :                       &quot; It provides the apt-get utility and APT dselect method that provides a\n&quot;
<span class="lineNum">     112 </span>                :                       &quot; simpler, safer way to install and upgrade packages.\n&quot;
<span class="lineNum">     113 </span>                :                       &quot; .\n&quot;
<span class="lineNum">     114 </span>                :                       &quot; APT features complete installation ordering, multiple source capability\n&quot;
<span class="lineNum">     115 </span><span class="lineCov">              1 :                       &quot; and several other unique features, see the Users Guide in apt-doc.&quot;);</span>
<span class="lineNum">     116 </span><span class="lineCov">              1 :         assert_eq(p.buildEssential(), true);</span>
<span class="lineNum">     117 </span>                :         
<span class="lineNum">     118 </span><span class="lineCov">              1 :         std::set&lt;std::string&gt; tags;</span>
<span class="lineNum">     119 </span><span class="lineCov">              1 :         tags.insert(&quot;admin::package-management&quot;);</span>
<span class="lineNum">     120 </span><span class="lineCov">              2 :         tags.insert(&quot;filetransfer::ftp&quot;);</span>
<span class="lineNum">     121 </span><span class="lineCov">              2 :         tags.insert(&quot;filetransfer::http&quot;);</span>
<span class="lineNum">     122 </span><span class="lineCov">              2 :         tags.insert(&quot;hardware::storage:cd&quot;);</span>
<span class="lineNum">     123 </span><span class="lineCov">              2 :         tags.insert(&quot;interface::commandline&quot;);</span>
<span class="lineNum">     124 </span><span class="lineCov">              2 :         tags.insert(&quot;network::client&quot;);</span>
<span class="lineNum">     125 </span><span class="lineCov">              2 :         tags.insert(&quot;protocol::ftp&quot;);</span>
<span class="lineNum">     126 </span><span class="lineCov">              2 :         tags.insert(&quot;protocol::http&quot;);</span>
<span class="lineNum">     127 </span><span class="lineCov">              2 :         tags.insert(&quot;protocol::ipv6&quot;);</span>
<span class="lineNum">     128 </span><span class="lineCov">              2 :         tags.insert(&quot;role::program&quot;);</span>
<span class="lineNum">     129 </span><span class="lineCov">              2 :         tags.insert(&quot;suite::debian&quot;);</span>
<span class="lineNum">     130 </span><span class="lineCov">              2 :         tags.insert(&quot;use::downloading&quot;);</span>
<span class="lineNum">     131 </span><span class="lineCov">              2 :         tags.insert(&quot;use::searching&quot;);</span>
<span class="lineNum">     132 </span><span class="lineCov">              2 :         tags.insert(&quot;works-with::software:package&quot;);</span>
<span class="lineNum">     133 </span><span class="lineCov">              2 :         assert_eq(p.tag(), tags);</span>
<span class="lineNum">     134 </span><span class="lineCov">              1 :     }</span>
<span class="lineNum">     135 </span>                : 
<span class="lineNum">     136 </span>                : };
<span class="lineNum">     137 </span>                : 
<span class="lineNum">     138 </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>