Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ParaEncode
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ParaEncode
Commits
01e1ab88
Commit
01e1ab88
authored
Apr 22, 2022
by
NzSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Unittests.
parent
945aac1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
WWGroup.spec.js
tests/WWGroup.spec.js
+24
-0
No files found.
tests/WWGroup.spec.js
View file @
01e1ab88
...
...
@@ -68,6 +68,12 @@ describe("Channel Spec", () => {
let
ret
=
channel
.
push
(
buffer
);
expect
(
ret
).
toBe
(
true
);
// Try to write a byte to full channel
// , should fail.
ret
=
channel
.
push
(
new
Uint8Array
([
1
]));
expect
(
ret
).
toBe
(
false
);
let
readData
=
channel
.
readData
(
1023
);
expect
(
areEqual
(
buffer
,
readData
))
.
withContext
(
"Data Mismatch"
)
...
...
@@ -96,6 +102,24 @@ describe("Channel Spec", () => {
expect
(
channel
.
isEmpty
()).
toBe
(
true
);
})
it
(
"2 Bytes Channel"
,
()
=>
{
let
channel
=
new
Channel
(
WW
,
2
,
ArrayBuffer
);
let
buffer
=
new
Uint8Array
([
3
]);
let
ret
=
channel
.
push
(
buffer
);
expect
(
ret
).
toBe
(
true
);
// Push should be failed cause
// there are no more space.
ret
=
channel
.
push
(
buffer
);
expect
(
ret
).
toBe
(
false
);
let
data
=
channel
.
readData
(
1
);
expect
(
areEqual
(
buffer
,
data
)).
toBe
(
true
);
expect
(
channel
.
isEmpty
()).
toBe
(
true
);
});
});
describe
(
"H264EncWWGroup Spec"
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment