Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: pkg/kernel/test/uint31_pair_map_test.dart

Issue 2780513004: [Kernel] Remove code from the old type propagation. (Closed)
Patch Set: Remove empty status file section Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/kernel/test/uint31_pair_map_bench.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import 'dart:math';
2 import 'package:kernel/type_propagation/canonicalizer.dart';
3 import 'package:test/test.dart';
4
5 Random random = new Random(12345);
6
7 main() {
8 test('Uint31PairMap randomized tests', runTest);
9 }
10
11 runTest() {
12 const int trials = 1000;
13 const int insertions = 1000;
14 const int uniqueKeys = 900;
15 for (int trial = 0; trial < trials; ++trial) {
16 int nextValue = 1;
17 Map<Point<int>, int> trusted = <Point<int>, int>{};
18 Uint31PairMap candidate = new Uint31PairMap();
19 for (int i = 0; i < insertions; ++i) {
20 int x = random.nextInt(uniqueKeys);
21 int y = random.nextInt(uniqueKeys);
22 Point key = new Point(x, y);
23 int trustedValue = trusted[key];
24 int candidateValue = candidate.lookup(x, y);
25 expect(candidateValue, equals(trustedValue));
26 if (trustedValue == null) {
27 int newValue = nextValue++;
28 trusted[key] = newValue;
29 candidate.put(newValue);
30 }
31 }
32 }
33 }
OLDNEW
« no previous file with comments | « pkg/kernel/test/uint31_pair_map_bench.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698