Fix test case name and scenario 64/296664/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 1 Aug 2023 08:28:08 +0000 (17:28 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 8 Aug 2023 08:32:14 +0000 (08:32 +0000)
- Issue:
Test case name is not matched with the name of the function which is
tested by the test case.
stt_get_audio_id has no test cases for testing invalid state error.

- Solution:
This patch fixes the name of the test cases and scenario. Through this
patch the name of each TCs will be matched with the tested function. And
also, negative TC for stt_get_audio_id will properly test the invalid
state scenario.

Change-Id: Ie7668a9516ab788cfda4c88ddc18af97c974874d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
tests/src/stt_unittests.cpp

index 53b7ece..a16b89c 100644 (file)
@@ -1975,7 +1975,7 @@ TEST_F(STTPreparedTest, utc_stt_recover_system_volume_n2)
        EXPECT_EQ(stt_recover_system_volume(mHandle), STT_ERROR_INVALID_STATE);
 }
 
-TEST_F(STTTest, utc_stt_set_audio_type_p1)
+TEST_F(STTTest, utc_stt_set_audio_id_p1)
 {
        const char *audio_id = "test";
 
@@ -1990,7 +1990,7 @@ TEST_F(STTTest, utc_stt_set_audio_type_p1)
        EXPECT_EQ(stt_set_audio_id(mHandle, audio_id), STT_ERROR_NONE);
 }
 
-TEST_F(STTTest, utc_stt_set_audio_type_n1)
+TEST_F(STTTest, utc_stt_set_audio_id_n1)
 {
        const char *audio_id = "test";
 
@@ -2003,7 +2003,7 @@ TEST_F(STTTest, utc_stt_set_audio_type_n1)
        EXPECT_EQ(stt_set_audio_id(mHandle, nullptr), STT_ERROR_INVALID_PARAMETER);
 }
 
-TEST_F(STTPreparedTest, utc_stt_set_audio_type_n2)
+TEST_F(STTPreparedTest, utc_stt_set_audio_id_n2)
 {
        const char *audio_id = "test";
 
@@ -2018,7 +2018,7 @@ TEST_F(STTPreparedTest, utc_stt_set_audio_type_n2)
        EXPECT_EQ(stt_set_audio_id(mHandle, audio_id), STT_ERROR_INVALID_STATE);
 }
 
-TEST_F(STTTest, utc_stt_get_audio_type_p1)
+TEST_F(STTTest, utc_stt_get_audio_id_p1)
 {
        const char *audio_id = "test";
        char *get_id = nullptr;
@@ -2037,7 +2037,7 @@ TEST_F(STTTest, utc_stt_get_audio_type_p1)
        EXPECT_STREQ(get_id, audio_id);
 }
 
-TEST_F(STTTest, utc_stt_get_audio_type_n1)
+TEST_F(STTTest, utc_stt_get_audio_id_n1)
 {
        char *get_id = nullptr;
 
@@ -2050,7 +2050,7 @@ TEST_F(STTTest, utc_stt_get_audio_type_n1)
        EXPECT_EQ(stt_get_audio_id(mHandle, nullptr), STT_ERROR_INVALID_PARAMETER);
 }
 
-TEST_F(STTPreparedTest, utc_stt_get_audio_type_n2)
+TEST_F(STTPreparedTest, utc_stt_get_audio_id_n2)
 {
        char *get_id = nullptr;
 
@@ -2062,8 +2062,7 @@ TEST_F(STTPreparedTest, utc_stt_get_audio_type_n2)
        mTestUtil->SetTestMode();
        EXPECT_EQ(mTestUtil->Start(TEST_LANGUAGE, TEST_RECOG_TYPE), true);
 
-       EXPECT_EQ(stt_get_audio_id(nullptr, &get_id), STT_ERROR_INVALID_PARAMETER);
-       EXPECT_EQ(stt_get_audio_id(mHandle, nullptr), STT_ERROR_INVALID_PARAMETER);
+       EXPECT_EQ(stt_get_audio_id(mHandle, &get_id), STT_ERROR_INVALID_STATE);
 }
 
 } // namespace