Change dumpsys-client test app 07/243707/1
authorKonrad Kuchciak <k.kuchciak@samsung.com>
Wed, 9 Sep 2020 08:23:35 +0000 (10:23 +0200)
committerKonrad Kuchciak <k.kuchciak@samsung.com>
Wed, 9 Sep 2020 08:26:01 +0000 (10:26 +0200)
The app has been changed to print "Test string\n"
N number of times, where N is a received parameter.

Change-Id: I055f03b515bd049c50aa209bd5156b46ba0fc7b8
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
src/test/tct-support/dumpsys-client/src/dumpsys-client.c

index be829b0edb852e5f700ea633b5992d622c55dab3..1586b96dc232792ce0fa4047a39c60f9198125fc 100644 (file)
@@ -24,6 +24,8 @@
 #define LOGD(...) dlog_print(DLOG_DEBUG, LOG_TAG, __VA_ARGS__)
 #define LOGE(...) dlog_print(DLOG_ERROR, LOG_TAG, __VA_ARGS__)
 
+#define TEST_STRING "Test string\n"
+
 static int cb(dumpsys_dump_h ctx)
 {
     int argc;
@@ -49,16 +51,15 @@ static int cb(dumpsys_dump_h ctx)
     for (int i=0; i < argc; i++)
         LOGD("arg %d: %s", i, argv[i]);
 
-    if (argc < 2) {
+    if (argc < 1) {
         LOGE("Not enough dump arguments");
-        LOGD("Dump request must be called with two arguments: {n, s}");
-        LOGD("Dump log will consist of string 's' repeated 'n' times");
+        LOGD("Provide number of test lines to print");
         return -1;
     }
 
     LOGD("Writing data...");
     for (int i=0; i < atoi(argv[0]); i++) {
-        ret = dumpsys_write(ctx, argv[1], strlen(argv[1]));
+        ret = dumpsys_write(ctx, TEST_STRING, strlen(TEST_STRING));
         if (ret) {
             LOGE("dumpsys_write() failed: %d", ret);
             return -1;