diff options
Diffstat (limited to 'src/test/slp_plugin_test.c')
-rw-r--r-- | src/test/slp_plugin_test.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/slp_plugin_test.c b/src/test/slp_plugin_test.c index 90eab44..c916e0b 100644 --- a/src/test/slp_plugin_test.c +++ b/src/test/slp_plugin_test.c @@ -77,6 +77,7 @@ int test_set_level() case 0 ... 100: TEST_SET(OEM_sys_set_haptic_motor_level, level); printf("set level: %d\n", level); + break; case -1: return 0; default: @@ -148,6 +149,7 @@ void svi_test() void vib_test() { char input,tmp; + int r; while(1) { printf("=======================1. vib_test==========================\n"); @@ -159,7 +161,10 @@ void vib_test() printf("q : quit\n"); printf("============================================================\n"); - scanf("%c", &input); + r = scanf("%c", &input); + if (r < 1) + continue; + while((tmp = getchar()) != '\n'); switch(input) { @@ -283,6 +288,7 @@ void backlight_test() int main() { char input,tmp; + int r; OEM_sys_get_devman_plugin_interface(); @@ -298,7 +304,10 @@ int main() printf("q : quit\n"); printf("=====================================================================\n"); - scanf("%c", &input); + r = scanf("%c", &input); + if (r < 1) + continue; + while((tmp = getchar()) != '\n'); switch(input) { |