I'm attempting to write unit tests in which we call the constructor to a generic class in the form:
void testConstructor() {
int argc = 2;
ACE_TCHAR* argv[] = {"Input1", "Input2"};
MyClass *myClass = new MyClass(argc, argv);
/**processing**/
}
Think of ACE_TCHAR*
the same as char*
. The code above results in
warning: deprecated conversion from string constant to ‘ACE_TCHAR*’
I have also tried:
void testConstructor() {
int argc = 2;
ACE_TCHAR* argv[2];
argv[0] = "Input1";
argv[1] = "Input2";
MyClass *myClass = new MyClass(argc, argv);
/**processing**/
}
Which results in the same error.
I read online somewhere that this could be mitigated by using
const ACE_TCHAR* argv[] = {"Input1", "Input2"};
But then the compile fails because of the function signature.
Edit: I'm not allowed to modify the 3rd party code, I'm only writing unit tests for it.
Any ideas?