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
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes

Hi

I am evaluating Isolator++ 1.3.4.0 with VS 2012 and fighting some error with exception code C0000005 (ACCESS_VIOLATION).

I was able to get Isolator++ up and running in a simple dummy setup (one lib-project with MyTurtle class, one MS Test project). So far so good.

Now I have transfered my dummy class I want to fake (MyTurtle) into my real project and did the steps described in the Online Help "Setting up MS Test".

The result is a failing test. An exception is thrown with exception code C0000005 indicating an ACCESS_VIOLATION.

Any help is highly appreciated! I am stuck...

Cheers

Christoph

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Here is the stacktrace I get:

Result Message:    Exception code: C0000005
Result StackTrace:    
at FAKE<MyTurtle>() in c:\program files (x86)\typemock\isolator++\include\fortests\isolator.h:Line 357
    at MyTests::MyMockTests::MyTurtleTest() in somePath\mymocktest.cpp:Line 18
 

Here is my test class:

#include "stdafx.h"
#include "CppUnitTest.h"

#include <isolator.h>

#include "MyTurtle.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace MyTests
{
   TEST_CLASS(MyMockTests)
   {
   public:

      TEST_METHOD(MyTurtleTest)
      {
         MyTurtle* t = FAKE<MyTurtle>();
         WHEN_CALLED(t->GetX()).ReturnVal(42);

         Assert::AreEqual(42, t->GetX());

         ISOLATOR_CLEANUP();
      }

   };
}

 

asked by intertag (3.1k points)

1 Answer

0 votes
Hi Christoph,
 
This is an interesting error.
First of all make sure your test project and real project defined the same.
To check it you can do a simple test like this:

TEST_METHOD(MyTurtleTest)
{
	MyTurtle* t = new MyTurtle();
	t->GetX();
}
In any case we shouldn't throw an ACCESS_VIOLATION exception in cases like this.
I'll contact you privately to investigate more further.
answered by inga (320 points)
...