Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
Tenjin
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nawasan Wisitsingkhon
Tenjin
Commits
320d8e6e
Commit
320d8e6e
authored
May 11, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unit testing
parent
7d9df7b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
README.md
README.md
+1
-1
headers.rs
tests/headers.rs
+24
-0
No files found.
README.md
View file @
320d8e6e
...
...
@@ -7,7 +7,7 @@ To understand The software-defined networking well, I trying to create a simple
## TODOs
-
[
x
]
design structure of code and working.
-
[
]
test case. (
[
Read docs
](
https://doc.rust-lang.org/book/ch11-01-writing-tests.html
)
)
-
[
x
]
test case. (
[
Read docs
](
https://doc.rust-lang.org/book/ch11-01-writing-tests.html
)
)
-
[
]
write more description in README.
## Learning resources
...
...
tests/headers.rs
0 → 100644
View file @
320d8e6e
#
[
cfg
(
test
)]
mod
tests
{
use
tenjin
::{
openflow
::{
controller_frame
::
ControllerFrame
,
ofp_manager
::
OfpMsgEvent
,
ofp_v1_0
::
Openflow10
,
},
Controller
,
};
#[test]
fn
test_header_v1_0_parser
()
{
let
ofp_header_bytes
:
Vec
<
u8
>
=
vec!
[
1
,
0
,
0
,
8
,
0
,
0
,
0
,
1
];
let
controller
=
Controller
::
new
(
Openflow10
::
new
());
let
ofp
=
controller
.get_ofp
();
let
header
=
ofp
.header_parse
(
&
ofp_header_bytes
);
assert_eq!
(
header
.version
(),
1
);
assert_eq!
(
header
.message
(),
0
);
assert_eq!
(
header
.length
(),
8
);
assert_eq!
(
header
.xid
(),
1
);
}
}
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