Merge lp://staging/~charlesk/indicator-power/coverage into lp://staging/indicator-power/12.10
Status: | Superseded |
---|---|
Proposed branch: | lp://staging/~charlesk/indicator-power/coverage |
Merge into: | lp://staging/indicator-power/12.10 |
Diff against target: |
3844 lines (+2748/-695) 16 files modified
Makefile.am (+8/-27) configure.ac (+26/-1) m4/gtest.m4 (+63/-0) po/POTFILES.in (+2/-0) src/Makefile.am (+36/-0) src/dbus-listener.c (+247/-0) src/dbus-listener.h (+82/-0) src/device.c (+667/-0) src/device.h (+107/-0) src/indicator-power.c (+200/-667) src/indicator-power.h (+58/-0) tests/Makefile.am (+62/-0) tests/Makefile.am.strings (+38/-0) tests/test-dbus-listener.cc (+370/-0) tests/test-device.cc (+470/-0) tests/test-indicator.cc (+312/-0) |
To merge this branch: | bzr merge lp://staging/~charlesk/indicator-power/coverage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lars Karlitski (community) | Needs Fixing | ||
Review via email: mp+108599@code.staging.launchpad.net |
This proposal has been superseded by a proposal from 2012-06-06.
Description of the change
Refactoring of indicator-power to facilitate automated testing.
1. The devices are no longer stored internally in indicator-power as GVariants. Instead there is a new IndicatorPowerD
2. Extract the DBus-specific code into a new object, IndicatorPowerD
3. Fixes a handful of edge case bugs discovered while adding unit tests.
This patch increases indicator-power's branch coverage from 0% to 84% and its line coverage from 0% to 96%
Very nice work! And impressive test coverage.
Note: I couldn't test it yet, as I'm still on precise. /me ducks.
src/Makefile. am:207:
* any reason you're using noinst_HEADERS instead of listing the headers
in the libraries sources? (the latter is recommended for programs and
convenience libs in the automake docs)
dbus-listener.c
* afaict, it could have been written by gdbus-codegen
* 305: g_signal_new is passed one too many arguments. Please add the
docstring with the number and names of parameters to it [1]
* dispose() is missing g_bus_unwatch_name (priv->watcher_id)
* get_devices_cb:144: trailing whitespace ;)
* the cancellable is passed into all functions and unreffed in dispose()
is the cancellable cancelled on unref or do we need to do that explicitely?
(I can't find anything in the docs)
dbus-listener.h: power_dbus_ listener_ new is declared but not defined in the .c
* 50: the signal name is overly complicated (it doesn't need to be namespaced
to the class)
* indicator_
device.c: class_install_ properties. This also allows notify_ by_pspec WARN_INVALID_ PROPERTY_ ID in the 'default' switch case power_device_ new_from_ variant: check whether the input variant
* class_init: I prefer saving all pspecs in a static array and installing
them all at once with g_object_
using g_object_
* finalize doesn't chain up to the parent class
* get/set_property:
- use G_OBJECT_
- PROP_ICON is not handled
- kind and state should check for sane input values
* 260 ff: I don't think we can use Richard's code (indicators are CA, right?)
* indicator_
has the correct type before calling g_variant_get
* 298: reference functions with 'function_name()' instead of #function_name
in doc strings
device.h:
* 43 ff: no need to namespace gobject properties (tbh, I wouldn't even
#define them, but simply use the strings)
indicator-power.c: power_dbus_ listener_ new was missing :)
* 119: ah, that's why you didn't notice the implementation of
indicator_
* ref the floating widgets in the private struct
(just something I noticed, it has nothing to do with this work)
indicator-power.h:
* device.h include is superfluous
test/test- dbus-{listener, device} .cc: glib_initalized : g_type_init can be called multiple times
* ensure_
[1] http:// developer. gnome.org/ gtk-doc- manual/ stable/ documenting_ symbols. html.en
Section 3.3.4