stacktrace_unittest.py revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1# Copyright 2014 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import unittest 6 7from memory_inspector.core import stacktrace 8 9 10class StacktraceTest(unittest.TestCase): 11 def runTest(self): 12 st = stacktrace.Stacktrace() 13 frame_1 = stacktrace.Frame(20) 14 frame_2 = stacktrace.Frame(24) 15 frame_2.SetExecFileInfo('/foo/bar.so', 0) 16 self.assertEqual(frame_2.exec_file_name, 'bar.so') 17 st.Add(frame_1) 18 st.Add(frame_1) 19 st.Add(frame_2) 20 st.Add(frame_1) 21 self.assertEqual(st.depth, 4) 22