diff options
Diffstat (limited to 'content/xdocs/OSVC.html')
-rwxr-xr-x | content/xdocs/OSVC.html | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/content/xdocs/OSVC.html b/content/xdocs/OSVC.html deleted file mode 100755 index 11986b7480..0000000000 --- a/content/xdocs/OSVC.html +++ /dev/null @@ -1,137 +0,0 @@ -<html> - <head> - <title>Apache Qpid : OSVC</title> - <link rel="stylesheet" href="styles/site.css" type="text/css" /> - <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> - </head> - - <body> - <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff"> - <tr> - <td valign="top" class="pagebody"> - <div class="pageheader"> - <span class="pagetitle"> - Apache Qpid : OSVC - </span> - </div> - <div class="pagesubheading"> - This page last changed on Apr 11, 2008 by <font color="#0050B2">cctrieloff</font>. - </div> - - <h3><a name="OSVC-ARHEL4Grimoire"></a>A RHEL4 Grimoire</h3> - -<p>by Michael Goulish on this 11th day of April, 2008</p> - -<h2><a name="OSVC-Introduction"></a>Introduction</h2> - -<p>Programmer! Turn back now, if you can, to the daylit world!</p> - -<p>But if you must walk this road - take with you this map! Do not stray into the mires and pits where I have wandered and despaired.</p> - -<p>Herein I will describe what I can of the perils I have encountered in the antique land of RHEL4.</p> - -<h2><a name="OSVC-Iteratorsandthe%22%3E%22operator."></a>Iterators and the "->" operator.</h2> - -<p>I believe this is a compiler problem with the -> operator, in the neighborhood of any kind of iterators.</p> - -<p>Code like this will not compile:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">ConsumerImplMap::iterator i = consumers.find(delivery.getTag()); - -<span class="code-keyword">if</span> (i != consumers.end()) -{ get_pointer(i)->acknowledged(delivery); <span class="code-comment">// <--- Bad! }</span></pre> -</div></div> - -<p>Do this instead:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">ConsumerImplMap::iterator i = consumers.find(delivery.getTag()); - -<span class="code-keyword">if</span> (i != consumers.end()) -{ (*i).second->complete(delivery); <span class="code-comment">// <--- Good! }</span></pre> -</div></div> - -<p>( Thanks, Kim! )</p> - -<h2><a name="OSVC-Don%27tuseBOOSTFIXTURETESTCASE"></a>Don't use BOOST_FIXTURE_TEST_CASE</h2> - -<p>Because it Doesn't Exist.</p> - -<p>All it does is allow you to use a class (or struct) declaration in many test cases without declaring it in every one.</p> - -<p>So what? Big deal! Just declare your structure in each test case, and use the QPID_AUTO_TEST_CASE macro instead!</p> - -<p>If you have this struct:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">struct ClientSessionFixture : <span class="code-keyword">public</span> Foo -{ <span class="code-object">int</span> bar; }</pre> -</div></div> - -<p>Don't do this:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">BOOST_FIXTURE_TEST_CASE(testQueueQuery, ClientSessionFixture) -{ bar = 666; BOOST_CHECK_EQUAL ( bar, 666 ); }</pre> -</div></div> - -<p>Do do this:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">QPID_AUTO_TEST_CASE(testQueueQuery) -{ ClientSessionFixture fix; fix.bar = 666; BOOST_CHECK_EQUAL ( fix.bar, 666 ); }</pre> -</div></div> - -<p>(Thanks, Alan!)</p> - -<h2><a name="OSVC-Don%27tusetheBOOST%5C%7B%7DTEST%7B%7Dmacros%5C%21"></a>Don't use the BOOST_<b><em>TEST</em></b> macros !</h2> - -<p>If you are tempted to use</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">BOOST_AUTO_TEST_SUITE, or - -BOOST_AUTO_TEST_CASE, or - -BOOST_AUTO_TEST_SUITE_END,</pre> -</div></div> -<p>dont!</p> - -<p>Use instead:</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">QPID_AUTO_TEST_SUITE, or - -QPID_AUTO_TEST_CASE, or - -QPID_AUTO_TEST_SUITE_END !</pre> -</div></div> -<p>They turn into Appropriate Things depending on the version of Boost you are using.</p> - -<p>Sometimes the Appropriate Thing is whitespace...</p> - -<p>(Thanks, Alan and Kim !)</p> - -<h2><a name="OSVC-Don%27tuseboost%3A%3Aiostreams."></a>Don't use boost::iostreams.</h2> - -<p>They don't exist.</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">/usr/include/boost/iostreams/: No such file or directory</pre> -</div></div> -<p>Instead, use low-level Unix IO, from the Dawn of Time.</p> -<div class="code"><div class="codeContent"> -<pre class="code-java">open() - -read() - -write()</pre> -</div></div> - - - </td> - </tr> - </table> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr> - <td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td> - </tr> - <tr> - <td align="center"><font color="grey">Document generated by Confluence on Apr 22, 2008 02:47</font></td> - </tr> - </table> - </body> -</html>
\ No newline at end of file |