From 912ae8230fb781eafeebe4555de4537b8768ade1 Mon Sep 17 00:00:00 2001 From: Jonas Termansen Date: Tue, 23 Jun 2020 08:41:19 +0000 Subject: [PATCH] [benchmark] Migrate Example benchmark to be null safe. Analyzer lints are fixed while here. TBR=whesse@google.com Change-Id: I4e43d9b356608c5cb885f008fb232ea2390b9dd4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151840 Reviewed-by: William Hesse --- benchmarks/Example/dart/Example.dart | 7 +++++-- benchmarks/Example/dart2/Example.dart | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/benchmarks/Example/dart/Example.dart b/benchmarks/Example/dart/Example.dart index 451124bc8ce..bf0f06fe80d 100644 --- a/benchmarks/Example/dart/Example.dart +++ b/benchmarks/Example/dart/Example.dart @@ -5,18 +5,21 @@ import 'package:benchmark_harness/benchmark_harness.dart'; class Example extends BenchmarkBase { - const Example() : super("Example"); + const Example() : super('Example'); // The benchmark code. + @override void run() {} // Not measured setup code executed prior to the benchmark runs. + @override void setup() {} // Not measures teardown code executed after the benchark runs. + @override void teardown() {} } -main() { +void main() { const Example().report(); } diff --git a/benchmarks/Example/dart2/Example.dart b/benchmarks/Example/dart2/Example.dart index 451124bc8ce..bf0f06fe80d 100644 --- a/benchmarks/Example/dart2/Example.dart +++ b/benchmarks/Example/dart2/Example.dart @@ -5,18 +5,21 @@ import 'package:benchmark_harness/benchmark_harness.dart'; class Example extends BenchmarkBase { - const Example() : super("Example"); + const Example() : super('Example'); // The benchmark code. + @override void run() {} // Not measured setup code executed prior to the benchmark runs. + @override void setup() {} // Not measures teardown code executed after the benchark runs. + @override void teardown() {} } -main() { +void main() { const Example().report(); }