예제 #1
0
    def test_actualPersistence(self):
        sql = sqlite3.connect(":memory:")

        ds = DataStore(sql, getDecoder)
        data = [0, 1, 2, 3, 4, 5, 6, 7]
        ds.segments.addSegment(0x0, len(data), "ROM", data)

        ds.infostore.setType(1, "8051")

        ds.flush()
        del ds

        #print [i for i in sql.execute("SELECT * from memory_info")]
        ds2 = DataStore(sql, getDecoder)
        rc, obj = ds2.infostore.lookup(1)

        self.assertEquals(rc, InfoStore.LKUP_OK)
        self.assertEquals(obj.addr, 1)
예제 #2
0
    os.unlink(testfile)
except OSError:
    pass

ds = DataStore(testfile)

my_dir = os.path.dirname(sys.argv[0])

testfile_path = my_dir + "/src/8051_flash_trunc.bin"

startTime = time.time()
print "Starting tests at time %f" % startTime

applogic.tools.addBinary(ds, testfile_path, 0x0, 0x8000, 0x7E00)

ds.flush()

midTime = time.time()
print "Loading binary took %f seconds" % (midTime - startTime)

runtime_arch = arch.architectureFactory('8051')
applogic.tools.codeFollow(ds, runtime_arch, 0x0)

ds.flush()

endTime = time.time()

print "Time taken: %f seconds" % (endTime - startTime)
print """Updates: %d
Inserts: %d
Deletes: %d