From ffb1b1c812fe8d05a2d8f36e524372ddcb91ec9e Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 8 Apr 2015 20:53:03 +0700 Subject: [PATCH] tests: update tests results related to top-level or Object->Sys Signed-off-by: Jean Privat --- tests/error_toplevel.nit | 4 ++ tests/sav/error_defs2_alt1.res | 4 +- tests/sav/error_defs2_alt2.res | 2 +- tests/sav/error_defs_alt4.res | 3 +- tests/sav/error_defs_alt5.res | 2 +- tests/sav/error_defs_alt9.res | 2 +- tests/sav/error_expr_not_ok_alt4.res | 3 +- tests/sav/error_toplevel_alt1.res | 2 +- tests/sav/error_toplevel_alt2.res | 8 ++- tests/sav/error_toplevel_alt3.res | 7 +- tests/sav/error_toplevel_alt4.res | 2 +- tests/sav/error_toplevel_alt5.res | 8 ++- tests/sav/nitlight_args1.res | 12 ++-- tests/sav/nitmetrics_args1.res | 128 ++++++++++++++++------------------ tests/sav/nituml_args3.res | 4 +- tests/sav/nituml_args4.res | 4 +- tests/sav/nitunit_args4.res | 6 +- tests/sav/nitunit_args5.res | 6 +- tests/sav/nitx_args2.res | 2 +- tests/sav/nitx_args3.res | 2 +- tests/sav/test_docdown_args2.res | 10 +-- 21 files changed, 120 insertions(+), 101 deletions(-) diff --git a/tests/error_toplevel.nit b/tests/error_toplevel.nit index c33bcb0..797261c 100644 --- a/tests/error_toplevel.nit +++ b/tests/error_toplevel.nit @@ -45,5 +45,9 @@ do o.output end +redef class Sys + redef fun output do 'S'.output +end + 0.foo1 foo2 diff --git a/tests/sav/error_defs2_alt1.res b/tests/sav/error_defs2_alt1.res index c79fb13..00c3748 100644 --- a/tests/sav/error_defs2_alt1.res +++ b/tests/sav/error_defs2_alt1.res @@ -1 +1,3 @@ -alt/error_defs2_alt1.nit:20,11--13: Error: bar is not a top level method. +4 +40 +124 diff --git a/tests/sav/error_defs2_alt2.res b/tests/sav/error_defs2_alt2.res index 8b01fd5..496828c 100644 --- a/tests/sav/error_defs2_alt2.res +++ b/tests/sav/error_defs2_alt2.res @@ -1 +1 @@ -alt/error_defs2_alt2.nit:21,11--13: Error: No property Object::foo is inherited. Remove the redef keyword to define a new property. +alt/error_defs2_alt2.nit:21,11--13: Error: No property Sys::foo is inherited. Remove the redef keyword to define a new property. diff --git a/tests/sav/error_defs_alt4.res b/tests/sav/error_defs_alt4.res index 80e2677..70d33d8 100644 --- a/tests/sav/error_defs_alt4.res +++ b/tests/sav/error_defs_alt4.res @@ -1 +1,2 @@ -alt/error_defs_alt4.nit:29,5--7: Error: baz is a top level method. +alt/error_defs_alt4.nit:27,36--38: Error: Incorrect number of parameters. Got 0, expected 1. Signature is (c: Char) +alt/error_defs_alt4.nit:27,36--38: Type error: expected expression. diff --git a/tests/sav/error_defs_alt5.res b/tests/sav/error_defs_alt5.res index fec299a..39b0cbd 100644 --- a/tests/sav/error_defs_alt5.res +++ b/tests/sav/error_defs_alt5.res @@ -1 +1 @@ -alt/error_defs_alt5.nit:30,11--13: Error: baz is a top level method. +alt/error_defs_alt5.nit:30,11--13: Error: No property A::baz is inherited. Remove the redef keyword to define a new property. diff --git a/tests/sav/error_defs_alt9.res b/tests/sav/error_defs_alt9.res index 8c547a1..eed537b 100644 --- a/tests/sav/error_defs_alt9.res +++ b/tests/sav/error_defs_alt9.res @@ -1 +1 @@ -alt/error_defs_alt9.nit:46,5--7: Error: A property baz is already defined in class Object at line 45. +alt/error_defs_alt9.nit:46,5--7: Error: A property baz is already defined in class Sys at line 45. diff --git a/tests/sav/error_expr_not_ok_alt4.res b/tests/sav/error_expr_not_ok_alt4.res index d22055c..62c634d 100644 --- a/tests/sav/error_expr_not_ok_alt4.res +++ b/tests/sav/error_expr_not_ok_alt4.res @@ -10,8 +10,7 @@ alt/error_expr_not_ok_alt4.nit:43,1--8: Error: Method 'fail' doesn't exists in I alt/error_expr_not_ok_alt4.nit:45,7--10: Type error: expected A, got Object alt/error_expr_not_ok_alt4.nit:46,1--9: Error: Method 'fail' doesn't exists in Object. alt/error_expr_not_ok_alt4.nit:49,7--10: Type error: expected A, got Object -alt/error_expr_not_ok_alt4.nit:50,1--10: Error: cannot call 'trash', a top-level method, with a receiver. -alt/error_expr_not_ok_alt4.nit:50,1--10: Error: Incorrect number of parameters. Got 0, expected 1. Signature is (x: A) +alt/error_expr_not_ok_alt4.nit:50,1--10: Error: Method 'trash' doesn't exists in Object. alt/error_expr_not_ok_alt4.nit:60,4--7: Type error: expected Bool, got Int alt/error_expr_not_ok_alt4.nit:60,20: Type error: expected A, got Int alt/error_expr_not_ok_alt4.nit:62,10--13: Type error: expected Bool, got Int diff --git a/tests/sav/error_toplevel_alt1.res b/tests/sav/error_toplevel_alt1.res index b18282f..5f067c0 100644 --- a/tests/sav/error_toplevel_alt1.res +++ b/tests/sav/error_toplevel_alt1.res @@ -1 +1 @@ -alt/error_toplevel_alt1.nit:25,3--10: Error: cannot call 'bar', a top-level method, with a receiver. +alt/error_toplevel_alt1.nit:25,3--10: Error: Method 'bar' doesn't exists in Int. diff --git a/tests/sav/error_toplevel_alt2.res b/tests/sav/error_toplevel_alt2.res index 8b3cf76..e7a0d8b 100644 --- a/tests/sav/error_toplevel_alt2.res +++ b/tests/sav/error_toplevel_alt2.res @@ -1 +1,7 @@ -alt/error_toplevel_alt2.nit:35,2--5: Error: self cannot be used in top-level method. +1 +0 +5 +0 +10 +20 +50 diff --git a/tests/sav/error_toplevel_alt3.res b/tests/sav/error_toplevel_alt3.res index acfd7bf..d61c3b2 100644 --- a/tests/sav/error_toplevel_alt3.res +++ b/tests/sav/error_toplevel_alt3.res @@ -1 +1,6 @@ -alt/error_toplevel_alt3.nit:36,6--9: Error: self cannot be used in top-level method. +1 +0 +5 +0 +10 +S50 diff --git a/tests/sav/error_toplevel_alt4.res b/tests/sav/error_toplevel_alt4.res index c1a37ee..af5d48f 100644 --- a/tests/sav/error_toplevel_alt4.res +++ b/tests/sav/error_toplevel_alt4.res @@ -1 +1 @@ -alt/error_toplevel_alt4.nit:37,2--10: Error: cannot call 'bar', a top-level method, with a receiver. +alt/error_toplevel_alt4.nit:37,2--10: Error: Method 'bar' doesn't exists in Int. diff --git a/tests/sav/error_toplevel_alt5.res b/tests/sav/error_toplevel_alt5.res index dff56d2..4528c41 100644 --- a/tests/sav/error_toplevel_alt5.res +++ b/tests/sav/error_toplevel_alt5.res @@ -1 +1,7 @@ -alt/error_toplevel_alt5.nit:40,2--4: Error: 'baz' is not a top-level method, thus need a receiver. +1 +0 +5 +0 +10 +50 +S \ No newline at end of file diff --git a/tests/sav/nitlight_args1.res b/tests/sav/nitlight_args1.res index 547af57..c5a6adb 100644 --- a/tests/sav/nitlight_args1.res +++ b/tests/sav/nitlight_args1.res @@ -46,14 +46,14 @@ var val2: Int = 10 end -fun foo do 2.output -fun bar(i: Int) do i.output -fun baz: Int do return 4 +fun foo do 2.output +fun bar(i: Int) do i.output +fun baz: Int do return 4 1.output -foo -bar(3) -baz.output +foo +bar(3) +baz.output var a = new A a.run diff --git a/tests/sav/nitmetrics_args1.res b/tests/sav/nitmetrics_args1.res index 139f52b..9bd4a19 100644 --- a/tests/sav/nitmetrics_args1.res +++ b/tests/sav/nitmetrics_args1.res @@ -162,11 +162,11 @@ std: 0.926 sum: 6 cnbp: number of accessible properties (inherited + local) - avg: 6.0 - max: C (10) - min: Object (4) - std: 2.268 - sum: 42 + avg: 3.0 + max: C (7) + min: Object (1) + std: 2.36 + sum: 24 cnba: number of accessible attributes (inherited + local) avg: 0.0 max: C (2) @@ -186,11 +186,11 @@ std: 0.535 sum: 2 cnbhp: number of inherited properties - avg: 3.0 - max: Bool (4) + avg: 0.0 + max: Bool (1) min: Object (0) - std: 1.464 - sum: 24 + std: 0.926 + sum: 6 ## global metrics cnoa: number of ancestor classes @@ -224,11 +224,11 @@ std: 0.926 sum: 6 cnbp: number of accessible properties (inherited + local) - avg: 6.0 - max: C (10) - min: Object (4) - std: 2.268 - sum: 42 + avg: 3.0 + max: C (7) + min: Object (1) + std: 2.36 + sum: 24 cnba: number of accessible attributes (inherited + local) avg: 0.0 max: C (2) @@ -248,11 +248,41 @@ std: 0.535 sum: 2 cnbhp: number of inherited properties - avg: 3.0 - max: Bool (4) + avg: 0.0 + max: Bool (1) min: Object (0) - std: 1.464 - sum: 24 + std: 0.926 + sum: 6 +--- Metrics of refinement usage --- +Number of modules: 1 + +Number of classes: 7 + Number of interface kind: 1 (14.28%) + Number of enum kind: 2 (28.57%) + Number of class kind: 4 (57.14%) + +Number of class definitions: 7 +Number of refined classes: 0 (0.00%) +Average number of class refinments by classes: 0.00 +Average number of class refinments by refined classes: na + +Number of properties: 18 + Number of MAttribute: 3 (16.66%) + Number of MMethod: 15 (83.33%) + +Number of property definitions: 20 +Number of redefined properties: 1 (5.55%) +Average number of property redefinitions by property: 0.11 +Average number of property redefinitions by redefined property: 2.00 +--- Explicit vs. Implicit Self --- +Total number of self: 5 +Total number of implicit self: 4 (80.00%) +--- Construction of tables --- +Number of runtime classes: 6 (excluding interfaces and abstract classes) +Average number of composing class definition by runtime class: 2.00 +Total size of tables (classes and instances): 23 (not including stuff like info for subtyping or call-next-method) +Average size of table by runtime class: 3.83 +Values never redefined: 17 (73.91%) --- Poset metrics --- ## Module importation hierarchy Number of nodes: 1 @@ -458,36 +488,6 @@ Distribution of direct smallers bivariants: 0 (na%) invariants: 0 (na%) total: 0 ---- Metrics of refinement usage --- -Number of modules: 1 - -Number of classes: 7 - Number of interface kind: 1 (14.28%) - Number of enum kind: 2 (28.57%) - Number of class kind: 4 (57.14%) - -Number of class definitions: 7 -Number of refined classes: 0 (0.00%) -Average number of class refinments by classes: 0.00 -Average number of class refinments by refined classes: na - -Number of properties: 18 - Number of MAttribute: 3 (16.66%) - Number of MMethod: 15 (83.33%) - -Number of property definitions: 20 -Number of redefined properties: 1 (5.55%) -Average number of property redefinitions by property: 0.11 -Average number of property redefinitions by redefined property: 2.00 ---- Explicit vs. Implicit Self --- -Total number of self: 5 -Total number of implicit self: 4 (80.00%) ---- Construction of tables --- -Number of runtime classes: 6 (excluding interfaces and abstract classes) -Average number of composing class definition by runtime class: 2.00 -Total size of tables (classes and instances): 38 (not including stuff like info for subtyping or call-next-method) -Average size of table by runtime class: 6.33 -Values never redefined: 32 (84.21%) generating project_hierarchy.dot generating module_hierarchy.dot @@ -695,18 +695,14 @@ Statistics of type usage: A: 1 (11.11%) # Mendel metrics - large mclasses (threshold: 2.291) - B: 3 - C: 3 - budding mclasses (threshold: 0.693) - B: 0.75 - C: 0.75 - blooming mclasses (threshold: 1.935) - B: 2.25 - C: 2.25 - blooming mclasses (threshold: 1.935) - B: 2.25 - C: 2.25 + large mclasses (threshold: 3.354) + Sys: 4 + budding mclasses (threshold: 3.51) + Sys: 4.0 + blooming mclasses (threshold: 12.0) + Sys: 16.0 + blooming mclasses (threshold: 12.0) + Sys: 16.0 --- Detection of the usage of covariance static type conformance --- -- Total -- - Kinds of the subtype - @@ -880,9 +876,9 @@ MMethodDef locally designated (by number of CallSites) base_simple3#C#val1: 1 (4.54%) ... base_simple3#A#init: 1 (4.54%) - base_simple3#Object#baz: 1 (4.54%) - base_simple3#Object#bar: 1 (4.54%) - base_simple3#Object#foo: 1 (4.54%) + base_simple3#Sys#baz: 1 (4.54%) + base_simple3#Sys#bar: 1 (4.54%) + base_simple3#Sys#foo: 1 (4.54%) base_simple3#C#init: 1 (4.54%) MMethodDef possibly invoked at runtime (by number of CallSites) population: 13 @@ -901,9 +897,9 @@ MMethodDef possibly invoked at runtime (by number of CallSites) base_simple3#C#val1: 1 (4.54%) ... base_simple3#A#init: 1 (4.54%) - base_simple3#Object#baz: 1 (4.54%) - base_simple3#Object#bar: 1 (4.54%) - base_simple3#Object#foo: 1 (4.54%) + base_simple3#Sys#baz: 1 (4.54%) + base_simple3#Sys#bar: 1 (4.54%) + base_simple3#Sys#foo: 1 (4.54%) base_simple3#C#init: 1 (4.54%) class_hierarchy.dot classdef_hierarchy.dot diff --git a/tests/sav/nituml_args3.res b/tests/sav/nituml_args3.res index 94b3764..a8a1cd3 100644 --- a/tests/sav/nituml_args3.res +++ b/tests/sav/nituml_args3.res @@ -12,11 +12,11 @@ digraph G { fontsize = 8 ] Object [ - label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ exit(exit_value: Int)\l+ sys(): Sys\l}" + label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l}" ] Sys [ - label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l}" + label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l}" ] Object -> Sys [dir=back arrowtail=open style=dashed]; diff --git a/tests/sav/nituml_args4.res b/tests/sav/nituml_args4.res index 1664fce..437fbe4 100644 --- a/tests/sav/nituml_args4.res +++ b/tests/sav/nituml_args4.res @@ -12,11 +12,11 @@ digraph G { fontsize = 8 ] Object [ - label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ exit(exit_value: Int)\l+ sys(): Sys\l}" + label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l}" ] Sys [ - label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l}" + label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l}" ] Object -> Sys [dir=back arrowtail=open style=dashed]; diff --git a/tests/sav/nitunit_args4.res b/tests/sav/nitunit_args4.res index 91eb55f..8c655a2 100644 --- a/tests/sav/nitunit_args4.res +++ b/tests/sav/nitunit_args4.res @@ -5,17 +5,17 @@ Entities: 4; Documented ones: 3; With nitunits: 3; Failures: 0 TestSuites: No test cases found Class suites: 0; Test Cases: 0; Failures: 0 -if true then +if true then assert true end -if true then +if true then assert true end -var a = 1 +var a = 1 assert a == 1 assert a == 1 \ No newline at end of file diff --git a/tests/sav/nitunit_args5.res b/tests/sav/nitunit_args5.res index 356eaf4..3da2105 100644 --- a/tests/sav/nitunit_args5.res +++ b/tests/sav/nitunit_args5.res @@ -5,7 +5,7 @@ Entities: 6; Documented ones: 5; With nitunits: 3; Failures: 0 TestSuites: No test cases found Class suites: 0; Test Cases: 0; Failures: 0 -assert true # tested -assert true # tested -assert true # tested +assert true # tested +assert true # tested +assert true # tested \ No newline at end of file diff --git a/tests/sav/nitx_args2.res b/tests/sav/nitx_args2.res index 4138d94..bdb2b9f 100644 --- a/tests/sav/nitx_args2.res +++ b/tests/sav/nitx_args2.res @@ -1,5 +1,5 @@ = result for 'foo' fun foo - base_simple3::Object::foo (lines 49-49) + base_simple3::Sys::foo (lines 49-49) diff --git a/tests/sav/nitx_args3.res b/tests/sav/nitx_args3.res index e3174b3..83a361e 100644 --- a/tests/sav/nitx_args3.res +++ b/tests/sav/nitx_args3.res @@ -24,5 +24,5 @@ base_simple3::Object (lines 19-20) class Sys - base_simple3::Sys (lines 53-66) + base_simple3::Sys (lines 49-49) diff --git a/tests/sav/test_docdown_args2.res b/tests/sav/test_docdown_args2.res index 51196e3..2da0aeb 100644 --- a/tests/sav/test_docdown_args2.res +++ b/tests/sav/test_docdown_args2.res @@ -55,11 +55,11 @@ h5 {font-weight:bold;} .popover { max-width: 800px !important; } -

module test_doc2

prop test_doc2#Object#foo1

Test code

assert true # tested
-
prop test_doc2#Object#foo2

Test code

assert true # tested
-
prop test_doc2#Object#foo3

Test code

assert true # tested
-
prop test_doc2#Object#foo4

Test code

assert false # not tested (and not highlighted)
-
prop test_doc2#Object#foo5

Test code

assert false # not tested (but highlighted)
+

module test_doc2

prop test_doc2#Sys#foo1

Test code

assert true # tested
+
prop test_doc2#Sys#foo2

Test code

assert true # tested
+
prop test_doc2#Sys#foo3

Test code

assert true # tested
+
prop test_doc2#Sys#foo4

Test code

assert false # not tested (and not highlighted)
+
prop test_doc2#Sys#foo5

Test code

assert false # not tested (but highlighted)
 
\ No newline at end of file -- 1.7.9.5