symbian os unit download
Home arrow Community Forum
Symbian OS Unit
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Using symbianOsUnit with async functionality (1 viewing) (1) Guest
This is the forumheader in the basic forum information
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Using symbianOsUnit with async functionality
#19
amey2003 (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Using symbianOsUnit with async functionality 2 Years, 6 Months ago Karma: 0  
HI all,
I am using symbianOsUnit to test my code.If we go by standard way we define our test functions in testheader.h and framework calls these test functions through testDriver.h, collects return values of these test functions.
After that we verify these values using ASSERT statements.
It works well.

But now what if my functionality is async. If we use active objects in our code, how can we retrn values from functions.

As control will pass to RunL, so how can we return from it.

So We can not put verify return values of functions by Assert statments.

can anybody thought of this or is their any support in new version to test async functionality??
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#20
Maze (User)
Fresh Boarder
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
Re:Using symbianOsUnit with async functionality 2 Years, 5 Months ago Karma: 0  
Hello,

unfortunately there is no real support for this (yet) in the symbianosunit.
My rewrite was however preparing for those kind of things (running async calls, running in separate threads, ...) but that's not yet done yet (and will take for me quite a while to add it, since I currently do not have time to work on it).

On rather simple solution you could implement is to nest the active scheduler within your test, and wait until you have received your response (or potentially until a timeout and in that case to fail the test) and at this point stop the nested active scheduler. This is basically the principle how (most) dialogs are run in SymbianOS. You can find here the documentation about the active scheduler. Thus, the code would look something like the following:

Code:

void testSomething() { startYourAsyncStuff(); // the next call will block CActiveScheduler::Start(); // we will continue here once we have stopped the nested active scheduler runSomeAdditionalTests(); } void asyncCallback() { // run only our tests if we are not the timeout if (!isTimeout()) runSomeTests() // if this is the last asyncCallback we expect we stop the nested active scheduler, otherwise we wait for the next asyncCallback. if (wasLastAsyncCallTest() || isTimeout()) CActiveScheduler::Stop(); // you should not call anything after you stopped the active scheduler }
So why is my version of the SymbianOSUnit prepared for those kind of tests? Basically because you can now have different test runners which allows you to also write one that wraps the tests in different ways. However to extend the whole framework to fully support async tests would require more effort. Therefore I would suggest you the above method. PS: The above description comes without guarantee, since I haven't done it yet, however it should work, but you might have to do some debugging to really get it right. Good Luck! Cheers Maze
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/08/17 09:06 By Maze.
  The administrator has disabled public write access.
#41
seller (User)
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Re:Using symbianOsUnit with async functionality 5 Months, 2 Weeks ago Karma: 0  
Do you know buy tera gold? If you are a tall level, I think you want to get much tera gold. If you want to play this game, you need to buy tera gold. If you do not know how to buy cheap tera gold, you can ask me.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#86
rslifE01 (User)
Platinum Boarder
Posts: 1288
graph
User Offline Click here to see the profile of this user
I6iMhotA 3 Months, 3 Weeks ago Karma: 0  
WOW is the number one selling MMORPG in North America since it wow gold was launched. WOW was released simultaneously for the Mac and Windows rift gold late in 2004. WOW is set in the war-torn world of rift buy platinum Azeroth, a mystical land that has served as the setting for cheap runescape gold Blizzard’s popular Warcraft real time strategy game series. As an online rift plat game, there’s no single-player component in wow. It is designed to runescape gold be played exclusively online. In addition to buying a copy of rs gold the game to install on your computer, users are also required wow gold for sale to set up and pay for an online account.Then you can rift platinum buy the cheap wow gold in our store. In these challenging times, they have become an escapist's dream. Online subscription computer games allow players to control a character - or 'avatar' in the parlance - explore the landscape, fight monsters and complete quests. Players can study for professions such as tailoring, mining, cooking and first-aid, while characters can form or join guilds and clubs.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Who's Online

We have 26 guests online

Login Form






Lost Password?
No account yet? Register