Sometimes I see people code something up like the following:
void AwesomeFunc( void )
{
if( var == 3 )
{
if( var2 == 4 )
{
if( var4 == "napkin" )
{
if( var5 == 8495 )
{
g_flag = true;
}
else
{
Debug.Log( "var5 wasn't 8495" );
}
}
else
{
Debug.Log( "var4 was not napkin" );
}
}
else
{
Debug.Log( "var2 wasn't 4" );
}
}
else
{
Debug.Log( "var wasn't 3" );
}
}
Read more…
I was a contract employee at Microsoft, an SDET I. While I was there I learned quite a lot about testing, and I really believe it made me a much better programmer. Although my time there was short lived, I managed to retain some of my testing knowledge, and I hope to share that with you now. So I’ll quickly and briefly cover the basics of testing. I’m not talking about unit testing either. I’ll break down the types of tests you have into different categories. There may be more.
- BVT (Base verification tests)
- –Positive test cases
- FVT (Functional verification tests)
- –Positive Test CasesĀ (Tester tests for expected failures )
- –Negative Test Cases (We catch unexpected failures during testing (hopefully) )
Read more…
Just a reminder how const-ness works. If I remember correctly.
// These two lines are the same type
// const and int can be switched around and the result is the same.
const int i;
int const j;
// If the word "const" follows the "*", it affects the pointer
int* const k;
// Both the pointer and the int are const
const int* const m;
// Same as line above, it just looks weird
int const * const n;
// Does the const affect the pointer or the int? The int..
int const * p;