锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国内精品久久久久久久久电影网,久久精品国产99久久久古代 ,91久久精一区二区三区大全http://www.shnenglu.com/volant/category/10539.htmlzh-cnFri, 16 Aug 2013 17:29:18 GMTFri, 16 Aug 2013 17:29:18 GMT60regex鈥斺旀鍒欒〃杈懼紡涓嬌鐢ㄦ柟鎷彿http://www.shnenglu.com/volant/archive/2010/04/12/112314.html灝忓灝忓Mon, 12 Apr 2010 05:14:00 GMThttp://www.shnenglu.com/volant/archive/2010/04/12/112314.htmlhttp://www.shnenglu.com/volant/comments/112314.htmlhttp://www.shnenglu.com/volant/archive/2010/04/12/112314.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/112314.htmlhttp://www.shnenglu.com/volant/services/trackbacks/112314.html宸ヤ綔涓粡甯擱渶瑕佸湪姝e垯琛ㄨ揪寮忎腑浣跨敤鏂規嫭鍙鳳紝姣斿鍖歸厤Linux緋葷粺鍛戒護琛屾彁紺虹“[root@localhost ~]# ”銆傚湪python涓紝鍙互浣跨敤姝e垯琛ㄨ揪寮?#8220;[\[][^\[\]]*[\]][#|$] ”榪涜鍖歸厤錛屼絾鍦╮egex涓姝e垯琛ㄨ揪寮忔棤娉曟紜尮閰嶃?br>鐢變簬man鎵嬪唽涓己灝戝鏂規嫭鍙瘋漿涔夌殑浠嬬粛錛屾湰鏂囧regex涓柟鎷彿鐨勪嬌鐢ㄨ繘琛屾祴璇曪紝嫻嬭瘯紼嬪簭濡備笅錛?/p>
#include <stdio.h>
#include 
<string.h>

#include 
<sys/types.h>
#include 
<regex.h>

int main(int argc, char** argv)
{
        
char * pattern, *mstr;
        
int x, z, lno = 0, cflags = REG_EXTENDED;
        
char ebuf[128], lbuf[256], format[32];
        regex_t reg;
        regmatch_t pm[
10];
        
const size_t nmatch = 10;

        pattern 
= argv[1];
        z 
= regcomp(&reg, pattern, cflags);

        
if (z != 0)
        
{
                regerror(z, 
&reg, ebuf, sizeof(ebuf));
                fprintf(stderr, 
"%s: pattern '%s' \n",ebuf, pattern);
                regfree(
&reg);
                
return 1;
        }


        
while(fgets(lbuf, sizeof(lbuf), stdin))
        
{
                
++lno;
                
if ((z = strlen(lbuf)) > 0 && lbuf[z-1]== '\n') lbuf[z - 1= 0;

                z 
= regexec(&reg, lbuf, nmatch, pm, 0);
                
if (z == REG_NOMATCH)
                
{
                        printf(
"not match\n");
                        
continue;
                }

                
else if (z != 0)
                
{
                        regerror(z, 
&reg, ebuf, sizeof(ebuf));
                        fprintf(stderr, 
"%s: regcom('%s')\n",
                                        ebuf, lbuf);
                        
return 2;
                }


                
if (pm[0].rm_so!=-1)
                        printf(
"%04d: %s\n", lno, lbuf);
                
for (x = 0; x < nmatch && pm[x].rm_so != -1++ x)
                
{
                        mstr 
= strndup(lbuf + pm[x].rm_so, pm[x].rm_eo-pm[x].rm_so);
                        printf(
" $%d: %s\n", x, mstr);
                        free(mstr);
                }

                fflush(stdout);

        }


        regfree(
&reg);
        
return 0;
}
涓嬮潰鏄姝e垯琛ㄨ揪寮?#8220;[\[][^\[\]]*[\]][#|$] ” 鐨勬祴璇曪紝鏄劇劧涓嶇鍚堣姹傘?
./testreg "[\[][^\[\]]*[\]][#|$] "  
[root@localhost bin]# 
not match
[a\]# 
0005: [a\]# 
 $
0: [a\]# 
浠庣畝鍗曠殑寮濮嬪厛嫻嬭瘯宸︽嫭鍙?#8220;[”鐨勫尮閰嶏細
./testreg "[\[]+"
a
not match
[
0002: [
 $
0: [
[root@localhost bin]# 
0003: [root@localhost bin]# 
 $
0: [
鍐嶆祴璇曞彸鎷彿“]”錛?
./testreg "[\]]+"
]
not match
\]  
0002: \]
 $
0: \]
-----------------
.
/testreg "[]]+"
]]
0001: ]]
 $
0: ]]
涓や釜綆鍗曠殑姝e垯琛ㄨ揪寮忓彲浠ョ湅鍑猴細regex涓乏鏂規嫭鍙烽渶瑕佽漿涔夛紝鍙蟲柟鎷彿涓嶉渶瑕佽漿涔夈?br>涓嬮潰鎴戜滑鍐嶆潵嫻嬭瘯鍖歸厤涓涓嬩換鎰忛潪鏂規嫭鍙峰瓧絎︼細
./testreg "[^\[]]+" //瀵筟杞箟錛屼笉瀵筣杞箟
[abc]
0001: [abc]
 $
0: c]
.
/testreg "[^\[\]]+" //瀵筟鍜宂杞箟
[abc]
0001: [abc]
 $
0: c]
.
/testreg "[^]\[]+" //瀵筟杞箟錛屼笉瀵筣杞箟錛屼笖鎶奭鏀懼湪^鍚庝嬌]涓嶄笌鍓嶉潰鐨刐鍖歸厤
[abc]
0001: [abc]
 $
0: abc
閫氳繃涓婇潰嫻嬭瘯鍙互寰楀嚭姝g‘鐨勬鍒欒〃杈懼紡鏉ュ尮閰峀inux鍛戒護琛屾彁紺虹鈥斺?#8220;[\[][^]\[]*[]][#$] ”鎴?#8220;\[[^]\[]*][#$] ”銆?

灝忓 2010-04-12 13:14 鍙戣〃璇勮
]]>
[瀵煎叆]鏍囧噯C鍑芥暟錛歴trncpyhttp://www.shnenglu.com/volant/archive/2009/06/18/87973.html灝忓灝忓Thu, 18 Jun 2009 06:38:00 GMThttp://www.shnenglu.com/volant/archive/2009/06/18/87973.htmlhttp://www.shnenglu.com/volant/comments/87973.htmlhttp://www.shnenglu.com/volant/archive/2009/06/18/87973.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/87973.htmlhttp://www.shnenglu.com/volant/services/trackbacks/87973.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2009/05/11/4167919.aspx

灝忓 2009-06-18 14:38 鍙戣〃璇勮
]]>
[瀵煎叆]GCC C璇█鎵╁睍錛?錛?/title><link>http://www.shnenglu.com/volant/archive/2009/06/18/87972.html</link><dc:creator>灝忓</dc:creator><author>灝忓</author><pubDate>Thu, 18 Jun 2009 06:38:00 GMT</pubDate><guid>http://www.shnenglu.com/volant/archive/2009/06/18/87972.html</guid><wfw:comment>http://www.shnenglu.com/volant/comments/87972.html</wfw:comment><comments>http://www.shnenglu.com/volant/archive/2009/06/18/87972.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/volant/comments/commentRss/87972.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/volant/services/trackbacks/87972.html</trackback:ping><description><![CDATA[ 鐪嬪紑婧愮殑浠g爜涓彂鐜頒簡涓浜涢潤鎬佸嚱鏁板0鏄庡悗鏈夊涓嬪唴瀹癸細__attribute__ ((constructor))榪欐槸gcc鐨勬墿灞曞睘鎬с?img src="http://blog.csdn.net/volant_hoo/aggbug/4169081.aspx" width="1" height="1"><br>鏂囩珷鏉ユ簮:<a >http://blog.csdn.net/volant_hoo/archive/2009/05/11/4169081.aspx</a><img src ="http://www.shnenglu.com/volant/aggbug/87972.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/volant/" target="_blank">灝忓</a> 2009-06-18 14:38 <a href="http://www.shnenglu.com/volant/archive/2009/06/18/87972.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[瀵煎叆]浠庝竴鍒伴潰璇曢璋堣搗http://www.shnenglu.com/volant/archive/2009/06/18/87970.html灝忓灝忓Thu, 18 Jun 2009 06:38:00 GMThttp://www.shnenglu.com/volant/archive/2009/06/18/87970.htmlhttp://www.shnenglu.com/volant/comments/87970.htmlhttp://www.shnenglu.com/volant/archive/2009/06/18/87970.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/87970.htmlhttp://www.shnenglu.com/volant/services/trackbacks/87970.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2009/05/11/4169108.aspx

灝忓 2009-06-18 14:38 鍙戣〃璇勮
]]>
[瀵煎叆]鍏變韓鍐呭瓨http://www.shnenglu.com/volant/archive/2009/06/18/87971.html灝忓灝忓Thu, 18 Jun 2009 06:38:00 GMThttp://www.shnenglu.com/volant/archive/2009/06/18/87971.htmlhttp://www.shnenglu.com/volant/comments/87971.htmlhttp://www.shnenglu.com/volant/archive/2009/06/18/87971.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/87971.htmlhttp://www.shnenglu.com/volant/services/trackbacks/87971.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2009/05/11/4169093.aspx

灝忓 2009-06-18 14:38 鍙戣〃璇勮
]]>
gtest鐨勪竴涓畝鍗曟墿灞曪紙榪愯鏃墮棿嫻嬭瘯錛夌殑瀹炰緥http://www.shnenglu.com/volant/archive/2008/08/27/60203.html灝忓灝忓Wed, 27 Aug 2008 15:34:00 GMThttp://www.shnenglu.com/volant/archive/2008/08/27/60203.htmlhttp://www.shnenglu.com/volant/comments/60203.htmlhttp://www.shnenglu.com/volant/archive/2008/08/27/60203.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/60203.htmlhttp://www.shnenglu.com/volant/services/trackbacks/60203.html涓婁竴綃囦腑瀵筭test榪涜浜嗕竴涓畝鍗曠殑鎵╁睍錛屾湰鏂囬氳繃瀹炰緥嫻嬭瘯騫朵粙緇嶈繖涓墿灞曠殑鐢ㄦ硶銆?/p>

棣栧厛瀹炵幇涓や釜Fibonacci鍑芥暟錛岀劧鍚庡榪欎袱涓嚱鏁拌繘琛屾祴璇曪細

Fibonacci_1錛屼嬌鐢ㄥ驚鐜疄鐜幫細

unsigned int Fibonacci_1(unsigned int n)
{
    unsigned 
int i;
    unsigned 
int f0 = 1, f1 = 1, f2;
    
for (i = 1; i < n; i++)
    
{
        f2 
= f0 + f1;
        f0 
= f1;
        f1 
= f2;
    }

    
return f1;
}


Fibonacci_2錛屼嬌鐢ㄩ掑綊瀹炵幇錛?/p>

unsigned int Fibonacci_2(unsigned int n)
{
    
switch (n)
    
{
        
case 0:
            
return 1;
        
case 1:
            
return 1;
        
default:
            
return Fibonacci_2(n - 1+ Fibonacci_2(n - 2);
    }

}


嫻嬭瘯鐢ㄤ緥錛?/p>

TEST_T(Fibonacci_Recursive, 30)
{
    Fibonacci_2(
30);
    ASSERT_TIME(
0.1);
}


TEST_T(Fibonacci_Loop, 
30)
{
    Fibonacci_1(
30);
    ASSERT_TIME(
0.1);
}


TEST_T(Fibonacci_Recursive, 
40)
{
    TEST_T_SHOWTIME();
    Fibonacci_2(
40);
    EXCEPT_TIME(
0.1);
    ASSERT_TIME(
1<< "\nUsed too long time!";
}


TEST_T(Fibonacci_Loop, 
40)
{
    TEST_T_SHOWTIME();
    Fibonacci_1(
40);
    EXCEPT_TIME(
0.1);
    ASSERT_TIME(
1<< "\nUsed too long time!";
}


嫻嬭瘯緇撴灉錛?/p>

 

[==========] Running 4 tests from 2 test cases.
[
----------] Global test environment set-up.
[
----------2 tests from TIME_Fibonacci_Recursive
[ RUN      ] TIME_Fibonacci_Recursive.
30
[       OK ] TIME_Fibonacci_Recursive.
30
[ RUN      ] TIME_Fibonacci_Recursive.
40
FibonacciTest.cpp:
47: Failure
Failed
Time: running 
2.9995(s) > 0.1(s)
FibonacciTest.cpp:
48: Failure
Failed
Time: running 
2.9995(s) > 1(s)
Used too 
long time!
[   TIME   ] used time: 
2.9995(s)
[  FAILED  ] TIME_Fibonacci_Recursive.
40
[
----------2 tests from TIME_Fibonacci_Loop
[ RUN      ] TIME_Fibonacci_Loop.
30
[       OK ] TIME_Fibonacci_Loop.
30
[ RUN      ] TIME_Fibonacci_Loop.
40
[   TIME   ] used time: 
0(s)
[       OK ] TIME_Fibonacci_Loop.
40
[
----------] Global test environment tear-down
[
==========4 tests from 2 test cases ran.
[  PASSED  ] 
3 tests.
[  FAILED  ] 
1 test, listed below:
[  FAILED  ] TIME_Fibonacci_Recursive.
40

 

瀹炰緥涓祴璇曚簡鍥涗釜嫻嬭瘯鐢ㄤ緥錛屽垎鍒祴璇曚簡涓や釜鍑芥暟鍒嗗埆璁$畻Fibonacci(30)鍜孎ibonacci(40)鎵鑺辮垂鐨勬椂闂淬傛祴璇曠敤渚?銆?姣旇緝綆鍗曪紝浠呮湁涓涓狝SSERT_TIME鏂█鐢ㄤ簬嫻嬭瘯榪愯鍒版璇ユ祴璇曠敤渚嬭姳璐圭殑鏃墮棿銆傛祴璇曠敤渚?銆?錛屽鍔犱簡涓ゆ潯璇彞錛歍EST_T_SHOWTIME()錛屾祴璇曠敤渚嬬粨鏉熷悗鎵撳嵃鎵ц鏃墮棿錛汦XCEPT_TIME鏂█錛岃繖閲屽彧鏄祴璇曚互涓婨XCEPT_TIME鍜孉SSERT_TIME鐨勫尯鍒紝鍓嶈呯戶緇墽琛屽悗緇鍙ワ紝鍚庤呭垯緇撴潫褰撳墠鐨勬祴璇曠敤渚嬨?img src ="http://www.shnenglu.com/volant/aggbug/60203.html" width = "1" height = "1" />

灝忓 2008-08-27 23:34 鍙戣〃璇勮
]]>
gtest鐨勪竴涓畝鍗曟墿灞?/title><link>http://www.shnenglu.com/volant/archive/2008/08/27/60201.html</link><dc:creator>灝忓</dc:creator><author>灝忓</author><pubDate>Wed, 27 Aug 2008 15:14:00 GMT</pubDate><guid>http://www.shnenglu.com/volant/archive/2008/08/27/60201.html</guid><wfw:comment>http://www.shnenglu.com/volant/comments/60201.html</wfw:comment><comments>http://www.shnenglu.com/volant/archive/2008/08/27/60201.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/volant/comments/commentRss/60201.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/volant/services/trackbacks/60201.html</trackback:ping><description><![CDATA[<p>鐪嬩簡gtest鐨勪竴涓猻imple錛屽叾涓湁嫻嬭瘯榪愯鏃墮棿鐨勬柟娉曪紝浣嗕嬌鐢ㄨ搗鏉ョ◢寰礋璐o紝鍥犳鍋氫簡涓涓畝鍗曠殑鎵╁睍銆?/p> <p>鎵╁睍鍐呭錛?br />1. TEST_T(test_case_name, test_name)錛岀敤浜庡畾涔夎繍琛屾椂闂存祴璇曠敤渚嬨?br />2. TEST_T_SHOWTIME()錛屾墦寮鎵撳嵃嫻嬭瘯鐢ㄤ緥榪愯鏃墮棿鎵撳嵃寮鍏熾?br />3. EXCEPT_TIME(second)鍜孉SSERT_TIME(second)錛屾柇璦錛宻econd涓篸ouble綾誨瀷錛屾祴璇曡繍琛屾椂闂存槸鍚﹀皬浜巗econd銆?/p> <p>浣跨敤璇存槑錛?br />鍚戞甯鎬嬌鐢ㄤ竴鏍鳳紝鍙槸鍦ㄩ渶瑕佹椂闂存祴璇曟椂include “gtest_e.h”鍗沖彲錛屽綋鐒朵篃寰楁妸鐩稿簲鐨勫簱閾炬帴鍒版墽琛屾枃浠朵腑銆?/p> <p>鍏蜂綋瀹炵幇錛?br />婧愭枃浠秅test_e.h----</p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_0_19_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_19_Open_Text.style.display='none'; Codehighlighter1_0_19_Closed_Image.style.display='inline'; Codehighlighter1_0_19_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_0_19_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_19_Closed_Text.style.display='none'; Codehighlighter1_0_19_Open_Image.style.display='inline'; Codehighlighter1_0_19_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"><span id="Codehighlighter1_0_19_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_19_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">*<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /> * gtest_e.h<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /> </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#ifndef GTEST_E_H_<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> GTEST_E_H_</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#include </span><span style="color: #000000">"</span><span style="color: #000000">gtest_time.h</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> TEST_T(test_case_name, test_name)\</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    GTEST_TEST(TIME_##test_case_name, test_name, ::TimeTest)<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> TEST_T_SHOWTIME() TimeTest_setShowFlag(1)</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> ASSERT_TIME(time) if(TimeTest_setTimePoint() - time > 0) \</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    FAIL() </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">Time: running </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000"><<</span><span style="color: #000000"> TimeTest_getTime() </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">(s) > </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000"><<</span><span style="color: #000000"> time </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">(s)</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> EXCEPT_TIME(time) if(TimeTest_setTimePoint() - time > 0) \</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    ADD_FAILURE() </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">Time: running </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000"><<</span><span style="color: #000000"> TimeTest_getTime() </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">(s) > </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000"><<</span><span style="color: #000000"> time </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">(s)</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#endif</span><span style="color: #000000"> /* GTEST_E_H_ */</span></div> 婧愭枃浠秅test_time.h----<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_0_22_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_22_Open_Text.style.display='none'; Codehighlighter1_0_22_Closed_Image.style.display='inline'; Codehighlighter1_0_22_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_0_22_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_22_Closed_Text.style.display='none'; Codehighlighter1_0_22_Open_Image.style.display='inline'; Codehighlighter1_0_22_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"><span id="Codehighlighter1_0_22_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_22_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">*<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /> * gtest_time.h<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /> </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#ifndef GTEST_TIME_H_<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#define</span><span style="color: #000000"> GTEST_TIME_H_</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#include </span><span style="color: #000000"><</span><span style="color: #000000">gtest</span><span style="color: #000000">/</span><span style="color: #000000">gtest.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">class</span><span style="color: #000000"> TimeTest: </span><span style="color: #0000ff">public</span><span style="color: #000000"> testing::Test<br /><img id="Codehighlighter1_133_490_Open_Image" onclick="this.style.display='none'; Codehighlighter1_133_490_Open_Text.style.display='none'; Codehighlighter1_133_490_Closed_Image.style.display='inline'; Codehighlighter1_133_490_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_133_490_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_133_490_Closed_Text.style.display='none'; Codehighlighter1_133_490_Open_Image.style.display='inline'; Codehighlighter1_133_490_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_133_490_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_133_490_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000">:<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    inline </span><span style="color: #0000ff">void</span><span style="color: #000000"> TimeTest_setShowFlag(</span><span style="color: #0000ff">int</span><span style="color: #000000"> flag)<br /><img id="Codehighlighter1_194_227_Open_Image" onclick="this.style.display='none'; Codehighlighter1_194_227_Open_Text.style.display='none'; Codehighlighter1_194_227_Closed_Image.style.display='inline'; Codehighlighter1_194_227_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_194_227_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_194_227_Closed_Text.style.display='none'; Codehighlighter1_194_227_Open_Image.style.display='inline'; Codehighlighter1_194_227_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_194_227_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_194_227_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />        show_time_ </span><span style="color: #000000">=</span><span style="color: #000000"> flag;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    inline </span><span style="color: #0000ff">double</span><span style="color: #000000"> TimeTest_getTime()<br /><img id="Codehighlighter1_271_317_Open_Image" onclick="this.style.display='none'; Codehighlighter1_271_317_Open_Text.style.display='none'; Codehighlighter1_271_317_Closed_Image.style.display='inline'; Codehighlighter1_271_317_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_271_317_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_271_317_Closed_Text.style.display='none'; Codehighlighter1_271_317_Open_Image.style.display='inline'; Codehighlighter1_271_317_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_271_317_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_271_317_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> end_time_ </span><span style="color: #000000">-</span><span style="color: #000000"> start_time_;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> TimeTest_setTimePoint();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">protected</span><span style="color: #000000">:<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> start_time_;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">double</span><span style="color: #000000"> end_time_;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">int</span><span style="color: #000000"> show_time_;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">virtual</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> SetUp();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">virtual</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> TearDown();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#endif</span><span style="color: #000000"> /* GTEST_TIME_H_ */</span></div> 婧愭枃浠秅test_time.cpp----<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_0_24_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_24_Open_Text.style.display='none'; Codehighlighter1_0_24_Closed_Image.style.display='inline'; Codehighlighter1_0_24_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_0_24_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_24_Closed_Text.style.display='none'; Codehighlighter1_0_24_Open_Image.style.display='inline'; Codehighlighter1_0_24_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"><span id="Codehighlighter1_0_24_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_24_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">*<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" /> * gtest_time.cpp<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /> </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#include </span><span style="color: #000000"><</span><span style="color: #000000">iostream</span><span style="color: #000000">></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#include </span><span style="color: #000000">"</span><span style="color: #000000">gtest_time.h</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> </span><span style="color: #0000ff">namespace</span><span style="color: #000000"> std;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#if</span><span style="color: #000000"> defined(WIN32)</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" />#include </span><span style="color: #000000"><</span><span style="color: #000000">sys</span><span style="color: #000000">/</span><span style="color: #000000">timeb.h</span><span style="color: #000000">></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">double</span><span style="color: #000000"> now()<br /><img id="Codehighlighter1_149_275_Open_Image" onclick="this.style.display='none'; Codehighlighter1_149_275_Open_Text.style.display='none'; Codehighlighter1_149_275_Closed_Image.style.display='inline'; Codehighlighter1_149_275_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_149_275_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_149_275_Closed_Text.style.display='none'; Codehighlighter1_149_275_Open_Image.style.display='inline'; Codehighlighter1_149_275_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_149_275_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_149_275_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">struct</span><span style="color: #000000"> _timeb current;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    _ftime(</span><span style="color: #000000">&</span><span style="color: #000000">current);<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> (((</span><span style="color: #0000ff">double</span><span style="color: #000000">) current.time) </span><span style="color: #000000">+</span><span style="color: #000000"> (</span><span style="color: #000000">1.0</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> current.millitm) </span><span style="color: #000000">*</span><span style="color: #000000"> </span><span style="color: #000000">0.000001</span><span style="color: #000000">);<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#else</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">double</span><span style="color: #000000"> now()<br /><img id="Codehighlighter1_296_438_Open_Image" onclick="this.style.display='none'; Codehighlighter1_296_438_Open_Text.style.display='none'; Codehighlighter1_296_438_Closed_Image.style.display='inline'; Codehighlighter1_296_438_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_296_438_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_296_438_Closed_Text.style.display='none'; Codehighlighter1_296_438_Open_Image.style.display='inline'; Codehighlighter1_296_438_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_296_438_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_296_438_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">struct</span><span style="color: #000000"> timeval current;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    gettimeofday(</span><span style="color: #000000">&</span><span style="color: #000000">current, NULL);<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> (((</span><span style="color: #0000ff">double</span><span style="color: #000000">) current.tv_sec) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1.0e-6</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> ((</span><span style="color: #0000ff">double</span><span style="color: #000000">) current.tv_usec));<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> TimeTest::SetUp()<br /><img id="Codehighlighter1_471_546_Open_Image" onclick="this.style.display='none'; Codehighlighter1_471_546_Open_Text.style.display='none'; Codehighlighter1_471_546_Closed_Image.style.display='inline'; Codehighlighter1_471_546_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_471_546_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_471_546_Closed_Text.style.display='none'; Codehighlighter1_471_546_Open_Image.style.display='inline'; Codehighlighter1_471_546_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_471_546_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_471_546_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    start_time_ </span><span style="color: #000000">=</span><span style="color: #000000"> now();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    end_time_ </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    TimeTest_setShowFlag(</span><span style="color: #000000">0</span><span style="color: #000000">);<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">void</span><span style="color: #000000"> TimeTest::TearDown()<br /><img id="Codehighlighter1_575_751_Open_Image" onclick="this.style.display='none'; Codehighlighter1_575_751_Open_Text.style.display='none'; Codehighlighter1_575_751_Closed_Image.style.display='inline'; Codehighlighter1_575_751_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_575_751_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_575_751_Closed_Text.style.display='none'; Codehighlighter1_575_751_Open_Image.style.display='inline'; Codehighlighter1_575_751_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_575_751_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_575_751_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000"> (show_time_)<br /><img id="Codehighlighter1_601_749_Open_Image" onclick="this.style.display='none'; Codehighlighter1_601_749_Open_Text.style.display='none'; Codehighlighter1_601_749_Closed_Image.style.display='inline'; Codehighlighter1_601_749_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_601_749_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_601_749_Closed_Text.style.display='none'; Codehighlighter1_601_749_Open_Image.style.display='inline'; Codehighlighter1_601_749_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">    </span><span id="Codehighlighter1_601_749_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_601_749_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> used_time </span><span style="color: #000000">=</span><span style="color: #000000"> TimeTest_setTimePoint();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />        cout </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">[   TIME   ] used time: </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000"><<</span><span style="color: #000000"> used_time </span><span style="color: #000000"><<</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">(s)</span><span style="color: #000000">"</span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000"><<</span><span style="color: #000000"> endl;<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">double</span><span style="color: #000000"> TimeTest::TimeTest_setTimePoint()<br /><img id="Codehighlighter1_795_851_Open_Image" onclick="this.style.display='none'; Codehighlighter1_795_851_Open_Text.style.display='none'; Codehighlighter1_795_851_Closed_Image.style.display='inline'; Codehighlighter1_795_851_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_795_851_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_795_851_Closed_Text.style.display='none'; Codehighlighter1_795_851_Open_Image.style.display='inline'; Codehighlighter1_795_851_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_795_851_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_795_851_Open_Text"><span style="color: #000000">{<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    end_time_ </span><span style="color: #000000">=</span><span style="color: #000000"> now();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">return</span><span style="color: #000000"> TimeTest_getTime();<br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <br />浠ヤ笂鍐呭鍙槸涓涓畝鍗曠殑瀹炵幇錛屾病鏈夎繃澶氱殑嫻嬭瘯錛屼笖鏃墮棿綺懼害涓嶅錛岃宸緝澶с?img src ="http://www.shnenglu.com/volant/aggbug/60201.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/volant/" target="_blank">灝忓</a> 2008-08-27 23:14 <a href="http://www.shnenglu.com/volant/archive/2008/08/27/60201.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>gtest錛坓oogle鐨刢++鍗曞厓嫻嬭瘯錛夎瘯鐢?/title><link>http://www.shnenglu.com/volant/archive/2008/07/31/57620.html</link><dc:creator>灝忓</dc:creator><author>灝忓</author><pubDate>Thu, 31 Jul 2008 04:52:00 GMT</pubDate><guid>http://www.shnenglu.com/volant/archive/2008/07/31/57620.html</guid><wfw:comment>http://www.shnenglu.com/volant/comments/57620.html</wfw:comment><comments>http://www.shnenglu.com/volant/archive/2008/07/31/57620.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/volant/comments/commentRss/57620.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/volant/services/trackbacks/57620.html</trackback:ping><description><![CDATA[google寮婧愪簡c++鍗曞厓嫻嬭瘯妗嗘灦錛岀湡璁╀漢鍏村銆傚畨瑁呯殑榪囩▼姣旇緝綆鍗曪紝鍦╡clipse+mingw+cygwin涓嬪緢easy灝辨悶瀹氫簡銆備嬌鐢ㄤ篃寰堝鏄擄紝鎸夌収sample涓嶇敤鐪嬫枃妗d篃鑳藉緢蹇笂鎵嬨傝繃紼嬪氨涓嶅灝戜簡錛岃鐐逛笢瑗垮蹇樸?br /><br />鏂█錛?br />ASSERT_TRUE(condition); EXPECT_TRUE(condition); condition涓虹湡<br />ASSERT_FALSE(condition);    EXPECT_FALSE(condition);    condition涓哄亣<br /><br />ASSERT_EQ(expected, actual);    EXPECT_EQ(expected, actual);    expected == actual<br />ASSERT_NE(val1, val2);  EXPECT_NE(val1, val2);  val1 != val2<br />ASSERT_LT(val1, val2);  EXPECT_LT(val1, val2);  val1 < val2<br />ASSERT_LE(val1, val2);  EXPECT_LE(val1, val2);  val1 <= val2<br />ASSERT_GT(val1, val2);  EXPECT_GT(val1, val2);  val1 > val2<br />ASSERT_GE(val1, val2);  EXPECT_GE(val1, val2);  val1 >= val2<br /><br />ASSERT_STREQ(expected_str, actual_str); EXPECT_STREQ(expected_str, actual_str); 涓や釜C瀛楃涓叉湁鐩稿悓鐨勫唴瀹?br />ASSERT_STRNE(str1, str2);   EXPECT_STRNE(str1, str2); 涓や釜C瀛楃涓叉湁涓嶅悓鐨勫唴瀹?br />ASSERT_STRCASEEQ(expected_str, actual_str); EXPECT_STRCASEEQ(expected_str, actual_str); 涓や釜C瀛楃涓叉湁鐩稿悓鐨勫唴瀹癸紝蹇界暐澶у皬鍐?br />ASSERT_STRCASENE(str1, str2);   EXPECT_STRCASENE(str1, str2);   涓や釜C瀛楃涓叉湁涓嶅悓鐨勫唴瀹癸紝蹇界暐澶у皬鍐?br /><br />澶存枃浠訛細<br />#include <gtest/gtest.h><br /><br />main錛?br />    testing::InitGoogleTest(&argc, argv);<br />    return RUN_ALL_TESTS();<br /><br />搴擄細<br />    -lgtest<br /><br /><img src ="http://www.shnenglu.com/volant/aggbug/57620.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/volant/" target="_blank">灝忓</a> 2008-07-31 12:52 <a href="http://www.shnenglu.com/volant/archive/2008/07/31/57620.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[瀵煎叆]鎼緩cppunit鍗曞厓嫻嬭瘯鐜http://www.shnenglu.com/volant/archive/2008/06/02/57611.html灝忓灝忓Mon, 02 Jun 2008 10:30:00 GMThttp://www.shnenglu.com/volant/archive/2008/06/02/57611.htmlhttp://www.shnenglu.com/volant/comments/57611.htmlhttp://www.shnenglu.com/volant/archive/2008/06/02/57611.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/57611.htmlhttp://www.shnenglu.com/volant/services/trackbacks/57611.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2008/06/02/2502339.aspx

灝忓 2008-06-02 18:30 鍙戣〃璇勮
]]>
[瀵煎叆]緇忓吀綆楁硶鈥斺旀眰鏈澶у瓙搴忓垪鍜?2) http://www.shnenglu.com/volant/archive/2008/04/07/57614.html灝忓灝忓Mon, 07 Apr 2008 12:16:00 GMThttp://www.shnenglu.com/volant/archive/2008/04/07/57614.htmlhttp://www.shnenglu.com/volant/comments/57614.htmlhttp://www.shnenglu.com/volant/archive/2008/04/07/57614.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/57614.htmlhttp://www.shnenglu.com/volant/services/trackbacks/57614.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2008/04/07/2256611.aspx

灝忓 2008-04-07 20:16 鍙戣〃璇勮
]]>
[瀵煎叆]緇忓吀綆楁硶鈥斺旀眰鏈澶у瓙搴忓垪鍜?1)http://www.shnenglu.com/volant/archive/2008/04/05/57615.html灝忓灝忓Fri, 04 Apr 2008 23:54:00 GMThttp://www.shnenglu.com/volant/archive/2008/04/05/57615.htmlhttp://www.shnenglu.com/volant/comments/57615.htmlhttp://www.shnenglu.com/volant/archive/2008/04/05/57615.html#Feedback0http://www.shnenglu.com/volant/comments/commentRss/57615.htmlhttp://www.shnenglu.com/volant/services/trackbacks/57615.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/volant_hoo/archive/2008/04/04/2252490.aspx

灝忓 2008-04-05 07:54 鍙戣〃璇勮
]]>
国产成人无码精品久久久免费| 中文成人久久久久影院免费观看| 97久久天天综合色天天综合色hd| 精品久久久久久无码免费| 一本综合久久国产二区| 精品久久人人妻人人做精品 | 国产精品无码久久久久久| 久久久久亚洲精品中文字幕 | 少妇内射兰兰久久| 2021国内久久精品| 99精品国产99久久久久久97| 国产精品久久婷婷六月丁香| 免费精品久久久久久中文字幕| 手机看片久久高清国产日韩| 久久亚洲国产成人影院网站| 亚洲精品97久久中文字幕无码 | 东方aⅴ免费观看久久av| 亚洲国产成人久久综合一区77| 欧美精品乱码99久久蜜桃| 要久久爱在线免费观看| 久久精品国产亚洲AV影院 | 久久久久亚洲AV成人网人人网站| 久久亚洲2019中文字幕| 无码任你躁久久久久久久| 久久成人国产精品免费软件| 色偷偷久久一区二区三区| 狠狠色丁香久久综合婷婷| 久久夜色精品国产亚洲av| 性色欲网站人妻丰满中文久久不卡| 99久久精品免费看国产| 久久久无码精品午夜| 综合久久国产九一剧情麻豆| 欧美精品一本久久男人的天堂| 精品久久久久久久国产潘金莲| 欧美喷潮久久久XXXXx| 国产精品无码久久久久| 精品多毛少妇人妻AV免费久久| 91超碰碰碰碰久久久久久综合| 亚洲欧美精品一区久久中文字幕| 91久久婷婷国产综合精品青草 | 久久夜色精品国产亚洲|