I am working on Rhapsody 7.6 and testConductor version 2.4.4
I have been using animation based testing for System testing but now I am trying to use assertion based testing for unit testing.
I want to do unit testing . Please answer my following queries:
1. Can Rhapsody 7.6 with TC can be used be for Unit testing in RiCPP using assertion mode?
2. When i create a simple project with one class and create a test Architecture on this class. I am able to build my test component.
However when i create a testcase in this test package, And update and build my test cases, I start getting strange errors:
C:\Development\3.1\3.1_7.6\Subsystems\Pkg\New Folder\Project\Project\TPkg_class_0_Comp\DefaultConfig\TPkg_class_0\TCon_class_0_TestControl\CSC_SD_tc_0.h(75) : error C2061: syntax error : identifier 'TCon_class_0'
C:\Development\3.1\3.1_7.6\Subsystems\Pkg\New Folder\Project\Project\TPkg_class_0_Comp\DefaultConfig\TPkg_class_0\TCon_class_0_TestControl\CSC_SD_tc_0.h(188) : warning C4520: 'TPkg_class_0::TCon_class_0_TestControl::CSC_SD_tc_0' : multiple default constructors specified
TPkg_class_0\TCon_class_0_Architecture\TCon_class_0.cpp(65) : warning C4355: 'this' : used in base member initializer list
TPkg_class_0\TCon_class_0_Architecture\TCon_class_0.cpp(65) : error C2664: 'TPkg_class_0::TCon_class_0_TestControl::CSC_SD_tc_0::CSC_SD_tc_0(IOxfActive *)' : cannot convert parameter 1 from 'TPkg_class_0::TCon_class_0_Architecture::TCon_class_0 *const ' to 'IOxfActive *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Here CSC_SD_tc_0 is a arbiter class which is generated when testcase is created.
TCON_class_0 is test context class
Please help me to answer my queries
chr_btc-es 270002EDQ977 Posts
Re: Rhapsody 7.6 and Unit testing2012-11-07T08:57:02ZThis is the accepted answer. This is the accepted answer.Hi,
1. Assertion based testing mode is available since Rhapsody 7.6 (for C++ and C).
2. Can you try to do Code->Clean and then build again, does this solve the errors?
If not, please attach your model and I will take a look.
RichaM 270002DMXT70 Posts
Re: Rhapsody 7.6 and Unit testing2012-11-07T09:20:25ZThis is the accepted answer. This is the accepted answer.
- chr_btc-es 270002EDQ9
However i am not able to find any sample project for assertion based testing. I am not sure how TC will judge whether my test case is passing or failing
chr_btc-es 270002EDQ977 Posts
Re: Rhapsody 7.6 and Unit testing2012-11-07T17:21:11ZThis is the accepted answer. This is the accepted answer.
- RichaM 270002DMXT
basically, TestConductor adds some assertions to the test code. These assertions are checking the return values or in/out arguments while executing the tests with the specified values. You can see this for example in the body of the DriverOperations/StubOperations in the model or in the generated code for the TestComponents.
Regarding samples, please see my answer to your other posting.