tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test.py (939B)


      1 # flake8: noqa: F821
      2 test.compile("source.cpp")
      3 test.run_analysis_script("gcTypes", upto="gcFunctions")
      4 
      5 # The suppressions file uses mangled names.
      6 info = test.load_funcInfo()
      7 suppressed = [f for f, v in info.items() if v.get("limits", 0) | 1]
      8 
      9 # Only one of these is fully suppressed (ie, *always* called within the scope
     10 # of an AutoSuppressGC).
     11 assert len(list(filter(lambda f: "suppressedFunction" in f, suppressed))) == 1
     12 assert len(list(filter(lambda f: "halfSuppressedFunction" in f, suppressed))) == 0
     13 assert len(list(filter(lambda f: "unsuppressedFunction" in f, suppressed))) == 0
     14 
     15 # gcFunctions should be the inverse, but we get to rely on unmangled names here.
     16 gcFunctions = test.load_gcFunctions()
     17 assert "void GC()" in gcFunctions
     18 assert "void suppressedFunction()" not in gcFunctions
     19 assert "void halfSuppressedFunction()" in gcFunctions
     20 assert "void unsuppressedFunction()" in gcFunctions
     21 assert "void f()" in gcFunctions