Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 3, 2023
1 parent 97b04ee commit c9db90c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ def get_report_hash(report: Report, hash_type: HashType) -> str:
else:
raise Exception("Invalid report hash type: " + str(hash_type))

print(hash_content)

return __str_to_hash('|||'.join(hash_content))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ def get_reports(
if report.report_hash is None:
report.report_hash = get_report_hash(
report, HashType.PATH_SENSITIVE)
print(get_report_hash(report, HashType.PATH_SENSITIVE))
print(get_report_hash(report, HashType.CONTEXT_FREE))
print(get_report_hash(
report, HashType.DIAGNOSTIC_MESSAGE))

reports.append(report)

Expand Down
47 changes: 20 additions & 27 deletions tools/report-converter/tests/unit/analyzers/test_gcc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

import os
import plistlib
# import shutil
# import tempfile
import shutil
import unittest

from codechecker_report_converter.analyzers.gcc import analyzer_result
Expand All @@ -37,6 +36,9 @@ def setup_class(self):
TEST_WORKSPACE = env.get_workspace('gcc_parser')
os.environ['TEST_WORKSPACE'] = TEST_WORKSPACE
self.test_workspace = os.environ['TEST_WORKSPACE']
self.cc_result_dir = self.test_workspace

self.analyzer_result = analyzer_result.AnalyzerResult()

self.test_files = os.path.join(os.path.dirname(__file__),
'gcc_output_test_files')
Expand All @@ -54,35 +56,26 @@ def teardown_class(self):
global TEST_WORKSPACE

print("Removing: " + TEST_WORKSPACE)
# shutil.rmtree(TEST_WORKSPACE, ignore_errors=True)

def setUp(self):
""" Setup the test. """
self.analyzer_result = analyzer_result.AnalyzerResult()
self.cc_result_dir = self.test_workspace

def tearDown(self):
""" Clean temporary directory. """
# shutil.rmtree(self.cc_result_dir)
shutil.rmtree(TEST_WORKSPACE, ignore_errors=True)

# def test_no_plist_file(self):
# """ Test transforming single plist file. """
# analyzer_output_file = os.path.join(self.test_files, 'files',
# 'double_free.cpp')
def test_no_plist_file(self):
""" Test transforming single plist file. """
analyzer_output_file = os.path.join(self.test_files, 'files',
'double_free.cpp')

# ret = self.analyzer_result.transform(
# [analyzer_output_file], self.cc_result_dir, plist.EXTENSION,
# file_name="{source_file}_{analyzer}")
# self.assertFalse(ret)
ret = self.analyzer_result.transform(
[analyzer_output_file], self.cc_result_dir, plist.EXTENSION,
file_name="{source_file}_{analyzer}")
self.assertFalse(ret)

# def test_no_plist_dir(self):
# """ Test transforming single plist file. """
# analyzer_output_file = os.path.join(self.test_files, 'non_existing')
def test_no_plist_dir(self):
""" Test transforming single plist file. """
analyzer_output_file = os.path.join(self.test_files, 'non_existing')

# ret = self.analyzer_result.transform(
# [analyzer_output_file], self.cc_result_dir, plist.EXTENSION,
# file_name="{source_file}_{analyzer}")
# self.assertFalse(ret)
ret = self.analyzer_result.transform(
[analyzer_output_file], self.cc_result_dir, plist.EXTENSION,
file_name="{source_file}_{analyzer}")
self.assertFalse(ret)

def test_gcc_transform_single_file(self):
""" Test transforming single plist file. """
Expand Down

0 comments on commit c9db90c

Please sign in to comment.