Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2010, 02:43 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 142
ivanraso is on a distinguished road
Default testCases sqlite objects

Hi. I am developing a appication that uses a sqlite database. I want to test my methods but i have a question. I am testing it with a example os dtabase that i found on internet about animal and photographs. The problem is when i am comparing two Animals' name the STassertEquals test the number value of the pointers.
Anyone has an example project of testing sqlite methods I am desperate please help me.
Code:
Animal *s=[Animal getAnimal:name];
Animal *g=[Animal getAnimal:name];
the two animal have the same name and now i wan to test if the sqlite methods works fine:
STassertEquals(s.nombre,g.nombre,@"FAILURE");
I was developing applications in Java's Junit and i dont know if this is possible in Objective C OcunitTest.
ivanraso is offline   Reply With Quote
Old 06-02-2010, 09:39 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

You want to assert that the string contents matches, not the pointer values.
Use something like
Code:
STAssertTrue([s.nombre isEqualToString:g.Nombre], @"FAILURE");
nobre84 is offline   Reply With Quote
Old 06-02-2010, 08:31 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 142
ivanraso is on a distinguished road
Default

Quote:
Originally Posted by nobre84 View Post
You want to assert that the string contents matches, not the pointer values.
Use something like
Code:
STAssertTrue([s.nombre isEqualToString:g.Nombre], @"FAILURE");
Anyone can send me a simpel proyect that uses it because I am trying to develop a ocunit test and it doesnt work...always i386 GCoff
ivanraso is offline   Reply With Quote
Old 06-03-2010, 08:47 AM   #4 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 6
Nathan187 is on a distinguished road
Default probably too late

Quote:
Originally Posted by ivanraso View Post
Anyone can send me a simpel proyect that uses it because I am trying to develop a ocunit test and it doesnt work...always i386 GCoff
but when comparing strings, I use

STAssertEqualStrings();


(not sure if this is available on the OCUnit test)
Nathan187 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 357
5 members and 352 guests
.Snipe, baja_yu, guusleijsten, NSString, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:32 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0