Mika Raento’s blog - Symbian, CS research and angst
Click 'Connect with Facebook' to join NetworkedBlogs. NetworkedBlogs is a community of bloggers and blog lovers. Join the fun, add your blog, and connect with others who read and write about subjects you like.
Inspecting UI state / windows /controls on Symbian
On Win32 and other windowing systems you can walk the window tree and ask windows for their type, state, contents etc. On Symbian there is no such built-in introspection.
However, it is possible to get access to a lot of information with enough hacks:
Use a FEP so your code gets loaded into all apps
Use various methods (control stack, window tree, container structure) to find out about windows and controls
Detect/Guess/hardcode the control class and use the native methods to ask it for contents
http://github.com/mikaraento/tts has a complete example. It’s the code from a project I did
Symbian HTTP POST and KErrCorrupt
This is something I guess everybody who writes a HTTP POST using MHTTPDataSupplier goes through… (at least that’s what it looks like on the forums). I didn’t find a clear answer so I thought I’d write it down myself.
GetNextDataPart() needs to return _the same buffer_ until ReleaseData() is called, and it will get called several times for the same part. If you don’t respect that the transaction will terminate with KErrCorrupt.
Example SConstruct for googletest + tip on UI tests
This slots into a project based on hello_openc
from scons_symbian import *
target = "googletest_main"
targettype = "exe"
libraries = ['libstdcpp', 'libc', 'euser']
# Static libs
staticlibs = ['libcrt0.lib']
uid3 = 0xA0001314
sources = ['../src/googletest_main.cpp',
'../../../third_party/googletest/src/gtest-all.cc',
'../../../third_party/googletest/test/gtest_unittest.cc']
includes = ['../data', '../inc', '../../../third_party/googletest', '../../..']
sysincludes = [
join(EPOC32_INCLUDE, "stdapis"),
join(EPOC32_INCLUDE, "stdapis/stlport"),
'../../../third_party/googletest/include'
]
defines = ['_STLP_NO_WCHAR_T']
SymbianProgram( tar
Heap/leak checking googletest tests
Leak checking is part of good programming practice (as leaked objects normally point to bugs in general). Symbian has its leak checking macros, but they aren’t completely trivial to use with Googletest (googletest has been designed with a whole-program reachability-based leak checker in mind, like OS X’s ‘leaks’) – googletest itself allocates memory in some cases.
The easiest way to add Symbian-style leak checking is to use a test fixture. Just add an instance of HeapChecker as the first member of your test fixture. HeapChecker looks like:
Header:
#ifndef TESTING_PUBLIC_HEAPCHECK_H_INCLUDED_
#define TESTING_PUBLIC_HEAPCHECK_H_INCLUDED
Googlemock 1.4.0 works on Symbian!
Googlemock – arguably the best C++ mocking framework now works on Symbian (winscw and gcc-e – I haven’t tried rvct). Although I’m obviously biased I really recommend it for all your mocking needs. Requires a recent OpenC.
If you have problems getting everything working on Symbian I’d be interested in hearing them – here or via e-mail.
Not enough data.
Calculated for blogs with 20+ followers.
- Ahmed WORLD Design
design, symbian, themes
- Symbian S60v3 S60v5 Pocket PC Applications, Games, Themes Downloads
mobile, application, symbian
- Full Blown iPhone
iphone, smartphone, mobile
- WoM Lanka
nokia, s60, mobile
- adremixer
mobile, marketing, advertising
Questions? contact: networkedblogs@ninua.com
Copyright (C) 2008, Ninua, Inc.