提交 e56f3a64 编写于 作者: A apperception 提交者: Gitee

Signed-off-by: zhaochen <zhaochen69@huawei.com>

上级 e969a100
...@@ -23,6 +23,9 @@ hcpptest_suite("ActsMediaCameraTest") { ...@@ -23,6 +23,9 @@ hcpptest_suite("ActsMediaCameraTest") {
include_dirs = [ include_dirs = [
"src", "src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include", "//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//foundation/multimedia/camera_lite/interfaces/kits",
"//foundation/multimedia/media_lite/interfaces/kits/recorder_lite",
"//foundation/multimedia/camera_lite/test/unittest",
] ]
ldflags = [ "-lstdc++" ] ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ] ldflags += [ "-lm" ]
...@@ -32,6 +35,8 @@ hcpptest_suite("ActsMediaCameraTest") { ...@@ -32,6 +35,8 @@ hcpptest_suite("ActsMediaCameraTest") {
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ] ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
deps = [ deps = [
"//foundation/graphic/surface:lite_surface",
"//foundation/graphic/ui:lite_ui",
"//foundation/multimedia/camera_lite/frameworks:camera_lite", "//foundation/multimedia/camera_lite/frameworks:camera_lite",
"//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite", "//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite",
] ]
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (C) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,19 +13,15 @@ ...@@ -13,19 +13,15 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef CAMERA_DEMO_TEST_H #ifndef CAMERA_LITE_TEST_H
#define CAMERA_DEMO_TEST_H #define CAMERA_LITE_TEST_H
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <sys/time.h>
#include "camera_kit.h"
#include "recorder.h" #include "recorder.h"
namespace OHOS {
const int32_t RET_OK = 0;
const int32_t RET_ERR = -1;
const int32_t FRAME_RATE_DEFAULT = 30; const int32_t FRAME_RATE_DEFAULT = 30;
const int32_t OK = 0; const int32_t OK = 0;
const int32_t FAIL = -1; const int32_t FAIL = -1;
...@@ -34,11 +30,29 @@ const int32_t BUFFER_SIZE = 1024; ...@@ -34,11 +30,29 @@ const int32_t BUFFER_SIZE = 1024;
static std::string g_filePath = "/test_root/multimedia/"; static std::string g_filePath = "/test_root/multimedia/";
std::string g_testPath; std::string g_testPath;
// CallBack Flag bool g_onGetCameraAbilityFlag;
enum TestCallBackFlag { bool g_onConfigureFlag;
FLAG0 = 0, bool g_onGetSupportedSizesFlag;
FLAG1 = 1, // CameraDeviceCallBack Flag
}; bool g_onCameraAvailableFlag;
bool g_onCameraUnavailableFlag;
// CameraStateCallback
bool g_onCreatedFlag;
bool g_onCreateFailedFlag;
bool g_onReleasedFlag;
bool g_onConfiguredFlag;
bool g_onConfigureFailedFlag;
// FrameStateCallback
bool g_onCaptureTriggerAbortedFlag;
bool g_onCaptureTriggerCompletedFlag;
bool g_onCaptureTriggerStartedFlag;
bool g_onGetFrameConfigureType;
bool g_onFrameFinishedFlag;
bool g_onFrameErrorFlag;
bool g_onFrameProgressedFlag;
bool g_onFrameStartedFlag;
bool g_onRecorderFlag;
bool g_onPreviewFlag;
// VideoSize // VideoSize
enum TestVideoSize { enum TestVideoSize {
...@@ -46,7 +60,7 @@ enum TestVideoSize { ...@@ -46,7 +60,7 @@ enum TestVideoSize {
HEIGHT = 1080, HEIGHT = 1080,
}; };
class ActsMediaCameraTest : public testing::Test { class CameraLiteTest : public testing::Test {
public: public:
// SetUpTestCase: before all testcasee // SetUpTestCase: before all testcasee
static void SetUpTestCase(void); static void SetUpTestCase(void);
...@@ -57,53 +71,5 @@ public: ...@@ -57,53 +71,5 @@ public:
// TearDown // TearDown
void TearDown(void); void TearDown(void);
}; };
} // namespace OHOS
class CameraFlag { #endif // CAMERA_LITE_TEST_H
public: \ No newline at end of file
// CameraSetupFlag
static int32_t g_onGetCameraAbilityFlag;
static int32_t g_onConfigureFlag;
static int32_t g_onGetSupportedSizesFlag;
// CameraDeviceCallBack Flag
static int32_t g_onCameraAvailableFlag;
static int32_t g_onCameraUnavailableFlag;
// CameraStateCallback
static int32_t g_onCreatedFlag;
static int32_t g_onCreateFailedFlag;
static int32_t g_onReleasedFlag;
static int32_t g_onConfiguredFlag;
static int32_t g_onConfigureFailedFlag;
// FrameStateCallback
static int32_t g_onCaptureTriggerAbortedFlag;
static int32_t g_onCaptureTriggerCompletedFlag;
static int32_t g_onCaptureTriggerStartedFlag;
static int32_t g_onGetFrameConfigureType;
static int32_t g_onFrameFinishedFlag;
static int32_t g_onFrameErrorFlag;
static int32_t g_onFrameProgressedFlag;
static int32_t g_onFrameStartedFlag;
};
// CameraSetup
int32_t CameraFlag::g_onGetCameraAbilityFlag = FLAG0;
int32_t CameraFlag::g_onConfigureFlag = FLAG0;
int32_t CameraFlag::g_onGetSupportedSizesFlag = FLAG0;
// CameraDeviceCallBack
int32_t CameraFlag::g_onCameraAvailableFlag = FLAG0;
int32_t CameraFlag::g_onCameraUnavailableFlag = FLAG0;
// CameraStateCallback
int32_t CameraFlag::g_onCreatedFlag = FLAG0;
int32_t CameraFlag::g_onCreateFailedFlag = FLAG0;
int32_t CameraFlag::g_onConfiguredFlag = FLAG0;
int32_t CameraFlag::g_onConfigureFailedFlag = FLAG0;
int32_t CameraFlag::g_onReleasedFlag = FLAG0;
// FrameStateCallback
int32_t CameraFlag::g_onCaptureTriggerAbortedFlag = FLAG0;
int32_t CameraFlag::g_onCaptureTriggerCompletedFlag = FLAG0;
int32_t CameraFlag::g_onCaptureTriggerStartedFlag = FLAG0;
int32_t CameraFlag::g_onGetFrameConfigureType = FLAG0;
int32_t CameraFlag::g_onFrameFinishedFlag = FLAG0;
int32_t CameraFlag::g_onFrameErrorFlag = FLAG0;
int32_t CameraFlag::g_onFrameProgressedFlag = FLAG0;
int32_t CameraFlag::g_onFrameStartedFlag = FLAG0;
#endif
\ No newline at end of file
...@@ -1006,7 +1006,7 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxFileSize2, Function | MediumTest | ...@@ -1006,7 +1006,7 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxFileSize2, Function | MediumTest |
HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFile1, Function | MediumTest | Level0) HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFile1, Function | MediumTest | Level0)
{ {
Recorder *recorder = new Recorder(); Recorder *recorder = new Recorder();
int32_t ret = recorder->SetOutputFile(-1); int32_t ret = recorder->SetOutputFile(1);
EXPECT_EQ(ERR_INVALID_PARAM, ret); EXPECT_EQ(ERR_INVALID_PARAM, ret);
delete recorder; delete recorder;
recorder = NULL; recorder = NULL;
...@@ -1020,7 +1020,7 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFile1, Function | MediumTest | ...@@ -1020,7 +1020,7 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFile1, Function | MediumTest |
HWTEST_F(ActsMediaRecorderNDKTest, Test_SetNextOutputFile1, Function | MediumTest | Level0) HWTEST_F(ActsMediaRecorderNDKTest, Test_SetNextOutputFile1, Function | MediumTest | Level0)
{ {
Recorder *recorder = new Recorder(); Recorder *recorder = new Recorder();
int32_t ret = recorder->SetNextOutputFile(-1); int32_t ret = recorder->SetNextOutputFile(1);
EXPECT_EQ(ERR_INVALID_PARAM, ret); EXPECT_EQ(ERR_INVALID_PARAM, ret);
delete recorder; delete recorder;
recorder = NULL; recorder = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册