Project

General

Profile

Bug #1029

cout and gdb for unit tests

Added by Dobbs, Adam almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Testing
Target version:
Start date:
21 June 2012
Due date:
% Done:

0%

Estimated time:
Workflow:
New Issue

Description

In the process of writing unit tests I find my code generates seg faults. OK, sort of good, thats what the tests are for. The tests however suppress all cout output from the code they are testing, and will not cout themselves either. GDB also will not run over the unit test executable. Valgrind will, which is helpful, but does not always give line numbers. By and large the lack of couts make it extremely difficult to track the cause of the seg faults (is the test environment causing the problem, is the main code flawed, if so where, etc). Can anything be done about this? Thanks.

#1

Updated by Rogers, Chris almost 11 years ago

cerr should work but point taken

#2

Updated by Dobbs, Adam almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Ah, cerr does work, fantastic. Thanks Chris.

#3

Updated by Rogers, Chris almost 11 years ago

  • Status changed from Closed to Open
  • Target version set to Future MAUS release
  • % Done changed from 100 to 0

Yes, I thought cout works as well - maybe I forgot to reset it properly in a test. Let me check...

#4

Updated by Rogers, Chris almost 11 years ago

Ah no, I disabled cout because of all the Geant4 junk that obscures the test output...

#5

Updated by Rogers, Chris almost 11 years ago

  • Status changed from Open to Rejected

I'll just reject the bug but I might be able to do something if its really irritating.

#6

Updated by Dobbs, Adam almost 11 years ago

I'm satisfied. cout-ing everything would produce a mess, whereas now I can just add cerr as needed specifically for the tests.

#7

Updated by Dobbs, Adam almost 11 years ago

in fact, already found and removed my seg fault.

Also available in: Atom PDF