|
Yes
Have a nice code day
|
|
|
|
|
Add the .cpp file to the project and #include the .h file whereever you need.
It should compile and link properly.
-Prakash
|
|
|
|
|
Iam a beginer in testing and i need help in writing unit test cases. I have a Software specification document, use cases , my problem is how can i write unit test cases?
bigbluff
|
|
|
|
|
what software do you write your tests with ?
to get started, you have to consider for each part tested (in general, functions one by one) the purpose of it. then you initializes the context of which the function is called, the you know exactly what it is supposed to do, so, what would be either the result and the context left.
you must test this...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
Before start writing the test cases, you should know your software well. You should proficient and Should have step by step knowledge of your project. what are the previous step, next step, input and output etc.
try to go through some existing test cases of your project. I think this will helps you..
best of luck.
regards
Vallikumar A
|
|
|
|
|
I would like to do a Dependency/sequential build on the files in .NET.
For example, I have 2 files x.c and y.c.
Compiling and Linking of x.c needs y.z( the output of y.c).
But since .NET builds in alphabetical order, I cannot aceheve this.
I have seen similar behaviour in VC++ 6.0 as well.
Is there a way to do this?
kvprasad
your future is what you think
|
|
|
|
|
I use MSVC6 - Select "Project->Dependencies...". I'm sure VS.NET has a similar option.
Steve
|
|
|
|
|
I have a dialog with about 5 CEdit fields,
CEdit1, CEdit2,..... CEdit5.
Currently, when I clicked the TAB key,
the cursor will jump from CEdit1 to
CEdit3 instead of CEdit2.
Can someone tell how to fix it?
Thanks,
Kevin
|
|
|
|
|
|
open dialog in resouce editor for which you want to change tab order. Then in the menu you will see format, there is taborder option in it, click it and you will be able to change tab order by clicking controls in the order we you them to be selected when pressing tab.
-Saurabh
|
|
|
|
|
Great! I fixed it.
Thanks for your help!
Kevin
|
|
|
|
|
|
I've seen in many source codes, some statements written in #if 0 block something like:
#if 0
printf("Blah Blah");
#endif
Please tell me what is the meaning of #if 0 in the code above.
|
|
|
|
|
Imtiaz Murtaza wrote: I've seen in many source codes, some statements written in #if 0 block something like:
#if 0
printf("Blah Blah");
#endif
Please tell me what is the meaning of #if 0 in the code above
it simply means the code in side the block is ignore for compilation and will not appear in the final build.
it is similar to saying
#if !defined(SOME_BUILD_FLAG) or<br />
#if FALSE<br />
<br />
#endif
since the dev wanted the code to be explicitly removed from compilation he used
#if 0<br />
#endif
directive
-Prakash
|
|
|
|
|
Mr.Prakash wrote:
it simply means the code in side the block is ignore for compilation and will not appear in the final build.
Then what is the purpose of the code inside that block ?
For example, if the code is written in #ifdef DEBUG block, it is skipped in the release builds but its purpose is clear and that is: it will be compiled in debug builds. So what is the purpose of writing code in #if 0 when i'll never be present in the executable.
|
|
|
|
|
There are many reasons to use
#if 0
Actually, I do it all the time.
Here is my reason.
Let say I re-write some code/method/function
and I think it should work.
But I would like to keep the old code
around. Just in case......
I know I can retrieve the old code
from the source control. However, it's
more convinence if I have the old
code right next to the new code.
Kevin
|
|
|
|
|
I hate #if 0 . It's not so bad if the code commented out is small, but when large pieces of code are bracketed with these you can find yourself analyzing code only to find, when you get to the top, that you've been wasting your time and the code isn't even part of the product. This has happened to me many times. If the programmer simply commented it out the syntax highlighting will stop such problems from ever occurring.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I hate #if 0
me too.
i use this purpose instead...
#ifdef DEBUG
#define DPRINT printf
#else
void DPRINT(...) {}
#endif
this way, in debug mode, we could DPRINT() something, which will not been took in account in release mode (and more, the compiler will optimize a call to DPRINT() in release).
for instance :
int Foo() {
DPRINT("Foo()\n");
int i = 654;
DPRINT("Foo output : %d\n", i);
return i;
}
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
you can #if 0 the code which needs to be ignored in both debug and release build, i.e. older logic to solve a problem, etc.
-Prakash
|
|
|
|
|
Yes steve u r definetly correct. But this is not supposed to be used to large chunks of code. it is more of an debugging approach than just saving old code.
Tip: Always it is a good option to try to put a breakpoint to know if this code is compiled or not. a breakpoint cannot be inserted in any code that is not compiled.
Hope this helps.
kvprasad
your future is what you think
|
|
|
|
|
Stephen Hewitt wrote: If the programmer simply commented it out...
But nested comments are not allowed. That's where #if 0 is of use.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
|
I agree that large blocks of #if 0 'd code are annoying but VS2005 improves things a lot by greying it out. It even greys out (for example) #ifdef _DEBUG blocks when _DEBUG is not defined.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
I believe that in Visual C++ 6.0 there is a key combination that will take you to / from
#if
and
#endif
but Microsoft in their 'wisdom' removed this very handy functionality from VC++.NET 2001. Yes, thanks Microsoft...
Personally, when I need to comment out large chunks of code, I use
#if defined dfkagtljarogh
#end if // defined dfkagtljarogh
where dfkagtljarogh is the result of some random keystrokes. Copy and paste to make sure that two instances match, and then it is not too bad to use Find to jump from beginning to end or vice versa.
And as for being unable to nest /* ... */ comments in C++, this is an abomination that should never have been put into the language. Is there any reason whatsoever why C++ (or C even) HAVE TO REFUSE to allow such useful nested comments?
Thanks again, Microsoft. Some C++ compilers do allow this.
Shraddhan
|
|
|
|
|
Shraddhan wrote: And as for being unable to nest /* ... */ comments in C++, this is an abomination that should never have been put into the language. Is there any reason whatsoever why C++ (or C even) HAVE TO REFUSE to allow such useful nested comments?
yes i agree with you and that is one thing that I hate in VC++ compiler.
-Prakash
|
|
|
|