Exemplo n.º 1
0
def atypes_node_setup_min_test():
    mem = MockMemory()
    node = Node(mem, 0x42)
    node.setup_min(1234, 5678)
    # check node
    assert node.get_succ() == 1234
    assert node.get_pred() == 5678
Exemplo n.º 2
0
def atypes_node_setup_test():
    mem = MockMemory()
    text = 'hello, world!'
    mem.w_cstr(12, text)
    node = Node(mem, 0x42)
    node.setup(1234, 5678, NodeType.NT_DEVICE, -5, 12)
    # check node
    assert node.get_succ() == 1234
    assert node.get_pred() == 5678
    assert int(node.get_type()) == NodeType.NT_DEVICE
    assert node.get_pri() == -5
    assert node.get_name(True) == 12
    assert node.get_name() == text
    node.set_type(NodeType(NodeType.NT_DEVICE))
Exemplo n.º 3
0
def atypes_node_setup_test():
  mem = MockMemory()
  text = 'hello, world!'
  mem.w_cstr(12, text)
  node = Node(mem, 0x42)
  node.setup(1234, 5678, NodeType.NT_DEVICE, -5, 12)
  # check node
  assert node.get_succ() == 1234
  assert node.get_pred() == 5678
  assert int(node.get_type()) == NodeType.NT_DEVICE
  assert node.get_pri() == -5
  assert node.get_name(True) == 12
  assert node.get_name() == text
  node.set_type(NodeType(NodeType.NT_DEVICE))
Exemplo n.º 4
0
def atypes_node_base_test():
    mem = MockMemory()
    text = 'hello, world!'
    mem.w_cstr(12, text)
    node = Node(mem, 0x42)
    # set node
    node.set_succ(1234)
    node.set_pred(5678)
    node.set_type(NodeType.NT_LIBRARY)
    node.set_pri(-3)
    node.set_name(12)
    # check node
    assert node.get_succ() == 1234
    assert node.get_pred() == 5678
    assert int(node.get_type()) == NodeType.NT_LIBRARY
    assert node.get_type() == NodeType(NodeType.NT_LIBRARY)
    assert node.get_pri() == -3
    assert node.get_name(True) == 12
    assert node.get_name() == text
Exemplo n.º 5
0
def atypes_node_base_test():
  mem = MockMemory()
  text = 'hello, world!'
  mem.w_cstr(12, text)
  node = Node(mem, 0x42)
  # set node
  node.set_succ(1234)
  node.set_pred(5678)
  node.set_type(NodeType.NT_LIBRARY)
  node.set_pri(-3)
  node.set_name(12)
  # check node
  assert node.get_succ() == 1234
  assert node.get_pred() == 5678
  assert int(node.get_type()) == NodeType.NT_LIBRARY
  assert node.get_type() == NodeType(NodeType.NT_LIBRARY)
  assert node.get_pri() == -3
  assert node.get_name(True) == 12
  assert node.get_name() == text