[Issue 5587] New: Use __LINE__ to pick number in unittest block names

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 15 01:02:46 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5587

           Summary: Use __LINE__ to pick number in unittest block names
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-02-15 01:00:14 PST ---
At the moment, we can't name unit tests. Ideally we could, but for now, we
can't. And this is a big problem in that any exceptions that are thrown from a
function called directly or indirectly by a unittest block ends up with a
fairly useless stack trace because the function generated from the unittest
block is something like _unittest1298, which gives absolutely no clue as to
which unittest block it's for. I have no idea how that number is generated, but
as far as I can tell, it's useless. Don suggested that we use __LINE__ to
generate that number so that it actually _is_ meaningful. So, I'm opening this
enhancement request for that to be done. I still think that we should have
named unittest blocks at some point (e.g. unittest(testName) {}), but using
__LINE__ in the name would be a big help.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list