Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 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.13"/> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 | <title>ArmNN: src/armnn/test/UnitTests.cpp File Reference</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 | $(document).ready(initResizable); |
| 18 | </script> |
| 19 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 20 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 21 | <script type="text/javascript" src="search/search.js"></script> |
| 22 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 26 | <div id="titlearea"> |
| 27 | <table cellspacing="0" cellpadding="0"> |
| 28 | <tbody> |
| 29 | <tr style="height: 56px;"> |
| 30 | <td id="projectalign" style="padding-left: 0.5em;"> |
| 31 | <div id="projectname">ArmNN |
| 32 |  <span id="projectnumber">NotReleased</span> |
| 33 | </div> |
| 34 | </td> |
| 35 | </tr> |
| 36 | </tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | <!-- end header part --> |
| 40 | <!-- Generated by Doxygen 1.8.13 --> |
| 41 | <script type="text/javascript"> |
| 42 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 43 | </script> |
| 44 | <script type="text/javascript" src="menudata.js"></script> |
| 45 | <script type="text/javascript" src="menu.js"></script> |
| 46 | <script type="text/javascript"> |
| 47 | $(function() { |
| 48 | initMenu('',true,false,'search.php','Search'); |
| 49 | $(document).ready(function() { init_search(); }); |
| 50 | }); |
| 51 | </script> |
| 52 | <div id="main-nav"></div> |
| 53 | </div><!-- top --> |
| 54 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | <div id="nav-tree"> |
| 56 | <div id="nav-tree-contents"> |
| 57 | <div id="nav-sync" class="sync"></div> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div id="splitbar" style="-moz-user-select:none;" |
| 61 | class="ui-resizable-handle"> |
| 62 | </div> |
| 63 | </div> |
| 64 | <script type="text/javascript"> |
| 65 | $(document).ready(function(){initNavTree('_unit_tests_8cpp.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#define-members">Macros</a> | |
| 85 | <a href="#func-members">Functions</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">UnitTests.cpp File Reference</div> </div> |
| 88 | </div><!--header--> |
| 89 | <div class="contents"> |
| 90 | <div class="textblock"><code>#include <boost/test/unit_test.hpp></code><br /> |
| 91 | <code>#include "<a class="el" href="_unit_tests_8hpp_source.html">UnitTests.hpp</a>"</code><br /> |
| 92 | <code>#include <<a class="el" href="_logging_8hpp_source.html">armnn/Logging.hpp</a>></code><br /> |
| 93 | <code>#include <boost/algorithm/string.hpp></code><br /> |
| 94 | </div> |
| 95 | <p><a href="_unit_tests_8cpp_source.html">Go to the source code of this file.</a></p> |
| 96 | <table class="memberdecls"> |
| 97 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 98 | Macros</h2></td></tr> |
| 99 | <tr class="memitem:a6b2a3852db8bb19ab6909bac01859985"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_unit_tests_8cpp.html#a6b2a3852db8bb19ab6909bac01859985">BOOST_TEST_MODULE</a>   UnitTests</td></tr> |
| 100 | <tr class="separator:a6b2a3852db8bb19ab6909bac01859985"><td class="memSeparator" colspan="2"> </td></tr> |
| 101 | </table><table class="memberdecls"> |
| 102 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 103 | Functions</h2></td></tr> |
| 104 | <tr class="memitem:a12aa278dd0bf585d562659e2b2e74014"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_unit_tests_8cpp.html#a12aa278dd0bf585d562659e2b2e74014">BOOST_GLOBAL_FIXTURE</a> (ConfigureLoggingFixture)</td></tr> |
| 105 | <tr class="separator:a12aa278dd0bf585d562659e2b2e74014"><td class="memSeparator" colspan="2"> </td></tr> |
| 106 | <tr class="memitem:ad57096af99f473aca7909812a744b619"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_unit_tests_8cpp.html#ad57096af99f473aca7909812a744b619">BOOST_AUTO_TEST_CASE</a> (LoggerTest)</td></tr> |
| 107 | <tr class="separator:ad57096af99f473aca7909812a744b619"><td class="memSeparator" colspan="2"> </td></tr> |
| 108 | </table> |
| 109 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 110 | <a id="a6b2a3852db8bb19ab6909bac01859985"></a> |
| 111 | <h2 class="memtitle"><span class="permalink"><a href="#a6b2a3852db8bb19ab6909bac01859985">◆ </a></span>BOOST_TEST_MODULE</h2> |
| 112 | |
| 113 | <div class="memitem"> |
| 114 | <div class="memproto"> |
| 115 | <table class="memname"> |
| 116 | <tr> |
| 117 | <td class="memname">#define BOOST_TEST_MODULE   UnitTests</td> |
| 118 | </tr> |
| 119 | </table> |
| 120 | </div><div class="memdoc"> |
| 121 | |
| 122 | <p class="definition">Definition at line <a class="el" href="_unit_tests_8cpp_source.html#l00005">5</a> of file <a class="el" href="_unit_tests_8cpp_source.html">UnitTests.cpp</a>.</p> |
| 123 | |
| 124 | </div> |
| 125 | </div> |
| 126 | <h2 class="groupheader">Function Documentation</h2> |
| 127 | <a id="ad57096af99f473aca7909812a744b619"></a> |
| 128 | <h2 class="memtitle"><span class="permalink"><a href="#ad57096af99f473aca7909812a744b619">◆ </a></span>BOOST_AUTO_TEST_CASE()</h2> |
| 129 | |
| 130 | <div class="memitem"> |
| 131 | <div class="memproto"> |
| 132 | <table class="memname"> |
| 133 | <tr> |
| 134 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 135 | <td>(</td> |
| 136 | <td class="paramtype">LoggerTest </td> |
| 137 | <td class="paramname"></td><td>)</td> |
| 138 | <td></td> |
| 139 | </tr> |
| 140 | </table> |
| 141 | </div><div class="memdoc"> |
| 142 | |
| 143 | <p class="definition">Definition at line <a class="el" href="_unit_tests_8cpp_source.html#l00068">68</a> of file <a class="el" href="_unit_tests_8cpp_source.html">UnitTests.cpp</a>.</p> |
| 144 | |
| 145 | <p class="reference">References <a class="el" href="_logging_8hpp_source.html#l00163">ARMNN_LOG</a>, <a class="el" href="_profiler_tests_8cpp.html#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK()</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407aad42f6697b035b7580e4fef93be20b4d">armnn::debug</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acb5e100e5a9a3e7f6d1fd97512215282">armnn::error</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407adf6402fd9ecc60f5a2159fdf45711cd4">armnn::fatal</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::info</a>, <a class="el" href="_logging_8cpp_source.html#l00147">armnn::SetAllLoggingSinks()</a>, <a class="el" href="_logging_8cpp_source.html#l00029">armnn::SetLogFilter()</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407a04a75036e9d520bb983c5ed03b8d0182">armnn::trace</a>, and <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 146 | <div class="fragment"><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>  std::stringstream ss;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">struct </span>StreamRedirector</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  StreamRedirector(std::ostream& stream, std::streambuf* newStreamBuffer)</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  : m_Stream(stream)</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  , m_BackupBuffer(m_Stream.rdbuf(newStreamBuffer))</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  {}</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  ~StreamRedirector() { m_Stream.rdbuf(m_BackupBuffer); }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  std::ostream& m_Stream;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  std::streambuf* m_BackupBuffer;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  };</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  StreamRedirector redirect(std::cout, ss.rdbuf());</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">using namespace </span><a class="code" href="namespacearmnn.html">armnn</a>;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="namespacearmnn.html#ac9aad76a34137b6359a867b282ea7cfb">SetLogFilter</a>(LogSeverity::Trace);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="namespacearmnn.html#a7f8325a4bc02f2f687ba1968b595ec0a">SetAllLoggingSinks</a>(<span class="keyword">true</span>, <span class="keyword">false</span>, <span class="keyword">false</span>);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(trace) << <span class="stringliteral">"My trace message; "</span> << -2;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(debug) << <span class="stringliteral">"My debug message; "</span> << -1;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(info) << <span class="stringliteral">"My info message; "</span> << 0;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(warning) << <span class="stringliteral">"My warning message; "</span> << 1;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(error) << <span class="stringliteral">"My error message; "</span> << 2;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(fatal) << <span class="stringliteral">"My fatal message; "</span> << 3;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <a class="code" href="namespacearmnn.html#ac9aad76a34137b6359a867b282ea7cfb">SetLogFilter</a>(LogSeverity::Fatal);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  }</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> </div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Trace: My trace message; -2"</span>));</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Debug: My debug message; -1"</span>));</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Info: My info message; 0"</span>));</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Warning: My warning message; 1"</span>));</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Error: My error message; 2"</span>));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(boost::contains(ss.str(), <span class="stringliteral">"Fatal: My fatal message; 3"</span>));</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> }</div><div class="ttc" id="_logging_8hpp_html_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.html#l00163">Logging.hpp:163</a></div></div> |
| 147 | <div class="ttc" id="namespacearmnn_html_ac9aad76a34137b6359a867b282ea7cfb"><div class="ttname"><a href="namespacearmnn.html#ac9aad76a34137b6359a867b282ea7cfb">armnn::SetLogFilter</a></div><div class="ttdeci">void SetLogFilter(LogSeverity level)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8cpp_source.html#l00029">Logging.cpp:29</a></div></div> |
| 148 | <div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_html_a0c262ba6f6c189a2d092d127c1b7627b"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.html#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a></div><div class="ttdeci">BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)</div></div> |
| 149 | <div class="ttc" id="namespacearmnn_html"><div class="ttname"><a href="namespacearmnn.html">armnn</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_helper_8hpp_source.html#l00011">BackendHelper.hpp:11</a></div></div> |
| 150 | <div class="ttc" id="namespacearmnn_html_a7f8325a4bc02f2f687ba1968b595ec0a"><div class="ttname"><a href="namespacearmnn.html#a7f8325a4bc02f2f687ba1968b595ec0a">armnn::SetAllLoggingSinks</a></div><div class="ttdeci">void SetAllLoggingSinks(bool standardOut, bool debugOut, bool coloured)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8cpp_source.html#l00147">Logging.cpp:147</a></div></div> |
| 151 | </div><!-- fragment --> |
| 152 | </div> |
| 153 | </div> |
| 154 | <a id="a12aa278dd0bf585d562659e2b2e74014"></a> |
| 155 | <h2 class="memtitle"><span class="permalink"><a href="#a12aa278dd0bf585d562659e2b2e74014">◆ </a></span>BOOST_GLOBAL_FIXTURE()</h2> |
| 156 | |
| 157 | <div class="memitem"> |
| 158 | <div class="memproto"> |
| 159 | <table class="memname"> |
| 160 | <tr> |
| 161 | <td class="memname">BOOST_GLOBAL_FIXTURE </td> |
| 162 | <td>(</td> |
| 163 | <td class="paramtype">ConfigureLoggingFixture </td> |
| 164 | <td class="paramname"></td><td>)</td> |
| 165 | <td></td> |
| 166 | </tr> |
| 167 | </table> |
| 168 | </div><div class="memdoc"> |
| 169 | |
| 170 | <p class="reference">Referenced by <a class="el" href="_runtime_tests_8cpp_source.html#l00037">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 171 | |
| 172 | </div> |
| 173 | </div> |
| 174 | </div><!-- contents --> |
| 175 | </div><!-- doc-content --> |
| 176 | <!-- start footer part --> |
| 177 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 178 | <ul> |
| 179 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_e0a84d05c80a2ef4231141dcbbeac5c8.html">armnn</a></li><li class="navelem"><a class="el" href="dir_9d86fd1fbecbedf5bdb69c7e7235fe5f.html">test</a></li><li class="navelem"><a class="el" href="_unit_tests_8cpp.html">UnitTests.cpp</a></li> |
| 180 | <li class="footer">Generated on Fri Mar 13 2020 16:06:59 for ArmNN by |
| 181 | <a href="http://www.doxygen.org/index.html"> |
| 182 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 183 | </ul> |
| 184 | </div> |
| 185 | </body> |
| 186 | </html> |