コード例 #1
0
dd0.cache[depnodes_0[-1]] = set(depnodes_0[-1:])
assert (list(dd0.heads()) == [depnodes_0[-1]])

## Extend
dd1 = dd0.extend(lbl1)

assert (dd1.label == lbl1)
assert (dd1.history == [dd0])
assert (dd1.cache == dd0.cache)
assert (dd1.pending == set())
assert (dd1 != dd0)

dd1.cache[depnodes_0[4]] = set(depnodes_0[5:9])
assert (dd1.cache != dd0.cache)

dd2 = dd0.copy()
assert (dd2.label == lbl0)
assert (dd2.history == [])
assert (dd2.cache == dd0.cache)
assert (dd2.pending == dd0.pending)
assert (dd2 == dd0)

dd2.cache[depnodes_0[4]] = set(depnodes_0[5:9])
assert (dd2.cache != dd0.cache)

print "[+] DependencyDict OK !"
print "[+] Structures OK !"

# graph 1

g1_ira = IRATest()
コード例 #2
0
ファイル: depgraph.py プロジェクト: wflk/miasm
DD0.cache[DEPNODES_0[-1]] = set(DEPNODES_0[-1:])
assert list(DD0.heads()) == [DEPNODES_0[-1]]

# Extend
DD1 = DD0.extend(LBL1)

assert DD1.label == LBL1
assert DD1.history == [DD0]
assert DD1.cache == DD0.cache
assert DD1.pending == set()
assert DD1 != DD0

DD1.cache[DEPNODES_0[4]] = set(DEPNODES_0[5:9])
assert DD1.cache != DD0.cache

DD2 = DD0.copy()
assert DD2.label == LBL0
assert DD2.history == []
assert DD2.cache == DD0.cache
assert DD2.pending == DD0.pending
assert DD2 == DD0

DD2.cache[DEPNODES_0[4]] = set(DEPNODES_0[5:9])
assert DD2.cache != DD0.cache


print "   [+] Test dictionary equality"
DNA = DependencyNode(LBL2, A, 0, next(STEP_COUNTER))
DNB = DependencyNode(LBL1, B, 1, next(STEP_COUNTER))
DNC = DependencyNode(LBL1, C, 0, next(STEP_COUNTER), True)
DNB2 = DependencyNode(LBL1, B, 1, next(STEP_COUNTER))
コード例 #3
0
ファイル: depgraph.py プロジェクト: avelik/miasm
dd0.cache[depnodes_0[-1]] = set(depnodes_0[-1:])
assert(list(dd0.heads()) == [depnodes_0[-1]])

## Extend
dd1 = dd0.extend(lbl1)

assert(dd1.label == lbl1)
assert(dd1.history == [dd0])
assert(dd1.cache == dd0.cache)
assert(dd1.pending == set())
assert(dd1 != dd0)

dd1.cache[depnodes_0[4]] = set(depnodes_0[5:9])
assert(dd1.cache != dd0.cache)

dd2 = dd0.copy()
assert(dd2.label == lbl0)
assert(dd2.history == [])
assert(dd2.cache == dd0.cache)
assert(dd2.pending == dd0.pending)
assert(dd2 == dd0)

dd2.cache[depnodes_0[4]] = set(depnodes_0[5:9])
assert(dd2.cache != dd0.cache)

print "[+] DependencyDict OK !"
print "[+] Structures OK !"

# graph 1

g1_ira = IRATest()
コード例 #4
0
ファイル: depgraph.py プロジェクト: simudream/miasm
DD0.cache[DEPNODES_0[-1]] = set(DEPNODES_0[-1:])
assert list(DD0.heads()) == [DEPNODES_0[-1]]

# Extend
DD1 = DD0.extend(LBL1)

assert DD1.label == LBL1
assert DD1.history == [DD0]
assert DD1.cache == DD0.cache
assert DD1.pending == set()
assert DD1 != DD0

DD1.cache[DEPNODES_0[4]] = set(DEPNODES_0[5:9])
assert DD1.cache != DD0.cache

DD2 = DD0.copy()
assert DD2.label == LBL0
assert DD2.history == []
assert DD2.cache == DD0.cache
assert DD2.pending == DD0.pending
assert DD2 == DD0

DD2.cache[DEPNODES_0[4]] = set(DEPNODES_0[5:9])
assert DD2.cache != DD0.cache

print "   [+] Test dictionary equality"
DNA = DependencyNode(LBL2, A, 0, next(STEP_COUNTER))
DNB = DependencyNode(LBL1, B, 1, next(STEP_COUNTER))
DNC = DependencyNode(LBL1, C, 0, next(STEP_COUNTER), True)
DNB2 = DependencyNode(LBL1, B, 1, next(STEP_COUNTER))
DNC2 = DependencyNode(LBL1, C, 0, next(STEP_COUNTER), True)