Page MenuHomePhabricator

elm_spinner: add invalid input validity filter
ClosedPublic

Authored by shilpasingh on Feb 8 2016, 2:12 AM.

Details

Summary

Do not allow invalid input in to spinner.
Invalid Input can be:

  1. '-' should not be inserted anywhere but the starting position, and no more than one '-' can be inputted.
  2. No more than one '.' can be inserted.

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

@feature

Test Plan
  1. Launch elementary test
  2. Run spinner demo
  3. Enter invalid inputs like inserting more than one '.', '-' or insert '-' anywhere else part from 1st position.

Diff Detail

Repository
rELM core/elementary
Branch
Spinner_invalid2
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1372
Build 1437: arc lint + arc unit
shilpasingh updated this revision to Diff 8378.Feb 8 2016, 2:12 AM
shilpasingh retitled this revision from to elm_spinner: add invalid input validity filter.
shilpasingh updated this object.
shilpasingh edited the test plan for this revision. (Show Details)
subodh6129 edited edge metadata.Feb 8 2016, 5:48 AM

Failing for eg:

  1. Enter -67 and then insert "." char. will result in .-67
  2. Enter "-" then enter some number
shilpasingh updated this revision to Diff 8384.Feb 8 2016, 6:13 AM
shilpasingh edited edge metadata.

Fixed the bug reported.

shilpasingh updated this revision to Diff 8385.Feb 8 2016, 6:39 AM

accept filter should always be first and then execute other filters.

subodh6129 added inline comments.Feb 8 2016, 6:59 AM
src/lib/elm_spinner.c
420

Do you need this data? If not please make it unused.

shilpasingh updated this revision to Diff 8386.Feb 8 2016, 7:03 AM
shilpasingh marked an inline comment as done.

Added EINA_UNUSED for unused parameter and pass NULL instead of spinner obj

shilpasingh updated this object.Feb 10 2016, 5:21 AM
cedric edited edge metadata.Feb 12 2016, 12:03 PM

How can I test this ?

Looks good
Thanks :)

@cedric, please launch spinner demo from elementary test and enter illegal inputs for the first spinner

for e.g: 5000.0.0.0.0 (I am trying to enter multiple ".")
try to enter minus sign in the middle for e.g: 5-0000
also you can try entering multiple '-' signs 5-000-000

as you can see all above inputs are totally illegal, I have verified spinners in other places/platforms and we cannot enter anything illegal in them as well hence bought in this feature.

shilpasingh updated this revision to Diff 8492.Feb 17 2016, 3:37 AM
shilpasingh edited edge metadata.

rebased

cedric accepted this revision.Feb 17 2016, 2:41 PM
cedric edited edge metadata.
This revision is now accepted and ready to land.Feb 17 2016, 2:41 PM
cedric closed this revision.Feb 17 2016, 2:41 PM