Commit 7d553e85 authored by Linshizhi's avatar Linshizhi

unittest edits

parent 5250a462
...@@ -316,7 +316,7 @@ describe("Channel Spec", () => { ...@@ -316,7 +316,7 @@ describe("Channel Spec", () => {
}, 10000); }, 10000);
fit("BLK-BASED Channel Case 1", async () => { it("BLK-BASED Channel Case 1", async () => {
const blkSize = 10; const blkSize = 10;
let chn = new Channel(blkSize * 2); let chn = new Channel(blkSize * 2);
chn.enableBlockMode(blkSize); chn.enableBlockMode(blkSize);
...@@ -329,4 +329,7 @@ describe("Channel Spec", () => { ...@@ -329,4 +329,7 @@ describe("Channel Spec", () => {
expect(chn.dataSize()).toBe(blkSize * 2); expect(chn.dataSize()).toBe(blkSize * 2);
}); });
it("BLK-BASED Channel Case 2", async () => {
});
}); });
...@@ -9,7 +9,7 @@ describe("H264EncWWGroup Spec", () => { ...@@ -9,7 +9,7 @@ describe("H264EncWWGroup Spec", () => {
await sleep(1000); await sleep(1000);
expect(wg.numOfWorker()).toBe(2); expect(wg.numOfWorker()).toBe(2);
}); }, 10000);
it("Encode by H264EncWWGroup Spec", async () => { it("Encode by H264EncWWGroup Spec", async () => {
const RGBAFrameSize = 1920*1080*4; const RGBAFrameSize = 1920*1080*4;
...@@ -23,7 +23,7 @@ describe("H264EncWWGroup Spec", () => { ...@@ -23,7 +23,7 @@ describe("H264EncWWGroup Spec", () => {
const data = new Uint8Array([...Array(RGBAFrameSize).keys()]); const data = new Uint8Array([...Array(RGBAFrameSize).keys()]);
for (let i = 0; i < 300; ++i) { for (let i = 0; i < 30; ++i) {
await grp.dispatch(data); await grp.dispatch(data);
} }
...@@ -34,7 +34,6 @@ describe("H264EncWWGroup Spec", () => { ...@@ -34,7 +34,6 @@ describe("H264EncWWGroup Spec", () => {
await waitCond(() => grp.isDone()); await waitCond(() => grp.isDone());
let result = await grp.getResult(); let result = await grp.getResult();
console.log(result);
grp.terminate(); grp.terminate();
......
...@@ -145,9 +145,7 @@ describe("EncWW Specifications", () => { ...@@ -145,9 +145,7 @@ describe("EncWW Specifications", () => {
// Send datas // Send datas
for (let i = 0; i < 30; ++i) { for (let i = 0; i < 30; ++i) {
while (chs[i%2].push(data) == false) { while (chs[i%2].push(data) == false) {}
console.log("sleep");
}
} }
// Send eof // Send eof
...@@ -305,8 +303,6 @@ describe("EncWW Specifications", () => { ...@@ -305,8 +303,6 @@ describe("EncWW Specifications", () => {
}, 100); }, 100);
}); });
console.log("Ready");
const data = new Uint8Array([...Array(RGBAFrameSize).keys()]); const data = new Uint8Array([...Array(RGBAFrameSize).keys()]);
let input_1 = new Channel(INPUT_SIZE, SharedArrayBuffer, mem1); let input_1 = new Channel(INPUT_SIZE, SharedArrayBuffer, mem1);
...@@ -324,12 +320,10 @@ describe("EncWW Specifications", () => { ...@@ -324,12 +320,10 @@ describe("EncWW Specifications", () => {
)) ))
let inputs = [ input_1, input_2 ]; let inputs = [ input_1, input_2 ];
for (let i = 0; i < 300; ++i) { for (let i = 0; i < 30; ++i) {
while (inputs[i%2].push(data) == false) { while (inputs[i%2].push(data) == false) {
console.log("Sleep");
await sleep(100); await sleep(100);
} }
console.log("PUSH IN MAIN\n");
} }
input_1.setPriv(PRIV_FLAGS.EOF); input_1.setPriv(PRIV_FLAGS.EOF);
...@@ -344,8 +338,6 @@ describe("EncWW Specifications", () => { ...@@ -344,8 +338,6 @@ describe("EncWW Specifications", () => {
}, 1000); }, 1000);
}); });
console.log("ALL DONE");
let done = false; let done = false;
mux.subscribe(msg => { mux.subscribe(msg => {
done = true; done = true;
......
...@@ -18,7 +18,7 @@ const RGBAFrameSize = 1920*1080*4; ...@@ -18,7 +18,7 @@ const RGBAFrameSize = 1920*1080*4;
describe("ParaEncoder", () => { describe("ParaEncoder", () => {
it("Encode With ParaEncoder", async () => { xit("Encode With ParaEncoder", async () => {
const data = new Uint8Array([...Array(RGBAFrameSize).keys()]); const data = new Uint8Array([...Array(RGBAFrameSize).keys()]);
let st = new Date(); let st = new Date();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment