chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes

#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

closed with the note: This issue has been resolved, and a fix will be included in the next official release of Isolator++ on Sunday.
asked ago by John Clapson (1.1k points)
closed ago by Tom_Typemock
I have managed to test this using typemock++ version 4. The new version 5 does not like the optimised code for x plane.
Hi John,

Thank you for the provided information.
I'm happy to hear that you were able to make It work with Typemock++ V4.
We are working on reproducing this issue in V5 on our computers so we can solve this asap.

We will keep you posted on our progress.

Best,
Alon Sapozhnikov.
Support Specialist.

1 Answer

0 votes
This issue has been resolved, and a fix will be included in the next official release of Isolator++ on Sunday.
answered ago by Tom_Typemock (1.2k points)
...