Code Coverage in XCode
August 29, 2007 on 3:15 am | In Duplicate Image Detector, Cocoa, MacOSX, Useful Code | Comments OffWhile working with the latest version of Duplicate Image Detector I was hoping to see the amount of code coverage in the unit tests.
I was happy to see that the code coverage tools are built into GCC, but disappointed to see that it isn’t the easiest to meaniful statistics added to part of the build process. There is a great post at SuperMegaUltraGroovy.Com listing how to get code coverage enabled for your unit tests.
The one step I couldn’t complete is the code that needs to be inserted into the the Run Script after your test case run code. The code was a bit managled by Safari/Wordpress and even sorting that out I still had some issues.
Well after a bit of hacking around I found this code works pretty well (you will need to edit the framework name):
# Run the unit tests in this test bundle.
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
# Run gcov on the framework getting tested
if [ "${CONFIGURATION}" = 'Test' ];
then
FRAMEWORK_NAME=DID-V2.0
FRAMEWORK_OBJ_DIR=${OBJROOT}/${FRAMEWORK_NAME}.build/${CONFIGURATION}/${FRAMEWORK_NAME}.build/Objects-normal/${NATIVE_ARCH}
mkdir -p coverage
pushd coverage
echo ${OBJROOT}
echo ${FRAMEWORK_OBJ_DIR}
find ${FRAMEWORK_OBJ_DIR} -name *.o -exec gcov -b -o ${FRAMEWORK_OBJ_DIR} {} \;
popd
fi
This will produce the following information after the unit tests when you run your test:
File '/Users/tupps/Development/LTConsult/svn/DID/v2/ImageMatchManagement.m'
Lines executed:70.00% of 40
Branches executed:100.00% of 34
Taken at least once:64.71% of 34
Calls executed:86.21% of 29
/Users/tupps/Development/LTConsult/svn/DID/v2/ImageMatchManagement.m:creating 'ImageMatchManagement.m.gcov'
I hope this helps get a few people closer to running unit tests and looking at their code coverage on the mac. A nice utility like shark would be fantastic for working through these files and all of the information that is exported.
chinese korean japenesse facial features asian
huge toy dildo
horny fat chicks
bbw fat
ffm dp
jucie coeds pussy
new student orientation manual
granny fucks
hot koreans squirting
chubby old women
men sex with animals
interracial nude
beach boys albums
hairy mature cunts
butt fetish
colombian male order brides
small cunt
free sexcams no membership
fetish anal
free bikini teens
milf boss nasty teacher sex galleries amatuer pictures
extreme facesitting
filipina chat
animated teen chat rooms
puma football boots
upland game dog
women smoking cigarettes fetish
oriental facial cumshot
exotic korean pussy
kid’s caught me masturbating
horny college chicks
gothic maternity wear
hairy pussy close up
enormous penis
ebony clits
outdoor fuck
fat women young stud
free filipina nude
fucked by stud
chronic strep throat
interracial sex black guys fucking blonde girls
double track shelf standard
large busty women
lesbians licking breasts
cumshot deep throat
oriental transexual sex
male penises
oriental pussy photos
hawaii nude beach
german cum
cute young butt
naked black bitches
horny baby sitter
how often men shave
office strip
high school cheerleaders pics
celebrity uncensored
free gay male sites
extreme closeups
earth worm closeup photos
lesbon cunt licking
highschool blowjob
star wars chicks nude
blow job teen
cartoon chicks
neck fetish
girls hairy with legs
boots dora the explorer
dog humping leg
orgy outdoor
sexy ebony teen
how to shave pubes
little girls
huge cocks in tight pussies
asian bukkake swallow
wife orgasm
interracial lesbian rape
bbw moviez
facesitting brazil
anime double penetration
sexy brazil
brazil soccer head quarters
chick fucking with piercings
coed suck
my friends hot mom porn site
airline approved dog carriers
moms boy
naked horny babes
enormous black boobs
up the skirt cheerleader
sluts deep throating
girl in shower videos
interracial sex black guys fucking blonde girls
swap cells excel
free incest movies
interracial 69
upskirt hidden cam
expanding cockhead contracting cunt
coeds fucking movie galleries
gay interracial creampie videos
panties tight
best asian escort bbbj filipina
extreme geek
biker bitches
briana banks sucking
girls long tongue tricks
erotic text stories
revolving grooming table dogs
chicago breast enlargement surgery
little tgp
naked latina porno
hot ass getting pounded
girl hogtied and machine fucked
nude beaches greece
dick licking
free twink nudes boys
black nurse sex
free teen chats
bad ass gothic layouts for myspace
how to eat your own jizz
outdoor ffm
art clips of school buses
ass worship
extreme toys
big brothers charleys lesbian lover
large butt plugs
ladyboy cock
extreme anal insertions
licking camel toe
double ended dildos
bbw with enormous breasts
videosz cheerleader
stories of bestiality
use sildenafil small animals
old men fuck young girls
amateur first time fuck
jessica alba nipples
plumper ffm
twink in bed
black cock interracial photographer sweater
extremely tight laced
free asian porn movie clips
cunt surrendering orgasm sperm
expanding cockhead contracting cunt
strapon bitch
blonde hot cheerleaders
busty latina girls
ffm bdsm mc stories illustrated
free interracial gay chat
anti gag cream
potos of snoop dog
small flexible tripod
gothic lesbian
illegal bestiality
bisexual sex mmff
big tits bbw porn
cunt finder
teens using dildos
dirty latina
sissy maid cocksucker
shaved college girls
hot chick masturbate
average size of male penis
wet breasts
goth chick
jack osbourne paparazzi pics
free xxx porn gallery
chicks with tattoos
hot chick masturbate
group blowjobs
twistys bree olsen movie samples
backseat lovers
paparazzi nude celeb photos
celebrity blowjob
funny nipples
blond sex clips
free ffm vids
ebony female ejaculation
nude preteen model
body switch story male female
indian bitch
horny latina teens gallery
huge cocks in tight pussies
anatomy of the throat
heidi klum nude
hot brunette babe
cock pussy
wire stripping machines
gothic teen jizz
chat with sexy webcams women
massive cocks fucking women
amateur sex cams free sex sex
extreme thong
pro anorexia gothic pictures
caught son wearing a dress
free filipina nude
atk foot fetish
gangbang ass
horny tgp
free beastiality vid
lesbian dildoes
pros on coed dorms
dogfart series blacks on blondes
coed anal rimming
make me gag
women’s erotic stories
suck it harder
blond fuck
flex appeal lexington ky
olsen twins are naked
hermione granger naked
dirty talk cum
dog booties
anal lover
satin gags
horny fat
korean slut
black skinny slut
interracial gay porno
clear beach bag
Dynamic NSTableView Part II
May 17, 2007 on 2:13 pm | In Cocoa, Useful Code | No CommentsJust another update NSTableView and creating it dynamically. If the NSTableView has its frame set then column resizing and scrolling seems to be screwed up.
By setting the frame of the scrollview and simply just calling init the NSTableView then the table seems to work correctly.
Technorati Tags: Cocoa
Dynamic NSTableView
May 16, 2007 on 11:56 pm | In Cocoa, Useful Code | No CommentsIf you need to add a NSTableView to a window or view in your code then it is not immediately obvious how to do this.
For example adding a button, all you need to do is initWithFrame for the button, then add the button to the main view.
However a NSTableView isn’t that simple. When you drag one out using interface builder you are getting a NSTableView wrapped up in a ScrollView. If you try to add the same way you would an NSButton you can’t see anything. What is needed is a ScrollView to wrap up the tableview.
I found this code which outlines how to setup a NSTableView. It is on the excellent cocoadev web site.
Technorati Tags: Cocoa, NSTableView, CocoaDev
Enterprise Library Username and Password Connection String
May 10, 2007 on 12:34 pm | In Useful Code, .Net | No CommentsI have a number of projects that use Microsoft’s Enterprise Library, but usually they use Integrated Security to connect to the SQL Server. Yesterday I had a project which had to connect to a SQL Server via username and password and found it wasn’t the easiest to work out how the dataconfiguration file should be set up. This is what I came up with that worked:
<connectionstring name="Sql Connection String">
<parameters>
<parameter name="Data Source" value="Server" isSensitive="false" />
<parameter name="Initial Catalog" value="Database" isSensitive="false" />
<parameter name="Integrated Security" value="false" isSensitive="false" />
<parameter name="Connection Timeout" value="10" isSensitive="false" />
<parameter name="user" value="sa" isSensitive="false" />
<parameter name="password" value="sa" isSensitive="false" />
</parameters>
</connectionstring>
Version 2.0 of Duplicate Image Detector
May 3, 2007 on 7:40 pm | In LT Consulting, Duplicate Image Detector | No CommentsAt present I am working on Version 2.0 of Duplicate Image Detector. At present it is nearly as quick as V1.0 for detecting duplicates, and it is now a matter of getting the user interface hooked up.
Version 2.0 will have the following goals:
- Simplified User Interface
- Easier access to advanced features
- Same speed as version 1.0
At present the user interface is coming along nicely and I beleive that it will be easier to use. In initial testing version 2.0 is nearly as quick as version 1.0 but still needs a bit of tweaking.
Once version 2.0 is out the door the next focus will be on improving the performance of the application.
New Website for Dius Computing
September 14, 2006 on 5:34 pm | In LT Consulting | No CommentsDius Computing (the reason I haven’t posted much recently) have just launched their new website. It looks pretty good and people won’t be ashamed to link to it now
Useful Split View Sites
April 13, 2006 on 8:18 pm | In Cocoa, MacOSX, Useful Code | No CommentsI have been hunting for information about NSSplitView and ran into a couple of sites with some decent information about Split Views and its intricacies.
Split View Help:
http://homepage.mac.com/jrc/contrib/ — Code for collapsing NSSplitViews programmatically.
http://www.cocoadev.com/index.pl?RBSplitView — An implementation of splitviews which gives you more control.
Generally Useful Site:
http://borkware.com/ — I am surprised I haven’t come across this site before. Seems to have a heap of useful code snippets.
I will let you know how I go with the intricacies of the NSSplitView
Stop Cocoa Bindings Feeling Like Cocoa Bindings - Part 2
April 11, 2006 on 8:33 pm | In LT Consulting, Cocoa, Core Data | No CommentsAfter a bit of testing I found that there are a couple of issues. The first if you edit a field name and then you click the add button the results aren’t saved. This is easily fixed by deselecting the table first:
- (IBAction)addExtraField:(id)sender
{
[extraFieldsDefinitionTable deselectAll:self];
[NSEntityDescription insertNewObjectForEntityForName:@”ExtraFieldName”
inManagedObjectContext:[self managedObjectContext]];
[self performSelector:@selector(selectLastRowOfTable) withObject:nil afterDelay:0];
}
The second issue was when you add multiple items, their was a chance that the item wouldn’t be editable. An extra line is needed to select the row before you can edit the table.
- (void)selectLastRowOfTable
{
[extraFieldsDefinitionTable selectRow:([extraFieldsDefinitionTable numberOfRows] -1) byExtendingSelection:NO];
[extraFieldsDefinitionTable editColumn:0 row:([extraFieldsDefinitionTable numberOfRows] -1)
withEvent:nil select:YES];
}
Adding those two lines to the code makes it all good.
Stop Cocoa Bindings Feeling Like Cocoa Bindings
April 10, 2006 on 2:34 am | In LT Consulting, Cocoa, Core Data | 5 CommentsOne thing that feels wrong with a bindings app is that when you add a new record to a table you then have to select that record with the mouse before you can edit that record. In my mind this feels just wrong and very ‘unMacintosh’. If you add a new playlist to iTunes the new playlist will be selected and ready to be renamed.
It is pretty easy to fix. In this case I am using Core Data and Bindings. You need to add one action to your controlling object and you also needs an outlet to the table in which the data has been added. In this case the object extraFieldsDefinitionTable is the NSTableView which is bound to the ExtraFieldName table in my data model.
- (IBAction)addExtraField:(id)sender
{
[NSEntityDescription insertNewObjectForEntityForName:@"ExtraFieldName"
inManagedObjectContext:[self managedObjectContext]];
[self performSelector:@selector(selectLastRowOfTable) withObject:nil afterDelay:0];
}
- (void)selectLastRowOfTable
{
[extraFieldsDefinitionTable editColumn:0 row:([extraFieldsDefinitionTable numberOfRows] -1)
withEvent:nil select:YES];
}
The reason this final part of code is called via a performSelector function is it allows the run loop to complete and update the tables data source from the core data model. If you are writing your own data source functions you can call reloadData on the table within the addExtraField function and then the editColumn without using performSelector.
Cocoa Bindings don’t stop my stupidity!
April 7, 2006 on 12:52 pm | In LT Consulting, Body Diary, Cocoa, MacOSX | No CommentsThe new version of Body Diary presents a list of additional fields to the user to fill in. The number of fields is determined by the user. This data hasn’t been assigned to coredata so I decided that the easiest way to show this would be to create a mutable array and have that as the data source for Cocoa Bindings. Whenever a record is added to the system the array is recreated.
My first attempt at working with the data I went straight to the array and editted the data. This left the display out of sync with the data. A quick scan of the documentation pointed out that I should be instead using the NSArrayController to manipulate the data. I modified my code but I was soon stuck with nothing working. I tried everything, recreating controller objects, modifying my code, stepping through line by line. Nothing worked and I was getting very close to just rewriting everything as traditional table delegate methods.
I decided to remove all my debugging trials and strip everything back to the bare essentials. Once I did this I noticed that the class controlling the window was crashing when I quit. It turns out that my code to set the MutableArray that the NSArrayController was using was back to front. So instead of retaining the newArray, releasing the old, and then assigning the new to the old, I was retaining and releasing correctly but was assigning the old to the new.
A quick switch of the code and my NSArrayController was behaving perfectly. So the old “Problem Exists Between Keyboard and Chair” strikes again.
Powered by WordPress with design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^