How to check statements?

I use a single test environment to test my libraries. I have quite a few statements in the library to make sure that programmer errors are caught in debug builds. Now I want to make sure that I test all possible errors of the programmer.

eg. in the Table class, I want to make sure that the rows and columns are no more than the rows and columns of the table. Suppose I forgot to test cols. I would like my unit tests to run a test in which an assertion should be run, and if not, skip the test. Is it possible?

+3
source share
3 answers

, , , <cassert>, ? , , . , assert <cassert>. Unit test , CUTE, ASSERT_THROWS . .

, , , assert . abort . . .

+2

:

  • , (, , ),

  • , , , .

, unit test . , unit test, Python ++ ( " ": , , ), - , , , , .

, , - AFAIK .

hth.

+2

, , , , google.

"boost unittest test assert" StackOverflow: Boost Test

"cppunit test assert" :

.

0

All Articles