quality: Add test cases for barrier messages
This commit is contained in:
parent
211d703366
commit
578c0d1bdc
4 changed files with 99 additions and 18 deletions
|
|
@ -12,15 +12,9 @@ defmodule Openflow.Barrier.Reply do
|
|||
|
||||
def ofp_type, do: 21
|
||||
|
||||
def new do
|
||||
%Reply{}
|
||||
end
|
||||
def new(xid \\ 0), do: %Reply{xid: xid}
|
||||
|
||||
def read(_) do
|
||||
%Reply{}
|
||||
end
|
||||
def read(_), do: %Reply{}
|
||||
|
||||
def to_binary(%Reply{}) do
|
||||
<<>>
|
||||
end
|
||||
def to_binary(%Reply{}), do: <<>>
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,17 +10,22 @@ defmodule Openflow.Barrier.Request do
|
|||
|
||||
alias __MODULE__
|
||||
|
||||
@type t :: %Request{
|
||||
version: 4,
|
||||
xid: 0..0xFFFFFFFF,
|
||||
datapath_id: String.t() | nil,
|
||||
aux_id: non_neg_integer() | nil
|
||||
}
|
||||
|
||||
@spec ofp_type() :: 20
|
||||
def ofp_type, do: 20
|
||||
|
||||
def new(xid \\ 0) do
|
||||
%Request{xid: xid}
|
||||
end
|
||||
@spec new(xid :: 0..0xFFFFFFFF) :: t()
|
||||
def new(xid \\ 0), do: %Request{xid: xid}
|
||||
|
||||
def read(_) do
|
||||
%Request{}
|
||||
end
|
||||
@spec read(binary()) :: t()
|
||||
def read(_), do: %Request{}
|
||||
|
||||
def to_binary(%Request{}) do
|
||||
<<>>
|
||||
end
|
||||
@spec to_binary(t()) :: binary()
|
||||
def to_binary(%Request{}), do: <<>>
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue