Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: unit test Pin
toxcct17-Aug-06 6:05
toxcct17-Aug-06 6:05 
GeneralRe: unit test Pin
Zac Howland17-Aug-06 6:26
Zac Howland17-Aug-06 6:26 
GeneralRe: unit test Pin
Waldermort17-Aug-06 6:28
Waldermort17-Aug-06 6:28 
GeneralRe: unit test Pin
Zac Howland17-Aug-06 6:54
Zac Howland17-Aug-06 6:54 
GeneralRe: unit test Pin
led mike17-Aug-06 8:51
led mike17-Aug-06 8:51 
GeneralRe: unit test Pin
Zac Howland17-Aug-06 9:53
Zac Howland17-Aug-06 9:53 
GeneralRe: unit test Pin
led mike17-Aug-06 10:31
led mike17-Aug-06 10:31 
GeneralRe: unit test Pin
lucy17-Aug-06 6:09
lucy17-Aug-06 6:09 
here's the sample code:

<br />
BOOL IsValid(MyType *p)<br />
{<br />
     /* test whether MyType *p is valid.<br />
      * if valid, return TRUE.<br />
      * return FALSE otherwise */<br />
   <br />
     .....<br />
}<br />
<br />
void TestIsValid ()<br />
{<br />
     MyType a;<br />
     BOOL bRet;<br />
<br />
     bRet = IsValid (&a);<br />
     printf ("IsValid( ) returns %d.\n", bRet);<br />
}<br />


So I don't see I can use what you recommended first as:
<br />
BOOL IsValid (MyType *p)<br />
{<br />
   ...<br />
#ifdef _DEBUG<br />
    TestIsValid();<br />
#endif<br />
}<br />


I hope I made myself clear this time.
GeneralRe: unit test Pin
Waldermort17-Aug-06 6:26
Waldermort17-Aug-06 6:26 
QuestionCRT string macros Pin
Waldermort17-Aug-06 5:17
Waldermort17-Aug-06 5:17 
AnswerRe: CRT string macros Pin
Waldermort17-Aug-06 6:03
Waldermort17-Aug-06 6:03 
GeneralRe: CRT string macros Pin
Zac Howland17-Aug-06 6:07
Zac Howland17-Aug-06 6:07 
GeneralRe: CRT string macros Pin
Michael Dunn17-Aug-06 13:21
sitebuilderMichael Dunn17-Aug-06 13:21 
Questionpost build event in makefile Pin
rana7417-Aug-06 5:11
rana7417-Aug-06 5:11 
QuestionMultiByteToWide does not work without printf??? Pin
fvandun17-Aug-06 5:02
fvandun17-Aug-06 5:02 
AnswerRe: MultiByteToWide does not work without printf??? Pin
Zac Howland17-Aug-06 5:14
Zac Howland17-Aug-06 5:14 
GeneralRe: MultiByteToWide does not work without printf??? Pin
fvandun17-Aug-06 5:29
fvandun17-Aug-06 5:29 
GeneralRe: MultiByteToWide does not work without printf??? Pin
Zac Howland17-Aug-06 5:41
Zac Howland17-Aug-06 5:41 
GeneralRe: MultiByteToWide does not work without printf??? Pin
fvandun17-Aug-06 5:55
fvandun17-Aug-06 5:55 
GeneralRe: MultiByteToWide does not work without printf??? Pin
Zac Howland17-Aug-06 5:58
Zac Howland17-Aug-06 5:58 
GeneralRe: MultiByteToWide does not work without printf??? Pin
fvandun17-Aug-06 6:07
fvandun17-Aug-06 6:07 
QuestionLimited Users Pin
Dave Kerr17-Aug-06 4:58
Dave Kerr17-Aug-06 4:58 
QuestionMicrosoft Access Database Import to VC++ Windows Forms Pin
Nokoff17-Aug-06 4:56
Nokoff17-Aug-06 4:56 
AnswerRe: Microsoft Access Database Import to VC++ Windows Forms Pin
cje17-Aug-06 5:15
cje17-Aug-06 5:15 
QuestionWindows Directory Pin
si_6917-Aug-06 4:49
si_6917-Aug-06 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.