Exemplo n.º 1
0
def atypes_node_remove_test():
    mem = MockMemory()
    text = 'hello, world!'
    mem.w_cstr(12, text)
    node = Node(mem, 0x80)
    node.setup(0x60, 0x100, NodeType.NT_DEVICE, -5, 12)
    node.remove()
Exemplo n.º 2
0
def atypes_node_remove_test():
  mem = MockMemory()
  text = 'hello, world!'
  mem.w_cstr(12, text)
  node = Node(mem, 0x80)
  node.setup(0x60, 0x100, NodeType.NT_DEVICE, -5, 12)
  node.remove()
Exemplo n.º 3
0
def atypes_node_str_test():
    mem = MockMemory()
    text = 'hello, world!'
    mem.w_cstr(12, text)
    node = Node(mem, 0x42)
    node.setup(0x1234, 0x5678, NodeType.NT_DEVICE, -5, 12)
    assert str(node) == \
        "[Node:@000042,p=005678,s=001234,NT_DEVICE,-5,'hello, world!']"
Exemplo n.º 4
0
def atypes_node_str_test():
  mem = MockMemory()
  text = 'hello, world!'
  mem.w_cstr(12, text)
  node = Node(mem, 0x42)
  node.setup(0x1234, 0x5678, NodeType.NT_DEVICE, -5, 12)
  assert str(node) == \
      "[Node:@000042,p=005678,s=001234,NT_DEVICE,-5,'hello, world!']"
Exemplo n.º 5
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.º 6
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))