I want to generate some random values for my parametrized googletest tests. Here two problems occur:
- I want to use built-in C++ rand() function, but generated numbers repeats in all tests. Then, I tried to use
GetParam()
as seed, but I have problems with assigning the value returned by this function to srand() function. It is attached to question with the necessity to make const to non-const cast, I use different variants of static_cast, and const_cast from const int to long int*, but none has been even compiled. - Maybe there is a built-in function in Google Tests for generating a random set of variables used for tests? I dig through documentation, but there is hardly anything about that.
Aucun commentaire:
Enregistrer un commentaire