Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 950319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:32:45+00:00 2026-05-15T23:32:45+00:00

I am maintaining a server application written in C many years ago. It has

  • 0

I am maintaining a server application written in C many years ago. It has very few unit tests (cxxtest) and I am thinking about developing more.

I read on the subject of unit testing C programs in the last days and tried a few things also. The right thing to do appears to be to include the .c file containing the function to test from my test suite. However, because that .c file contains many functions calling many others, there are lots dependencies I have to deal with before I can start the real work.

What I would like to do is to “turn off” all functions I’m not interested with for a particular test. I would stub those called by my function under test. I am considering putting ifdef around my functions if it’s what it takes.

Is there a better solution or a framework addressing this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:32:46+00:00Added an answer on May 15, 2026 at 11:32 pm

    Cmock solves most of my problem. I gave up on the idea of isolating a single function. I will be fine if I can isolate one C file from another. Cmock allows me to do that quite conveniently (and even more).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am maintaining an application that has classes (written in 2005) that extend javax.xml.messaging.JAXMServlet
I'm maintaining an application that uses SQL Server Express 2005 as the back end.
My team is maintaining a huge Client Server win32 Delphi application. It is a
We have a mid-size SQL Server based application that has no indexes defined. Not
Our server application runs as a service and has a ASP.NET MVC3 web-based frontend
I am maintaining an application which has been designed like this: messy code --abuses-->
A new client of mine has a small VB/Access database application written in 2002
I'm currently maintaining an application and noticed that many of the objects that have
I'm currently maintaining some web server software and I need to perform a lot
I am maintaining a function in SQL Server 2005, that based on an integer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.