Beispiel #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()
Beispiel #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()
Beispiel #3
0
def atypes_list_remove_node_test():
    l = new_list()
    n1 = Node(l.mem, 0x50)
    l.add_tail(n1)
    n2 = Node(l.mem, 0x60)
    l.add_tail(n2)
    assert len(l) == 2
    assert [a for a in l] == [n1, n2]
    n1.remove()
    assert len(l) == 1
    assert [a for a in l] == [n2]
    n2.remove()
    assert len(l) == 0
Beispiel #4
0
def atypes_list_remove_node_test():
  l = new_list()
  n1 = Node(l.mem, 0x50)
  l.add_tail(n1)
  n2 = Node(l.mem, 0x60)
  l.add_tail(n2)
  assert len(l) == 2
  assert [a for a in l] == [n1, n2]
  n1.remove()
  assert len(l) == 1
  assert [a for a in l] == [n2]
  n2.remove()
  assert len(l) == 0