hwc: modify the some symbol
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_hwc_window.cpp
index 3af1f35..3f91ace 100644 (file)
@@ -40,50 +40,23 @@ public:
        TDMHwcWindow();
        void SetUp(void);
        void TearDown(void);
-
-       tdm_error error;
-       tdm_hwc_window **hwc_wins;
-       int hwc_count;
 };
 
 TDMHwcWindow::TDMHwcWindow()
 {
-       error = TDM_ERROR_NONE;
-       hwc_wins = NULL;
-       hwc_count = 0;
-       video_hwc_win = NULL;
 }
 
 void TDMHwcWindow::SetUp(void)
 {
-       tdm_hwc_window *hw = NULL;
-
        TDMOutput::SetUp();
-
-       hwc_wins = (tdm_hwc_window **)calloc(output_count * HWC_WIN_NUM, sizeof(tdm_hwc_window *));
-
-       //create HWC_WIN_NUM hwc_windows for each outputs
-       for (int o = 0; o < output_count; o++) {
-               if (tc_tdm_output_is_hwc_enable(outputs[o])) {
-                       for (int w = 0; w < HWC_WIN_NUM; w++) {
-                               hw = tdm_hwc_create_window(outputs[w], &error);
-                               ASSERT_EQ(TDM_ERROR_NONE, error);
-                               hwc_wins[hwc_count++] = hw;
-                       }
-               }
-       }
 }
 
 void TDMHwcWindow::TearDown(void)
 {
-       for (int w = 0; w < hwc_count; w++)
-               tdm_hwc_window_destroy(hwc_wins[w]);
-
        TDMOutput::TearDown();
 }
 
-/* void tdm_hwc_window_destroy(tdm_hwc_window *hwc_window); */
-/*
+/* void tdm_hwc_window_destroy() */
 TEST_P(TDMHwcWindow, DestroyWindowFailNull)
 {
        tdm_hwc_window_destroy(NULL);
@@ -93,31 +66,34 @@ TEST_P(TDMHwcWindow, DestroyWindowSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_hwc_window *hw = NULL;
 
        for (int o = 0; o < output_count; o++) {
-               if (tc_tdm_output_is_hwc_enable(outputs[o])) {
-                       hw = tdm_hwc_create_window(outputs[o], &error);
-                       ASSERT_EQ(TDM_ERROR_NONE, error);
-                       error = tdm_hwc_window_destroy(outputs[o], hw);
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hw = tdm_hwc_create_window(hwc, &error);
                        ASSERT_EQ(TDM_ERROR_NONE, error);
+                       if (hw)
+                               tdm_hwc_window_destroy(hw);
                }
        }
 }
-*/
 
-/* tbm_surface_queue_h tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error); */
+/* tbm_surface_queue_h tdm_hwc_window_acquire_buffer_queue() */
 TEST_P(TDMHwcWindow, GetBufferQueueFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_error error = TDM_ERROR_NONE;
        tbm_surface_queue_h queue = NULL;
 
-       queue = tdm_hwc_window_get_buffer_queue(NULL, &error);
+       queue = tdm_hwc_window_acquire_buffer_queue(NULL, &error);
        ASSERT_NE(TDM_ERROR_NONE, error);
        ASSERT_EQ(NULL, queue);
 
-       queue = tdm_hwc_window_get_buffer_queue(NULL, NULL);
+       queue = tdm_hwc_window_acquire_buffer_queue(NULL, NULL);
        ASSERT_EQ(NULL, queue);
 }
 
@@ -125,27 +101,44 @@ TEST_P(TDMHwcWindow, GetBufferQueueSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_wins[HWC_WIN_NUM];
+       tdm_error error = TDM_ERROR_NONE;
+       int w;
        tbm_surface_queue_h queue = NULL;
        tdm_hwc_window_info info = { 0 };
 
-       info.src_config.format = TBM_FORMAT_ARGB8888;
-       info.src_config.size.h = info.src_config.size.v = 256;
-       info.src_config.pos.h = info.src_config.pos.w = 256;
-       info.dst_pos.h = info.dst_pos.w = 256;
-       info.transform = TDM_TRANSFORM_NORMAL;
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       for (w = 0; w < HWC_WIN_NUM; w++) {
+                               hwc_wins[w] = tdm_hwc_create_window(hwc, &error);
+                               ASSERT_NE(NULL, hwc_wins[w]);
+                       }
+
+                       info.src_config.format = TBM_FORMAT_ARGB8888;
+                       info.src_config.size.h = info.src_config.size.v = 256;
+                       info.src_config.pos.h = info.src_config.pos.w = 256;
+                       info.dst_pos.h = info.dst_pos.w = 256;
+                       info.transform = TDM_TRANSFORM_NORMAL;
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_info(hwc_wins[w], &info);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
+                       for (w = 0; w < HWC_WIN_NUM; w++) {
+                               error = tdm_hwc_window_set_info(hwc_wins[w], &info);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
 
-               queue = tdm_hwc_window_get_buffer_queue(hwc_wins[w], &error);
-               tbm_surface_queue_destroy(queue);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
-               ASSERT_NE(NULL, queue);
+                               queue = tdm_hwc_window_acquire_buffer_queue(hwc_wins[w], &error);
+                               tdm_hwc_window_release_buffer_queue(hwc_wins[w], queue);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
+                               ASSERT_NE(NULL, queue);
 
-               queue = tdm_hwc_window_get_buffer_queue(hwc_wins[w], NULL);
-               tbm_surface_queue_destroy(queue);
-               ASSERT_NE(NULL, queue);
+                               queue = tdm_hwc_window_acquire_buffer_queue(hwc_wins[w], NULL);
+                               tdm_hwc_window_release_buffer_queue(hwc_wins[w], queue);
+                               ASSERT_NE(NULL, queue);
+                       }
+
+                       for (w = 0; w < HWC_WIN_NUM; w++)
+                               tdm_hwc_window_destroy(hwc_wins[w]);
+               }
        }
 }
 
@@ -155,39 +148,70 @@ TEST_P(TDMHwcWindow, SetCompositionTypeFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
-       error = tdm_hwc_window_set_composition_type(NULL, TDM_COMPOSITION_DEVICE);
+       tdm_error error = TDM_ERROR_NONE;
+
+       error = tdm_hwc_window_set_composition_type(NULL, TDM_HWC_WIN_COMPOSITION_DEVICE);
        ASSERT_NE(TDM_ERROR_NONE, error);
 }
 
-TEST_P(TDMHwcWindow, SetCompositionTypeSuccessful)
+TEST_P(TDMHwcWindow, SetCompositionTypeFailInvalieCompositionType)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_COMPOSITION_DEVICE);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
-               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_COMPOSITION_CLIENT);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
-               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_COMPOSITION_CURSOR);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
+
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_set_composition_type(hwc_win, tdm_hwc_window_composition(TDM_HWC_WIN_COMPOSITION_NONE - 1));
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
        }
 }
 
-TEST_P(TDMHwcWindow, SetCompositionTypeFailInvalieCompositionType)
+TEST_P(TDMHwcWindow, SetCompositionTypeSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_composition_type(hwc_wins[w], tdm_hwc_window_composition(TDM_COMPOSITION_NONE - 1));
-               ASSERT_NE(TDM_ERROR_NONE, error);
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_wins[HWC_WIN_NUM];
+       tdm_error error = TDM_ERROR_NONE;
+       int w;
+
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       for (w = 0; w < HWC_WIN_NUM; w++) {
+                               hwc_wins[w] = tdm_hwc_create_window(hwc, &error);
+                               ASSERT_NE(NULL, hwc_wins[w]);
+                       }
+
+                       for (w = 0; w < HWC_WIN_NUM; w++) {
+                               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_HWC_WIN_COMPOSITION_DEVICE);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
+                               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_HWC_WIN_COMPOSITION_CLIENT);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
+                               error = tdm_hwc_window_set_composition_type(hwc_wins[w], TDM_HWC_WIN_COMPOSITION_CURSOR);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
+                       }
+
+                       for (w = 0; w < HWC_WIN_NUM; w++)
+                               tdm_hwc_window_destroy(hwc_wins[w]);
+               }
        }
 }
 
-/* tdm_error tdm_hwc_window_set_buffer_damage(tdm_hwc_window *hwc_window, tdm_region damage); */
+/* tdm_error tdm_hwc_window_set_buffer_damage() */
 TEST_P(TDMHwcWindow, SetBufferDamageFailNullHwcWindow)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_error error = TDM_ERROR_NONE;
        tdm_region damage = {.num_rects = 0, .rects = NULL};
 
        error = tdm_hwc_window_set_buffer_damage(NULL, damage);
@@ -198,42 +222,69 @@ TEST_P(TDMHwcWindow, SetBufferDamageFailNullDamageRects)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_region damage = {.num_rects = 1, .rects = NULL};
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_buffer_damage(hwc_wins[w], damage);
-               ASSERT_NE(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_set_buffer_damage(hwc_win, damage);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
        }
 }
 
-
 TEST_P(TDMHwcWindow, SetBufferDamageSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_wins[HWC_WIN_NUM];
+       tdm_error error = TDM_ERROR_NONE;
        tdm_pos const rects[1] = {0};
        tdm_region damage = {.num_rects = 1, .rects = rects};
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_buffer_damage(hwc_wins[w], damage);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       for (int w = 0; w < HWC_WIN_NUM; w++) {
+                               hwc_wins[w] = tdm_hwc_create_window(hwc, &error);
+                               ASSERT_NE(NULL, hwc_wins[w]);
+                               error = tdm_hwc_window_set_buffer_damage(hwc_wins[w], damage);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
+                               tdm_hwc_window_destroy(hwc_wins[w]);
+                       }
+               }
        }
 }
 
-
-/* tdm_error tdm_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info); */
+/* tdm_error tdm_hwc_window_set_info() */
 TEST_P(TDMHwcWindow, SetInfoFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_hwc_window_info info = { 0 };
 
        error = tdm_hwc_window_set_info(NULL, &info);
        ASSERT_NE(TDM_ERROR_NONE, error);
 
-       if (hwc_count > 0) {
-               error = tdm_hwc_window_set_info(hwc_wins[0], NULL);
-               ASSERT_NE(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_set_info(hwc_win, NULL);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
        }
 }
 
@@ -241,20 +292,30 @@ TEST_P(TDMHwcWindow, SetInfoSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_hwc_window_info info = { 0 };
 
-       for (int w = 0; w < hwc_count; w++) {
-               error = tdm_hwc_window_set_info(hwc_wins[w], &info);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_set_info(hwc_win, &info);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
        }
 }
 
-
-/* tdm_error tdm_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h buffer); */
+/* tdm_error tdm_hwc_window_set_buffer() */
 TEST_P(TDMHwcWindow, SetBufferFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
+       tdm_error error = TDM_ERROR_NONE;
+
        error = tdm_hwc_window_set_buffer(NULL, NULL);
        ASSERT_NE(TDM_ERROR_NONE, error);
 }
@@ -263,106 +324,116 @@ TEST_P(TDMHwcWindow, SetBufferSuccessful)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
 
-       for (int w = 0; w < hwc_count; w++) {
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_wins[HWC_WIN_NUM];
+       tdm_error error = TDM_ERROR_NONE;
+       tbm_surface_h buffer = NULL;
 
-               tbm_surface_h buff = tbm_surface_create(256, 256, TBM_FORMAT_ARGB8888);
-
-               /* test: set*/
-               error = tdm_hwc_window_set_buffer(hwc_wins[w], buff);
-               tbm_surface_destroy(buff);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
-
-               /* test: reset*/
-               error = tdm_hwc_window_set_buffer(hwc_wins[w], NULL);
-               ASSERT_EQ(TDM_ERROR_NONE, error);
-       }
-}
-
-/* tdm_hwc_get_available_properties() */
-/*
-TEST_P(TDMHwcWindow, GetAvailablePropertiesFailNullWin)
-{
-       TDM_UT_SKIP_FLAG(has_outputs);
-
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
-       const tdm_prop *props;
-       int count;
-
-       error = tdm_hwc_get_available_properties(NULL, &props, &count);
-       ASSERT_NE(TDM_ERROR_NONE, error);
-
-       error = tdm_hwc_get_available_properties(video_hwc_win, NULL, &count);
-       ASSERT_NE(TDM_ERROR_NONE, error);
-
-       error = tdm_hwc_get_available_properties(video_hwc_win, &props, NULL);
-       ASSERT_NE(TDM_ERROR_NONE, error);
-}
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       for (int w = 0; w < HWC_WIN_NUM; w++) {
+                               hwc_wins[w] = tdm_hwc_create_window(hwc, &error);
+                               ASSERT_NE(NULL, hwc_wins[w]);
 
-TEST_P(TDMHwcWindow, GetAvailablePropertiesSuccess)
-{
-       TDM_UT_SKIP_FLAG(has_outputs);
+                               buffer = tbm_surface_create(256, 256, TBM_FORMAT_ARGB8888);
+                               ASSERT_NE(NULL, buffer);
 
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
+                               error = tdm_hwc_window_set_buffer(hwc_wins[w], buffer);
+                               tbm_surface_destroy(buffer);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
 
-       const tdm_prop *props;
-       int count;
+                               /* set NULL to the buffer */
+                               error = tdm_hwc_window_set_buffer(hwc_wins[w], NULL);
+                               ASSERT_EQ(TDM_ERROR_NONE, error);
 
-       error = tdm_hwc_get_available_properties(video_hwc_win, &props, &count);
-       ASSERT_TRUE(TDM_ERROR_NONE == error || TDM_ERROR_NOT_IMPLEMENTED == error);
+                               tdm_hwc_window_destroy(hwc_wins[w]);
+                       }
+               }
+       }
 }
-*/
 
-/* tdm_hwc_window_get_property() */
-TEST_P(TDMHwcWindow, GetPropertyFailNull)
+/* tdm_hwc_window_set_property() */
+TEST_P(TDMHwcWindow, SetPropertyFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
 
+       tdm_error error = TDM_ERROR_NONE;
        tdm_value value;
        int id = 1;
 
-       error = tdm_hwc_window_get_property(NULL, id, &value);
-       ASSERT_NE(TDM_ERROR_NONE, error);
-
-       error = tdm_hwc_window_get_property(video_hwc_win, id, NULL);
+       error = tdm_hwc_window_set_property(NULL, id, value);
        ASSERT_NE(TDM_ERROR_NONE, error);
 }
 
-TEST_P(TDMHwcWindow, GetPropertyFailWrongId)
+TEST_P(TDMHwcWindow, SetPropertyFailWrongId)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_value value;
        int id = INT_MAX;
 
-       error = tdm_hwc_window_get_property(video_hwc_win, id, &value);
-       ASSERT_NE(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_set_property(hwc_win, id, value);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
+       }
 }
 
-/* tdm_hwc_window_set_property() */
-TEST_P(TDMHwcWindow, SetPropertyFailNull)
+/* tdm_hwc_window_get_property() */
+TEST_P(TDMHwcWindow, GetPropertyFailNull)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_value value;
        int id = 1;
 
-       error = tdm_hwc_window_set_property(NULL, id, value);
+       error = tdm_hwc_window_get_property(NULL, id, &value);
        ASSERT_NE(TDM_ERROR_NONE, error);
+
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_get_property(hwc_win, id, NULL);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
+       }
 }
 
-TEST_P(TDMHwcWindow, SetPropertyFailWrongId)
+TEST_P(TDMHwcWindow, GetPropertyFailWrongId)
 {
        TDM_UT_SKIP_FLAG(has_outputs);
-       TDM_UT_SKIP_FLAG(video_hwc_win != NULL);
 
+       tdm_hwc *hwc = NULL;
+       tdm_hwc_window *hwc_win;
+       tdm_error error = TDM_ERROR_NONE;
        tdm_value value;
        int id = INT_MAX;
 
-       error = tdm_hwc_window_set_property(video_hwc_win, id, value);
-       ASSERT_NE(TDM_ERROR_NONE, error);
+       for (int o = 0; o < output_count; o++) {
+               hwc = tdm_output_get_hwc(hwc, &error);
+               if (hwc) {
+                       hwc_win = tdm_hwc_create_window(hwc, &error);
+                       ASSERT_NE(NULL, hwc_win);
+                       error = tdm_hwc_window_get_property(hwc_win, id, &value);
+                       ASSERT_NE(TDM_ERROR_NONE, error);
+                       tdm_hwc_window_destroy(hwc_win);
+               }
+       }
 }
 
 #ifdef TDM_UT_TEST_WITH_PARAMS