Re: CPlusTest in Xcode 2.3
Re: CPlusTest in Xcode 2.3
- Subject: Re: CPlusTest in Xcode 2.3
- From: John Richetta <email@hidden>
- Date: Fri, 14 Jul 2006 11:59:25 -0700
I have some questions about a CPlusTest crash (see e-mail copied
below), and CPlusTest, in general:
1. Has this problem Aaron asked about been resolved or investigated?
I have the exact same problem(Xc 2.3, OS X 10.4.7): simple TestCases,
without any setup and teardown (yet), and which consistently crash at
program exit, whenever there is more than one test case.
The debugger seems to be a little bit confused about where it is in
this application, and breakpoints seem to be unreliably triggered.
Stepping through the assembly is not immediately enlightening.
Is there a publicly visible RADAR bug, or could some kind Apple
engineer give us an update?
2. Has anyone beside me tried to use CPlusTest in a stand-alone test
jig application? I find the motivations for the test bundle
machinery indirectly discussed in the Unit Testing Guide to be rather
unclear. I don't understand:
a. why it says the test target doesn't need the source code under
test to be added to it (the grey box at the top of page 12 baffles
me); how does the "injected" bundle "[access] any source code
required for the tests"???
b. why I'd want to "inject" a bundle into an application (and
specifically, exactly what that means) to test it - I normally do all
unit testing in stand-alone applications. There are cases where
testing within a complete application is desirable, but they are much
less common for me. I'm not sure why I'd want any significant
machinery to achieve this - why not simply conditionally compile my
tests into a (non-final) target?
I must be missing obvious answers to #2 - enlightenment and good
references most welcome. If anyone has gotten around #1, I'd love to
hear about it (though admittedly, it's noncritical, however
disturbing).
Thanks, -jar
P.S. - One more thing: is source for the Apple version of CPlusTest
available somewhere that I missed? I haven't figured out a good way
to search Apple's open source, but I didn't see it browsing around
the likely places and (unsurprisingly) it doesn't appear to be part
of the developer tool distribution.
Date: Tue, 23 May 2006 21:18:32 -0700
From: Aaron Montgomery <email@hidden>
Subject: Re: CPlusTest in Xcode 2.3
To: Chris Hanson <email@hidden>
Cc: email@hidden
On May 23, 2006, at 9:06 PM, Chris Hanson wrote:
> In your TestCase subclasses, are you overriding setUp() and tearDown
> () to handle creating and destroying the state of your tests? Or
> are you doing it in the constructor and destructor of your test
> case subclasses?
No, there is no state created, the constructor and destructor are
completely empty. The test method is a single line:
void UT_superadd::Test(void)
{
CPTAssert(superadd(1,1) == 1 + 1);
}
This is just supposed to be a little tiny example to be used in a
tutorial, so there isn't anything fancy going on with memory or
resources.
> If the above doesn't clear up your issue, please file a bug at
> <http://bugreport.apple.com/>.
I'll try to do that tonight.
Thanks,
Aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden