Chromium Code Reviews| Index: test/unittests/interpreter/source-position-table-unittest.cc |
| diff --git a/test/unittests/interpreter/source-position-table-unittest.cc b/test/unittests/interpreter/source-position-table-unittest.cc |
| index 22825cb229e1ad1d43290dca52abf3d894bf8a13..dc0af9199f5008b99c6c8d2e6502a8a01e60d14e 100644 |
| --- a/test/unittests/interpreter/source-position-table-unittest.cc |
| +++ b/test/unittests/interpreter/source-position-table-unittest.cc |
| @@ -18,9 +18,9 @@ class SourcePositionTableTest : public TestWithIsolateAndZone { |
| }; |
| // Some random offsets, mostly at 'suspicious' bit boundaries. |
| -static int offsets[] = {0, 1, 2, 3, 4, 30, 31, 32, |
| - 33, 62, 63, 64, 65, 126, 127, 128, |
| - 129, 250, 1000, 9999, 12000, 31415926}; |
| +static int offsets[] = {0, 1, 2, 3, 4, 30, 31, 32, |
| + 33, 62, 63, 64, 65, 126, 127, 128, |
| + 129, 250, 1000, 9999, 12000, 31415926, 31415926}; |
| TEST_F(SourcePositionTableTest, EncodeStatement) { |
| SourcePositionTableBuilder builder(isolate(), zone()); |
| @@ -33,6 +33,19 @@ TEST_F(SourcePositionTableTest, EncodeStatement) { |
| CHECK(!builder.ToSourcePositionTable().is_null()); |
| } |
| +TEST_F(SourcePositionTableTest, EncodeStatementOverwrite) { |
| + SourcePositionTableBuilder builder(isolate(), zone()); |
| + for (int i = 0; i < arraysize(offsets); i++) { |
| + builder.AddStatementPosition( |
| + offsets[i], offsets[i], |
| + SourcePositionTableBuilder::OVERWRITE_DUPLICATE); |
| + } |
| + |
| + // To test correctness, we rely on the assertions in ToSourcePositionTable(). |
| + // (Also below.) |
| + CHECK(!builder.ToSourcePositionTable().is_null()); |
| +} |
| + |
|
vogelheim
2016/03/14 10:41:15
Maybe a good test case would be to just add each o
Yang
2016/03/14 11:32:34
Done.
|
| TEST_F(SourcePositionTableTest, EncodeExpression) { |
| SourcePositionTableBuilder builder(isolate(), zone()); |
| for (int i = 0; i < arraysize(offsets); i++) { |