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 16695008: Fix release serialization tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 447
448 static void ReserveSpaceForSnapshot(Deserializer* deserializer, 448 static void ReserveSpaceForSnapshot(Deserializer* deserializer,
449 const char* file_name) { 449 const char* file_name) {
450 int file_name_length = StrLength(file_name) + 10; 450 int file_name_length = StrLength(file_name) + 10;
451 Vector<char> name = Vector<char>::New(file_name_length + 1); 451 Vector<char> name = Vector<char>::New(file_name_length + 1);
452 OS::SNPrintF(name, "%s.size", file_name); 452 OS::SNPrintF(name, "%s.size", file_name);
453 FILE* fp = OS::FOpen(name.start(), "r"); 453 FILE* fp = OS::FOpen(name.start(), "r");
454 name.Dispose(); 454 name.Dispose();
455 int new_size, pointer_size, data_size, code_size, map_size, cell_size; 455 int new_size, pointer_size, data_size, code_size, map_size, cell_size,
456 property_cell_size;
456 #ifdef _MSC_VER 457 #ifdef _MSC_VER
457 // Avoid warning about unsafe fscanf from MSVC. 458 // Avoid warning about unsafe fscanf from MSVC.
458 // Please note that this is only fine if %c and %s are not being used. 459 // Please note that this is only fine if %c and %s are not being used.
459 #define fscanf fscanf_s 460 #define fscanf fscanf_s
460 #endif 461 #endif
461 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size)); 462 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size));
462 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size)); 463 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size));
463 CHECK_EQ(1, fscanf(fp, "data %d\n", &data_size)); 464 CHECK_EQ(1, fscanf(fp, "data %d\n", &data_size));
464 CHECK_EQ(1, fscanf(fp, "code %d\n", &code_size)); 465 CHECK_EQ(1, fscanf(fp, "code %d\n", &code_size));
465 CHECK_EQ(1, fscanf(fp, "map %d\n", &map_size)); 466 CHECK_EQ(1, fscanf(fp, "map %d\n", &map_size));
466 CHECK_EQ(1, fscanf(fp, "cell %d\n", &cell_size)); 467 CHECK_EQ(1, fscanf(fp, "cell %d\n", &cell_size));
468 CHECK_EQ(1, fscanf(fp, "property cell %d\n", &property_cell_size));
467 #ifdef _MSC_VER 469 #ifdef _MSC_VER
468 #undef fscanf 470 #undef fscanf
469 #endif 471 #endif
470 fclose(fp); 472 fclose(fp);
471 deserializer->set_reservation(NEW_SPACE, new_size); 473 deserializer->set_reservation(NEW_SPACE, new_size);
472 deserializer->set_reservation(OLD_POINTER_SPACE, pointer_size); 474 deserializer->set_reservation(OLD_POINTER_SPACE, pointer_size);
473 deserializer->set_reservation(OLD_DATA_SPACE, data_size); 475 deserializer->set_reservation(OLD_DATA_SPACE, data_size);
474 deserializer->set_reservation(CODE_SPACE, code_size); 476 deserializer->set_reservation(CODE_SPACE, code_size);
475 deserializer->set_reservation(MAP_SPACE, map_size); 477 deserializer->set_reservation(MAP_SPACE, map_size);
476 deserializer->set_reservation(CELL_SPACE, cell_size); 478 deserializer->set_reservation(CELL_SPACE, cell_size);
479 deserializer->set_reservation(PROPERTY_CELL_SPACE, property_cell_size);
477 } 480 }
478 481
479 482
480 DEPENDENT_TEST(PartialDeserialization, PartialSerialization) { 483 DEPENDENT_TEST(PartialDeserialization, PartialSerialization) {
481 if (!Snapshot::IsEnabled()) { 484 if (!Snapshot::IsEnabled()) {
482 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; 485 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10;
483 Vector<char> startup_name = Vector<char>::New(file_name_length + 1); 486 Vector<char> startup_name = Vector<char>::New(file_name_length + 1);
484 OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); 487 OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file);
485 488
486 CHECK(Snapshot::Initialize(startup_name.start())); 489 CHECK(Snapshot::Initialize(startup_name.start()));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 TEST(TestThatAlwaysFails) { 637 TEST(TestThatAlwaysFails) {
635 bool ArtificialFailure = false; 638 bool ArtificialFailure = false;
636 CHECK(ArtificialFailure); 639 CHECK(ArtificialFailure);
637 } 640 }
638 641
639 642
640 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { 643 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) {
641 bool ArtificialFailure2 = false; 644 bool ArtificialFailure2 = false;
642 CHECK(ArtificialFailure2); 645 CHECK(ArtificialFailure2);
643 } 646 }
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