Anda di halaman 1dari 2

Q1.Status Access denied?

1.it is try to raise some exception which may be code defined for ex.loggers
2.trying to write a variable which is read only (private variables of a class ar
e read only).
Q2.failed to execute MI command.?
1.The object of a class is not created properly because the members or the membe
r classes are not defined properly.
because of which the compiler is not getting either the address of the variabl
e or instance of the class.
2.the reference created for the class cannot be accessed.
A reference to a class is different than the address of the class it is the cl
ass itself.
A class which is referenced inside a class cannot be initialized by new operat
or as it gives the pointer to the object.
The references are initialized within the
Q3.What is singleton?
one and only one object of a type in system.
while defining the constructor of singleton class you should call the singleton
function with this pointer as argument to store the address of the object or els
e
when you are creating the instance of the object it will not get the address of
the object and it can do nothing as it doesn't know where to point to.
Q4.cannot call member function without object.
You need to instantiate an object in order to call its member functions. The mem
ber functions need an object to operate on,they can't just be used on their own.
Q5 cannot initialize an abstract class/ cannot create an object of an abstract c
lass.
if a class has even a single pure virtual functions it is defined as abstract cl
ass.The object of an abstract class cannot be created only pointers and referenc
es of
the class can be created. An abstract class can only be initialized by the deriv
ed class.
Process:
The files to be created are:
1.testrte_gen.rb :
this files helps in the creation of testrte, the one has to define the interface
s and datatypes paths which are being used in the module working on.
2.rakefile.rb:
copy this from other module and change the module name inside it.
3.Project.meta
configure this for Unit_Test.
define the paths which you will be using in the project.
4. if doing for FEM then configure .cproject for unit testing.
Folder creation and test-case writing:
A test folder has to be created inside the module containing tree as shown in pi
cture.
The folder include under test will contain the header files required to write a
nd execute the test cases.
In CPP-Unit the test-cases are just another function in which we can call functi
ons from the c files of the application with desired values assigned to the vari
ables and
according to which we depict the possible outcome, which if does than the test c
ase is passed or failed.

So the test case function which we make has to be declared and then defined.The
declaration is done in the include folder and the definition of the function is
done in src folder. Then a main function is required to call the test-case funct
ion which is done by the testrunner source file and header file which
will be copied in the respective header and source folder which will execute the
test cases.
now as we need to access the variables and the functions of the application for
which we will declaring the mock or dummy functions which they were
calling from outside of the module those functions headers or source will be def
ined in the respective folder under mock folder.
Generating testrte:
Then rte has to be generated to execute the test cases.
In bdc run the command rake testrte on command console window on the module fold
er.
In fem it can be done either by running the batch file made to generate the test
rte or by console command ruby testrte_gen.rb
Once rte is generated build the project and run the executable to run the test c
ases.
To know the coverage the command gcover ./ -b -l has to be run on the command wi
ndow on the workspace folder.

Anda mungkin juga menyukai