Micro template library A library for building device drivers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

131 lines
57 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>uTL: test/tests/test_ostream_dev.cpp Source File</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  18. $(document).ready(initResizable);
  19. /* @license-end */</script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/searchdata.js"></script>
  22. <script type="text/javascript" src="search/search.js"></script>
  23. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  24. </head>
  25. <body>
  26. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  27. <div id="titlearea">
  28. <table cellspacing="0" cellpadding="0">
  29. <tbody>
  30. <tr style="height: 56px;">
  31. <td id="projectalign" style="padding-left: 0.5em;">
  32. <div id="projectname">uTL
  33. </div>
  34. <div id="projectbrief">micro Template library</div>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. <!-- end header part -->
  41. <!-- Generated by Doxygen 1.8.14 -->
  42. <script type="text/javascript">
  43. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  44. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  45. /* @license-end */
  46. </script>
  47. <script type="text/javascript" src="menudata.js"></script>
  48. <script type="text/javascript" src="menu.js"></script>
  49. <script type="text/javascript">
  50. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  51. $(function() {
  52. initMenu('',true,false,'search.php','Search');
  53. $(document).ready(function() { init_search(); });
  54. });
  55. /* @license-end */</script>
  56. <div id="main-nav"></div>
  57. </div><!-- top -->
  58. <div id="side-nav" class="ui-resizable side-nav-resizable">
  59. <div id="nav-tree">
  60. <div id="nav-tree-contents">
  61. <div id="nav-sync" class="sync"></div>
  62. </div>
  63. </div>
  64. <div id="splitbar" style="-moz-user-select:none;"
  65. class="ui-resizable-handle">
  66. </div>
  67. </div>
  68. <script type="text/javascript">
  69. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  70. $(document).ready(function(){initNavTree('test__ostream__dev_8cpp_source.html','');});
  71. /* @license-end */
  72. </script>
  73. <div id="doc-content">
  74. <!-- window showing the filter options -->
  75. <div id="MSearchSelectWindow"
  76. onmouseover="return searchBox.OnSearchSelectShow()"
  77. onmouseout="return searchBox.OnSearchSelectHide()"
  78. onkeydown="return searchBox.OnSearchSelectKey(event)">
  79. </div>
  80. <!-- iframe showing the search results (closed by default) -->
  81. <div id="MSearchResultsWindow">
  82. <iframe src="javascript:void(0)" frameborder="0"
  83. name="MSearchResults" id="MSearchResults">
  84. </iframe>
  85. </div>
  86. <div class="header">
  87. <div class="headertitle">
  88. <div class="title">test_ostream_dev.cpp</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <a href="test__ostream__dev_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>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="gtest_8h.html">gtest/gtest.h</a>&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="ostream__dev_8h.html">utl/dev/ostream_dev.h</a>&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html"> 24</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacetest__ostream__dev.html">test_ostream_dev</a> {</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keyword">using namespace </span><a class="code" href="namespaceutl.html">utl</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="comment">// Device base data types</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="comment">// MUST be DefaultConstructible, Copyable</span></div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8"> 29</a></span>&#160; <span class="keyword">using</span> <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a> = uint8_t;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="comment">// Test data</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> SIZE = 10;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6"> 34</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a> <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a> = 42;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0"> 35</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp; <a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a> = <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4"> 36</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp;&amp; <a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a> = 0xAA;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2"> 37</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a> <a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="comment">// ostream device implementer (Mocks)</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html"> 40</a></span>&#160; <span class="keyword">class </span><a class="code" href="classtest__ostream__dev_1_1_ostream__dev__impl.html">Ostream_dev_impl</a> : <span class="keyword">public</span> <a class="code" href="classutl_1_1ostream__dev.html">ostream_dev</a>&lt;Ostream_dev_impl, test_data_t&gt; {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">friend</span> <a class="code" href="classutl_1_1ostream__dev.html">ostream_dev&lt;Ostream_dev_impl, test_data_t&gt;</a>;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">// virtual device</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#ae94524fafad7bf6c6f9dc07a4798648b"> 44</a></span>&#160; <span class="keyword">static</span> constexpr <span class="keywordtype">size_t</span> N =SIZE;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a782792f34ec64257188ef223b969e148"> 45</a></span>&#160; std::array&lt;test_data_t, N&gt; v {}; <span class="comment">// more than one so we can remember N-1 previous values</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#aa37383bb13f3fe02f21fa7d8558158a9"> 46</a></span>&#160; <span class="keywordtype">size_t</span> c {0};</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="comment">// ostream_dev requirements</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a439ae6127956a8b3a049b35ac79fcf2b"> 50</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a439ae6127956a8b3a049b35ac79fcf2b">put_</a> (<span class="keyword">const</span> <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp; data) {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; v[c++] = data;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">if</span> (c &gt;= N)</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; c = 0;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; }</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a7b3e45d7aab2cf5d4ee6fd21074ef86e"> 56</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a7b3e45d7aab2cf5d4ee6fd21074ef86e">put_</a> (<span class="keyword">const</span> <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>* data, <span class="keywordtype">size_t</span> n) {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0 ; i&lt;n &amp;&amp; i&lt;N; ++i) {</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; v[i] = data[i];</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">return</span> n;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a94ea8195e734ad5e6e76a263df86a7ab"> 63</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp; <a class="code" href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a94ea8195e734ad5e6e76a263df86a7ab">getLastV</a> () { <span class="keywordflow">return</span> (c) ? v[c-1] : v[N-1]; }</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; };</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="comment">// virtual ostream device</span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html"> 66</a></span>&#160; <span class="keyword">class </span><a class="code" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html">Ostream_vdev_impl</a> : <span class="keyword">public</span> <a class="code" href="classutl_1_1ostream__dev.html">ostream_dev</a>&lt;virtual_tag, test_data_t&gt; {</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="comment">// virtual device</span></div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#adf0a9e1446383983a99ec5e9a58a5044"> 69</a></span>&#160; <span class="keyword">static</span> constexpr <span class="keywordtype">size_t</span> N =SIZE;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a220aec538ada71f940c19ef3252cd039"> 70</a></span>&#160; std::array&lt;test_data_t, N&gt; v {};</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#ade2a195650dfdaf71e69857a4c983e08"> 71</a></span>&#160; <span class="keywordtype">size_t</span> c {0};</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// ostream_dev requirements</span></div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a2d2f94b579b360be329380ed2a80f82d"> 75</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a2d2f94b579b360be329380ed2a80f82d">put_</a> (<span class="keyword">const</span> <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp; data) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; v[c++] = data;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> (c &gt;= N)</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; c = 0;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; }</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a9251ba3170eebc3d3fa84a3e33b5587b"> 81</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a9251ba3170eebc3d3fa84a3e33b5587b">put_</a> (<span class="keyword">const</span> <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>* data, <span class="keywordtype">size_t</span> n) {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0 ; i&lt;n &amp;&amp; i&lt;N; ++i) {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; v[i] = data[i];</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; }</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">return</span> n;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; }</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a8d4f3a9553026155c33c9fd15ed62634"> 88</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>&amp; <a class="code" href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a8d4f3a9553026155c33c9fd15ed62634">getLastV</a> () { <span class="keywordflow">return</span> (c) ? v[c-1] : v[N-1]; }</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; };</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// fixtures</span></div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_tostream___idev.html"> 92</a></span>&#160; <span class="keyword">class </span><a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a> : <span class="keyword">public</span> <a class="code" href="classtesting_1_1_test.html">::testing::Test</a> {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="comment">// zero initialized device</span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_tostream___idev.html#a5478f97cab31905180f832c595ec4d1c"> 95</a></span>&#160; <a class="code" href="classtest__ostream__dev_1_1_ostream__dev__impl.html">Ostream_dev_impl</a> osIdev {};</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; };</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_tostream___vdev.html"> 97</a></span>&#160; <span class="keyword">class </span><a class="code" href="classtest__ostream__dev_1_1_tostream___vdev.html">Tostream_Vdev</a> : <span class="keyword">public</span> <a class="code" href="classtesting_1_1_test.html">::testing::Test</a> {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// zero initialized devices</span></div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_tostream___vdev.html#aa5607a51d6272b468414826bb7701eb2"> 100</a></span>&#160; std::array&lt;Ostream_vdev_impl, 5&gt; osVdev {};</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classtest__ostream__dev_1_1_tostream___vdev.html#a20502252099af2580e32afc2dd483dd4"> 101</a></span>&#160; <a class="code" href="classutl_1_1ostream__dev.html">ostream_dev&lt;virtual_tag, test_data_t&gt;</a> *basePointer = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; };</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="comment">//ToDo: Must add Concept test for ostream_dev</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="comment">// TEST_F(Tostream_Idev, TestConcept) {</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="comment">// EXPECT_EQ(true, Ostream_dev&lt;osIdev&gt;);</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="comment">// }</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c"> 109</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a>(<a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a>, Construction) {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <a class="code" href="gtest_8h.html#af28c06b2b5e8dee151896f299f6610cf">EXPECT_LT</a>(0UL, <span class="keyword">sizeof</span>(osIdev));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; }</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a933ad1f9cbffc56c355494b2e5a898ed"> 113</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a>, Api) {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1UL, osIdev.put(<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>)); <span class="comment">// single write from var</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, osIdev.getLastV ());</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1UL, osIdev.put(<a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>));<span class="comment">// single write from lvalue ref</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1UL, osIdev.put(<a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>));<span class="comment">// single write from rvalue ref</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1UL, osIdev.put(42));<span class="comment">// single write from rvalue</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, osIdev.getLastV ());</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(7U, osIdev.put(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>, 7)); <span class="comment">// batch write some data</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i =0 ; i&lt;7 ; ++i) {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>[i], osIdev.v[i]);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(0, osIdev.v[7]);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(SIZE, osIdev.put(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>, SIZE)); <span class="comment">// batch write all data</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i =0 ; i&lt;SIZE ; ++i) {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>[i], osIdev.v[i]);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a48320d39ddad3627913184df15a6eeae"> 138</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a>, streamOperator) {</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keyword">struct </span>Blop {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a> x, y, z;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; };</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; osIdev &lt;&lt; <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>; <span class="comment">// single write from var</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, osIdev.getLastV ());</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; osIdev &lt;&lt; <a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>;<span class="comment">// single write from lvalue ref</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; osIdev &lt;&lt; <a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>;<span class="comment">// single write from rvalue ref</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; osIdev &lt;&lt; (<a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a>)42; <span class="comment">// single write from rvalue</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, osIdev.getLastV ());</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="comment">// stream a blop of data (should use put(T*, N) version)</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; Blop blop {1, 1, 42};</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; osIdev &lt;&lt; blop;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1U, osIdev.v[0]);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1U, osIdev.v[1]);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, osIdev.v[2]);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keyword">const</span> Blop cblop {2, 2, 42};</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; osIdev &lt;&lt; cblop;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(2U, osIdev.v[0]);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(2U, osIdev.v[1]);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, osIdev.v[2]);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; }</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a15b2cd537bd2f755805c043397a90369"> 169</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a>, Iterator1) {</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="comment">// default constructible</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="classutl_1_1ostreamdev__it.html">Ostream_dev_impl::iterator</a> def_it;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (0, *(int32_t*)&amp;def_it); <span class="comment">// not dereferencable</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">// output iterator requirements</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="comment">// https://en.cppreference.com/w/cpp/named_req/OutputIterator</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keyword">auto</span> it = osIdev.begin();</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keyword">auto</span> it2(it);</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (*(int32_t*)&amp;it, *(int32_t*)&amp;it2);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; it2 = it;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (*(int32_t*)&amp;it, *(int32_t*)&amp;it2);</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; def_it = it;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (*(int32_t*)&amp;it, *(int32_t*)&amp;def_it);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; ++it, it++;</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; *it = <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, osIdev.getLastV ());</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; *it = <a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; *it = <a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">IdataRR</a>, osIdev.getLastV ());</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; *it++ = <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, osIdev.getLastV ());</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; }</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a0f24de95548df2cfaee079bb7569b43d"> 198</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___idev.html">Tostream_Idev</a>, Iterator2) {</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keyword">auto</span> it = osIdev.begin();</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; std::fill_n(it, SIZE, <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0 ;i&lt;SIZE ; ++i) {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, osIdev.v[i]);</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; }</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; }</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a5b0629176b2db8d5e78c26337bab73fd"> 207</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___vdev.html">Tostream_Vdev</a>, virtualApi) {</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="comment">// loop to virtual devices and use them via base pointer</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; dev : osVdev) {</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; basePointer = &amp;dev;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; basePointer-&gt;put(<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, dev.v[0]);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(SIZE, basePointer-&gt;put(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>, SIZE)); <span class="comment">// batch write all data</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i =0 ; i&lt;SIZE ; ++i) {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">Ibuffer</a>[i], dev.v[i]);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; }</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; }</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#a362bd1b25e349211c067276cbed35fbc"> 221</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___vdev.html">Tostream_Vdev</a>, virtualStream) {</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keyword">struct </span>Blop {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_data_t</a> x, y, z;</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; };</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; Blop blop {1, 1, 42};</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keyword">const</span> Blop cblop {2, 2, 42};</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="comment">// loop to virtual devices and use them via base pointer</span></div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; dev : osVdev) {</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; basePointer = &amp;dev;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; *basePointer &lt;&lt; <a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>;</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(<a class="code" href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">IdataR</a>, dev.v[0]);</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; *basePointer &lt;&lt; blop;</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1U, dev.v[0]);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(1U, dev.v[1]);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, dev.v[2]);</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; *basePointer &lt;&lt; cblop;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(2U, dev.v[0]);</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(2U, dev.v[1]);</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a>(42U, dev.v[2]);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; }</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; }</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="namespacetest__ostream__dev.html#ac73a944cfce63878b27a9bc5843d1047"> 246</a></span>&#160; <a class="code" href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">TEST_F</a> (<a class="code" href="classtest__ostream__dev_1_1_tostream___vdev.html">Tostream_Vdev</a>, virtualIterator) {</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="comment">// loop to virtual devices and use them via base pointer</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; dev : osVdev) {</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; basePointer = &amp;dev;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keyword">auto</span> it = *basePointer-&gt;begin();</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; std::fill_n(it, SIZE, <a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>);</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0 ;i&lt;SIZE ; ++i) {</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <a class="code" href="gtest_8h.html#a4159019abda84f5366acdb7604ff220a">EXPECT_EQ</a> (<a class="code" href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">Idata</a>, dev.v[i]);</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; }</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; }</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;}</div><div class="ttc" id="classtest__ostream__dev_1_1_tostream___idev_html"><div class="ttname"><a href="classtest__ostream__dev_1_1_tostream___idev.html">test_ostream_dev::Tostream_Idev</a></div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00092">test_ostream_dev.cpp:92</a></div></div>
  92. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__vdev__impl_html_a9251ba3170eebc3d3fa84a3e33b5587b"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a9251ba3170eebc3d3fa84a3e33b5587b">test_ostream_dev::Ostream_vdev_impl::put_</a></div><div class="ttdeci">size_t put_(const test_data_t *data, size_t n)</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00081">test_ostream_dev.cpp:81</a></div></div>
  93. <div class="ttc" id="namespacetest__ostream__dev_html"><div class="ttname"><a href="namespacetest__ostream__dev.html">test_ostream_dev</a></div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00024">test_ostream_dev.cpp:24</a></div></div>
  94. <div class="ttc" id="namespacetest__ostream__dev_html_ab0ee4bd586c47ce5f9dcc0fe60dd27a2"><div class="ttname"><a href="namespacetest__ostream__dev.html#ab0ee4bd586c47ce5f9dcc0fe60dd27a2">test_ostream_dev::Ibuffer</a></div><div class="ttdeci">test_data_t Ibuffer[]</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00037">test_ostream_dev.cpp:37</a></div></div>
  95. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__vdev__impl_html_a8d4f3a9553026155c33c9fd15ed62634"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a8d4f3a9553026155c33c9fd15ed62634">test_ostream_dev::Ostream_vdev_impl::getLastV</a></div><div class="ttdeci">test_data_t &amp; getLastV()</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00088">test_ostream_dev.cpp:88</a></div></div>
  96. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__vdev__impl_html_a2d2f94b579b360be329380ed2a80f82d"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__vdev__impl.html#a2d2f94b579b360be329380ed2a80f82d">test_ostream_dev::Ostream_vdev_impl::put_</a></div><div class="ttdeci">size_t put_(const test_data_t &amp;data)</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00075">test_ostream_dev.cpp:75</a></div></div>
  97. <div class="ttc" id="gtest_8h_html"><div class="ttname"><a href="gtest_8h.html">gtest.h</a></div></div>
  98. <div class="ttc" id="namespacetest__ostream__dev_html_ad7ded62f12c3abfcaddae39a905793b4"><div class="ttname"><a href="namespacetest__ostream__dev.html#ad7ded62f12c3abfcaddae39a905793b4">test_ostream_dev::IdataRR</a></div><div class="ttdeci">test_data_t &amp;&amp; IdataRR</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00036">test_ostream_dev.cpp:36</a></div></div>
  99. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__dev__impl_html_a439ae6127956a8b3a049b35ac79fcf2b"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a439ae6127956a8b3a049b35ac79fcf2b">test_ostream_dev::Ostream_dev_impl::put_</a></div><div class="ttdeci">size_t put_(const test_data_t &amp;data)</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00050">test_ostream_dev.cpp:50</a></div></div>
  100. <div class="ttc" id="gtest_8h_html_af28c06b2b5e8dee151896f299f6610cf"><div class="ttname"><a href="gtest_8h.html#af28c06b2b5e8dee151896f299f6610cf">EXPECT_LT</a></div><div class="ttdeci">#define EXPECT_LT(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="gtest_8h_source.html#l16651">gtest.h:16651</a></div></div>
  101. <div class="ttc" id="classutl_1_1ostream__dev_html"><div class="ttname"><a href="classutl_1_1ostream__dev.html">utl::ostream_dev</a></div><div class="ttdoc">Abstract base classes for output stream devices. </div><div class="ttdef"><b>Definition:</b> <a href="ostream__dev_8h_source.html#l00052">ostream_dev.h:52</a></div></div>
  102. <div class="ttc" id="namespacetest__ostream__dev_html_a63ac45c38a80885dda445ddee2a1e0c8"><div class="ttname"><a href="namespacetest__ostream__dev.html#a63ac45c38a80885dda445ddee2a1e0c8">test_ostream_dev::test_data_t</a></div><div class="ttdeci">uint8_t test_data_t</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00029">test_ostream_dev.cpp:29</a></div></div>
  103. <div class="ttc" id="namespaceutl_html"><div class="ttname"><a href="namespaceutl.html">utl</a></div><div class="ttdoc">STL&amp;#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>
  104. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__vdev__impl_html"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__vdev__impl.html">test_ostream_dev::Ostream_vdev_impl</a></div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00066">test_ostream_dev.cpp:66</a></div></div>
  105. <div class="ttc" id="namespacetest__ostream__dev_html_a7e9209298f1eec33fb72637fd17720d6"><div class="ttname"><a href="namespacetest__ostream__dev.html#a7e9209298f1eec33fb72637fd17720d6">test_ostream_dev::Idata</a></div><div class="ttdeci">test_data_t Idata</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00034">test_ostream_dev.cpp:34</a></div></div>
  106. <div class="ttc" id="namespacetest__ostream__dev_html_a7d0ba57fc928d165451e031ab6935d1c"><div class="ttname"><a href="namespacetest__ostream__dev.html#a7d0ba57fc928d165451e031ab6935d1c">test_ostream_dev::TEST_F</a></div><div class="ttdeci">TEST_F(Tostream_Idev, Construction)</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00109">test_ostream_dev.cpp:109</a></div></div>
  107. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__dev__impl_html_a7b3e45d7aab2cf5d4ee6fd21074ef86e"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a7b3e45d7aab2cf5d4ee6fd21074ef86e">test_ostream_dev::Ostream_dev_impl::put_</a></div><div class="ttdeci">size_t put_(const test_data_t *data, size_t n)</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00056">test_ostream_dev.cpp:56</a></div></div>
  108. <div class="ttc" id="classtest__ostream__dev_1_1_tostream___vdev_html"><div class="ttname"><a href="classtest__ostream__dev_1_1_tostream___vdev.html">test_ostream_dev::Tostream_Vdev</a></div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00097">test_ostream_dev.cpp:97</a></div></div>
  109. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__dev__impl_html_a94ea8195e734ad5e6e76a263df86a7ab"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__dev__impl.html#a94ea8195e734ad5e6e76a263df86a7ab">test_ostream_dev::Ostream_dev_impl::getLastV</a></div><div class="ttdeci">test_data_t &amp; getLastV()</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00063">test_ostream_dev.cpp:63</a></div></div>
  110. <div class="ttc" id="classutl_1_1ostreamdev__it_html"><div class="ttname"><a href="classutl_1_1ostreamdev__it.html">utl::ostreamdev_it</a></div><div class="ttdef"><b>Definition:</b> <a href="dev__iterators_8h_source.html#l00069">dev_iterators.h:69</a></div></div>
  111. <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>
  112. <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>
  113. <div class="ttc" id="classtest__ostream__dev_1_1_ostream__dev__impl_html"><div class="ttname"><a href="classtest__ostream__dev_1_1_ostream__dev__impl.html">test_ostream_dev::Ostream_dev_impl</a></div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00040">test_ostream_dev.cpp:40</a></div></div>
  114. <div class="ttc" id="ostream__dev_8h_html"><div class="ttname"><a href="ostream__dev_8h.html">ostream_dev.h</a></div><div class="ttdoc">Abstract base class interface for output devices of utl. </div></div>
  115. <div class="ttc" id="namespacetest__ostream__dev_html_a1a5e65c79718b3bbc72501c02e090ac0"><div class="ttname"><a href="namespacetest__ostream__dev.html#a1a5e65c79718b3bbc72501c02e090ac0">test_ostream_dev::IdataR</a></div><div class="ttdeci">test_data_t &amp; IdataR</div><div class="ttdef"><b>Definition:</b> <a href="test__ostream__dev_8cpp_source.html#l00035">test_ostream_dev.cpp:35</a></div></div>
  116. </div><!-- fragment --></div><!-- contents -->
  117. </div><!-- doc-content -->
  118. <!-- start footer part -->
  119. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  120. <ul>
  121. <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__ostream__dev_8cpp.html">test_ostream_dev.cpp</a></li>
  122. <li class="footer">Generated by
  123. <a href="http://www.doxygen.org/index.html">
  124. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  125. </ul>
  126. </div>
  127. </body>
  128. </html>