|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.14"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>uTL: test/tests/test_1w_impl.cpp Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(initResizable);
- /* @license-end */</script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">uTL
- </div>
- <div id="projectbrief">micro Template library</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.14 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @license-end */
- </script>
- <script type="text/javascript" src="menudata.js"></script>
- <script type="text/javascript" src="menu.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(function() {
- initMenu('',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- /* @license-end */</script>
- <div id="main-nav"></div>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('test__1w__impl_8cpp_source.html','');});
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
-
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
-
- <div class="header">
- <div class="headertitle">
- <div class="title">test_1w_impl.cpp</div> </div>
- </div><!--header-->
- <div class="contents">
- <a href="test__1w__impl_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <<a class="code" href="gtest_8h.html">gtest/gtest.h</a>></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <<a class="code" href="__1wire__uart_8h.html">utl/com/_1wire_uart.h</a>></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="namespacetest__1w.html"> 29</a></span> <span class="keyword">namespace </span><a class="code" href="namespacetest__1w.html">test_1w</a> {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keyword">using namespace </span><a class="code" href="namespaceutl.html">utl</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="comment">// implementer class stub</span></div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classtest__1w_1_1_o_w.html"> 33</a></span>  <span class="keyword">class </span><a class="code" href="classtest__1w_1_1_o_w.html">OW</a> : <span class="keyword">public</span> <a class="code" href="classutl_1_1__1wire__uart__i.html">_1wire_uart_i</a><OW> {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">friend</span> <a class="code" href="classutl_1_1__1wire__uart__i.html">_1wire_uart_i<OW></a>;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <a class="code" href="namespaceutl.html#a1427cb5a2b13313147a902173b91e3c1">byte_t</a> UART_RW (<a class="code" href="namespaceutl.html#a1427cb5a2b13313147a902173b91e3c1">byte_t</a> byte) {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="comment">// return the given. This also mean no-device</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="keywordflow">return</span> byte;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  }</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordtype">void</span> UART_BR (uint32_t br) {} <span class="comment">// imaginary baud-rate implementation</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  };</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="comment">// fixture</span></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classtest__1w_1_1_test__1w__impl.html"> 43</a></span>  <span class="keyword">class </span><a class="code" href="classtest__1w_1_1_test__1w__impl.html">Test_1w_impl</a> : <span class="keyword">public</span> <a class="code" href="classtesting_1_1_test.html">::testing::Test</a> {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">//void SetUp() override { }</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="comment">//void TearDown() override { }</span></div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classtest__1w_1_1_test__1w__impl.html#aa0eda9594f798f3ebed80f179741293a"> 47</a></span>  <a class="code" href="classtest__1w_1_1_o_w.html">OW</a> <a class="code" href="classtest__1w_1_1_test__1w__impl.html#aa0eda9594f798f3ebed80f179741293a">ow</a>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  };</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespacetest__1w.html#a91bee95e2ca23e750b4a33479aea8029"> 50</a></span>  <a class="code" href="namespacetest__1w.html#a91bee95e2ca23e750b4a33479aea8029">TEST_F</a>(<a class="code" href="classtest__1w_1_1_test__1w__impl.html">Test_1w_impl</a>, TestConcept) {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// EXPECT_EQ(_1Wire_i<OW>, true);</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  }</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="namespacetest__1w.html#a2e7d40e0befd264af7e7b6794b447555"> 54</a></span>  <a class="code" href="namespacetest__1w.html#a91bee95e2ca23e750b4a33479aea8029">TEST_F</a>(<a class="code" href="classtest__1w_1_1_test__1w__impl.html">Test_1w_impl</a>, TestConstruction) {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="code" href="gtest_8h.html#aa8bc8320813e1abb0016129b636e3b27">EXPECT_GT</a>(<span class="keyword">sizeof</span>(ow), 0UL);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="namespacetest__1w.html#ab5d5a9f17f851deeb0058589c4bdbdfc"> 58</a></span>  <a class="code" href="namespacetest__1w.html#a91bee95e2ca23e750b4a33479aea8029">TEST_F</a> (<a class="code" href="classtest__1w_1_1_test__1w__impl.html">Test_1w_impl</a>, TestFunctionality) {</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <a class="code" href="namespaceutl.html#a1427cb5a2b13313147a902173b91e3c1">byte_t</a> b {42};</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a> <span class="keywordtype">id</span> = ow.first(OW::Speed::STD);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<span class="keywordtype">id</span> != <a class="code" href="classutl_1_1__1wire__id__t.html#adad08aa5ce38e1a87800de57a91db81b">_1wire_id_t::nullDev</a>(), <span class="keyword">false</span>); <span class="comment">// as long as there is no slave Mock</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (ow.reset(OW::Speed::STD), <span class="keyword">false</span>); <span class="comment">// as long as there is no slave Mock</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="comment">//ow.match(id, OW::Speed::STD);</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(ow.rx_data(OW::Speed::STD), 0xFF);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(ow.tx_data(b, OW::Speed::STD), 42);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div><div class="ttc" id="namespacetest__1w_html_a91bee95e2ca23e750b4a33479aea8029"><div class="ttname"><a href="namespacetest__1w.html#a91bee95e2ca23e750b4a33479aea8029">test_1w::TEST_F</a></div><div class="ttdeci">TEST_F(Test_1w_impl, TestConcept)</div><div class="ttdef"><b>Definition:</b> <a href="test__1w__impl_8cpp_source.html#l00050">test_1w_impl.cpp:50</a></div></div>
- <div class="ttc" id="classtest__1w_1_1_o_w_html"><div class="ttname"><a href="classtest__1w_1_1_o_w.html">test_1w::OW</a></div><div class="ttdef"><b>Definition:</b> <a href="test__1w__impl_8cpp_source.html#l00033">test_1w_impl.cpp:33</a></div></div>
- <div class="ttc" id="classtest__1w_1_1_test__1w__impl_html"><div class="ttname"><a href="classtest__1w_1_1_test__1w__impl.html">test_1w::Test_1w_impl</a></div><div class="ttdef"><b>Definition:</b> <a href="test__1w__impl_8cpp_source.html#l00043">test_1w_impl.cpp:43</a></div></div>
- <div class="ttc" id="gtest_8h_html"><div class="ttname"><a href="gtest_8h.html">gtest.h</a></div></div>
- <div class="ttc" id="classutl_1_1__1wire__id__t_html"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html">utl::_1wire_id_t</a></div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00032">_1wire_id.h:32</a></div></div>
- <div class="ttc" id="gtest_8h_html_aa8bc8320813e1abb0016129b636e3b27"><div class="ttname"><a href="gtest_8h.html#aa8bc8320813e1abb0016129b636e3b27">EXPECT_GT</a></div><div class="ttdeci">#define EXPECT_GT(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="gtest_8h_source.html#l16655">gtest.h:16655</a></div></div>
- <div class="ttc" id="namespaceutl_html"><div class="ttname"><a href="namespaceutl.html">utl</a></div><div class="ttdoc">STL&#39;s core language concepts. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire_8h_source.html#l00030">_1wire.h:30</a></div></div>
- <div class="ttc" id="classutl_1_1__1wire__id__t_html_adad08aa5ce38e1a87800de57a91db81b"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#adad08aa5ce38e1a87800de57a91db81b">utl::_1wire_id_t::nullDev</a></div><div class="ttdeci">static constexpr const _1wire_id_t & nullDev()</div><div class="ttdoc">Return nullDev reference. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00050">_1wire_id.h:50</a></div></div>
- <div class="ttc" id="classtesting_1_1_test_html"><div class="ttname"><a href="classtesting_1_1_test.html">testing::Test</a></div><div class="ttdef"><b>Definition:</b> <a href="gtest_8h_source.html#l15014">gtest.h:15014</a></div></div>
- <div class="ttc" id="classtest__1w_1_1_test__1w__impl_html_aa0eda9594f798f3ebed80f179741293a"><div class="ttname"><a href="classtest__1w_1_1_test__1w__impl.html#aa0eda9594f798f3ebed80f179741293a">test_1w::Test_1w_impl::ow</a></div><div class="ttdeci">OW ow</div><div class="ttdef"><b>Definition:</b> <a href="test__1w__impl_8cpp_source.html#l00047">test_1w_impl.cpp:47</a></div></div>
- <div class="ttc" id="gtest_8h_html_a4159019abda84f5366acdb7604ff220a"><div class="ttname"><a href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a></div><div class="ttdeci">#define EXPECT_EQ(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="gtest_8h_source.html#l16643">gtest.h:16643</a></div></div>
- <div class="ttc" id="namespaceutl_html_a1427cb5a2b13313147a902173b91e3c1"><div class="ttname"><a href="namespaceutl.html#a1427cb5a2b13313147a902173b91e3c1">utl::byte_t</a></div><div class="ttdeci">uint8_t byte_t</div><div class="ttdoc">8 bits wide </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.html#l00031">types.h:31</a></div></div>
- <div class="ttc" id="classutl_1_1__1wire__uart__i_html"><div class="ttname"><a href="classutl_1_1__1wire__uart__i.html">utl::_1wire_uart_i</a></div><div class="ttdoc">1-wire UART interface template class using CRTP Using the private virtual interface we provide the in...</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__uart_8h_source.html#l00052">_1wire_uart.h:52</a></div></div>
- <div class="ttc" id="__1wire__uart_8h_html"><div class="ttname"><a href="__1wire__uart_8h.html">_1wire_uart.h</a></div><div class="ttdoc">A 1-wire implementation using a microprocessor&#39;s uart for bit timing. </div></div>
- <div class="ttc" id="namespacetest__1w_html"><div class="ttname"><a href="namespacetest__1w.html">test_1w</a></div><div class="ttdef"><b>Definition:</b> <a href="test__1w__impl_8cpp_source.html#l00029">test_1w_impl.cpp:29</a></div></div>
- </div><!-- fragment --></div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="dir_13e138d54eb8818da29c3992edef070a.html">test</a></li><li class="navelem"><a class="el" href="dir_d84abbe486a7f5f39e3c9088ffc1760a.html">tests</a></li><li class="navelem"><a class="el" href="test__1w__impl_8cpp.html">test_1w_impl.cpp</a></li>
- <li class="footer">Generated by
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
- </ul>
- </div>
- </body>
- </html>
|