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