Prechádzať zdrojové kódy

minor bug fix for sup diff

avkonst 11 rokov pred
rodič
commit
a7ff1303ab

+ 2 - 2
mainline/ext/std/tools/view.py

@@ -110,7 +110,7 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions, dist_col
 
         if aggregated_data_prev != None:
             aggregated_data_prev_tree = aggregated_data_prev.get_data_tree()
-            aggregated_data_prev_tree = append_suppressions(path, aggregated_data_prev_tree, loader, mode)
+            aggregated_data_prev_tree = append_suppressions(path, aggregated_data_prev_tree, loader_prev, mode)
             aggregated_data_tree = append_diff(aggregated_data_tree,
                                                aggregated_data_prev_tree)
             
@@ -221,7 +221,7 @@ def load_aggregated_data_with_mode(loader, loader_prev, path, mode):
                             aggr_data['distribution-bars'][metric_value] = 0
                         aggr_data['distribution-bars'][metric_value] += 1
                         if sup_data != None:
-                            if sup_data.find('{0}:{1}'.format(namespace, field)) != -1:
+                            if sup_data.find('[{0}:{1}]'.format(namespace, field)) != -1:
                                 aggr_data['sup'] += 1
                         self.set_data(namespace, field, aggr_data)
             

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_view_second_per_file_stdout.gold.txt

@@ -111,7 +111,7 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="7" total="10.0" min="0" max="3" avg="1.42857142857" sup="1">
-                    <__diff__ nonzero="0" count="1" avg="-0.0714285714286" min="-1" max="0" total="1.0" sup="0" />
+                    <__diff__ nonzero="0" count="1" avg="-0.0714285714286" min="-1" max="0" total="1.0" sup="1" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.142857142857" />
                         <distribution-bar count="3" __diff__="-1" metric="1" ratio="0.428571428571" />

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_view_second_per_file_txt_all_stdout.gold.txt

@@ -122,7 +122,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 3 [+0]
 	Total          : 10.0 [+1.0]
-	Distribution   : 7 [+1] regions in total (including 1 [+0] suppressed)
+	Distribution   : 7 [+1] regions in total (including 1 [+1] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.143 : 0.143 : 1 [+1]	||||||||||||||
 	             1 : 0.429 : 0.571 : 3 [-1]	|||||||||||||||||||||||||||||||||||||||||||

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_view_second_stdout.gold.txt

@@ -11,7 +11,7 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="8" total="13.0" min="0" max="3" avg="1.625" sup="1">
-                    <__diff__ nonzero="0" count="0" avg="0.25" min="-1" max="0" total="2.0" sup="0" />
+                    <__diff__ nonzero="0" count="0" avg="0.25" min="-1" max="0" total="2.0" sup="1" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.125" />
                         <distribution-bar count="3" __diff__="-3" metric="1" ratio="0.375" />

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_view_second_txt_all_stdout.gold.txt

@@ -3,7 +3,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 3 [+0]
 	Total          : 13.0 [+2.0]
-	Distribution   : 8 [+0] regions in total (including 1 [+0] suppressed)
+	Distribution   : 8 [+0] regions in total (including 1 [+1] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.125 : 0.125 : 1 [+1]	|||||||||||||
 	             1 : 0.375 : 0.500 : 3 [-3]	||||||||||||||||||||||||||||||||||||||