tests: Added test for text_stat
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 8 Sep 2015 18:36:26 +0000 (14:36 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Tue, 8 Sep 2015 18:36:26 +0000 (14:36 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

tests/niti.skip
tests/nitvm.skip
tests/sav/nitcg/test_text_stat.res [new file with mode: 0644]
tests/sav/test_text_stat.res [new file with mode: 0644]
tests/test_text_stat.nit [new file with mode: 0644]

index 3e10daa..ef83f4d 100644 (file)
@@ -31,3 +31,4 @@ fibonacci_word
 shootout_nsieve
 test_ropebuffer
 ui_test
+test_text_stat
index 3e10daa..ef83f4d 100644 (file)
@@ -31,3 +31,4 @@ fibonacci_word
 shootout_nsieve
 test_ropebuffer
 ui_test
+test_text_stat
diff --git a/tests/sav/nitcg/test_text_stat.res b/tests/sav/nitcg/test_text_stat.res
new file mode 100644 (file)
index 0000000..1066456
--- /dev/null
@@ -0,0 +1,58 @@
+Hello world !
+Usage of Strings:
+
+Allocations, by type:
+               
+       -FlatString = 32
+       -FlatBuffer = 2
+       -Concat = 0
+       -RopeBuffer = 0
+
+Calls to length, by type:
+       FlatString = 36 (cache misses 8, 22.22%)
+       FlatBuffer = 4
+Indexed accesses, by type:
+       FlatString = 17
+Calls to bytelen for each type:
+       FlatString = 70
+Calls to position for each type:
+       FlatString = 35
+Calls to bytepos for each type:
+       FlatString = 18
+Calls to first_byte on FlatString 153
+Calls to last_byte on FlatString 103
+FlatStrings allocated with length 81 (85.417%)
+Length of travel for index distribution:
+* null = 20 => occurences 83.333%, cumulative 83.333% 
+* 1 = 8 => occurences 21.053%, cumulative 73.684% 
+Byte length of the FlatStrings created:
+* null = 6 => occurences 4.286%, cumulative 4.286% 
+* 1 = 25 => occurences 16.234%, cumulative 20.13% 
+* 2 = 31 => occurences 18.452%, cumulative 36.905% 
+* 3 = 30 => occurences 16.393%, cumulative 50.273% 
+* 4 = 4 => occurences 2.02%, cumulative 48.485% 
+* 5 = 19 => occurences 8.92%, cumulative 53.991% 
+* 6 = 26 => occurences 11.404%, cumulative 61.842% 
+* 9 = 1 => occurences 0.412%, cumulative 58.436% 
+* 10 = 10 => occurences 3.876%, cumulative 58.915% 
+* 11 = 2 => occurences 0.733%, cumulative 56.41% 
+* 12 = 1 => occurences 0.348%, cumulative 54.007% 
+* 13 = 1 => occurences 0.333%, cumulative 52.0% 
+* 14 = 1 => occurences 0.319%, cumulative 50.16% 
+* 15 = 6 => occurences 1.84%, cumulative 50.0% 
+* 16 = 7 => occurences 2.053%, cumulative 49.853% 
+* 17 = 1 => occurences 0.281%, cumulative 48.034% 
+* 25 = 2 => occurences 0.542%, cumulative 46.883% 
+* 26 = 1 => occurences 0.261%, cumulative 45.431% 
+* 31 = 2 => occurences 0.505%, cumulative 44.444% 
+* 32 = 1 => occurences 0.244%, cumulative 43.171% 
+* 33 = 1 => occurences 0.236%, cumulative 42.08% 
+* 34 = 2 => occurences 0.459%, cumulative 41.284% 
+* 36 = 1 => occurences 0.222%, cumulative 40.222% 
+* 37 = 1 => occurences 0.216%, cumulative 39.309% 
+* 39 = 1 => occurences 0.21%, cumulative 38.445% 
+* 40 = 1 => occurences 0.204%, cumulative 37.628% 
+* 43 = 1 => occurences 0.199%, cumulative 36.853% 
+* 46 = 1 => occurences 0.194%, cumulative 36.117% 
+* 51 = 15 => occurences 2.841%, cumulative 38.068% 
+* 55 = 1 => occurences 0.184%, cumulative 37.201% 
diff --git a/tests/sav/test_text_stat.res b/tests/sav/test_text_stat.res
new file mode 100644 (file)
index 0000000..49e9adc
--- /dev/null
@@ -0,0 +1,58 @@
+Hello world !
+Usage of Strings:
+
+Allocations, by type:
+               
+       -FlatString = 32
+       -FlatBuffer = 2
+       -Concat = 0
+       -RopeBuffer = 0
+
+Calls to length, by type:
+       FlatString = 36 (cache misses 8, 22.22%)
+       FlatBuffer = 4
+Indexed accesses, by type:
+       FlatString = 17
+Calls to bytelen for each type:
+       FlatString = 70
+Calls to position for each type:
+       FlatString = 35
+Calls to bytepos for each type:
+       FlatString = 18
+Calls to first_byte on FlatString 153
+Calls to last_byte on FlatString 103
+FlatStrings allocated with length 81 (85.417%)
+Length of travel for index distribution:
+* 0 = 20 => occurences 83.333%, cumulative 83.333% 
+* 1 = 8 => occurences 21.053%, cumulative 73.684% 
+Byte length of the FlatStrings created:
+* 0 = 6 => occurences 4.317%, cumulative 4.317% 
+* 1 = 25 => occurences 16.34%, cumulative 20.261% 
+* 2 = 31 => occurences 18.563%, cumulative 37.126% 
+* 3 = 30 => occurences 16.484%, cumulative 50.549% 
+* 4 = 3 => occurences 1.523%, cumulative 48.223% 
+* 5 = 20 => occurences 9.434%, cumulative 54.245% 
+* 6 = 26 => occurences 11.454%, cumulative 62.115% 
+* 9 = 1 => occurences 0.413%, cumulative 58.678% 
+* 10 = 10 => occurences 3.891%, cumulative 59.144% 
+* 11 = 2 => occurences 0.735%, cumulative 56.618% 
+* 12 = 1 => occurences 0.35%, cumulative 54.196% 
+* 13 = 1 => occurences 0.334%, cumulative 52.174% 
+* 14 = 1 => occurences 0.321%, cumulative 50.321% 
+* 15 = 6 => occurences 1.846%, cumulative 50.154% 
+* 16 = 7 => occurences 2.059%, cumulative 50.0% 
+* 17 = 1 => occurences 0.282%, cumulative 48.169% 
+* 25 = 2 => occurences 0.543%, cumulative 47.011% 
+* 26 = 1 => occurences 0.262%, cumulative 45.55% 
+* 31 = 2 => occurences 0.506%, cumulative 44.557% 
+* 32 = 1 => occurences 0.244%, cumulative 43.276% 
+* 33 = 1 => occurences 0.237%, cumulative 42.18% 
+* 34 = 2 => occurences 0.46%, cumulative 41.379% 
+* 36 = 1 => occurences 0.223%, cumulative 40.312% 
+* 37 = 1 => occurences 0.216%, cumulative 39.394% 
+* 39 = 1 => occurences 0.211%, cumulative 38.526% 
+* 40 = 1 => occurences 0.205%, cumulative 37.705% 
+* 43 = 1 => occurences 0.2%, cumulative 36.926% 
+* 46 = 1 => occurences 0.195%, cumulative 36.187% 
+* 51 = 16 => occurences 3.036%, cumulative 38.33% 
+* 52 = 5 => occurences 0.923%, cumulative 38.192% 
diff --git a/tests/test_text_stat.nit b/tests/test_text_stat.nit
new file mode 100644 (file)
index 0000000..3d18a92
--- /dev/null
@@ -0,0 +1,17 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import text_stat
+
+print "Hello world !"