add testcase

Signed-off-by: qwx1028698 <quannini@huawei.com>
This commit is contained in:
qwx1028698 2023-05-12 17:14:56 +08:00
parent 7abcd2b3ef
commit 0aceedbcc0
6 changed files with 60 additions and 7 deletions

View File

@ -21,9 +21,10 @@ group("HatsHdfDisplayTest") {
if (xts_hats_rich == true) {
deps = [
"buffer:HatsHdfDisplayBufferTest",
#"composer/death:HatsHdfDisplayComposerDeathTest",
#"composer/moduletest:HatszHdfDisplayComposerMtTest",
#"composer/unittest:HatszHdfDisplayComposerUtTest",
"composer/moduletest:HatszHdfDisplayComposerMtTest",
"composer/unittest:HatszHdfDisplayComposerUtTest",
]
} else {
deps = [

View File

@ -215,6 +215,14 @@ const AllocInfo DISPLAY_BUFFER_TEST_SETS[] = {
.usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
.format = PIXEL_FMT_BGRX_5551
},
#elif
// num21
{
.width = ALLOC_SIZE_1080,
.height = ALLOC_SIZE_1920,
.usage = HBM_USE_MEM_DMA | HBM_USE_CPU_WRITE,
.format = PIXEL_FMT_RGBA_1010102
},
#endif // DISPLAY_COMMUNITY
};

View File

@ -733,6 +733,29 @@ BENCHMARK_F(DisplayBenchmarkTest, SetLayerBlendTypeTest)(benchmark::State &state
BENCHMARK_REGISTER_F(DisplayBenchmarkTest, SetLayerBlendTypeTest)->
Iterations(100)->Repetitions(3)->ReportAggregatesOnly();
BENCHMARK_F(DisplayBenchmarkTest, SetLayerMaskInfoTest)(benchmark::State &state)
{
int32_t ret;
std::vector<LayerSettings> settings = {
{
.rectRatio = { 0, 0, 1.0f, 1.0f },
.color = GREEN
}
};
for (auto _ : state) {
std::vector<std::shared_ptr<HdiTestLayer>> layers = CreateLayers(settings);
ASSERT_TRUE((layers.size() > 0));
auto layer = layers[0];
MaskInfo maskInfo = MaskInfo::LAYER_HBM_SYNC;
ret = g_composerDevice->SetLayerMaskInfo(g_displayIds[0], layer->GetId(), maskInfo);
}
PrepareAndPrensent();
EXPECT_EQ(DISPLAY_SUCCESS, ret);
}
BENCHMARK_REGISTER_F(DisplayBenchmarkTest, SetLayerMaskInfoTest)->
Iterations(100)->Repetitions(3)->ReportAggregatesOnly();
BENCHMARK_F(DisplayBenchmarkTest, DestroyLayerTest)(benchmark::State &state)
{
int32_t ret;
@ -747,7 +770,6 @@ BENCHMARK_F(DisplayBenchmarkTest, DestroyLayerTest)(benchmark::State &state)
ASSERT_TRUE((layers.size() > 0));
auto layer = layers[0];
PrepareAndPrensent();
// sleep(1);
ret = g_composerDevice->DestroyLayer(g_displayIds[0], layer->GetId());
}
PrepareAndPrensent();

View File

@ -605,6 +605,28 @@ HWTEST_F(DeviceTest, SUB_DriverSystem_DisplayComposer_0220, TestSize.Level1)
}
HWTEST_F(DeviceTest, SUB_DriverSystem_DisplayComposer_0230, TestSize.Level1)
{
std::vector<LayerSettings> settings = {
{
.rectRatio = { 0, 0, 1.0f, 1.0f },
.color = GREEN
}
};
std::vector<std::shared_ptr<HdiTestLayer>> layers = CreateLayers(settings);
ASSERT_TRUE((layers.size() > 0));
auto layer = layers[0];
MaskInfo maskInfo = MaskInfo::LAYER_HBM_SYNC;
auto ret = g_composerDevice->SetLayerMaskInfo(g_displayIds[0], layer->GetId(), maskInfo);
PrepareAndPrensent();
EXPECT_EQ(DISPLAY_SUCCESS, ret);
}
HWTEST_F(DeviceTest, SUB_DriverSystem_DisplayComposer_0240, TestSize.Level1)
{
std::vector<LayerSettings> settings = {
{
@ -626,7 +648,7 @@ HWTEST_F(DeviceTest, SUB_DriverSystem_DisplayComposer_0230, TestSize.Level1)
EXPECT_EQ(DISPLAY_SUCCESS, ret);
}
HWTEST_F(VblankTest, SUB_DriverSystem_DisplayComposer_0240, TestSize.Level1)
HWTEST_F(VblankTest, SUB_DriverSystem_DisplayComposer_0250, TestSize.Level1)
{
int ret;
DISPLAY_TEST_LOGE();

View File

@ -11,11 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
base_root = "../../../../../"
base_root = "../../../../../../"
import("//build/ohos.gni")
import("//build/test.gni")
import("//test/xts/tools/build/suite.gni")
import("$base_root/peripheral/input/input.gni")
import("$base_root/drivers/peripheral/input/input.gni")
module_output_path = "hats/input"
ohos_moduletest_suite("HatsHdfInputPassthroughBenchmarkTest") {

View File

@ -15,7 +15,7 @@ import("//build/ohos_var.gni")
import("//build/test.gni")
import("//test/xts/tools/build/suite.gni")
base_root = "../../../../../"
base_root = "../../../../../../"
module_output_path = "hats/input"
ohos_moduletest_suite("HatsHdfInputbenchmarkTest") {
module_out_path = module_output_path