def test_parse_output_to_processed_report_big_addresses(self):
        """Tests that given output with big addresses prototizes."""
        self.needs_file_delete = False
        actual_report_bytes = crash_uploader.get_symbolized_stack_bytes(
            'reason', '0xfffffffffffffff4', [])
        actual_report_proto = process_state_pb2.ProcessStateProto()
        actual_report_proto.ParseFromString(actual_report_bytes)

        self.assertEqual(actual_report_proto.crash.address, -12)
    def test_parse_output_to_processed_report(self):
        """Tests if given output parses to the expected symbolized stack bytes."""
        self.needs_file_delete = False
        state = stack_analyzer.get_crash_data(SAMPLE_OUTPUT_TO_PARSE)
        actual_report_bytes = crash_uploader.get_symbolized_stack_bytes(
            state.crash_type, state.crash_address, state.frames)
        with open(EXPECTED_PROCESSED_REPORT_PATH, 'rb') as expected_report:
            expected_report_bytes = expected_report.read()

        self.assertEqual(actual_report_bytes, expected_report_bytes)
 def test_parse_output_to_processed_report_bad_stack(self):
     """Tests if given bad stack fails to parse to a processed report."""
     self.needs_file_delete = False
     actual_report_bytes = crash_uploader.get_symbolized_stack_bytes(
         'reason', 12345, [None])
     self.assertIsNone(actual_report_bytes)