pirafrank / google-toolbox-for-mac

Automatically exported from code.google.com/p/google-toolbox-for-mac
Apache License 2.0
0 stars 0 forks source link

GTMAssertObjectImageEqualToImageNamed does not write files to User's desktop when Shared Build folder is set up #71

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure Xcode to use a shared build folder, nested somewhat deeply
2. Write a test using GTMAssertObjectImageEqualToImageNamed
3. Run the test in the iOS simulator to generate the reference image (first run)

What is the expected output? What do you see instead?
The image file is expected to be put on the current user's desktop.
However it is placed somewhere else, depending on the shared build output 
folder's location.

What version of the product are you using? On what operating system?
GTM SVN Rev 426.
iOS 4.2.1 / Xcode 3.2.5

Please provide any additional information below.
The problem is caused by the

 + (NSString *)gtm_getUnitTestSaveToDirectory 

method which assumes a certain nesting depth to find the desktop. I attached a 
proposed patch that - while not ideal either - fixes the problem probably for 
most users. It would not work if the user's home was located somewhere 
non-default.

Original issue reported on code.google.com by daniel.s...@gmail.com on 20 Jan 2011 at 2:11

Attachments: