views:

65

answers:

3

Hi, I am new for the Unit Testing Can some one tell me where this testing class is defined in the following code and how can i find it ?

#ifndef UT_USERSESSIONMANAGER_
#def UT_USERSESSIONMANAGER_
#include<gmock/gmock-genral.h>  //If define in this then how can i find it
#include<"pre_include.hpp">    //I am sure not define in this
#include<"pre_usersession.hpp">//I am sure not define in this

using namespace pre;

class Ut_UserSessionManager:public::testing::test
{
 public:
  Pre_UserSessionManager *UserSessionFailure;
  Pre_UserSessionManager *UserSessionSuccess;
 public:
  virtual void Setup();
  virtual void TearDown();
}
A: 

If you are using MSVC goto Tools -> Options -> VC++ Directories to locate your include path which would be containing all the header file paths.

If using Linux/UNIX, go to your Makefile, search for INCLUDE PATH which would list down all your include path directories.

#include <iostream>
or
#include "include.h" 

not both # and "

DumbCoder
A: 

If this code already compiles and links and you are using Visual Studio then maybe you want to switch on the creation of browse information. Then when the build has finished place your cursor on the symbol in question and hit the F12 key.

But it's probably not that simple ...

Typically you will find the declaration of classes in header files and the definition (= implementation) in source files (*.cpp) or in libraries (note that this is just a general statements and there is more to this e.g. when using templates). So if the compiler complains then make sure you include the correct header files. If the linker complains make sure you have added the correct libraries.

To find out the hierarchy of your includes and/or locate symbols in your C++ source code you may find SourceNavigator(open source @ SourceForge) a useful tool. Sometimes it can be daunting to track this type of information down in C++. Admittedly the tool is a bit dated but it may nevertheless be helpful.

John
A: 

The class ::testing::Test (mind the case sensitivity) is part of the googletest framework and can be found in those files:

  • gtest.h declaration
  • gtest.cc definition

If the other answers don't help you find those files, just do a search on your disk...

nabulke