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 65265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:55:10+00:00 2026-05-10T18:55:10+00:00

I have been using CPPUnit as a unit testing framework and am now trying

  • 0

I have been using CPPUnit as a unit testing framework and am now trying to use it in an automated build and package system. However a problem holding me back is that if a crash occurs during the running of the unit tests, e.g. a null pointer dereferencing, it halts the remainder of the automation.

Is there any way for CPPUnit to recover from the exception, record the test failure and then exist gracefully rather than terminating the unit test process? Even an approach specific to null pointer dereferencing would be useful as that makes up about 90% of the issues I have had.

To be technology-specific, I am using makefiles on a Windows system.

  • 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. 2026-05-10T18:55:10+00:00Added an answer on May 10, 2026 at 6:55 pm

    You’re automating the execution of your cppunit-based unit-tests during your build process, right ?

    If you were trying to use CppUnit to execute the build process, I would be tempted to say don’t do that !

    Could you tell us what is stopping the build process when the unit tests crash ? And what are your unit tests started by, a Makefile, a script of your own, or a continuous integration framework ?


    To try to answer your question, CppUnit cannot recover from violation or segmentation errors. On Unix-like systems you should be able to catch the SIGSEGV and to continue, but in which state ?

    If your crashes occur in your unit test and not in your product, then I’d recommend you to rely on assertion guards to prevent dereferencing NULL pointers:

    class TestObject : public CPPUNIT_NS::TestCase {   CPPUNIT_TEST_SUITE(Test);   CPPUNIT_TEST(testObjectIsReady);   CPPUNIT_TEST_SUITE_END();  public:   void setUp(void) {}   void tearDown(void) {}   protected:   void testObjectIsReady(void)   {       Object *theObject = GetObject();       CPPUNIT_ASSERT_MESSAGE('check pointer is not null', theObject != NULL);       //--- now you can play with your object without dereferencing a NULL pointer      CPPUNIT_ASSERT_MESSAGE('check objet is ready', theObject->isReady());   } }; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 63k
  • Answers 63k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer See this thread by Sun on why they deprecated Thread.stop().… May 11, 2026 at 10:28 am
  • added an answer Using the READPAST locking hint is correct and your SQL… May 11, 2026 at 10:28 am
  • added an answer ROT13 (or hover on this link to see the non-obfuscated… May 11, 2026 at 10:27 am

Related Questions

I have been using CPPUnit as a unit testing framework and am now trying
I have been using PHP and JavaScript for building my dad's website. He wants
I have been using Eclipse as an IDE for a short amount of time
I have been using Castle MonoRail for the last two years, but in a
I have been using C# for a while now, and going back to C++
I have been using ASP.NET for years, but I can never remember when using
I have been using Ruby for a while now and I find, for bigger
I have been using IoC for a little while now and I am curious
I have been using the CSLA framework for couple of years now for windows
I have been using PLT Scheme , but it has some issues. Does anyone

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.