--- /dev/null
+/*
+ * test
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <stdio.h>
+#include <error.h>
+#include <tzplatform_config.h>
+
+
+#include "test.h"
+
+#define METHOD_DISPLAY_GETBRIGHTNESS "getbrightness"
+#define METHOD_DISPLAY_SETBRIGHTNESS "setbrightness"
+#define METHOD_DISPLAY_GETMAXBRIGHTNESS "GetMaxBrightness"
+#define METHOD_DISPLAY_SETMAXBRIGHTNESS "SetMaxBrightness"
+#define METHOD_DISPLAY_HOLDBRIGHTNESS "HoldBrightness"
+#define METHOD_DISPLAY_RELEASEBRIGHTNESS "ReleaseBrightness"
+#define METHOD_DISPLAY_CUSTOMBRIGHTNESS "CustomBrightness"
+#define METHOD_DISPLAY_SETAUTOBRIGHTNESSMIN "setautobrightnessmin"
+#define METHOD_DISPLAY_SETREFRESHRATE "SetRefreshRate"
+#define METHOD_DISPLAY_GETDISPLAYCOUNT "GetDisplayCount"
+#define METHOD_DISPLAY_CHANGESTATE "ChangeState"
+#define METHOD_DISPLAY_LOCKSTATE_NOPT "lockstate_nopt"
+#define METHOD_DISPLAY_UNLOCKSTATE "unlockstate"
+#define METHOD_DISPLAY_SETLCDTIMEOUT "setlcdtimeout"
+#define METHOD_DISPLAY_CUSTOMLCDON "CustomLCDOn"
+#define METHOD_DISPLAY_LCDPANEL_OFFMODE "LCDPanelOffMode"
+#define METHOD_DISPLAY_STAYTOUCHSCREEN_OFF "StayTouchScreenOff"
+#define METHOD_DISPLAY_LOCKSCREENBGON "LockScreenBgOn"
+#define METHOD_DISPLAY_DUMPMODE "Dumpmode"
+#define METHOD_DISPLAY_SAVELOG "SaveLog"
+#define METHOD_DISPLAY_POWERKEY_IGNORE "PowerKeyIgnore"
+#define METHOD_DISPLAY_POWERKEY_LCDOFF "PowerKeyLCDOff"
+#define METHOD_DISPLAY_LOCKTIMEOUT_EXPIRED "LockTimeoutExpired"
+#define METHOD_DISPLAY_LOCKTIMEOUT_INPUT "LockTimeoutInput"
+#define METHOD_DISPLAY_ACTORCONTROL "ActorControl"
+#define METHOD_DISPLAY_START "start"
+#define METHOD_DISPLAY_STOP "stop"
+
+#define PM_STATE_LOG_FILE tzplatform_mkpath(TZ_SYS_ALLLOGS, "pm_state.log")
+
+static bool get_display_method(const char *method, int *value)
+{
+ DBusMessage *msg;
+ int val;
+ bool ret = FALSE;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ method, NULL, NULL);
+ if (!msg) {
+ _E("fail (%s): no reply", method);
+ return ret;
+ }
+
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID) == 0)
+ _E("fail (%s): no message", method);
+ else {
+ _I("success (%s): %d", method, val);
+ ret = TRUE;
+ if (NULL != value)
+ *value = val;
+ }
+
+ dbus_message_unref(msg);
+ return ret;
+}
+
+static bool set_display_method(const char *method, char *sig, char *param[])
+{
+ DBusMessage *msg;
+ int val;
+ bool ret = FALSE;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ method, sig, param);
+ if (!msg) {
+ _E("fail (%s): no reply", method);
+ return ret;
+ }
+
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID) == 0)
+ _E("fail (%s): no message", method);
+ else {
+ if ((val == -ENOTSUP) || (val == -ENOSYS)) {
+ _I("Not supported feature! (%s): %d", method, val);
+ ret = TRUE;
+ } else if (val < 0) {
+ _E("fail (%s): returned fail (%d)", method, val);
+ } else {
+ _I("success (%s): %d", method, val);
+ ret = TRUE;
+ }
+ }
+
+ dbus_message_unref(msg);
+ return ret;
+}
+
+static bool set_display_method_noreply(const char *method, char *sig, char *param[])
+{
+ DBusMessage *msg;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ method, sig, param);
+ if (!msg) {
+ _E("fail (%s): no reply", method);
+ return FALSE;
+ }
+
+ dbus_message_unref(msg);
+ return TRUE;
+}
+
+static bool get_display_brightness(int *brightness)
+{
+ return get_display_method(METHOD_DISPLAY_GETBRIGHTNESS, brightness);
+}
+
+static bool set_display_brightness(int brightness)
+{
+ DBusMessage *msg;
+ int getbrightness = -1;
+ int val = 0;
+ char *param[1];
+ char str_val[10];
+ bool ret = FALSE;
+
+ snprintf(str_val, sizeof(str_val), "%d", brightness);
+ param[0] = str_val;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ METHOD_DISPLAY_SETBRIGHTNESS, "i", param);
+ if (!msg) {
+ _E("fail : no reply");
+ return ret;
+ }
+
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID) == 0) {
+ _E("fail : no message");
+ goto out;
+ }
+
+ if (0 != val) { //setbrightness fail
+ if ((brightness <= 0) && (val == -EPERM)) {
+ _I("success : can't set brightness (%d) lower than zero", brightness);
+ ret = TRUE;
+ } else if (val == -EPERM) {
+ _E("fail : please check display api capability or brightness_automatic setting.");
+ } else {
+ _E("fail : return fail %d", val);
+ }
+ goto out;
+ } else {
+ if (brightness <= 0) {
+ _E("fail : can't set brightness (%d) lower than zero, but returned success", brightness);
+ goto out;
+ }
+ }
+
+ if (!get_display_brightness(&getbrightness)) {
+ _E("fail : can't get brightness");
+ } else {
+ if (brightness == getbrightness) {
+ _I("success : %d", getbrightness);
+ ret = TRUE;
+ } else {
+ _E("fail : set brightness %d, but current brightness is %d", brightness, getbrightness);
+ }
+ }
+out:
+ dbus_message_unref(msg);
+ return ret;
+}
+
+static bool get_display_maxbrightness()
+{
+ return get_display_method(METHOD_DISPLAY_GETMAXBRIGHTNESS, NULL);
+}
+
+static bool set_display_maxbrightness(int brightness)
+{
+ char *param[1];
+ char str_val[10];
+
+ snprintf(str_val, sizeof(str_val), "%d", brightness);
+ param[0] = str_val;
+
+ return set_display_method(METHOD_DISPLAY_SETMAXBRIGHTNESS, "i", param);
+}
+
+static bool set_display_holdbrightness(int brightness)
+{
+ char *param[1];
+ char str_val[10];
+
+ snprintf(str_val, sizeof(str_val), "%d", brightness);
+ param[0] = str_val;
+
+ return set_display_method(METHOD_DISPLAY_HOLDBRIGHTNESS, "i", param);
+}
+
+static bool set_display_releasebrightness()
+{
+ return set_display_method(METHOD_DISPLAY_RELEASEBRIGHTNESS, NULL, NULL);
+}
+
+static bool get_display_custombrightness()
+{
+ return get_display_method(METHOD_DISPLAY_CUSTOMBRIGHTNESS, NULL);
+}
+
+static bool set_display_autobrightness_min(int min)
+{
+ DBusMessage *msg;
+ int val = 0;
+ char *param[1];
+ char str_min[10];
+ bool ret = FALSE;
+
+ snprintf(str_min, sizeof(str_min), "%d", min);
+ param[0] = str_min;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ METHOD_DISPLAY_SETAUTOBRIGHTNESSMIN, "i", param);
+ if (!msg) {
+ _E("fail : no reply");
+ return ret;
+ }
+
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID) == 0) {
+ _E("fail : no message");
+ } else {
+ if ((min < 1) || (min > 100)) {
+ if (val < 0) {
+ _I("success : autobrightness min value should be 1~100. can't set (%d).", min);
+ ret = TRUE;
+ } else {
+ _I("fail : can't set (%d). but returned success", min);
+ }
+ } else {
+ if (val < 0) {
+ _E("fail : return fail (%d)", val);
+ } else {
+ _I("success : %d", val);
+ ret = TRUE;
+ }
+ }
+ }
+ dbus_message_unref(msg);
+ return ret;
+}
+
+static bool set_display_refreshrate(int app, int rate)
+{
+ char *param[2];
+ char str_app[10];
+ char str_rate[10];
+
+ snprintf(str_app, sizeof(str_app), "%d", app);
+ snprintf(str_rate, sizeof(str_rate), "%d", rate);
+
+ param[0] = str_app;
+ param[1] = str_rate;
+
+ return set_display_method(METHOD_DISPLAY_SETREFRESHRATE, "ii", param);
+}
+
+static bool get_display_count()
+{
+ return get_display_method(METHOD_DISPLAY_GETDISPLAYCOUNT, NULL);
+}
+
+static bool set_display_changestate(char *state)
+{
+ char *param[1];
+
+ param[0] = state;
+
+ return set_display_method(METHOD_DISPLAY_CHANGESTATE, "s", param);
+}
+
+static bool set_display_lockstate_nopt(char *state, char *option, char *ignore, int timeout)
+{
+ char *param[4];
+ char str_timeout[10];
+
+ snprintf(str_timeout, sizeof(str_timeout), "%d", timeout);
+
+ param[0] = state;
+ param[1] = option;
+ param[1] = ignore;
+ param[1] = str_timeout;
+
+ return set_display_method(METHOD_DISPLAY_LOCKSTATE_NOPT, "sssi", param);
+}
+
+static bool set_display_unlockstate(char *state, char *option)
+{
+ char *param[2];
+
+ param[0] = state;
+ param[1] = option;
+
+ return set_display_method(METHOD_DISPLAY_UNLOCKSTATE, "ss", param);
+}
+
+static bool set_display_lcdtimeout(int normal, int dim, int holdkey_block)
+{
+ char *param[3];
+ char str_normal[10];
+ char str_dim[10];
+ char str_holdkey[10];
+
+ snprintf(str_normal, sizeof(str_normal), "%d", normal);
+ snprintf(str_dim, sizeof(str_dim), "%d", dim);
+ snprintf(str_holdkey, sizeof(str_holdkey), "%d", holdkey_block);
+
+ param[0] = str_normal;
+ param[1] = str_dim;
+ param[2] = str_holdkey;
+
+ return set_display_method(METHOD_DISPLAY_SETLCDTIMEOUT, "iii", param);
+}
+
+static bool set_display_customlcdon(int timeout_msec)
+{
+ char *param[3];
+ char str_timeout[10];
+
+ snprintf(str_timeout, sizeof(str_timeout), "%d", timeout_msec);
+
+ param[0] = str_timeout;
+
+ return set_display_method(METHOD_DISPLAY_CUSTOMLCDON, "i", param);
+}
+
+static bool set_display_lcdpanel_offmode(int on)
+{
+ char *param[1];
+ char str_on[10];
+
+ snprintf(str_on, sizeof(str_on), "%d", on);
+ param[0] = str_on;
+
+ return set_display_method(METHOD_DISPLAY_LCDPANEL_OFFMODE, "i", param);
+}
+
+static bool set_display_staytouchscreen_off(int on)
+{
+ char *param[1];
+ char str_on[10];
+
+ snprintf(str_on, sizeof(str_on), "%d", on);
+ param[0] = str_on;
+
+ return set_display_method(METHOD_DISPLAY_STAYTOUCHSCREEN_OFF, "i", param);
+}
+
+static bool set_display_lockscreen_bg_on(char *on)
+{
+ char *param[1];
+
+ param[0] = on;
+
+ return set_display_method(METHOD_DISPLAY_LOCKSCREENBGON, "s", param);
+}
+
+static bool set_display_dumpmode(char *on)
+{
+ char *param[1];
+
+ param[0] = on;
+
+ return set_display_method(METHOD_DISPLAY_DUMPMODE, "s", param);
+}
+
+static bool set_display_savelog()
+{
+ DBusMessage *msg;
+ struct stat buf;
+ bool ret = FALSE;
+
+ if (!stat(PM_STATE_LOG_FILE, &buf)) {
+ remove(PM_STATE_LOG_FILE);
+ }
+
+ if (!set_display_method_noreply(METHOD_DISPLAY_SAVELOG, NULL, NULL))
+ return ret;
+
+ sleep(3);
+
+ if (!stat(PM_STATE_LOG_FILE, &buf)) {
+ _I("success : %s", PM_STATE_LOG_FILE);
+ ret = TRUE;
+ }
+
+ return ret;
+}
+
+static bool set_display_powerkey_ignore(int on)
+{
+ char *param[1];
+ char str_on[10];
+
+ snprintf(str_on, sizeof(str_on), "%d", on);
+ param[0] = str_on;
+
+ return set_display_method(METHOD_DISPLAY_POWERKEY_IGNORE, "i", param);
+}
+
+static bool set_display_powerkey_lcdoff()
+{
+ return set_display_method(METHOD_DISPLAY_POWERKEY_LCDOFF, NULL, NULL);
+}
+
+static bool set_display_locktimeout_expired(char *req_id)
+{
+ DBusMessage *msg;
+ char *param[1];
+ int val;
+ char *ret_req_id;
+ bool ret = FALSE;
+
+ param[0] = req_id;
+
+ msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
+ DEVICED_PATH_DISPLAY,
+ DEVICED_INTERFACE_DISPLAY,
+ METHOD_DISPLAY_LOCKTIMEOUT_EXPIRED, "s", param);
+ if (!msg) {
+ _E("fail: no reply");
+ return ret;
+ }
+
+ if (dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_STRING, &ret_req_id, //request id
+ DBUS_TYPE_INT32, &val, //return value
+ DBUS_TYPE_INVALID) == 0)
+ _E("fail: no message");
+ else {
+ if ((0 != strcmp(req_id, ret_req_id)) || (val < 0)) {
+ _E("fail: return fail");
+ } else {
+ _I("success: %s %d", ret_req_id, val);
+ ret = TRUE;
+ }
+ }
+
+ dbus_message_unref(msg);
+ return ret;
+}
+
+static bool set_display_locktimeout_input(char *req_id, int input)
+{
+ char *param[2];
+ char str_input[10];
+
+ snprintf(str_input, sizeof(str_input), "%d", input);
+ param[0] = req_id;
+ param[1] = str_input;
+
+ return set_display_method(METHOD_DISPLAY_LOCKTIMEOUT_INPUT, "si", param);
+}
+
+static bool set_display_actorcontrol(char *command, int actor, int caps)
+{
+ char *param[3];
+ char str_actor[10];
+ char str_caps[10];
+
+ snprintf(str_actor, sizeof(str_actor), "%d", actor);
+ snprintf(str_caps, sizeof(str_caps), "%d", caps);
+ param[0] = command;
+ param[1] = str_actor;
+ param[2] = str_caps;
+
+ return set_display_method(METHOD_DISPLAY_ACTORCONTROL, "sii", param);
+}
+
+static bool set_display_start()
+{
+ return set_display_method_noreply(METHOD_DISPLAY_START, NULL, NULL);
+}
+
+static bool set_display_stop()
+{
+ return set_display_method_noreply(METHOD_DISPLAY_STOP, NULL, NULL);
+}
+
+void display_test_all(int *success, int *fail)
+{
+ int s = 0;
+ int f = 0;
+
+ (get_display_brightness(NULL)) ? s++ : f++;
+ (set_display_brightness(67)) ? s++ : f++;
+ (set_display_brightness(0)) ? s++ : f++;
+ (get_display_maxbrightness()) ? s++ : f++;
+ (set_display_maxbrightness(80)) ? s++ : f++; //not support, always success.
+ (set_display_holdbrightness(30)) ? s++ : f++;
+ (set_display_releasebrightness()) ? s++ : f++;
+ (get_display_custombrightness()) ? s++ : f++;
+ (set_display_autobrightness_min(15)) ? s++ : f++;
+ (set_display_autobrightness_min(0)) ? s++ : f++;
+ (set_display_refreshrate(0, 30)) ? s++ : f++;
+ (get_display_count()) ? s++ : f++;
+ (set_display_changestate("lcdon")) ? s++ : f++;
+ //(set_display_lockstate_nopt("lcddim", "staycurstate", "", 3)) ? s++ : f++;
+ //(set_display_unlockstate("lcddim", "resettimer")) ? s++ : f++;
+ (set_display_lcdtimeout(5, 10, 1)) ? s++ : f++;
+ (set_display_customlcdon(6000)) ? s++ : f++;
+ (set_display_lcdpanel_offmode(1)) ? s++ : f++;
+ (set_display_lcdpanel_offmode(0)) ? s++ : f++;
+ (set_display_staytouchscreen_off(1)) ? s++ : f++;
+ (set_display_staytouchscreen_off(0)) ? s++ : f++;
+ (set_display_lockscreen_bg_on("true")) ? s++ : f++;
+ (set_display_dumpmode("on")) ? s++ : f++;
+ (set_display_dumpmode("off")) ? s++ : f++;
+ (set_display_savelog()) ? s++ : f++;
+ (set_display_powerkey_ignore(1)) ? s++ : f++; //not support, always success.
+ (set_display_powerkey_lcdoff()) ? s++ : f++; //not support, always success.
+ //(set_display_locktimeout_expired("auto_test")) ? s++ : f++;
+ //(set_display_locktimeout_input("auto_test", 1)) ? s++ : f++;
+ (set_display_actorcontrol("set", 4, 1<<3)) ? s++ : f++;
+ (set_display_actorcontrol("reset", 4, 1<<3)) ? s++ : f++;
+ (set_display_stop()) ? s++ : f++;
+ (set_display_start()) ? s++ : f++;
+
+ if (NULL != success) *success = s;
+ if (NULL != fail) *fail = f;
+}
+
+static void display_init(void *data)
+{
+ int success = 0;
+ int fail = 0;
+
+ _I("start test");
+
+ display_test_all(&success, &fail);
+
+ _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+}
+
+static void display_exit(void *data)
+{
+ _I("end test");
+
+}
+
+static int display_unit(int argc, char **argv)
+{
+ if (argc < 4) {
+ int success = 0;
+ int fail = 0;
+ _I("start test");
+ display_test_all(&success, &fail);
+ _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_GETBRIGHTNESS)) {
+ get_display_brightness(NULL);
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SETBRIGHTNESS)) {
+ set_display_brightness(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_GETMAXBRIGHTNESS)) {
+ get_display_maxbrightness();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SETMAXBRIGHTNESS)) {
+ set_display_maxbrightness(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_HOLDBRIGHTNESS)) {
+ set_display_holdbrightness(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_RELEASEBRIGHTNESS)) {
+ set_display_releasebrightness();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_CUSTOMBRIGHTNESS)) {
+ get_display_custombrightness();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SETAUTOBRIGHTNESSMIN)) {
+ set_display_autobrightness_min(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SETREFRESHRATE)) {
+ set_display_refreshrate(atoi(argv[4]), atoi(argv[5]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_GETDISPLAYCOUNT)) {
+ get_display_count();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_CHANGESTATE)) {
+ set_display_changestate(argv[4]);
+// } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_LOCKSTATE_NOPT)) {
+// set_display_lockstate_nopt(argv[4], argv[5], argv[6], atoi(argv[7]));
+// } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_UNLOCKSTATE)) {
+// set_display_lockstate_nopt(argv[4], argv[5]);
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SETLCDTIMEOUT)) {
+ set_display_lcdtimeout(atoi(argv[4]), atoi(argv[5]), atoi(argv[6]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_CUSTOMLCDON)) {
+ set_display_customlcdon(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_LCDPANEL_OFFMODE)) {
+ set_display_lcdpanel_offmode(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_STAYTOUCHSCREEN_OFF)) {
+ set_display_staytouchscreen_off(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_LOCKSCREENBGON)) {
+ set_display_lockscreen_bg_on(argv[4]);
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_DUMPMODE)) {
+ set_display_dumpmode(argv[4]);
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_SAVELOG)) {
+ set_display_savelog();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_POWERKEY_IGNORE)) {
+ set_display_powerkey_ignore(atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_POWERKEY_LCDOFF)) {
+ set_display_powerkey_lcdoff();
+// } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_LOCKTIMEOUT_EXPIRED)) {
+// set_display_locktimeout_expired(argv[4]);
+// } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_LOCKTIMEOUT_INPUT)) {
+// set_display_locktimeout_input(argv[4], atoi(argv[4]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_ACTORCONTROL)) {
+ set_display_actorcontrol(argv[4], atoi(argv[5]), atoi(argv[6]));
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_START)) {
+ set_display_start();
+ } else if (0 == strcasecmp(argv[3], METHOD_DISPLAY_STOP)) {
+ set_display_stop();
+ } else {
+ _E("Unknown test case!!!");
+ }
+
+ return 0;
+}
+
+static const struct test_ops display_test_ops = {
+ .priority = TEST_PRIORITY_NORMAL,
+ .name = "display",
+ .init = display_init,
+ .exit = display_exit,
+ .unit = display_unit,
+};
+
+TEST_OPS_REGISTER(&display_test_ops)