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

Side by Side Diff: test/cctest/test-serialize.cc

Issue 7550009: Fix ContextDeserialization and PartialDeserialization tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. 1 // Copyright 2007-2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 byte* snapshot = ReadBytes(file_name, &snapshot_size); 452 byte* snapshot = ReadBytes(file_name, &snapshot_size);
453 453
454 Object* root; 454 Object* root;
455 { 455 {
456 SnapshotByteSource source(snapshot, snapshot_size); 456 SnapshotByteSource source(snapshot, snapshot_size);
457 Deserializer deserializer(&source); 457 Deserializer deserializer(&source);
458 deserializer.DeserializePartial(&root); 458 deserializer.DeserializePartial(&root);
459 CHECK(root->IsString()); 459 CHECK(root->IsString());
460 } 460 }
461 v8::HandleScope handle_scope; 461 v8::HandleScope handle_scope;
462 Handle<Object>root_handle(root); 462 Handle<Object> root_handle(root);
463
464 ReserveSpaceForPartialSnapshot(file_name);
463 465
464 Object* root2; 466 Object* root2;
465 { 467 {
466 SnapshotByteSource source(snapshot, snapshot_size); 468 SnapshotByteSource source(snapshot, snapshot_size);
467 Deserializer deserializer(&source); 469 Deserializer deserializer(&source);
468 deserializer.DeserializePartial(&root2); 470 deserializer.DeserializePartial(&root2);
469 CHECK(root2->IsString()); 471 CHECK(root2->IsString());
470 CHECK(*root_handle == root2); 472 CHECK(*root_handle == root2);
471 } 473 }
472 } 474 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 byte* snapshot = ReadBytes(file_name, &snapshot_size); 537 byte* snapshot = ReadBytes(file_name, &snapshot_size);
536 538
537 Object* root; 539 Object* root;
538 { 540 {
539 SnapshotByteSource source(snapshot, snapshot_size); 541 SnapshotByteSource source(snapshot, snapshot_size);
540 Deserializer deserializer(&source); 542 Deserializer deserializer(&source);
541 deserializer.DeserializePartial(&root); 543 deserializer.DeserializePartial(&root);
542 CHECK(root->IsContext()); 544 CHECK(root->IsContext());
543 } 545 }
544 v8::HandleScope handle_scope; 546 v8::HandleScope handle_scope;
545 Handle<Object>root_handle(root); 547 Handle<Object> root_handle(root);
548
549 ReserveSpaceForPartialSnapshot(file_name);
546 550
547 Object* root2; 551 Object* root2;
548 { 552 {
549 SnapshotByteSource source(snapshot, snapshot_size); 553 SnapshotByteSource source(snapshot, snapshot_size);
550 Deserializer deserializer(&source); 554 Deserializer deserializer(&source);
551 deserializer.DeserializePartial(&root2); 555 deserializer.DeserializePartial(&root2);
552 CHECK(root2->IsContext()); 556 CHECK(root2->IsContext());
553 CHECK(*root_handle != root2); 557 CHECK(*root_handle != root2);
554 } 558 }
555 } 559 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 TEST(TestThatAlwaysFails) { 674 TEST(TestThatAlwaysFails) {
671 bool ArtificialFailure = false; 675 bool ArtificialFailure = false;
672 CHECK(ArtificialFailure); 676 CHECK(ArtificialFailure);
673 } 677 }
674 678
675 679
676 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { 680 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) {
677 bool ArtificialFailure2 = false; 681 bool ArtificialFailure2 = false;
678 CHECK(ArtificialFailure2); 682 CHECK(ArtificialFailure2);
679 } 683 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698