Run Time Error : All tests in the same test case must use the same test fixture class.

753 views
Skip to first unread message

Mf_Soul

unread,
Jul 26, 2013, 11:28:06 AM7/26/13
to googletes...@googlegroups.com
Hello All,
I am trying to test legacy C code. I have created a fixture class in namespace.
namespace {

    class ABC : public ::testing::Test{
    protected:
    ABC(){ //some default initializations};
   ~ABC();
};
Test_F(ABC,genralreject)
{
}
}//end of namespace.

When I am trying to run above code I am getting error saying 
"./src/gtest.cc:1995: Failure
Failed
All tests in the same test case must use the same test fixture
class.  However, in test case GetDaqListInfo,
you defined test commandsyntaxNRC and test commandsyntaxNRC
using two different test fixture classes.  This can happen if
the two classes are from different namespaces or translation
units and have the same name.  You should probably rename one
of the classes to put the tests into different test cases."

I have written only one test case still I am getting message
 "[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up."

Thank you in advance..!!

Josh Kelley

unread,
Jul 27, 2013, 10:11:04 PM7/27/13
to Mf_Soul, Google C++ Testing Framework
Your sample code refers to test case ABC, test genralreject, but the error message refers to test case GetDaqListInfo, test commandsyntaxNRC.  Apparently you're linking in test code besides the code you've posted, and there's some sort of error there.  (Without actually seeing the problematic code, I'm not sure what's actually causing this error.)

--
Josh Kelley


--
 
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages