Boost unit test?

C

carl

I am writing unit-test using boost. Now for all the tests (5 at the moment)
I need to load two rather large images.

Is it possible to define a Boost unit test function that gets run once
before all the tests where I can put this loading of images so I don't have
to do it in each of the tests?
 
G

Gert-Jan de Vos

I am writing unit-test using boost. Now for all the tests (5 at the moment)
I need to load two rather large images.

Is it possible to define a Boost unit test function that gets run once
before all the tests where I can put this loading of images so I don't have
to do it in each of the tests?

Read about fixtures or the test initialization function in the boost
unit test
documentation. The examples show what you want.
 
C

carl

I am writing unit-test using boost. Now for all the tests (5 at the
moment)
I need to load two rather large images.

Is it possible to define a Boost unit test function that gets run once
before all the tests where I can put this loading of images so I don't
have
to do it in each of the tests?

Read about fixtures or the test initialization function in the boost
unit test
documentation. The examples show what you want.

Thanks this was perfect:

http://www.boost.org/doc/libs/1_37_0/libs/test/doc/html/utf/user-guide/fixture/global.html
 
R

Richard

[Please do not mail me a copy of your followup]

"carl" <[email protected]> spake the secret code
I am writing unit-test using boost. Now for all the tests (5 at the moment)
I need to load two rather large images.

Is it possible to define a Boost unit test function that gets run once
before all the tests where I can put this loading of images so I don't have
to do it in each of the tests?

You might want to look at my 5-part tutorial on using Boost.Test:
Part 1 <http://tinyurl.com/ns4bvx>
Part 2 <http://tinyurl.com/mavghy>
Part 3 <http://tinyurl.com/msf4hb>
Part 4 <http://tinyurl.com/meduqo>
Part 5 <http://tinyurl.com/nserw5>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top