- Timestamp:
- 03/28/11 23:54:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pyregfi-smoketest.py
r215 r216 31 31 # Gathers various (meaningless) statistics to exercise simple attribute access 32 32 # and to hopefully smoke out any bugs that can be identified by changing stats 33 def iterTally (hive):33 def iterTallyNames(hive): 34 34 key_count = 0 35 35 key_lens = 0 … … 77 77 78 78 79 # Uses the HiveIterator to walk all keys 80 # Gathers various (meaningless) statistics about data/data_raw attributes 81 def iterTallyData(hive): 82 data_stat = 0.0 83 dataraw_stat = 0.0 84 85 for k in hive: 86 for v in k.values: 87 d = v.data 88 if d == None: 89 data_stat += 0.1 90 elif hasattr(d, "__len__"): 91 data_stat += len(d) 92 else: 93 data_stat += d/2.0**64 94 95 d = v.data_raw 96 if d == None: 97 dataraw_stat += 0.1 98 else: 99 dataraw_stat += len(d) 100 101 print(" Data stat: %f" % data_stat) 102 print(" Raw data stat: %f" % dataraw_stat) 103 104 105 79 106 if len(sys.argv) < 2: 80 107 usage() … … 82 109 83 110 84 tests = [("iterTally",iterTally),("iterParentWalk",iterParentWalk),] 111 #tests = [("iterTallyNames",iterTallyNames),("iterParentWalk",iterParentWalk),] 112 tests = [("iterTallyData",iterTallyData),] 85 113 86 114 files = []
Note: See TracChangeset
for help on using the changeset viewer.