• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
I'm using Xcode 3.1 and I can't get OCMOCK_VALUE to compile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
email@hidden



 _______________________________________________
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

  • Prev by Date: Re: Xcode 3.x and Subversion 1.5.0
  • Next by Date: My First cocoa....
  • Previous by thread: Games for iPhone
  • Next by thread: My First cocoa....
  • Index(es):
    • Date
    • Thread