Created
July 3, 2012 22:49
-
-
Save blazingpair/3043930 to your computer and use it in GitHub Desktop.
This fixes a problem of test coverage in Xcode related to an Apple implementation of a core unix api.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CoverageFix.m | |
// | |
// This fixes a problem related to an Apple implementation of a core unix api. | |
// | |
// Created by Paul Zabelin on 5/17/12. | |
// Copyright (c) 2012 Blazing Cloud, Inc. All rights reserved. | |
// | |
// Include this into app target to measure Application Tests code coverage | |
// Exclude from RELEASE build not to ship with the app | |
#ifdef DEBUG | |
@interface CoverageFix : NSObject | |
FILE* fopen$UNIX2003(const char* filename, const char* mode); | |
size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream); | |
@end | |
@implementation CoverageFix | |
FILE* fopen$UNIX2003(const char* filename, const char* mode) { | |
return fopen(filename, mode); | |
} | |
size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream) { | |
return fwrite(ptr, size, nitems, stream); | |
} | |
@end | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment