提交 8c45263d 编写于 作者: Y yygxr

fix xts case error for musl

Signed-off-by: Nyygxr <wuhao30@huawei.com>
上级 919accbc
...@@ -222,7 +222,14 @@ export default function CameraInputTest(surfaceId) { ...@@ -222,7 +222,14 @@ export default function CameraInputTest(surfaceId) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
......
...@@ -352,7 +352,14 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -352,7 +352,14 @@ export default function cameraSessionTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -935,28 +942,30 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -935,28 +942,30 @@ export default function cameraSessionTest(surfaceId: any) {
await startCameraSession(i); await startCameraSession(i);
mCameraSession.start(async (err) => { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback"); mCameraSession.start(async (err) => {
if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start PASSED"); if (!err) {
} else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start PASSED");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start FAILED : " + err.message); } else {
expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start FAILED : " + err.message);
} expect().assertFail();
}) }
await sleep(2000); })
await sleep(2000);
mCameraSession.stop(async (err) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop callback"); mCameraSession.stop(async (err) => {
if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop callback");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop PASSED"); if (!err) {
} else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop PASSED");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop FAILED : " + err.message); } else {
expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop FAILED : " + err.message);
} expect().assertFail();
}) }
await sleep(500); })
await sleep(500);
}
await beginCameraSessionConfig(); await beginCameraSessionConfig();
await stopCameraSession(); await stopCameraSession();
...@@ -991,13 +1000,15 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -991,13 +1000,15 @@ export default function cameraSessionTest(surfaceId: any) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.start(); if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED"); await mCameraSession.start();
await sleep(2000); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED");
await sleep(2000);
await mCameraSession.stop(); await mCameraSession.stop();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED");
await sleep(500); await sleep(500);
}
await beginCameraSessionConfig(); await beginCameraSessionConfig();
...@@ -1525,60 +1536,63 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -1525,60 +1536,63 @@ export default function cameraSessionTest(surfaceId: any) {
await startCameraSession(i); await startCameraSession(i);
let focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); if (!isEmpty(mPreviewOutput)) {
if (focusModeSupportedFlag == false) { let focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_AUTO"); if (focusModeSupportedFlag == false) {
await beginCameraSessionConfig(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_AUTO");
await stopCameraSession(); await beginCameraSessionConfig();
continue; await stopCameraSession();
} continue;
}
focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
if (focusModeSupportedFlag == false) { if (focusModeSupportedFlag == false) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_CONTINUOUS_AUTO"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_CONTINUOUS_AUTO");
await beginCameraSessionConfig(); await beginCameraSessionConfig();
await stopCameraSession(); await stopCameraSession();
continue; continue;
}
mCameraSession.on('focusStateChange', async (err, data) => {
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 callback");
if (data != null || data != undefined) {
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 PASSED: " + data);
nfyFlag = true;
}
} else {
expect().assertFail();
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED: " + err.message);
} }
await sleep(1);
}) mCameraSession.on('focusStateChange', async (err, data) => {
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 callback");
if (data != null || data != undefined) {
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 PASSED: " + data);
nfyFlag = true;
}
} else {
expect().assertFail();
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED: " + err.message);
}
await sleep(1);
})
await mCameraSession.start(); await mCameraSession.start();
await beginCameraSessionConfig(); await beginCameraSessionConfig();
mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO); mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO);
await commitCameraSessionConfig(); await commitCameraSessionConfig();
await sleep(100); await sleep(100);
await beginCameraSessionConfig(); await beginCameraSessionConfig();
mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
await commitCameraSessionConfig(); await commitCameraSessionConfig();
await sleep(100); await sleep(100);
if (nfyFlag == false) { if (nfyFlag == false) {
//expect().assertFail(); //expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!"); //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!");
}
await mCameraSession.stop();
} }
await mCameraSession.stop();
await beginCameraSessionConfig(); await beginCameraSessionConfig();
await stopCameraSession(); await stopCameraSession();
...@@ -1613,30 +1627,32 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -1613,30 +1627,32 @@ export default function cameraSessionTest(surfaceId: any) {
await startCameraSession(i); await startCameraSession(i);
mCameraSession.on('error', async (err, data) => { if (!isEmpty(mPreviewOutput)) {
if (!err) { mCameraSession.on('error', async (err, data) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 callback"); if (!err) {
if (data != null || data != undefined) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 callback");
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 PASSED: " + data); if (data != null || data != undefined) {
nfyFlag = true; console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 PASSED: " + data);
nfyFlag = true;
}
} else {
expect().assertFail();
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED: " + err.message);
} }
} else { await sleep(1);
expect().assertFail(); })
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED: " + err.message);
await mCameraSession.start();
await sleep(400);
if (nfyFlag == false) {
//expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!");
} }
await sleep(1);
})
await mCameraSession.start(); await mCameraSession.stop();
await sleep(400);
if (nfyFlag == false) {
//expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!");
} }
await mCameraSession.stop();
await beginCameraSessionConfig(); await beginCameraSessionConfig();
await stopCameraSession(); await stopCameraSession();
......
...@@ -412,7 +412,14 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -412,7 +412,14 @@ export default function cameraSessionExposureTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -523,7 +530,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -523,7 +530,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
} }
async function releaseOutput() { async function releaseOutput() {
console.info('Enter createOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop(); await mPreviewOutput.stop();
...@@ -539,7 +546,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -539,7 +546,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
await mVideoOutput.release(); await mVideoOutput.release();
} }
*/ */
console.info('Exit createOutput'); console.info('Exit releaseOutput');
return true; return true;
} }
......
...@@ -363,7 +363,14 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -363,7 +363,14 @@ export default function cameraSessionFlashTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -474,7 +481,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -474,7 +481,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
} }
async function releaseOutput() { async function releaseOutput() {
console.info('Enter createOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop(); await mPreviewOutput.stop();
...@@ -490,7 +497,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -490,7 +497,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
await mVideoOutput.release(); await mVideoOutput.release();
} }
*/ */
console.info('Exit createOutput'); console.info('Exit releaseOutput');
return true; return true;
} }
......
...@@ -408,7 +408,14 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -408,7 +408,14 @@ export default function cameraSessionFocusTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -519,7 +526,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -519,7 +526,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
} }
async function releaseOutput() { async function releaseOutput() {
console.info('Enter createOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop(); await mPreviewOutput.stop();
...@@ -535,7 +542,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -535,7 +542,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
await mVideoOutput.release(); await mVideoOutput.release();
} }
*/ */
console.info('Exit createOutput'); console.info('Exit releaseOutput');
return true; return true;
} }
......
...@@ -361,7 +361,14 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -361,7 +361,14 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -472,7 +479,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -472,7 +479,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
} }
async function releaseOutput() { async function releaseOutput() {
console.info('Enter createOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop(); await mPreviewOutput.stop();
...@@ -488,7 +495,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -488,7 +495,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
await mVideoOutput.release(); await mVideoOutput.release();
} }
*/ */
console.info('Exit createOutput'); console.info('Exit releaseOutput');
return true; return true;
} }
......
...@@ -365,7 +365,14 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -365,7 +365,14 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = null;
await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => {
console.info('createCameraInput success');
mCameraInput = result;
}).catch((err) => {
console.info('createCameraInput failed, err = ' + err.message);
});
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
...@@ -476,7 +483,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -476,7 +483,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
} }
async function releaseOutput() { async function releaseOutput() {
console.info('Enter createOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop(); await mPreviewOutput.stop();
...@@ -492,7 +499,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -492,7 +499,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
await mVideoOutput.release(); await mVideoOutput.release();
} }
*/ */
console.info('Exit createOutput'); console.info('Exit releaseOutput');
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册