[boost][test] - BOOST_FIXTURE_TEST_SUITE, BOOST_FIXTURE_TEST_CASE clarification

In 1.33.1 release, is the following true? BOOST_FIXTURE_TEST_SUITE( suite_name, F ); //not supported BOOST_FIXTURE_TEST_CASE( test_name, F ); //not supported Thanks, Ed

Ed Johnson wrote:
In 1.33.1 release, is the following true?
BOOST_FIXTURE_TEST_SUITE( suite_name, F ); //not supported BOOST_FIXTURE_TEST_CASE( test_name, F ); //not supported
Thanks,
Ed
BOOST_FIXTURE_TEST_SUITE wouldn't compile. BOOST_FIXTURE_TEST_CASE compiled and worked fine at first glance. However, I made a BOOST_FIXTURE_TEST_CASE into a friend function of my testee class, and got a compiler error. BOOST_AUTO_TEST_CASE works fine as a friend function of a testee. Using 1.33.1

"Ed Johnson"
Ed Johnson wrote:
In 1.33.1 release, is the following true?
BOOST_FIXTURE_TEST_SUITE( suite_name, F ); //not supported BOOST_FIXTURE_TEST_CASE( test_name, F ); //not supported
Thanks,
Ed
BOOST_FIXTURE_TEST_SUITE wouldn't compile.
It's later addition
BOOST_FIXTURE_TEST_CASE compiled and worked fine at first glance.
Ok.
However, I made a BOOST_FIXTURE_TEST_CASE into a friend function of my testee class, and got a compiler error.
BOOST_FIXTURE_TEST_CASE is a macro. I am not sure what you are trying to do by declaring it a friend?
BOOST_AUTO_TEST_CASE works fine as a friend function of a testee.
The same here. Gennadiy

Gennadiy Rozental wrote:
"Ed Johnson"
wrote in message news:e3g5qn$rks$1@sea.gmane.org... Ed Johnson wrote:
In 1.33.1 release, is the following true?
BOOST_FIXTURE_TEST_SUITE( suite_name, F ); //not supported BOOST_FIXTURE_TEST_CASE( test_name, F ); //not supported
Thanks,
Ed BOOST_FIXTURE_TEST_SUITE wouldn't compile.
It's later addition
BOOST_FIXTURE_TEST_CASE compiled and worked fine at first glance.
Ok.
However, I made a BOOST_FIXTURE_TEST_CASE into a friend function of my testee class, and got a compiler error.
BOOST_FIXTURE_TEST_CASE is a macro. I am not sure what you are trying to do by declaring it a friend?
I want to be able to test private members of my classes while using the Auto Test framework. I won't test private data that often, so it's not that big a deal to use the BOOST_AUTO_TEST_CASE for those occasions. We discussed it in this thread: [Unit-Test] How to test private functions
BOOST_AUTO_TEST_CASE works fine as a friend function of a testee.
The same here.
Gennadiy

BOOST_FIXTURE_TEST_CASE is a macro. I am not sure what you are trying to do by declaring it a friend?
I want to be able to test private members of my classes while using the Auto Test framework. I won't test private data that often, so it's not that big a deal to use the BOOST_AUTO_TEST_CASE for those occasions.
Let me repeat. *BOOST_FIXTURE_TEST_CASE is a macro*. Declaring it as a friend doesn't help you in any way. Gennadiy

Gennadiy Rozental wrote:
BOOST_FIXTURE_TEST_CASE is a macro. I am not sure what you are trying to do by declaring it a friend? I want to be able to test private members of my classes while using the Auto Test framework. I won't test private data that often, so it's not that big a deal to use the BOOST_AUTO_TEST_CASE for those occasions.
Let me repeat. *BOOST_FIXTURE_TEST_CASE is a macro*. Declaring it as a friend doesn't help you in any way.
Gennadiy
I'm comfortable with the fact that BOOST_FIXTURE_TEST_CASE will not work with friend. However, isn't BOOST_AUTO_TEST_CASE also a macro? We both agreed in this thread that BOOST_AUTO_TEST_CASE worked as a friend function, right?

"Ed Johnson"
Gennadiy Rozental wrote:
BOOST_FIXTURE_TEST_CASE is a macro. I am not sure what you are trying to do by declaring it a friend? I want to be able to test private members of my classes while using the Auto Test framework. I won't test private data that often, so it's not that big a deal to use the BOOST_AUTO_TEST_CASE for those occasions.
Let me repeat. *BOOST_FIXTURE_TEST_CASE is a macro*. Declaring it as a friend doesn't help you in any way.
Gennadiy
I'm comfortable with the fact that BOOST_FIXTURE_TEST_CASE will not work with friend.
However, isn't BOOST_AUTO_TEST_CASE also a macro? We both agreed in this thread that BOOST_AUTO_TEST_CASE worked as a friend function, right?
No. We did not. BOOST_AUTO_TEST_CASE is a macro also. And whatever you do defining macro as a friend wont help you. I am bit confused that I need to explain this. What do you expect to achieve by defining macro as a friend? It's just invalid C++. (Well not exactly, but that is definitely not what you expect it to be) Gennadiy
participants (2)
-
Ed Johnson
-
Gennadiy Rozental