#include "CppUnitTest.h"
#include "Isolator5.h"
#include "IntControlButton.h"
#include "Utilility.h"
using namespace Typemock;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
TEST_CLASS(TestComButton)
{
public:
Isolator* a = nullptr;
IntControlButton* btnPtr = nullptr;
TEST_METHOD_INITIALIZE(SetUp)
{
a = new Isolator();
// Arrange fixture wide fakes...
char com[] = "sim/cockpit2/radios/actuators/com1_standby_frequency_hz_833";
btnPtr = new IntControlButton(ButtonBase::com, com, Utilility::IntValToText3n3d, Utilility::TextToIntVal3n3d, 7,
Utilility::InsDigIntVal3n3d, Utilility::DeleteVal3n3d);
}
TEST_METHOD_CLEANUP(TearDown)
{
delete a;
delete btnPtr;
a = nullptr;
btnPtr = nullptr;
}
TEST_METHOD(constructor)
{
Assert::IsFalse(btnPtr->selected);
if (btnPtr != nullptr)
{
char* testText = a->Variable.Get<char*>(A::Member(btnPtr, text));
//Assert::IsTrue(strcmp(testText, "com") == 0);
//Assert::IsTrue(ButtonBase::com == btnPtr->btnType);
//char* dataRefNa = a->Variable.Get<char*>(A::MemberByName(btnPtr, "dataRefName"));
//Assert::IsTrue(strcmp("sim/cockpit2/radios/actuators/com1_standby_frequency_hz_833", dataRefNa) == 0);
}
}
};
The bold line fails to compile due to 'potentially uninitialized local pointer variable 'value' used', however as a far as I can tell all of my variables are initialised. Any idea what's causing this?
Thanks John