I'm using Xcode 3.1 and I can't get OCMOCK_VALUE to compile
I'm using Xcode 3.1 and I can't get OCMOCK_VALUE to compile
- Subject: I'm using Xcode 3.1 and I can't get OCMOCK_VALUE to compile
- From: Pat McGee <email@hidden>
- Date: Thu, 18 Sep 2008 23:05:04 -0400
Hi,
I'm trying to learn how to do unit testing with mock objects in Cocoa. I'm using the OCMock framework. In Xcode 3.1, I have a unit test method with the following: int shouldReturn = 1; [[[mockGenerateSite expect] andReturnValue:OCMOCK_VALUE(shouldReturn)] generateWebFilesTo:@"/Path/Goes/Here" error: &wError];
That gave me a compiler error: "error: syntax error before 'typeof'"
When I replaced that with the following, it compiled and worked:
int shouldReturn = 1; NSValue *myValue = [NSValue value: &shouldReturn withObjCType: @encode (int)]; [[[mockGenerateSite expect] andReturnValue:myValue] generateWebFilesTo:@"/Path/Goes/Here" error: &wError];
The difference is that I expanded the OCMOCK_VALUE macro myself, and took out the typeof. (I found the macro definition in OCMock.Framework/OCMockRecorder.h.)
Any idea what's going on?
Thanks,
Pat
-- "Save the Earth; it's the only planet with Chocolate!"
Pat McGee
|
_______________________________________________
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