Changeset 252 for test


Ignore:
Timestamp:
05/08/11 13:33:49 (13 years ago)
Author:
tim
Message:

updated pyregfi to work with regfi changes
renamed some functions for more clarity
fixed some issues related to talloc_reference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/pyregfi-smoketest.py

    r232 r252  
    4242
    4343
    44 # helper function
     44# walks up parents to obtain path, rather than using downward links like iterator
    4545def getCurrentPath(key):
    4646    if key == None:
     
    7171                i += 1
    7272        except Exception as e:
    73             print("WARNING: Could not decend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e))
     73            print("WARNING: Could not descend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e))
    7474    print("   Successfully tested paths on %d keys." % i)
    7575
     
    162162    iter = pyregfi.HiveIterator(hive)
    163163    for k in iter:
    164         path = getCurrentPath(k)
     164        path = iter.current_path()
    165165        try:
    166             hive_iter = hive.subtree(path)
     166            hive_iter = hive.subtree(path[1:])
    167167            sk = hive_iter.first_subkey()
    168168            while sk != None:
    169169                ssk = hive_iter.find_subkey(sk.name)
    170                 sk_stat += len(ssk.name)
     170                if ssk != None:
     171                    sk_stat += len(ssk.name)
     172                else:
     173                    print("WARNING: ssk was None")
    171174                sk = hive_iter.next_subkey()
    172175
     
    174177            while v != None:
    175178                vv = hive_iter.find_value(v.name)
    176                 v_stat += len(vv.name)
     179                if vv != None:
     180                    v_stat += len(vv.name)
     181                else:
     182                    print("WARNING: vv was None")
    177183                v = hive_iter.next_value()
    178184
    179185        except Exception as e:
    180             print("WARNING: Could not decend to path '%s'.\nError:\n %s\n%s" % (path,e.args,e))
     186            print("WARNING: Could not descend to path '%s'.\nError:\n %s\n%s" % (path[1:],e.args,e))
    181187    print("   Subkey stat: %f" % sk_stat)
    182188    print("   Value stat: %f" % v_stat)
Note: See TracChangeset for help on using the changeset viewer.