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

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

Issue 542104: Fix windows tests. In the context of fopen the opposite of 'b' for binary... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 11 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 int new_space_used, 312 int new_space_used,
313 int pointer_space_used, 313 int pointer_space_used,
314 int data_space_used, 314 int data_space_used,
315 int code_space_used, 315 int code_space_used,
316 int map_space_used, 316 int map_space_used,
317 int cell_space_used, 317 int cell_space_used,
318 int large_space_used) { 318 int large_space_used) {
319 int file_name_length = strlen(file_name_) + 10; 319 int file_name_length = strlen(file_name_) + 10;
320 Vector<char> name = Vector<char>::New(file_name_length + 1); 320 Vector<char> name = Vector<char>::New(file_name_length + 1);
321 OS::SNPrintF(name, "%s.size", file_name_); 321 OS::SNPrintF(name, "%s.size", file_name_);
322 FILE* fp = OS::FOpen(name.start(), "wa"); 322 FILE* fp = OS::FOpen(name.start(), "w");
323 fprintf(fp, "new %d\n", new_space_used); 323 fprintf(fp, "new %d\n", new_space_used);
324 fprintf(fp, "pointer %d\n", pointer_space_used); 324 fprintf(fp, "pointer %d\n", pointer_space_used);
325 fprintf(fp, "data %d\n", data_space_used); 325 fprintf(fp, "data %d\n", data_space_used);
326 fprintf(fp, "code %d\n", code_space_used); 326 fprintf(fp, "code %d\n", code_space_used);
327 fprintf(fp, "map %d\n", map_space_used); 327 fprintf(fp, "map %d\n", map_space_used);
328 fprintf(fp, "cell %d\n", cell_space_used); 328 fprintf(fp, "cell %d\n", cell_space_used);
329 fprintf(fp, "large %d\n", large_space_used); 329 fprintf(fp, "large %d\n", large_space_used);
330 fclose(fp); 330 fclose(fp);
331 } 331 }
332 332
(...skipping 21 matching lines...) Expand all
354 ser.CurrentAllocationAddress(LO_SPACE)); 354 ser.CurrentAllocationAddress(LO_SPACE));
355 } 355 }
356 356
357 357
358 DEPENDENT_TEST(PartialDeserialization, PartialSerialization) { 358 DEPENDENT_TEST(PartialDeserialization, PartialSerialization) {
359 v8::V8::Initialize(); 359 v8::V8::Initialize();
360 const char* file_name = FLAG_testing_serialization_file; 360 const char* file_name = FLAG_testing_serialization_file;
361 int file_name_length = strlen(file_name) + 10; 361 int file_name_length = strlen(file_name) + 10;
362 Vector<char> name = Vector<char>::New(file_name_length + 1); 362 Vector<char> name = Vector<char>::New(file_name_length + 1);
363 OS::SNPrintF(name, "%s.size", file_name); 363 OS::SNPrintF(name, "%s.size", file_name);
364 FILE* fp = OS::FOpen(name.start(), "ra"); 364 FILE* fp = OS::FOpen(name.start(), "r");
365 int new_size, pointer_size, data_size, code_size, map_size, cell_size; 365 int new_size, pointer_size, data_size, code_size, map_size, cell_size;
366 int large_size; 366 int large_size;
367 #ifdef _MSC_VER 367 #ifdef _MSC_VER
368 // Avoid warning about unsafe fscanf from MSVC. 368 // Avoid warning about unsafe fscanf from MSVC.
369 // Please note that this is only fine if %c and %s are not being used. 369 // Please note that this is only fine if %c and %s are not being used.
370 #define fscanf fscanf_s 370 #define fscanf fscanf_s
371 #endif 371 #endif
372 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size)); 372 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size));
373 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size)); 373 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size));
374 CHECK_EQ(1, fscanf(fp, "data %d\n", &data_size)); 374 CHECK_EQ(1, fscanf(fp, "data %d\n", &data_size));
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 TEST(TestThatAlwaysFails) { 505 TEST(TestThatAlwaysFails) {
506 bool ArtificialFailure = false; 506 bool ArtificialFailure = false;
507 CHECK(ArtificialFailure); 507 CHECK(ArtificialFailure);
508 } 508 }
509 509
510 510
511 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { 511 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) {
512 bool ArtificialFailure2 = false; 512 bool ArtificialFailure2 = false;
513 CHECK(ArtificialFailure2); 513 CHECK(ArtificialFailure2);
514 } 514 }
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