提交 877531a3 编写于 作者: L ling990

modify Signed-off-by: ling990 <liling96@huawei.com>

Signed-off-by: Nling990 <liling96@huawei.com>
上级 5d55ba17
...@@ -147,6 +147,8 @@ describe('AudioDecoderFormatCallback', function () { ...@@ -147,6 +147,8 @@ describe('AudioDecoderFormatCallback', function () {
audioDecodeProcessor.stop((err) => { audioDecodeProcessor.stop((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.log("stop success"); console.log("stop success");
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.log("reset success"); console.log("reset success");
......
...@@ -157,6 +157,8 @@ describe('AudioDecoderFormatPromise', function () { ...@@ -157,6 +157,8 @@ describe('AudioDecoderFormatPromise', function () {
await audioDecodeProcessor.stop().then(() => { await audioDecodeProcessor.stop().then(() => {
console.log("stop success"); console.log("stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
inputQueue = [];
outputQueue = [];
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.log("reset success"); console.log("reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
......
...@@ -271,6 +271,8 @@ describe('AudioDecoderFunc', function () { ...@@ -271,6 +271,8 @@ describe('AudioDecoderFunc', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeFile(path, buf, len){ function writeFile(path, buf, len){
...@@ -309,6 +311,7 @@ describe('AudioDecoderFunc', function () { ...@@ -309,6 +311,7 @@ describe('AudioDecoderFunc', function () {
} }
async function resetWork() { async function resetWork() {
resetParam();
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case reset success"); console.info("case reset success");
...@@ -338,6 +341,7 @@ describe('AudioDecoderFunc', function () { ...@@ -338,6 +341,7 @@ describe('AudioDecoderFunc', function () {
audioDecodeProcessor.stop((err) => { audioDecodeProcessor.stop((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case stop success"); console.info("case stop success");
resetParam();
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.log("case reset success"); console.log("case reset success");
...@@ -776,6 +780,7 @@ describe('AudioDecoderFunc', function () { ...@@ -776,6 +780,7 @@ describe('AudioDecoderFunc', function () {
}) })
}); });
eventEmitter.on('reset', () => { eventEmitter.on('reset', () => {
resetParam();
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case reset 1`); console.info(`case reset 1`);
......
...@@ -281,6 +281,8 @@ describe('AudioDecoderFunc', function () { ...@@ -281,6 +281,8 @@ describe('AudioDecoderFunc', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeFile(path, buf, len) { function writeFile(path, buf, len) {
...@@ -317,6 +319,7 @@ describe('AudioDecoderFunc', function () { ...@@ -317,6 +319,7 @@ describe('AudioDecoderFunc', function () {
} }
async function resetWork() { async function resetWork() {
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
if (needrelease) { if (needrelease) {
...@@ -340,6 +343,7 @@ describe('AudioDecoderFunc', function () { ...@@ -340,6 +343,7 @@ describe('AudioDecoderFunc', function () {
await audioDecodeProcessor.stop().then(() => { await audioDecodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -658,6 +662,7 @@ describe('AudioDecoderFunc', function () { ...@@ -658,6 +662,7 @@ describe('AudioDecoderFunc', function () {
audioDecodeProcessor.stop().then(() => { audioDecodeProcessor.stop().then(() => {
console.info("case stop after 5s success"); console.info("case stop after 5s success");
}, failCallback).catch(failCatch);}); }, failCallback).catch(failCatch);});
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
......
...@@ -78,6 +78,8 @@ describe('AudioDecoderMultiInstances', function () { ...@@ -78,6 +78,8 @@ describe('AudioDecoderMultiInstances', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeFile(path, buf, len) { function writeFile(path, buf, len) {
...@@ -114,6 +116,7 @@ describe('AudioDecoderMultiInstances', function () { ...@@ -114,6 +116,7 @@ describe('AudioDecoderMultiInstances', function () {
} }
async function resetWork(audioDecodeProcessor) { async function resetWork(audioDecodeProcessor) {
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
if (needrelease) { if (needrelease) {
...@@ -137,6 +140,7 @@ describe('AudioDecoderMultiInstances', function () { ...@@ -137,6 +140,7 @@ describe('AudioDecoderMultiInstances', function () {
await audioDecodeProcessor.stop().then(() => { await audioDecodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -255,6 +259,7 @@ describe('AudioDecoderMultiInstances', function () { ...@@ -255,6 +259,7 @@ describe('AudioDecoderMultiInstances', function () {
console.info('case has created 16 decoders'); console.info('case has created 16 decoders');
console.info('case array: ' + array); console.info('case array: ' + array);
for (let j = 0; j < 16; j++) { for (let j = 0; j < 16; j++) {
resetParam();
await array[j].reset().then(() => { await array[j].reset().then(() => {
console.info("reset decoder " + j); console.info("reset decoder " + j);
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
......
...@@ -329,6 +329,7 @@ describe('AudioDecoderReliabilityCallback', function () { ...@@ -329,6 +329,7 @@ describe('AudioDecoderReliabilityCallback', function () {
audioDecodeProcessor.stop((err) => { audioDecodeProcessor.stop((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case stop success"); console.info("case stop success");
resetParam();
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.log("case reset success"); console.log("case reset success");
...@@ -425,6 +426,7 @@ describe('AudioDecoderReliabilityCallback', function () { ...@@ -425,6 +426,7 @@ describe('AudioDecoderReliabilityCallback', function () {
case RESET: case RESET:
mySteps.shift(); mySteps.shift();
console.info(`case to reset`); console.info(`case to reset`);
resetParam();
audioDecodeProcessor.reset((err) => { audioDecodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case reset 1`); console.info(`case reset 1`);
......
...@@ -350,6 +350,7 @@ describe('AudioDecoderReliabilityPromise', function () { ...@@ -350,6 +350,7 @@ describe('AudioDecoderReliabilityPromise', function () {
await audioDecodeProcessor.stop().then(() => { await audioDecodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioDecodeProcessor.reset().then(() => { await audioDecodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -435,6 +436,7 @@ describe('AudioDecoderReliabilityPromise', function () { ...@@ -435,6 +436,7 @@ describe('AudioDecoderReliabilityPromise', function () {
case RESET: case RESET:
mySteps.shift(); mySteps.shift();
console.info(`case to reset`); console.info(`case to reset`);
resetParam();
audioDecodeProcessor.reset().then(() => { audioDecodeProcessor.reset().then(() => {
console.info(`case reset 1`); console.info(`case reset 1`);
nextStep(mySteps, done); nextStep(mySteps, done);
......
...@@ -90,6 +90,8 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -90,6 +90,8 @@ describe('AudioEncoderFuncCallback', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeHead(path, len) { function writeHead(path, len) {
...@@ -155,6 +157,7 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -155,6 +157,7 @@ describe('AudioEncoderFuncCallback', function () {
} }
async function resetWork() { async function resetWork() {
resetParam();
audioEncodeProcessor.reset((err) => { audioEncodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case reset success"); console.info("case reset success");
...@@ -180,6 +183,7 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -180,6 +183,7 @@ describe('AudioEncoderFuncCallback', function () {
audioEncodeProcessor.stop((err) => { audioEncodeProcessor.stop((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case stop success"); console.info("case stop success");
resetParam();
audioEncodeProcessor.reset((err) => { audioEncodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
audioEncodeProcessor.release((err) => { audioEncodeProcessor.release((err) => {
...@@ -605,6 +609,7 @@ describe('AudioEncoderFuncCallback', function () { ...@@ -605,6 +609,7 @@ describe('AudioEncoderFuncCallback', function () {
}) })
}); });
eventEmitter.on('reset', () => { eventEmitter.on('reset', () => {
resetParam();
audioEncodeProcessor.reset((err) => { audioEncodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case reset 1`); console.info(`case reset 1`);
......
...@@ -100,6 +100,8 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -100,6 +100,8 @@ describe('AudioEncoderFuncPromise', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeHead(path, len) { function writeHead(path, len) {
...@@ -165,6 +167,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -165,6 +167,7 @@ describe('AudioEncoderFuncPromise', function () {
} }
async function resetWork() { async function resetWork() {
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
if (needrelease) { if (needrelease) {
...@@ -188,6 +191,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -188,6 +191,7 @@ describe('AudioEncoderFuncPromise', function () {
await audioEncodeProcessor.stop().then(() => { await audioEncodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -515,6 +519,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -515,6 +519,7 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor.stop().then(() => { audioEncodeProcessor.stop().then(() => {
console.info("stop after 5s success"); console.info("stop after 5s success");
}, failCallback).catch(failCatch);}); }, failCallback).catch(failCatch);});
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("reset success"); console.info("reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
......
...@@ -92,6 +92,8 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -92,6 +92,8 @@ describe('AudioEncoderFuncPromise', function () {
timestamp = 0; timestamp = 0;
sawInputEOS = false; sawInputEOS = false;
sawOutputEOS = false; sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
} }
function writeHead(path, len) { function writeHead(path, len) {
...@@ -157,6 +159,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -157,6 +159,7 @@ describe('AudioEncoderFuncPromise', function () {
} }
async function resetWork(audioEncodeProcessor) { async function resetWork(audioEncodeProcessor) {
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
if (needrelease) { if (needrelease) {
...@@ -180,6 +183,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -180,6 +183,7 @@ describe('AudioEncoderFuncPromise', function () {
await audioEncodeProcessor.stop().then(() => { await audioEncodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -301,6 +305,7 @@ describe('AudioEncoderFuncPromise', function () { ...@@ -301,6 +305,7 @@ describe('AudioEncoderFuncPromise', function () {
console.info('case has created 16 encoders'); console.info('case has created 16 encoders');
console.info('case array: ' + array); console.info('case array: ' + array);
for (let j = 0; j < 16; j++) { for (let j = 0; j < 16; j++) {
resetParam();
await array[j].reset().then(() => { await array[j].reset().then(() => {
console.info("reset encoder " + j); console.info("reset encoder " + j);
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
......
...@@ -179,6 +179,7 @@ describe('AudioEncoderSTTCallback', function () { ...@@ -179,6 +179,7 @@ describe('AudioEncoderSTTCallback', function () {
audioEncodeProcessor.stop((err) => { audioEncodeProcessor.stop((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info("case stop success"); console.info("case stop success");
resetParam();
audioEncodeProcessor.reset((err) => { audioEncodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.log("case reset success"); console.log("case reset success");
...@@ -274,6 +275,7 @@ describe('AudioEncoderSTTCallback', function () { ...@@ -274,6 +275,7 @@ describe('AudioEncoderSTTCallback', function () {
case RESET: case RESET:
mySteps.shift(); mySteps.shift();
console.info(`case to reset`); console.info(`case to reset`);
resetParam();
audioEncodeProcessor.reset((err) => { audioEncodeProcessor.reset((err) => {
expect(err).assertUndefined(); expect(err).assertUndefined();
console.info(`case reset 1`); console.info(`case reset 1`);
......
...@@ -197,6 +197,7 @@ describe('AudioEncoderSTTPromise', function () { ...@@ -197,6 +197,7 @@ describe('AudioEncoderSTTPromise', function () {
await audioEncodeProcessor.stop().then(() => { await audioEncodeProcessor.stop().then(() => {
console.info("case stop success"); console.info("case stop success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
resetParam();
await audioEncodeProcessor.reset().then(() => { await audioEncodeProcessor.reset().then(() => {
console.info("case reset success"); console.info("case reset success");
}, failCallback).catch(failCatch); }, failCallback).catch(failCatch);
...@@ -283,6 +284,7 @@ describe('AudioEncoderSTTPromise', function () { ...@@ -283,6 +284,7 @@ describe('AudioEncoderSTTPromise', function () {
case RESET: case RESET:
mySteps.shift(); mySteps.shift();
console.info(`case to reset`); console.info(`case to reset`);
resetParam();
audioEncodeProcessor.reset().then(() => { audioEncodeProcessor.reset().then(() => {
console.info(`case reset 1`); console.info(`case reset 1`);
nextStep(mySteps, done); nextStep(mySteps, done);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册