fix errors related with media plugin accepted/tizen/unified/20200406.074342 submit/tizen/20200406.072014 submit/tizen/20200406.072047
authorYoungjae Shin <yj99.shin@samsung.com>
Thu, 2 Apr 2020 05:24:00 +0000 (14:24 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 6 Apr 2020 07:19:22 +0000 (16:19 +0900)
media/MediaFactory.cpp
media/MediaFactory.h
media/SoundVolume.cpp
unittests/mdsp_test_media.cpp

index e37192b..0b8f1cf 100644 (file)
@@ -23,10 +23,10 @@ MODES_NAMESPACE_USE;
 
 MediaFactory::MediaFactory()
 {
-       actionMap[SoundVolume::NAME[SYSTEM_VOLUME]] = SYSTEM_VOLUME;
-       actionMap[SoundVolume::NAME[NOTIFICATION_VOLUME]] = NOTIFICATION_VOLUME;
-       actionMap[SoundVolume::NAME[RINGTONE_VOLUME]] = RINGTONE_VOLUME;
-       actionMap[SoundVolume::NAME[MEDIA_VOLUME]] = MEDIA_VOLUME;
+       actionMap[SoundVolume::NAME[SYSTEM_VOL]] = SYSTEM_VOL;
+       actionMap[SoundVolume::NAME[NOTIFICATION_VOL]] = NOTIFICATION_VOL;
+       actionMap[SoundVolume::NAME[RINGTONE_VOL]] = RINGTONE_VOL;
+       actionMap[SoundVolume::NAME[MEDIA_VOL]] = MEDIA_VOL;
        actionMap[MediaPlayer::NAME] = PLAYER;
 }
 
@@ -40,17 +40,17 @@ MediaAction* MediaFactory::createAction(const std::string &key)
 
        MediaAction *action;
        switch (search->second) {
-       case SYSTEM_VOLUME:
-               action = new SoundVolume(SYSTEM_VOLUME, SOUND_TYPE_SYSTEM);
+       case SYSTEM_VOL:
+               action = new SoundVolume(SYSTEM_VOL, SOUND_TYPE_SYSTEM);
                break;
-       case NOTIFICATION_VOLUME:
-               action = new SoundVolume(NOTIFICATION_VOLUME, SOUND_TYPE_NOTIFICATION);
+       case NOTIFICATION_VOL:
+               action = new SoundVolume(NOTIFICATION_VOL, SOUND_TYPE_NOTIFICATION);
                break;
-       case RINGTONE_VOLUME:
-               action = new SoundVolume(RINGTONE_VOLUME, SOUND_TYPE_RINGTONE);
+       case RINGTONE_VOL:
+               action = new SoundVolume(RINGTONE_VOL, SOUND_TYPE_RINGTONE);
                break;
-       case MEDIA_VOLUME:
-               action = new SoundVolume(MEDIA_VOLUME, SOUND_TYPE_MEDIA);
+       case MEDIA_VOL:
+               action = new SoundVolume(MEDIA_VOL, SOUND_TYPE_MEDIA);
                break;
        case PLAYER:
                action = new MediaPlayer();
index 1ef5e4c..43465b7 100644 (file)
@@ -30,10 +30,10 @@ public:
        void destroyAction(MediaAction *action);
 private:
        enum actionKey{
-               SYSTEM_VOLUME,
-               NOTIFICATION_VOLUME,
-               RINGTONE_VOLUME,
-               MEDIA_VOLUME,
+               SYSTEM_VOL,
+               NOTIFICATION_VOL,
+               RINGTONE_VOL,
+               MEDIA_VOL,
                PLAYER
        };
 
index 03aa22f..7140772 100644 (file)
@@ -26,9 +26,9 @@ MODES_NAMESPACE_USE;
 // It should align with actionKey in MediaFactory
 const std::string SoundVolume::NAME[4] = {
        "systemVolume",
-       "notificationVolume"
+       "notificationVolume",
        "ringtoneVolume",
-       "mediaVolume",
+       "mediaVolume"
 };
 
 SoundVolume::SoundVolume(int key, sound_type_e soundType)
index ebc53b4..40d1279 100644 (file)
@@ -69,34 +69,42 @@ protected:
        static gboolean VolumeSetUndoIdler(gpointer data)
        {
                PluginAction *action;
+               action = nullptr;
                result = plugin->set("mediaVolume", 5, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("systemVolume", 2, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("ringtoneVolume", 9, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("notificationVolume", 1, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("mediaVolume", -1, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("systemVolume", -1, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("ringtoneVolume", -1, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);
 
+               action = nullptr;
                result = plugin->set("notificationVolume", -1, &action);
                EXPECT_EQ(MODES_ERROR_NONE, result);
                plugin->undo(action);