summaryrefslogtreecommitdiff
path: root/src/documentation/content/xdocs/OSVC.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/documentation/content/xdocs/OSVC.html')
-rwxr-xr-xsrc/documentation/content/xdocs/OSVC.html137
1 files changed, 137 insertions, 0 deletions
diff --git a/src/documentation/content/xdocs/OSVC.html b/src/documentation/content/xdocs/OSVC.html
new file mode 100755
index 0000000000..11986b7480
--- /dev/null
+++ b/src/documentation/content/xdocs/OSVC.html
@@ -0,0 +1,137 @@
+<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&#33; Turn back now, if you can, to the daylit world&#33;</p>
+
+<p>But if you must walk this road - take with you this map&#33; 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 "-&gt;" operator.</h2>
+
+<p>I believe this is a compiler problem with the &#45;&gt; 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)-&gt;acknowledged(delivery); <span class="code-comment">// &lt;--- 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-&gt;complete(delivery); <span class="code-comment">// &lt;--- Good! }</span></pre>
+</div></div>
+
+<p>( Thanks, Kim&#33; )</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&#33; Just declare your structure in each test case, and use the QPID_AUTO_TEST_CASE macro instead&#33;</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&#33;)</p>
+
+<h2><a name="OSVC-Don%27tusetheBOOST%5C%7B%7DTEST%7B%7Dmacros%5C%21"></a>Don't use the BOOST&#95;<b><em>TEST</em></b> macros &#33;</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&#33;</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 &#33;)</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