测试代码合入

Signed-off-by: wangyi <wangyi357@h-partners.com>
This commit is contained in:
wangyi
2025-03-13 09:46:37 +08:00
parent aaf41be20f
commit 52bad8cd4c
4 changed files with 15 additions and 9 deletions
@@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef VIDEO_SAMPLE_H
#define VIDEO_SAMPLE_H
#ifndef VIDEO_HDRVIVID_TO_HDR_FUZZER_H
#define VIDEO_HDRVIVID_TO_HDR_FUZZER_H
#include <fstream>
#include <vector>
+5 -4
View File
@@ -36,7 +36,7 @@ OH_Pixelmap_InitializationOptions *g_createOpts_RGBA = nullptr;
OH_Pixelmap_InitializationOptions *g_createOpts_BGRA = nullptr;
OH_PixelmapNative *pixelMap_RGBA = nullptr;
OH_PixelmapNative *pixelMap_BGRA = nullptr;
void InitCreatePixelmapParam_RGBA()
void InitCreatePixelmapParamRGBA()
{
if (g_createOpts_RGBA == nullptr) {
OH_PixelmapInitializationOptions_Create(&g_createOpts_RGBA);
@@ -45,7 +45,7 @@ void InitCreatePixelmapParam_RGBA()
OH_PixelmapInitializationOptions_SetPixelFormat(g_createOpts_RGBA, NATIVEBUFFER_PIXEL_FMT_RGBA_8888);
}
}
void InitCreatePixelmapParam_BGRA()
void InitCreatePixelmapParamBGRA()
{
if (g_createOpts_BGRA == nullptr) {
OH_PixelmapInitializationOptions_Create(&g_createOpts_BGRA);
@@ -72,8 +72,8 @@ public:
void VpeImageApiTest::SetUpTestCase()
{
g_pixData = new uint8_t[PIX_SIZE];
InitCreatePixelmapParam_RGBA();
InitCreatePixelmapParam_BGRA();
InitCreatePixelmapParamRGBA();
InitCreatePixelmapParamBGRA();
OH_PixelmapNative_CreatePixelmap(g_pixData, PIX_SIZE, g_createOpts_RGBA, &pixelMap_RGBA);
OH_PixelmapNative_CreatePixelmap(g_pixData, PIX_SIZE, g_createOpts_BGRA, &pixelMap_BGRA);
}
@@ -81,6 +81,7 @@ void VpeImageApiTest::TearDownTestCase()
{
if (g_pixData) {
delete[] g_pixData;
g_pixData = nullptr;
}
if (g_createOpts_RGBA) {
OH_PixelmapInitializationOptions_Release(g_createOpts_RGBA);
@@ -467,7 +467,7 @@ HWTEST_F(VpeVideoCapTest, METADATAGENERATE_SUPPORT_001, TestSize.Level2)
inputFormat.colorSpace = BT2020_HLG;
inputFormat.pixelFormat = PIXEL_FORMAT_RGBA_1010102;
if (!access("/system/lib64/media/", 0)) {
// ASSERT_EQ(true, OH_ImageProcessing_IsMetadataGenerationSupported(&inputFormat));
ASSERT_EQ(true, OH_ImageProcessing_IsMetadataGenerationSupported(&inputFormat));
} else {
ASSERT_EQ(false, OH_ImageProcessing_IsMetadataGenerationSupported(&inputFormat));
}
+7 -2
View File
@@ -136,7 +136,7 @@ HWTEST_F(VpeVideoReliTest, METADATASUPPORT_001, TestSize.Level2)
void CheckCapability(VideoProcessing_ColorSpaceInfo inputFormat)
{
if (IsSRGBColorSpace(formatImage)) {
if (IsSRGBColorSpace()) {
if (ValidatePixelFormat(formatImage)) {
if (!access("/system/lib64/ndk/libvideo_processing_capi_impl.so", F_OK)) {
if (!access("/system/lib64/media/", 0)) {
@@ -201,7 +201,12 @@ HWTEST_F(VpeVideoReliTest, METADATASUPPORT_003, TestSize.Level2)
cout<<"--metadataType--" << i << "--colorSpace--" << j << "--pixelFormat--" << k << endl;
}
}
if (IsSRGBColorSpace(formatImage)) {
if (formatImage.colorSpace == OH_COLORSPACE_SRGB_FULL ||
formatImage.colorSpace == OH_COLORSPACE_SRGB_LIMIT ||
formatImage.colorSpace == OH_COLORSPACE_LINEAR_SRGB ||
formatImage.colorSpace == OH_COLORSPACE_DISPLAY_SRGB ||
formatImage.colorSpace == OH_COLORSPACE_DISPLAY_P3_SRGB ||
formatImage.colorSpace == OH_COLORSPACE_DISPLAY_BT2020_SRGB) {
if (ValidatePixelFormat(formatImage)){
if (!access("/system/lib64/ndk/libvideo_processing_capi_impl.so", F_OK)) {
if (!access("/system/lib64/media/", 0)) {