Code review comment for lp:~3v1n0/unity/debug-property-matching-fix

Revision history for this message
Christopher Lee (veebers) wrote :

Ugh, sorry to flip-flop but after reading the xpathselect protocol docs[1] again it looks like GetPropertyValue is incorrect.

The data format is [type_id, val, ..(more possible vals)..]

So for instance if there is a query like //typename[globalRect=0] the actual property would be something like: [TYPE_RECT, 0, 0, 100, 100].

Currently UnpackPropertyValue would return [TYPE_RECT, 0, 0, 100, 100] (due to line 14) so that is wrong.
Assuming the removal of that check it would return 0 (the 2nd element in the array) which is also wrong.

I think what we actually want here is to remove the first (0th) element in that array and return the remainder. (so [TYPE_SIMPLE, 12] will return 12)
There shouldn't need a check for an array, as the protocol states that it should _always_ be an array and if it's not it is an error.

[1] http://developer.ubuntu.com/api/devel/ubuntu-14.04/autopilot/appendix/protocol.html#returning-state-data

review: Disapprove

« Back to merge proposal