u can do this with a CppUnit::TestCase.
-u can create for example a costum Class , MyClass: public TestCase
-pass the data in the class constructor
-implement the virtual void runTest() function of TestCase Class
After that u create a CppUnit::TestSuite that contain all your Tests with the right parameters.
-u add the suite to your TestRunner
-and run them
Sorry for my bad english ;)
Good luck
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I basically want to test a particular method multiple times with different data (>50 different datasets).
Is there any way to easily execute a test and pass it some custom data? The pseudocode below should demonstrate what I mean:
// Pseudocode
t_data somedata[50];
...
for (int i = 0; i < 50; i++)
sometest.run(somedata[i]);
You can't pass data directly to unit tests, but you could have multiple unit tests call a function that takes as a parameter this test data.
u can do this with a CppUnit::TestCase.
-u can create for example a costum Class , MyClass: public TestCase
-pass the data in the class constructor
-implement the virtual void runTest() function of TestCase Class
After that u create a CppUnit::TestSuite that contain all your Tests with the right parameters.
-u add the suite to your TestRunner
-and run them
Sorry for my bad english ;)
Good luck