[sysprof] tests: test we got reasonable address translation



commit f12f9ed3f4154b03cbe3150302ebd568afcc14ff
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 5 19:33:13 2019 -0700

    tests: test we got reasonable address translation

 src/tests/test-capture.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/tests/test-capture.c b/src/tests/test-capture.c
index fff3557..4605fa0 100644
--- a/src/tests/test-capture.c
+++ b/src/tests/test-capture.c
@@ -827,6 +827,7 @@ test_reader_writer_cat_jitmap (void)
   SysprofCaptureWriter *writer2;
   SysprofCaptureWriter *res;
   SysprofCaptureReader *reader;
+  const SysprofCaptureSample *sample;
   GError *error = NULL;
   SysprofCaptureAddress addrs[20];
   gboolean r;
@@ -881,6 +882,16 @@ test_reader_writer_cat_jitmap (void)
   sysprof_capture_writer_unref (writer2);
   sysprof_capture_reader_unref (reader);
 
+  reader = sysprof_capture_writer_create_reader (res, &error);
+  g_assert_no_error (error);
+  g_assert_nonnull (reader);
+  g_hash_table_unref (sysprof_capture_reader_read_jitmap (reader));
+  sample = sysprof_capture_reader_read_sample (reader);
+  g_assert_cmpint (sample->frame.pid, ==, getpid ());
+  g_assert_cmpint (sample->n_addrs, ==, G_N_ELEMENTS (addrs));
+  g_assert_cmpint (sample->addrs[0], !=, sample->addrs[1]);
+  sysprof_capture_reader_unref (reader);
+
   sysprof_capture_writer_unref (res);
 
   g_unlink ("jitmap1.syscap");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]