Menu

Exception when setting Outputter

Help
2005-11-14
2013-04-22
  • David Johansen

    David Johansen - 2005-11-14

    I have some code that I wrote earlier this year that uses CppUnit and it was all working fine. I tried downloading the newest stable release and using it again and it crashes when I set the outputter. Here's the error:

    Unhandled exception at 0x7c901230 in MatrixTestRunner.exe: User breakpoint.

    And here's the code I run:
    // Get the top level suite from the registry
            CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();

            // Adds the test to the list of test to run
            CppUnit::TextUi::TestRunner runner;
            runner.addTest( suite );

            // Change the default outputter to a compiler error format outputter
            runner.setOutputter( new CppUnit::CompilerOutputter(&runner.result(), std::cerr));

            // Run the tests.
            return runner.run() ? 0: 1;

    Any ideas on what I need to do to fix this? And the weird part is that according to the dates the stable release hasn't changed since I had it working.
    Thanks,
    Dave

     
    • David Johansen

      David Johansen - 2005-11-14

      Sorry, I forgot to mention that I am building this on Visual Studio 2003 on Windows XP and that hasn't changed since I build it last time.
      Dave

       
    • anantK

      anantK - 2005-11-22

      Hello Dave,

      I experienced the same problem as you are undergoing. Change the following statement

      runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
                                &runner.result(), std::cout) );

      I think it should for you too....

      Anant

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.