Answer the question
In order to leave comments, you need to log in
How to combine UnitTest with C++ assert?
Let's say there is a function that receives a certain name. This name does not come from outside (from the user) and must obey certain rules. To ensure that the obscene name does not get to us, I make an assert, pseudocode:
void Foo(string)
{
assert(CheckName(string));
…
}
Question: is there a way to write a test case for Foo so that the assert will work and the test will pass?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question