quality: Add test cases for port_desc and port_stats messages

This commit is contained in:
Eishun Kondoh 2019-05-05 23:37:20 +09:00
parent 2e3f772b1f
commit 599f1947db
8 changed files with 153 additions and 31 deletions

View file

@ -13,10 +13,6 @@ defmodule Openflow.Multipart.PortDesc.Reply do
def ofp_type, do: 18
def new(ports \\ []) do
%Reply{ports: ports}
end
def read(<<ports_bin::bytes>>) do
ports = for <<port_bin::64-bytes <- ports_bin>>, do: Openflow.Port.read(port_bin)
%Reply{ports: Enum.reverse(ports)}