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

Unified Diff: test/unittests/interpreter/source-position-table-unittest.cc

Issue 1801473003: [ignition, debugger] correctly set position for return with elided bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« test/cctest/cctest.status ('K') | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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++) {
« test/cctest/cctest.status ('K') | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698