Page MenuHomePhabricator

elm_spinner: Add label format validator
ClosedPublic

Authored by shilpasingh on Feb 19 2016, 7:14 AM.

Details

Reviewers
jpeg
cedric
Summary

Check for all error conditions case in elm_spinner_label_format_set
and set label format only if its valid.

Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>

@feature

Test Plan
  1. Launch elementary test spinner
  2. Set invalid formats e.g. formats with out %, formats with more than

one format specifier "%d %s" etc:-

Diff Detail

Repository
rELM core/elementary
Branch
arcpatch-D3720
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1414
Build 1479: arc lint + arc unit
shilpasingh updated this revision to Diff 8515.Feb 19 2016, 7:14 AM
shilpasingh retitled this revision from to elm_spinner: Add label format validator.
shilpasingh updated this object.
shilpasingh edited the test plan for this revision. (Show Details)
shilpasingh updated this revision to Diff 8516.Feb 19 2016, 7:26 AM

follow coding guideline

shilpasingh updated this object.Feb 19 2016, 7:30 AM
shilpasingh added reviewers: jpeg, cedric.
shilpasingh added subscribers: subodh6129, buds, govi.
cedric accepted this revision.Feb 19 2016, 3:56 PM
cedric edited edge metadata.
This revision is now accepted and ready to land.Feb 19 2016, 3:56 PM
cedric closed this revision.Feb 19 2016, 3:56 PM

@cedric, this commit has not been landed yet. If any issue please let me know

jpeg edited edge metadata.Feb 23 2016, 4:52 PM

I have a few comments. This looks ok as is but not perfect.

src/lib/elm_spinner.c
81–94

please change this name

83

there can be only one '.' in the format string (between $ and d)

128

please differentiate between isdigit and '.'
I think #, (space), + and - should also be acceptable (as first char)

jpeg reopened this revision.Feb 23 2016, 4:52 PM

This has not been merged yet

This revision is now accepted and ready to land.Feb 23 2016, 4:52 PM
jpeg added a comment.Feb 23 2016, 4:58 PM

How does this relate to D3664 ? I see a validation there too?

In D3720#60769, @jpeg wrote:

How does this relate to D3664 ? I see a validation there too?

D3664 is a filtering patch to not allow invalid characters while typing in to entry. what ever may be the label format we can type anything in entry, hence we have added few entry filters to control invalid inputs. we have 3 filters currently valid digit filter, invalid input filter and min max filter.
Hence this patch is not related to D3664

shilpasingh updated this revision to Diff 8539.Feb 24 2016, 6:50 AM
shilpasingh edited edge metadata.

Fixed comments, consider possible flags, multiple occurance of '.' and other error conditions only.

shilpasingh requested a review of this revision.Feb 24 2016, 6:53 AM
shilpasingh edited edge metadata.

tested for other possible error conditions only and not all warnings as those warnings are ignored by printf and rest of the valid format is set.

if we need simpler code we can also consider integrating regular expression based check

jpeg accepted this revision.Feb 26 2016, 12:08 AM
jpeg edited edge metadata.

Looks good

This revision is now accepted and ready to land.Feb 26 2016, 12:08 AM