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 "pch.h"

#include "CppUnitTest.h"

#include "IntControlButton.h"

#include "Utilility.h"

#include "isolator.h"

#include <GL/gl.h>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace TestVrHelper

{

TEST_CLASS(TestVrHelper)

{

public:

IntControlButton* btn = nullptr;

TEST_METHOD_CLEANUP(TearDown)

{

if (btn != nullptr)

{

delete btn;

}

ISOLATOR_CLEANUP();

}

TEST_METHOD_INITIALIZE(SetUp)

{

FAKE_GLOBAL(glBegin);

WHEN_CALLED(glBegin(GL_LINE_LOOP)).ReturnFake();

FAKE_GLOBAL(glEnd);

WHEN_CALLED(glEnd()).ReturnFake();

FAKE_GLOBAL(glColor4fv);

FAKE_GLOBAL(XPLMGetFontDimensions);

FAKE_GLOBAL(XPLMDrawString);

FAKE_GLOBAL(glVertex2i);

FAKE_GLOBAL(XPLMFindDataRef);

WHEN_CALLED((XPLMFindDataRef("sim/cockpit2/radios/actuators/com1_standby_frequency_hz_833"))).Return(1);

FAKE_GLOBAL(XPLMGetDatai);

WHEN_CALLED(XPLMGetDatai((XPLMDataRef)1)).Return(123456);

FAKE_GLOBAL(XPLMSetDatai);

btn = new IntControlButton(ButtonBase::com, "sim/cockpit2/radios/actuators/com1_standby_frequency_hz_833", Utilility::IntValToText3n3d, Utilility::TextToIntVal3n3d, 7,

Utilility::InsDigIntVal3n3d, Utilility::DeleteVal3n3d);

}

TEST_METHOD(TestMethod1)

{

Assert::IsFalse(btn->selected);

}

};

}

It fails on the TEST_METHOD line.
asked ago by John Clapson (600 points)

1 Answer

0 votes
Hi John,

Please make sure you have the following lines in the Post-Build Event:

copy "C:\Program Files (x86)\Typemock\Isolator++\bin\x64\IsolatorCore.dll" "$(ProjectDir)\x64\Debug"
copy "C:\Program Files (x86)\Typemock\Isolator++\bin\x64\msdia140.dll" "$(ProjectDir)\x64\Debug"
copy "C:\Program Files (x86)\Typemock\Isolator++\bin\x64\symsrv.dll" "$(ProjectDir)\x64\Debug"

To add them, in Visual Studio, right-click on your test project -> Properties and go to the Post-Build Event tab -> Command Line and paste the lines above. Try rerunning your tests and see if that fixes the issue.

If this doesn't help, please send me logs for the test run. I will send you a separate email where you can send them to me. To enable logs, open your Isolator++ Configuration tool located in your installation directory, and under Settings, click on Enable Logging. Now run the test again to create the logs.

Best,
Tom Milchman
Typemock Support Specialist
answered ago by Tom_Typemock (1.2k points)
...