Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help in creating c++ stubs.

Need help in creating c++ stubs.

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++testingbeta-testinghelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maya_
    wrote on last edited by
    #1

    Hi Everyone, I'm working on a NT service which calls other Services in another machine. I know that for unit testing we can write stubs for other remote services to test the service. I've searched on the net but i couldn't find any tutorial to do this. Can anyone please tell me how to write stubs (the basic idea, i've absolutely no idea where to start) or direct me to any tutorial that would help me?? Regards,

    L 1 Reply Last reply
    0
    • M Maya_

      Hi Everyone, I'm working on a NT service which calls other Services in another machine. I know that for unit testing we can write stubs for other remote services to test the service. I've searched on the net but i couldn't find any tutorial to do this. Can anyone please tell me how to write stubs (the basic idea, i've absolutely no idea where to start) or direct me to any tutorial that would help me?? Regards,

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You just write a method with the same signature as the 'real' function, and add your own code to return a good or bad status as appropriate. For example the Windows function GetFileVersionInfo() could be coded like this

      BOOL GetFileVersionInfo(LPCTSTR lptstrFilename,
      DWORD dwHandle,
      DWORD dwLen,
      LPVOID lpData
      )
      {
      OutputDebugString("My test");

      return TRUE;
      

      }

      MVP 2010 - are they mad?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups