Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: tools/binary_size/libsupersize/function_signature_test.py

Issue 2856203004: supersize: Fix name normalization of top-level lambdas (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/libsupersize/function_signature.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/function_signature_test.py
diff --git a/tools/binary_size/libsupersize/function_signature_test.py b/tools/binary_size/libsupersize/function_signature_test.py
index ca613383febb2e259b67dc78e4f2d724ba24a10d..6c6ac7351b8c8fa4b9c72cba62f2b11d7c53d39f 100755
--- a/tools/binary_size/libsupersize/function_signature_test.py
+++ b/tools/binary_size/libsupersize/function_signature_test.py
@@ -66,6 +66,11 @@ class AnalyzeTest(unittest.TestCase):
' const')
# Make sure []s are not removed from the name part.
check('', 'Foo', '()', ' [virtual thunk]')
+ # Template function that accepts an anonymous lambda.
+ check('',
+ 'blink::FrameView::ForAllNonThrottledFrameViews<blink::FrameView::Pre'
+ 'Paint()::{lambda(FrameView&)#2}>',
+ '(blink::FrameView::PrePaint()::{lambda(FrameView&)#2} const&)', '')
# SkArithmeticImageFilter.cpp has class within function body. e.g.:
# ArithmeticFP::onCreateGLSLInstance() looks like:
@@ -82,6 +87,13 @@ class AnalyzeTest(unittest.TestCase):
self.assertEqual('(anonymous namespace)::Foo::Baz', got_name)
self.assertEqual(SIG, got_full)
+ # Top-level lambda.
+ # Note: Inline lambdas do not seem to be broken into their own symbols.
+ SIG = 'cc::{lambda(cc::PaintOp*)#63}::_FUN(cc::PaintOp*)'
+ got_full, got_name = function_signature.Parse(SIG)
+ self.assertEqual('cc::{lambda#63}', got_name)
+ self.assertEqual('cc::{lambda#63}(cc::PaintOp*)', got_full)
+
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG,
« no previous file with comments | « tools/binary_size/libsupersize/function_signature.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698