Remove legacy IU engine module 41/281641/1 accepted/tizen/unified/20220921.022909
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 19 Sep 2022 07:39:06 +0000 (16:39 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Tue, 20 Sep 2022 06:24:06 +0000 (15:24 +0900)
- Issue:
Legacy IU module is not used now.

- Solution:
This patch removes legacy IU module from the project. This legacy IU
module does not fit current architecture for voice touch feature.

Change-Id: If5af3c00df414a94ff63acc4ffb0675ba296f0d4
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/mmimgr/iu/intent_understanding_engine.cpp [deleted file]
src/mmimgr/iu/intent_understanding_engine.h [deleted file]
src/mmimgr/iu/mmi_iu.cpp
src/mmimgr/meson.build
tests/iu/intent_understanding_engine_rule_unittests.cpp [deleted file]
tests/iu/intent_understanding_engine_unittests.cpp [deleted file]
tests/meson.build

diff --git a/src/mmimgr/iu/intent_understanding_engine.cpp b/src/mmimgr/iu/intent_understanding_engine.cpp
deleted file mode 100644 (file)
index 4f738ea..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <unistd.h>
-#include <string>
-#include <json-glib/json-glib.h>
-#include <unordered_map>
-
-#include "mmi_iu_log.h"
-#include "mmi_iu_event.h"
-#include "intent_understanding_engine.h"
-#include "input_intent.h"
-#include "output_intent.h"
-#include "mmi-common.h"
-
-using namespace std;
-
-static unordered_map<string, string> key_action_map
-    = { { "UP",         "Up" },
-        { "DOWN",       "Down" },
-        { "LEFT",       "Left" },
-        { "RGHT",       "Right" },
-        { "I360",       "Ok" },
-        { "XF86Back",   "Back" },
-        { "I69",        "Back" },
-      };
-
-static unordered_map<int, string> voice_action_map
-    = { { MMI_EVENT_VOICE_TYPE_UP,       "MoveUp" },
-        { MMI_EVENT_VOICE_TYPE_DOWN,     "MoveDown" },
-        { MMI_EVENT_VOICE_TYPE_LEFT,     "MoveLeft" },
-        { MMI_EVENT_VOICE_TYPE_RIGHT,    "MoveRight" },
-        { MMI_EVENT_VOICE_TYPE_CANCEL,   "Cancel" },
-        { MMI_EVENT_VOICE_TYPE_PLAY,     "Play" },
-        { MMI_EVENT_VOICE_TYPE_YES,      "Yes" },
-        { MMI_EVENT_VOICE_TYPE_EXECUTE,  "Execute" },
-        { MMI_EVENT_VOICE_TYPE_BACK,     "Back" },
-        { MMI_EVENT_VOICE_TYPE_EXIT,     "Exit" },
-        { MMI_EVENT_VOICE_TYPE_STOP,     "Stop" },
-        { MMI_EVENT_VOICE_TYPE_TERMINATE, "Terminate" },
-        { MMI_EVENT_VOICE_TYPE_SHOW_NUMBER, "ShowNumber" },
-        { MMI_EVENT_VOICE_TYPE_SHOW_LABEL, "ShowLabel" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_ONE, "TouchOne" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_TWO, "TouchTwo" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_THREE, "TouchThree" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_FOUR, "TouchFour" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_FIVE, "TouchFive" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_SIX, "TouchSix" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_SEVEN, "TouchSeven" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_EIGHT, "TouchEight" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_NINE, "TouchNine" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_TEN, "TouchTen" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_ELEVEN, "TouchEleven" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_TWELVE, "TouchTwelve" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_WIFI, "TouchWifi" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_DATETIME, "TouchDateTime" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_AUTOMODE, "TouchAutoMode" },
-        { MMI_EVENT_VOICE_TYPE_TOUCH_GRID, "TouchGrid" },
-      };
-
-static unordered_map<int, string> gesture_action_map
-    = { { MMI_EVENT_GESTURE_TYPE_SWIPE_UP,   "HandUp" },
-        { MMI_EVENT_GESTURE_TYPE_SWIPE_DOWN, "HandDown" },
-        { MMI_EVENT_GESTURE_TYPE_SWIPE_LEFT, "HandLeft" },
-        { MMI_EVENT_GESTURE_TYPE_SWIPE_RIGHT, "HandRight" },
-        { MMI_EVENT_GESTURE_TYPE_PUSH,       "HandPush" },
-        //{ MMI_EVENT_GESTURE_TYPE_WAVEHANDX,  "WaveHandX" },
-        //{ MMI_EVENT_GESTURE_TYPE_FLIPPALM,   "FlipPalm" },
-        //{ MMI_EVENT_GESTURE_TYPE_SHOWPALM,   "ShowPalm" }
-      };
-
-static unordered_map<int, string> vision_action_map
-    = { { MMI_EVENT_VISION_TYPE_USER_MOVE_AWAY, "OutOfVision" }
-      };
-
-IntentUnderstandingEngine::IntentUnderstandingEngine()
-{
-}
-
-IntentUnderstandingEngine::~IntentUnderstandingEngine()
-{
-
-}
-
-void IntentUnderstandingEngine::set_app_state(const char *state)
-{
-     if (string(state) == "Initiation")
-        application_state = MMI_STATE_INITIATION;
-    else if (string(state) == "Exploration")
-        application_state = MMI_STATE_EXPLORATION;
-    else if (string(state) == "Execution")
-        application_state = MMI_STATE_EXECUTION;
-    else if (string(state) == "Feedback")
-        application_state = MMI_STATE_FEEDBACK;
-    else if (string(state) == "Observation")
-        application_state = MMI_STATE_OBSERVATION;
-    else if (string(state) == "Termination")
-        application_state = MMI_STATE_TERMINATION;
-}
-
-void IntentUnderstandingEngine::set_app_state(mmi_state appstate)
-{
-    application_state = appstate;
-}
-
-mmi_state IntentUnderstandingEngine::get_app_state()
-{
-    return application_state;
-}
-
-bool IntentUnderstandingEngine::parse_json_data(JsonParser *parser)
-{
-    JsonNode *root = NULL;
-
-    JsonObject *root_obj = NULL;
-    JsonObject *output_intent_obj = NULL;
-    JsonObject *input_intent_obj = NULL;
-    JsonObject *iu_rule_arr_obj = NULL;
-
-    JsonArray *input_intent_array = NULL;
-    JsonArray *iu_rule_array = NULL;
-
-    const gchar *status = NULL;
-    const gchar *output_action = NULL;
-    const gchar *modality = NULL;
-    const gchar *action = NULL;
-
-    int arr_len = 0;
-
-    root = json_parser_get_root(parser);
-    if (root == NULL) {
-        _E("failed to get root");
-        return false;
-    }
-
-    root_obj = json_node_get_object(root);
-    if (root_obj == NULL) {
-        _E("failed to get object");
-        return false;
-    }
-
-    iu_rule_array = json_object_get_array_member(root_obj, "IURule");
-    if (iu_rule_array) {
-        iu_rule_list.clear();
-
-        arr_len = json_array_get_length(iu_rule_array);
-
-        for (int i = 0; i < arr_len; i++) {
-            IntentUnderstandingRule iu_rule;
-            iu_rule_arr_obj = json_array_get_object_element(iu_rule_array, i);
-            input_intent_array = json_object_get_array_member(iu_rule_arr_obj, "InputIntents");
-
-            if (input_intent_array) {
-                int input_intent_list_len = json_array_get_length(input_intent_array);
-                for (int j = 0; j < input_intent_list_len; j++) {
-                    input_intent_obj = json_array_get_object_element(input_intent_array, j);
-
-                    modality = json_object_get_string_member(input_intent_obj, "Modality");
-                    action = json_object_get_string_member(input_intent_obj, "Action");
-
-                    InputIntent intent;
-                    intent.set_modality(string(modality));
-                    intent.set_action(string(action));
-
-                    iu_rule.add_input_intent(intent);
-                }
-            }
-
-            status = json_object_get_string_member(iu_rule_arr_obj, "MMIStatus");
-            iu_rule.set_app_state(status);
-
-            output_intent_obj = json_object_get_object_member(iu_rule_arr_obj, "OutputIntent");
-            output_action = json_object_get_string_member(output_intent_obj, "Action");
-
-            OutputIntent oi;
-            oi.set_action(output_action);
-
-            iu_rule.set_output_intent(oi);
-
-            iu_rule_list.push_back(iu_rule);
-        }
-    }
-
-    return true;
-}
-
-bool IntentUnderstandingEngine::set_rule_json_file(const char *json_file_path)
-{
-    if (!json_file_path)
-        return false;
-
-    JsonParser *parser = json_parser_new();
-    GError *err_msg = NULL;
-    bool ret = true;
-
-    json_parser_load_from_file(parser, (char *)json_file_path, &err_msg);
-    if (err_msg) {
-        _E("failed to load json file. error message: %s", err_msg->message);
-        ret = false;
-        goto cleanup;
-    }
-
-    ret = parse_json_data(parser);
-
-cleanup:
-    if (err_msg)
-        g_error_free(err_msg);
-
-    if (parser)
-        g_object_unref(parser);
-
-    return ret;
-}
-
-bool IntentUnderstandingEngine::set_rule_json_data(const char *json_data)
-{
-    if (!json_data)
-        return false;
-
-    JsonParser *parser = json_parser_new();
-    GError *err_msg = NULL;
-    bool ret = true;
-
-    json_parser_load_from_data(parser, (char *)json_data, -1, &err_msg);
-    if (err_msg) {
-        _E("failed to load json file. error message: %s", err_msg->message);
-        ret = false;
-        goto cleanup;
-    }
-
-    parse_json_data(parser);
-
-cleanup:
-    if (err_msg)
-        g_error_free(err_msg);
-
-    if (parser)
-        g_object_unref(parser);
-
-    return ret;
-}
-
-bool IntentUnderstandingEngine::set_input_intent_json_data(const char *json_data)
-{
-    JsonParser *parser = json_parser_new();
-    GError *err_msg = NULL;
-    JsonNode *root = NULL;
-    JsonObject *root_obj = NULL;
-    JsonArray *input_intent_array = NULL;
-    JsonObject *arr_obj;
-    const gchar *modality_type;
-    const gchar *action;
-
-    bool ret = true;
-    int arr_len = 0;
-    int input_time = 0, input_duration = 0;
-
-    json_parser_load_from_data(parser, (char *)json_data, -1, &err_msg);
-    if (err_msg) {
-        _E("failed to load json file. error message: %s", err_msg->message);
-        ret = false;
-        goto cleanup;
-    }
-
-    root = json_parser_get_root(parser);
-    if (root == NULL) {
-        _E("failed to get root");
-        ret = false;
-        goto cleanup;
-    }
-
-    root_obj = json_node_get_object(root);
-    if (root_obj == NULL) {
-        _E("failed to get object");
-        ret = false;
-        goto cleanup;
-    }
-
-    input_intent_array = json_object_get_array_member(root_obj, "InputIntents");
-    if (input_intent_array) {
-        input_intent_list.clear();
-
-        arr_len = json_array_get_length(input_intent_array);
-
-        for (int i = 0; i < arr_len; i++) {
-            input_time = 0, input_duration = 0;
-            arr_obj = json_array_get_object_element(input_intent_array, i);
-            modality_type = json_object_get_string_member(arr_obj, "Modality");
-            action = json_object_get_string_member(arr_obj, "Action");
-
-            if (json_object_has_member(arr_obj, "Time"))
-                input_time = json_object_get_int_member(arr_obj, "Time");
-
-            if (json_object_has_member(arr_obj, "Duration"))
-                input_duration = json_object_get_int_member(arr_obj, "Duration");
-
-            _I("### modality type: %s, action: %s, time: %d, duration: %d ###\n", modality_type, action, input_time, input_duration);
-
-            InputIntent intent;
-            intent.set_modality(string(modality_type));
-            intent.set_action(string(action));
-            intent.set_input_time(input_time);
-            intent.set_input_duration(input_duration);
-
-            input_intent_list.push_back(intent);
-        }
-    }
-
-cleanup:
-    if (err_msg)
-        g_error_free(err_msg);
-
-    if (parser)
-        g_object_unref(parser);
-
-    return ret;
-}
-
-string IntentUnderstandingEngine::convert_key_event(int type, char *keyname)
-{
-    string action;
-    string button_name;
-
-    if (!keyname)
-        return string("");
-
-    button_name = key_action_map[string(keyname)];
-    if (!button_name.empty()) {
-        action = "Press" + button_name + "Button";
-    }
-
-    return action;
-}
-
-string IntentUnderstandingEngine::convert_voice_event(int type)
-{
-    string action = voice_action_map[type];
-    return action;
-}
-
-string IntentUnderstandingEngine::convert_gesture_event(int type)
-{
-    string action = gesture_action_map[type];
-    return action;
-}
-
-string IntentUnderstandingEngine::convert_vision_event(int type)
-{
-    string action = vision_action_map[type];
-    return action;
-}
-
-bool IntentUnderstandingEngine::set_input_event(int type, void *event)
-{
-    InputIntent intent;
-    string modality_type;
-    string action;
-
-    mmi_provider_event_key *key_event;
-    mmi_provider_event_voice *voice_event;
-    mmi_provider_event_gesture *gesture_event;
-    mmi_provider_event_vision *vision_event;
-
-    if (type == MMI_PROVIDER_EVENT_KEY) {
-        modality_type = "KeyInput";
-        key_event = (mmi_provider_event_key *)event;
-        action = convert_key_event(type, key_event->keyname);
-    }
-    else if (type == MMI_PROVIDER_EVENT_VOICE) {
-        modality_type = "Voice";
-        voice_event = (mmi_provider_event_voice *)event;
-        action = convert_voice_event(voice_event->type);
-    }
-    else if (type == MMI_PROVIDER_EVENT_GESTURE) {
-        modality_type = "Gesture";
-        gesture_event = (mmi_provider_event_gesture *)event;
-        action = convert_gesture_event(gesture_event->type);
-    }
-    else if (type == MMI_PROVIDER_EVENT_VISION) {
-        modality_type = "Vision";
-        vision_event = (mmi_provider_event_vision *)event;
-        action = convert_vision_event(vision_event->type);
-    }
-
-    intent.set_modality(modality_type);
-    intent.set_action(action);
-
-    input_intent_list.push_back(intent);
-
-    return !action.empty();
-}
-
-string IntentUnderstandingEngine::get_output_intent_json_data()
-{
-    OutputIntent oi;
-    string output_json_text;
-
-    oi.set_action(get_output_intent_action());
-
-    output_json_text = oi.get_output_intent_text();
-
-    return output_json_text;
-}
-
-bool IntentUnderstandingEngine::match_input_intent(IntentUnderstandingRule iu_rule)
-{
-    unsigned int input_intent_size = input_intent_list.size();
-    unsigned int match_count = 0;
-
-    if (iu_rule.get_input_intent_size() != input_intent_size)
-        return false;
-
-    for (InputIntent it : input_intent_list)
-    {
-        if (iu_rule.find_input_intent(it))
-        {
-            match_count++;
-            break;
-        }
-    }
-
-    return input_intent_size == match_count ? true : false;
-}
-
-string IntentUnderstandingEngine::get_output_intent_action()
-{
-    if (iu_rule_list.empty()) {
-        _E("No intent understanding rule data");
-        return string("");
-    }
-
-    for (IntentUnderstandingRule iu_rule : iu_rule_list)
-    {
-        if (match_input_intent(iu_rule) && iu_rule.get_app_state() == application_state) {
-            string output_action = iu_rule.get_output_intent().get_action();
-            _D("Output action : %s\n", output_action.c_str());
-            return output_action;
-        }
-    }
-
-    return string("");
-}
-
-void IntentUnderstandingEngine::init_input_buffer()
-{
-    input_intent_list.clear();
-}
-
-void IntentUnderstandingEngine::set_event_handler(event_callback_func event_cb)
-{
-    on_event_handler = std::move(event_cb);
-}
-
diff --git a/src/mmimgr/iu/intent_understanding_engine.h b/src/mmimgr/iu/intent_understanding_engine.h
deleted file mode 100644 (file)
index 6090a44..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __INTENT_UNDERSTANDING_ENGINE__
-#define __INTENT_UNDERSTANDING_ENGINE__
-
-#include <unistd.h>
-#include <string>
-#include <list>
-#include <functional>
-
-#include "input_intent.h"
-#include "mmi-common.h"
-#include "iu_rule.h"
-
-using namespace std;
-
-class IntentUnderstandingEngine {
-private:
-    typedef std::function<void(int, void *)> event_callback_func;
-
-    event_callback_func on_event_handler;
-
-public:
-    IntentUnderstandingEngine();
-    virtual ~IntentUnderstandingEngine();
-
-    bool set_rule_json_file(const char *json_file_path);
-    bool set_rule_json_data(const char *json_data);
-
-    bool set_input_intent_json_data(const char *json_data);
-    bool set_input_event(int type, void *event);
-
-    string get_output_intent_json_data();
-    string get_output_intent_action();
-
-    void set_app_state(mmi_state appstate);
-    void set_app_state(const char *state);
-
-    void init_input_buffer();
-
-    mmi_state get_app_state();
-
-    void set_event_handler(event_callback_func event_cb);
-
-private:
-    bool match_input_intent(IntentUnderstandingRule iu_rule);
-
-    bool parse_json_data(JsonParser *parser);
-
-    string convert_key_event(int type, char *keyname);
-    string convert_voice_event(int type);
-    string convert_gesture_event(int type);
-    string convert_vision_event(int type);
-
-    list<IntentUnderstandingRule> iu_rule_list;
-    list<InputIntent> input_intent_list;
-
-    mmi_state application_state = MMI_STATE_INITIATION;
-};
-
-#endif /* __INTENT_UNDERSTANDING_ENGINE__ */
index 8a96a1c..7a28d31 100644 (file)
@@ -24,7 +24,6 @@
 #include "mmi_iu_log.h"
 #include "output_intent.h"
 #include "input_intent.h"
-#include "intent_understanding_engine.h"
 #include "VoiceTouchEngine.h"
 #include "mmi-common.h"
 
@@ -42,7 +41,6 @@ static bool initialized = false;
 static string g_system_app_id;
 static string g_focus_app_id;
 
-static IntentUnderstandingEngine *iu_engine = NULL;
 static VoiceTouchEngine *g_VoiceTouchEngine = nullptr;
 
 #define DEFAULT_RULE_FILE "/usr/share/iu/default_rule.json"
@@ -88,7 +86,6 @@ EXPORT_API int mmi_iu_init()
     init();
 
     try {
-        iu_engine = new IntentUnderstandingEngine();
         g_VoiceTouchEngine = new VoiceTouchEngine();
     } catch (exception &e) {
         _E("[MMI IU] Fail to allocate memory. (%s)", e.what());
@@ -109,11 +106,6 @@ EXPORT_API int mmi_iu_shutdown()
 {
     init();
 
-    if (iu_engine) {
-        delete iu_engine;
-        iu_engine = NULL;
-    }
-
     delete g_VoiceTouchEngine;
     g_VoiceTouchEngine = nullptr;
 
index 05da294..05f120d 100644 (file)
@@ -17,8 +17,6 @@ mmimgr_srcs = [
        'mmi_stub.c',
        'iu/input_intent.cpp',
        'iu/input_intent.h',
-       'iu/intent_understanding_engine.cpp',
-       'iu/intent_understanding_engine.h',
        'iu/iu_rule.cpp',
        'iu/iu_rule.h',
        'iu/mmi_iu.cpp',
diff --git a/tests/iu/intent_understanding_engine_rule_unittests.cpp b/tests/iu/intent_understanding_engine_rule_unittests.cpp
deleted file mode 100644 (file)
index 8700e6d..0000000
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*
- * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <gtest/gtest.h>
-#include <string>
-
-#include "mmi_iu.h"
-#include "output_intent.h"
-#include "intent_understanding_engine.h"
-#include <glib.h>
-#include <string>
-#include <json-glib/json-glib.h>
-
-using namespace std;
-
-namespace {
-
-class IUEngineRuleTest : public testing::Test {
-    public:
-        virtual void SetUp() {
-            EXPECT_EQ(iue.set_rule_json_data(rule.c_str()), true);
-        }
-        virtual void TearDown() {
-        }
-
-        IntentUnderstandingEngine iue;
-
-    private:
-        string rule = R"({
-            "IURule" : [
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressMicButton"
-                        }
-                    ],
-                    "MMIStatus" : "Initiation",
-                    "OutputIntent": {
-                        "Action" : "WakeUp"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "ShowPalm"
-                        }
-                    ],
-                    "MMIStatus": "Initiation",
-                    "OutputIntent": {
-                        "Action" : "WakeUp"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressUpButton"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveUp"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressDownButton"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveDown"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressRightButton"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveRight"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressLeftButton"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveLeft"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "MoveUp"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveUp"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "MoveDown"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveDown"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "MoveRight"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveRight"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "MoveLeft"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveLeft"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "HandUp"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveUp"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "HandDown"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveDown"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "HandRight"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveRight"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "HandLeft"
-                        }
-                    ],
-                    "MMIStatus": "Exploration",
-                    "OutputIntent": {
-                        "Action" : "MoveLeft"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressOkButton"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Execute"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Play"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Play"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Yes"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Yes"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Yes"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Yes"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "HandPush"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressOkButton"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Execute"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressBackButton"
-                        }
-                    ],
-                    "MMIStatus": "Execution",
-                    "OutputIntent": {
-                        "Action" : "Cancel"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressBackButton"
-                        }
-                    ],
-                    "MMIStatus": "Feedback",
-                    "OutputIntent": {
-                        "Action" : "Cancel"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Cancel"
-                        }
-                    ],
-                    "MMIStatus": "Feedback",
-                    "OutputIntent": {
-                        "Action" : "Cancel"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Back"
-                        }
-                    ],
-                    "MMIStatus": "Feedback",
-                    "OutputIntent": {
-                        "Action" : "Cancel"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "WaveHandX"
-                        }
-                    ],
-                    "MMIStatus": "Feedback",
-                    "OutputIntent": {
-                        "Action" : "Cancel"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Vision",
-                            "Action" : "OutOfVision"
-                        }
-                    ],
-                    "MMIStatus": "Observation",
-                    "OutputIntent": {
-                        "Action" : "Pause"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "KeyInput",
-                            "Action" : "PressBackButton"
-                        }
-                    ],
-                    "MMIStatus": "Termination",
-                    "OutputIntent": {
-                        "Action" : "Exit"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Exit"
-                        }
-                    ],
-                    "MMIStatus": "Termination",
-                    "OutputIntent": {
-                        "Action" : "Exit"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Stop"
-                        }
-                    ],
-                    "MMIStatus": "Termination",
-                    "OutputIntent": {
-                        "Action" : "Stop"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Voice",
-                            "Action" : "Terminate"
-                        }
-                    ],
-                    "MMIStatus": "Termination",
-                    "OutputIntent": {
-                        "Action" : "Terminate"
-                    }
-                },
-                {
-                    "InputIntents" : [
-                        {
-                            "Modality" : "Gesture",
-                            "Action" : "FlipPalm"
-                        }
-                    ],
-                    "MMIStatus": "Termination",
-                    "OutputIntent": {
-                        "Action" : "Exit"
-                    }
-                }
-            ]
-        })";
-};
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_keyinput_press_mic_button)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressMicButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_INITIATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "WakeUp");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_showpalm)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "ShowPalm"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_INITIATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "WakeUp");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_input_press_up)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressUpButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveUp");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_input_press_down)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressDownButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveDown");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_input_press_right)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressRightButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveRight");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_input_press_left)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressLeftButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveLeft");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_move_up)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "MoveUp"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveUp");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_move_down)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "MoveDown"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveDown");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_move_right)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "MoveRight"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveRight");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_move_left)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "MoveLeft"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveLeft");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_hand_up)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "HandUp"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveUp");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_hand_down)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "HandDown"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveDown");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_hand_right)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "HandRight"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveRight");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_hand_left)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "HandLeft"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXPLORATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "MoveLeft");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_press_ok)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressOkButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXECUTION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Execute");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_execute)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Execute"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXECUTION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Execute");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_play)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Play"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXECUTION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Play");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_yes)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Yes"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXECUTION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Yes");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_hand_push)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "HandPush"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_EXECUTION);
-
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Execute");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_back_button)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressBackButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_FEEDBACK);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Cancel");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_cancel)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Cancel"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_FEEDBACK);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Cancel");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_back)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Back"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_FEEDBACK);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Cancel");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_wavehandx)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "WaveHandX"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_FEEDBACK);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Cancel");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_vision_outofvision)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Vision",
-                "Action" : "OutOfVision"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_OBSERVATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Pause");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_key_back_terminate)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressBackButton"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_TERMINATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Exit");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_exit)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Exit"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_TERMINATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Exit");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_stop)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Stop"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_TERMINATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Stop");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_voice_terminate)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Voice",
-                "Action" : "Terminate"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_TERMINATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Terminate");
-}
-
-TEST_F(IUEngineRuleTest, utc_intent_understanding_engine_rule_gesture_flippalm)
-{
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "Gesture",
-                "Action" : "FlipPalm"
-            }
-        ]
-    }
-    )";
-
-    iue.set_app_state(MMI_STATE_TERMINATION);
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "Exit");
-}
-
-} // namespace
-
-
diff --git a/tests/iu/intent_understanding_engine_unittests.cpp b/tests/iu/intent_understanding_engine_unittests.cpp
deleted file mode 100644 (file)
index 2f822ef..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <gtest/gtest.h>
-#include <string>
-
-#include "mmi_iu.h"
-#include "output_intent.h"
-#include "intent_understanding_engine.h"
-#include <glib.h>
-#include <string>
-#include <json-glib/json-glib.h>
-
-using namespace std;
-
-namespace {
-
-class IUEngineTest : public testing::Test {
-    public:
-        virtual void SetUp() {
-        }
-        virtual void TearDown() {
-        }
-
-    private:
-};
-
-TEST_F(IUEngineTest, utc_intent_understanding_engine)
-{
-    IntentUnderstandingEngine iue;
-
-    string rule = R"({
-        "IURule" : [
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "KeyInput",
-                        "Action" : "PressMicButton"
-                    }
-                ],
-                "MMIStatus" : "Initiation",
-                "OutputIntent": {
-                    "Action" : "WakeUp"
-                }
-            },
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "Gesture",
-                        "Action" : "ShowPalm"
-                    }
-                ],
-                "MMIStatus": "Initiation",
-                "OutputIntent": {
-                    "Action" : "WakeUp"
-                }
-            },
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "KeyInput",
-                        "Action" : "PressUpButton"
-                    }
-                ],
-                "MMIStatus": "Exploration",
-                "OutputIntent": {
-                    "Action" : "MoveUp"
-                }
-            }
-        ]
-    })";
-
-    EXPECT_EQ(iue.set_rule_json_data(rule.c_str()), true);
-}
-
-TEST_F(IUEngineTest, utc_intent_understanding_engine_get_output_intent_p)
-{
-    IntentUnderstandingEngine iue;
-
-    string rule = R"({
-        "IURule" : [
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "KeyInput",
-                        "Action" : "PressMicButton"
-                    }
-                ],
-                "MMIStatus" : "Initiation",
-                "OutputIntent": {
-                    "Action" : "WakeUp"
-                }
-            },
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "Gesture",
-                        "Action" : "ShowPalm"
-                    }
-                ],
-                "MMIStatus": "Initiation",
-                "OutputIntent": {
-                    "Action" : "WakeUp"
-                }
-            },
-            {
-                "InputIntents" : [
-                    {
-                        "Modality" : "KeyInput",
-                        "Action" : "PressUpButton"
-                    }
-                ],
-                "MMIStatus": "Exploration",
-                "OutputIntent": {
-                    "Action" : "MoveUp"
-                }
-            }
-        ]
-    })";
-
-    std::string input_intent_json_data =
-    R"({
-        "InputIntents" : [
-            {
-                "Modality" : "KeyInput",
-                "Action" : "PressMicButton"
-            }
-        ]
-    }
-    )";
-
-    EXPECT_EQ(iue.set_rule_json_data(rule.c_str()), true);
-
-    iue.set_input_intent_json_data(input_intent_json_data.c_str());
-
-    EXPECT_STREQ(iue.get_output_intent_action().c_str(), "WakeUp");
-}
-
-} // namespace
-
-
index 0448ef0..da0f5fe 100644 (file)
@@ -4,8 +4,6 @@ mmi_manager_tests_srcs = [
        'mmi-client-tests.cpp',
        'mmi-manager-main-tests.cpp',
        'ecore-event-dispatcher.cpp',
-       'iu/intent_understanding_engine_rule_unittests.cpp',
-       'iu/intent_understanding_engine_unittests.cpp',
        'iu/iu_rule_unittests.cpp',
        'iu/mmi_iu_feed_input_event_unittests.cpp',
        'iu/mmi_iu_noinit_unittests.cpp',