I have a structure that I used to populate Class Structures with values:
MyType structMy[] =
{
{ START, INTEGER_TYPE, 3, (void *)&classStart->statusStart.set },
{ STABLE, CHAR_TYPE, 5, (void *)&classtStable->statusStable.set },
{ STOP, DOUBLE_TYPE, 1, (void *)&classStop->statusStop.set }
}
But for testing and validation I want to add test cases to the structure: some values which depend on the defined data type per line and number of values.
But because of the structure setup and 1 value or an array, I think I need a (void*). But the compiler doesn't like it. What can I do to write an array into a structure where data types can change?
MyType structMy[] =
{
{ START, INTEGER_TYPE, 3, (void*){0, 1, 2} },
{ STABLE, CHAR_TYPE, 5, (void*){'A', 'B', 'C', 'D', 'E'} },
{ STOP, DOUBLE_TYPE, 1, (void*){2.4} }
}