Unttests for nested functions

BCS BCS_member at pathlink.com
Tue May 30 10:04:19 PDT 2006


That's about what I was thinking. 

Really all that is needed is a chunk of memory that the unittest can manipulate
and pass off to the nested function. It's own stack frame would do as long as
all of the variables from the other function are mapped the same (&i ==
FramePointer + TheSameSomethin in both functions). I'm not sure where variable
alignment is decided, so I don't know how hard this would be to implement, but
it's not that complicated conceptually.


In article <e5gl5v$2icg$1 at digitaldaemon.com>, Daniel Keep says...
>
>I suppose the problem is that the inner function is inseperable from the
>outer function.  Since the inner function shares the outer function's
>stack, you can't really call it without the outer function.
>
>The problem here is that unittests are run on program *startup*.  That
>means that in order those unittests inside a function, it would have
>to... uh... I dunno; maybe "fake" the function's stack.  But then you
>just end up with random garbage data in the inner function.
>





More information about the Digitalmars-d-learn mailing list