diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-09-23 22:38:16 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-09-23 22:38:16 -0700 |
commit | 37d53a70958bfe5b1d7946229af9c12f0b865abc (patch) | |
tree | af209b4fed1411344ad5aa6ead0e168c718b54b5 /html/subx/003trace.cc.html | |
parent | 76cb753a49974f6bb5a836a52445adf97de4a7cc (diff) | |
download | mu-37d53a70958bfe5b1d7946229af9c12f0b865abc.tar.gz |
4512
Diffstat (limited to 'html/subx/003trace.cc.html')
-rw-r--r-- | html/subx/003trace.cc.html | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/html/subx/003trace.cc.html b/html/subx/003trace.cc.html index 6abc7086..9e3c7c6c 100644 --- a/html/subx/003trace.cc.html +++ b/html/subx/003trace.cc.html @@ -129,10 +129,10 @@ if ('onhashchange' in window) { <span id="L70" class="LineNr"> 70 </span><span class="Delimiter">:(before "End Types")</span> <span id="L71" class="LineNr"> 71 </span><span class="Normal">struct</span> trace_line <span class="Delimiter">{</span> <span id="L72" class="LineNr"> 72 </span> <span class="Normal">int</span> <a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">;</span> <span class="Comment">// optional field just to help browse traces later</span> -<span id="L73" class="LineNr"> 73 </span> string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">;</span> +<span id="L73" class="LineNr"> 73 </span> string label<span class="Delimiter">;</span> <span id="L74" class="LineNr"> 74 </span> string <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">;</span> -<span id="L75" class="LineNr"> 75 </span> trace_line<span class="Delimiter">(</span>string l<span class="Delimiter">,</span> string c<span class="Delimiter">)</span> :<a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">),</span> <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">(</span>l<span class="Delimiter">),</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">(</span>c<span class="Delimiter">)</span> <span class="Delimiter">{}</span> -<span id="L76" class="LineNr"> 76 </span> trace_line<span class="Delimiter">(</span><span class="Normal">int</span> d<span class="Delimiter">,</span> string l<span class="Delimiter">,</span> string c<span class="Delimiter">)</span> :<a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">(</span>d<span class="Delimiter">),</span> <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">(</span>l<span class="Delimiter">),</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">(</span>c<span class="Delimiter">)</span> <span class="Delimiter">{}</span> +<span id="L75" class="LineNr"> 75 </span> trace_line<span class="Delimiter">(</span>string l<span class="Delimiter">,</span> string c<span class="Delimiter">)</span> :<a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">),</span> label<span class="Delimiter">(</span>l<span class="Delimiter">),</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">(</span>c<span class="Delimiter">)</span> <span class="Delimiter">{}</span> +<span id="L76" class="LineNr"> 76 </span> trace_line<span class="Delimiter">(</span><span class="Normal">int</span> d<span class="Delimiter">,</span> string l<span class="Delimiter">,</span> string c<span class="Delimiter">)</span> :<a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">(</span>d<span class="Delimiter">),</span> label<span class="Delimiter">(</span>l<span class="Delimiter">),</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">(</span>c<span class="Delimiter">)</span> <span class="Delimiter">{}</span> <span id="L77" class="LineNr"> 77 </span><span class="Delimiter">};</span> <span id="L78" class="LineNr"> 78 </span> <span id="L79" class="LineNr"> 79 </span><span class="Comment">//: Support for tracing an entire run.</span> @@ -176,14 +176,14 @@ if ('onhashchange' in window) { <span id="L117" class="LineNr">117 </span> trace_stream<span class="Delimiter">()</span> :<a href='003trace.cc.html#L112'>curr_stream</a><span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> <a href='003trace.cc.html#L114'>curr_depth</a><span class="Delimiter">(</span><a href='003trace.cc.html#L105'>Max_depth</a><span class="Delimiter">),</span> <a href='003trace.cc.html#L115'>collect_depth</a><span class="Delimiter">(</span><a href='003trace.cc.html#L105'>Max_depth</a><span class="Delimiter">)</span> <span class="Delimiter">{}</span> <span id="L118" class="LineNr">118 </span> <a href='003trace.cc.html#L118'>~trace_stream</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L112'>curr_stream</a><span class="Delimiter">)</span> <span class="Normal">delete</span> <a href='003trace.cc.html#L112'>curr_stream</a><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span id="L119" class="LineNr">119 </span> -<span id="L120" class="LineNr">120 </span> ostream& stream<span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L121" class="LineNr">121 </span> <span class="Identifier">return</span> stream<span class="Delimiter">(</span><a href='003trace.cc.html#L105'>Max_depth</a><span class="Delimiter">,</span> <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">);</span> +<span id="L120" class="LineNr">120 </span> ostream& stream<span class="Delimiter">(</span>string label<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L121" class="LineNr">121 </span> <span class="Identifier">return</span> stream<span class="Delimiter">(</span><a href='003trace.cc.html#L105'>Max_depth</a><span class="Delimiter">,</span> label<span class="Delimiter">);</span> <span id="L122" class="LineNr">122 </span> <span class="Delimiter">}</span> <span id="L123" class="LineNr">123 </span> -<span id="L124" class="LineNr">124 </span> ostream& stream<span class="Delimiter">(</span><span class="Normal">int</span> <a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">,</span> string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L124" class="LineNr">124 </span> ostream& stream<span class="Delimiter">(</span><span class="Normal">int</span> <a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">,</span> string label<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L125" class="LineNr">125 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L72'>depth</a> > <a href='003trace.cc.html#L115'>collect_depth</a><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Constant"> null</span>_stream<span class="Delimiter">;</span> <span id="L126" class="LineNr">126 </span> <a href='003trace.cc.html#L112'>curr_stream</a> = <span class="Normal">new</span> ostringstream<span class="Delimiter">;</span> -<span id="L127" class="LineNr">127 </span> <a href='003trace.cc.html#L113'>curr_label</a> = <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">;</span> +<span id="L127" class="LineNr">127 </span> <a href='003trace.cc.html#L113'>curr_label</a> = label<span class="Delimiter">;</span> <span id="L128" class="LineNr">128 </span> <a href='003trace.cc.html#L114'>curr_depth</a> = <a href='003trace.cc.html#L72'>depth</a><span class="Delimiter">;</span> <span id="L129" class="LineNr">129 </span> <span class="Delimiter">(</span>*curr_stream<span class="Delimiter">)</span> << std::hex<span class="Delimiter">;</span> <span id="L130" class="LineNr">130 </span> <span class="Identifier">return</span> *curr_stream<span class="Delimiter">;</span> @@ -199,7 +199,7 @@ if ('onhashchange' in window) { <span id="L140" class="LineNr">140 </span> <span class="Comment">// be sure to call this before messing with curr_stream or curr_label</span> <span id="L141" class="LineNr">141 </span> <span class="Normal">void</span> <a href='003trace.cc.html#L147'>newline</a><span class="Delimiter">();</span> <span id="L142" class="LineNr">142 </span> <span class="Comment">// useful for debugging</span> -<span id="L143" class="LineNr">143 </span> string <a href='003trace.cc.html#L164'>readable_contents</a><span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">);</span> <span class="Comment">// empty label = show everything</span> +<span id="L143" class="LineNr">143 </span> string <a href='003trace.cc.html#L164'>readable_contents</a><span class="Delimiter">(</span>string label<span class="Delimiter">);</span> <span class="Comment">// empty label = show everything</span> <span id="L144" class="LineNr">144 </span><span class="Delimiter">};</span> <span id="L145" class="LineNr">145 </span> <span id="L146" class="LineNr">146 </span><span class="Delimiter">:(code)</span> @@ -220,12 +220,12 @@ if ('onhashchange' in window) { <span id="L161" class="LineNr">161 </span> <a href='003trace.cc.html#L114'>curr_depth</a> = <a href='003trace.cc.html#L105'>Max_depth</a><span class="Delimiter">;</span> <span id="L162" class="LineNr">162 </span><span class="Delimiter">}</span> <span id="L163" class="LineNr">163 </span> -<span id="L164" class="LineNr">164 </span>string trace_stream::<a href='003trace.cc.html#L164'>readable_contents</a><span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L164" class="LineNr">164 </span>string trace_stream::<a href='003trace.cc.html#L164'>readable_contents</a><span class="Delimiter">(</span>string label<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L165" class="LineNr">165 </span> ostringstream output<span class="Delimiter">;</span> -<span id="L166" class="LineNr">166 </span> <a href='003trace.cc.html#L73'>label</a> = <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">);</span> +<span id="L166" class="LineNr">166 </span> label = <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> <span id="L167" class="LineNr">167 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = <a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span><a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> -<span id="L168" class="LineNr">168 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">.</span>empty<span class="Delimiter">()</span> || <a href='003trace.cc.html#L73'>label</a> == p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L169" class="LineNr">169 </span> output << std::setw<span class="Delimiter">(</span><span class="Constant">4</span><span class="Delimiter">)</span> << p<span class="Delimiter">-></span><a href='003trace.cc.html#L72'>depth</a> << <span class="Constant">' '</span> << p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a> << <span class="Constant">": "</span> << p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L168" class="LineNr">168 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>label<span class="Delimiter">.</span>empty<span class="Delimiter">()</span> || label == p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L169" class="LineNr">169 </span> output << std::setw<span class="Delimiter">(</span><span class="Constant">4</span><span class="Delimiter">)</span> << p<span class="Delimiter">-></span><a href='003trace.cc.html#L72'>depth</a> << <span class="Constant">' '</span> << p<span class="Delimiter">-></span>label << <span class="Constant">": "</span> << p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L170" class="LineNr">170 </span> <span class="Delimiter">}</span> <span id="L171" class="LineNr">171 </span> <span class="Identifier">return</span> output<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span id="L172" class="LineNr">172 </span><span class="Delimiter">}</span> @@ -318,10 +318,10 @@ if ('onhashchange' in window) { <span id="L259" class="LineNr">259 </span> <span class="Delimiter">}</span> <span id="L260" class="LineNr">260 </span> <span id="L261" class="LineNr">261 </span><span class="Comment">#define CHECK_TRACE_COUNT(label, count) \</span> -<span id="L262" class="LineNr">262 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='002test.cc.html#L21'>Passed</a> && trace_count<span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> != <span class="Delimiter">(</span>count<span class="Delimiter">))</span> <span class="Delimiter">{</span> \ -<span id="L263" class="LineNr">263 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << __FUNCTION__ << <span class="Constant">"("</span> << <span class="Constant">__FILE__</span> << <span class="Constant">":"</span> << <span class="Constant">__LINE__</span> << <span class="Constant">"): trace_count of "</span> << <a href='003trace.cc.html#L73'>label</a> << <span class="Constant">" should be "</span> << count << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> \ -<span id="L264" class="LineNr">264 </span> cerr << <span class="Constant">" got "</span> << trace_count<span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span class="Comment">/*</span><span class="Comment"> multiple eval </span><span class="Comment">*/</span> \ -<span id="L265" class="LineNr">265 </span> <a href='003trace.cc.html#L200'>DUMP</a><span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">);</span> \ +<span id="L262" class="LineNr">262 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='002test.cc.html#L21'>Passed</a> && trace_count<span class="Delimiter">(</span>label<span class="Delimiter">)</span> != <span class="Delimiter">(</span>count<span class="Delimiter">))</span> <span class="Delimiter">{</span> \ +<span id="L263" class="LineNr">263 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << __FUNCTION__ << <span class="Constant">"("</span> << <span class="Constant">__FILE__</span> << <span class="Constant">":"</span> << <span class="Constant">__LINE__</span> << <span class="Constant">"): trace_count of "</span> << label << <span class="Constant">" should be "</span> << count << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> \ +<span id="L264" class="LineNr">264 </span> cerr << <span class="Constant">" got "</span> << trace_count<span class="Delimiter">(</span>label<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span class="Comment">/*</span><span class="Comment"> multiple eval </span><span class="Comment">*/</span> \ +<span id="L265" class="LineNr">265 </span> <a href='003trace.cc.html#L200'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> \ <span id="L266" class="LineNr">266 </span> <a href='002test.cc.html#L21'>Passed</a> =<span class="Constant"> false</span><span class="Delimiter">;</span> \ <span id="L267" class="LineNr">267 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">/*</span><span class="Comment"> Currently we stop at the very first failure. </span><span class="Comment">*/</span> \ <span id="L268" class="LineNr">268 </span> <span class="Delimiter">}</span> @@ -337,10 +337,10 @@ if ('onhashchange' in window) { <span id="L278" class="LineNr">278 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>curr_expected_line < <a href='001help.cc.html#L157'>SIZE</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">)</span> && expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>empty<span class="Delimiter">())</span> <span id="L279" class="LineNr">279 </span> ++curr_expected_line<span class="Delimiter">;</span> <span id="L280" class="LineNr">280 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>curr_expected_line == <a href='001help.cc.html#L157'>SIZE</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Constant"> true</span><span class="Delimiter">;</span> -<span id="L281" class="LineNr">281 </span> string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">;</span> +<span id="L281" class="LineNr">281 </span> string label<span class="Delimiter">,</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">;</span> <span id="L282" class="LineNr">282 </span> <a href='003trace.cc.html#L305'>split_label_contents</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">),</span> &label<span class="Delimiter">,</span> &contents<span class="Delimiter">);</span> <span id="L283" class="LineNr">283 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span><a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L284" class="LineNr">284 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a> != p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L284" class="LineNr">284 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>label != p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L285" class="LineNr">285 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L74'>contents</a> != <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L286" class="LineNr">286 </span> ++curr_expected_line<span class="Delimiter">;</span> <span id="L287" class="LineNr">287 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>curr_expected_line < <a href='001help.cc.html#L157'>SIZE</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">)</span> && expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>empty<span class="Delimiter">())</span> @@ -349,19 +349,19 @@ if ('onhashchange' in window) { <span id="L290" class="LineNr">290 </span> <a href='003trace.cc.html#L305'>split_label_contents</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">),</span> &label<span class="Delimiter">,</span> &contents<span class="Delimiter">);</span> <span id="L291" class="LineNr">291 </span> <span class="Delimiter">}</span> <span id="L292" class="LineNr">292 </span> -<span id="L293" class="LineNr">293 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L318'>line_exists_anywhere</a><span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L294" class="LineNr">294 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << FUNCTION << <span class="Constant">"("</span> << <span class="Normal">FILE</span> << <span class="Constant">":"</span> << LINE << <span class="Constant">"): <a href='011run.cc.html#L117'>line</a> ["</span> << <a href='003trace.cc.html#L73'>label</a> << <span class="Constant">": "</span> << <a href='003trace.cc.html#L74'>contents</a> << <span class="Constant">"] out of order in <a href='003trace.cc.html#L196'>trace</a>:</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> +<span id="L293" class="LineNr">293 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L318'>line_exists_anywhere</a><span class="Delimiter">(</span>label<span class="Delimiter">,</span> <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L294" class="LineNr">294 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << FUNCTION << <span class="Constant">"("</span> << <span class="Normal">FILE</span> << <span class="Constant">":"</span> << LINE << <span class="Constant">"): <a href='011run.cc.html#L117'>line</a> ["</span> << label << <span class="Constant">": "</span> << <a href='003trace.cc.html#L74'>contents</a> << <span class="Constant">"] out of order in <a href='003trace.cc.html#L196'>trace</a>:</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> <span id="L295" class="LineNr">295 </span> <a href='003trace.cc.html#L200'>DUMP</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> <span id="L296" class="LineNr">296 </span> <span class="Delimiter">}</span> <span id="L297" class="LineNr">297 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L298" class="LineNr">298 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << FUNCTION << <span class="Constant">"("</span> << <span class="Normal">FILE</span> << <span class="Constant">":"</span> << LINE << <span class="Constant">"): missing ["</span> << <a href='003trace.cc.html#L74'>contents</a> << <span class="Constant">"] in <a href='003trace.cc.html#L196'>trace</a>:</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> -<span id="L299" class="LineNr">299 </span> <a href='003trace.cc.html#L200'>DUMP</a><span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">);</span> +<span id="L299" class="LineNr">299 </span> <a href='003trace.cc.html#L200'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> <span id="L300" class="LineNr">300 </span> <span class="Delimiter">}</span> <span id="L301" class="LineNr">301 </span> <a href='002test.cc.html#L21'>Passed</a> =<span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L302" class="LineNr">302 </span> <span class="Identifier">return</span><span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L303" class="LineNr">303 </span><span class="Delimiter">}</span> <span id="L304" class="LineNr">304 </span> -<span id="L305" class="LineNr">305 </span><span class="Normal">void</span> <a href='003trace.cc.html#L305'>split_label_contents</a><span class="Delimiter">(</span><span class="Normal">const</span> string& s<span class="Delimiter">,</span> string* <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> string* <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L305" class="LineNr">305 </span><span class="Normal">void</span> <a href='003trace.cc.html#L305'>split_label_contents</a><span class="Delimiter">(</span><span class="Normal">const</span> string& s<span class="Delimiter">,</span> string* label<span class="Delimiter">,</span> string* <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L306" class="LineNr">306 </span> <span class="Normal">static</span> <span class="Normal">const</span> string delim<span class="Delimiter">(</span><span class="Constant">": "</span><span class="Delimiter">);</span> <span id="L307" class="LineNr">307 </span> <span class="Normal">size_t</span> pos = s<span class="Delimiter">.</span>find<span class="Delimiter">(</span>delim<span class="Delimiter">);</span> <span id="L308" class="LineNr">308 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>pos == string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span> @@ -374,23 +374,23 @@ if ('onhashchange' in window) { <span id="L315" class="LineNr">315 </span> <span class="Delimiter">}</span> <span id="L316" class="LineNr">316 </span><span class="Delimiter">}</span> <span id="L317" class="LineNr">317 </span> -<span id="L318" class="LineNr">318 </span><span class="Normal">bool</span> <a href='003trace.cc.html#L318'>line_exists_anywhere</a><span class="Delimiter">(</span><span class="Normal">const</span> string& <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> <span class="Normal">const</span> string& <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L318" class="LineNr">318 </span><span class="Normal">bool</span> <a href='003trace.cc.html#L318'>line_exists_anywhere</a><span class="Delimiter">(</span><span class="Normal">const</span> string& label<span class="Delimiter">,</span> <span class="Normal">const</span> string& <a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L319" class="LineNr">319 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span><a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L320" class="LineNr">320 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a> != p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L320" class="LineNr">320 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>label != p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L321" class="LineNr">321 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L74'>contents</a> == <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Constant"> true</span><span class="Delimiter">;</span> <span id="L322" class="LineNr">322 </span> <span class="Delimiter">}</span> <span id="L323" class="LineNr">323 </span> <span class="Identifier">return</span><span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L324" class="LineNr">324 </span><span class="Delimiter">}</span> <span id="L325" class="LineNr">325 </span> -<span id="L326" class="LineNr">326 </span><span class="Normal">int</span> trace_count<span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L327" class="LineNr">327 </span> <span class="Identifier">return</span> trace_count<span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L326" class="LineNr">326 </span><span class="Normal">int</span> trace_count<span class="Delimiter">(</span>string label<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L327" class="LineNr">327 </span> <span class="Identifier">return</span> trace_count<span class="Delimiter">(</span>label<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L328" class="LineNr">328 </span><span class="Delimiter">}</span> <span id="L329" class="LineNr">329 </span> -<span id="L330" class="LineNr">330 </span><span class="Normal">int</span> trace_count<span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> string <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L330" class="LineNr">330 </span><span class="Normal">int</span> trace_count<span class="Delimiter">(</span>string label<span class="Delimiter">,</span> string <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L331" class="LineNr">331 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Trace_stream<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L332" class="LineNr">332 </span> <span class="Normal">long</span> result = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L333" class="LineNr">333 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span><a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L334" class="LineNr">334 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a> == p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L334" class="LineNr">334 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>label == p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L335" class="LineNr">335 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='011run.cc.html#L117'>line</a> == <span class="Constant">""</span> || <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span><a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> == <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">))</span> <span id="L336" class="LineNr">336 </span> ++result<span class="Delimiter">;</span> <span id="L337" class="LineNr">337 </span> <span class="Delimiter">}</span> @@ -398,11 +398,11 @@ if ('onhashchange' in window) { <span id="L339" class="LineNr">339 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L340" class="LineNr">340 </span><span class="Delimiter">}</span> <span id="L341" class="LineNr">341 </span> -<span id="L342" class="LineNr">342 </span><span class="Normal">int</span> <a href='003trace.cc.html#L342'>trace_count_prefix</a><span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> string prefix<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L342" class="LineNr">342 </span><span class="Normal">int</span> <a href='003trace.cc.html#L342'>trace_count_prefix</a><span class="Delimiter">(</span>string label<span class="Delimiter">,</span> string prefix<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L343" class="LineNr">343 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Trace_stream<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L344" class="LineNr">344 </span> <span class="Normal">long</span> result = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L345" class="LineNr">345 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='003trace.cc.html#L175'>Trace_stream</a><span class="Delimiter">-></span><a href='003trace.cc.html#L110'>past_lines</a><span class="Delimiter">.</span><a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L346" class="LineNr">346 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a> == p<span class="Delimiter">-></span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L346" class="LineNr">346 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>label == p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L347" class="LineNr">347 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L93'>starts_with</a><span class="Delimiter">(</span><a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span><a href='003trace.cc.html#L74'>contents</a><span class="Delimiter">),</span> <a href='003trace.cc.html#L391'>trim</a><span class="Delimiter">(</span>prefix<span class="Delimiter">)))</span> <span id="L348" class="LineNr">348 </span> ++result<span class="Delimiter">;</span> <span id="L349" class="LineNr">349 </span> <span class="Delimiter">}</span> @@ -410,14 +410,14 @@ if ('onhashchange' in window) { <span id="L351" class="LineNr">351 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L352" class="LineNr">352 </span><span class="Delimiter">}</span> <span id="L353" class="LineNr">353 </span> -<span id="L354" class="LineNr">354 </span><span class="Normal">bool</span> trace_doesnt_contain<span class="Delimiter">(</span>string <a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> string <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L355" class="LineNr">355 </span> <span class="Identifier">return</span> trace_count<span class="Delimiter">(</span><a href='003trace.cc.html#L73'>label</a><span class="Delimiter">,</span> <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">;</span> +<span id="L354" class="LineNr">354 </span><span class="Normal">bool</span> trace_doesnt_contain<span class="Delimiter">(</span>string label<span class="Delimiter">,</span> string <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L355" class="LineNr">355 </span> <span class="Identifier">return</span> trace_count<span class="Delimiter">(</span>label<span class="Delimiter">,</span> <a href='011run.cc.html#L117'>line</a><span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L356" class="LineNr">356 </span><span class="Delimiter">}</span> <span id="L357" class="LineNr">357 </span> <span id="L358" class="LineNr">358 </span><span class="Normal">bool</span> trace_doesnt_contain<span class="Delimiter">(</span>string expected<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L359" class="LineNr">359 </span> vector<string> tmp = <a href='003trace.cc.html#L382'>split_first</a><span class="Delimiter">(</span>expected<span class="Delimiter">,</span> <span class="Constant">": "</span><span class="Delimiter">);</span> <span id="L360" class="LineNr">360 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L157'>SIZE</a><span class="Delimiter">(</span>tmp<span class="Delimiter">)</span> == <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L361" class="LineNr">361 </span> <a href='003trace.cc.html#L203'>raise</a> << expected << <span class="Constant">": missing <a href='003trace.cc.html#L73'>label</a> or <a href='003trace.cc.html#L74'>contents</a> in <a href='003trace.cc.html#L196'>trace</a> <a href='011run.cc.html#L117'>line</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> +<span id="L361" class="LineNr">361 </span> <a href='003trace.cc.html#L203'>raise</a> << expected << <span class="Constant">": missing label or <a href='003trace.cc.html#L74'>contents</a> in <a href='003trace.cc.html#L196'>trace</a> <a href='011run.cc.html#L117'>line</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span> <span id="L362" class="LineNr">362 </span> assert<span class="Delimiter">(</span><span class="Constant">false</span><span class="Delimiter">);</span> <span id="L363" class="LineNr">363 </span> <span class="Delimiter">}</span> <span id="L364" class="LineNr">364 </span> <span class="Identifier">return</span> trace_doesnt_contain<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">),</span> tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">));</span> |