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

Side by Side Diff: runtime/bin/file_test.cc

Issue 9189003: Move assert.h/assert.cc from runtime/vm to runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check for correct rebase Created 8 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 | « runtime/bin/file_macos.cc ('k') | runtime/bin/file_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/file.h" 5 #include "bin/file.h"
6 #include "platform/assert.h"
6 #include "platform/globals.h" 7 #include "platform/globals.h"
7 #include "vm/assert.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 10
11 // Helper method to be able to run the test from the runtime 11 // Helper method to be able to run the test from the runtime
12 // directory, or the top directory. 12 // directory, or the top directory.
13 static const char* GetFileName(const char* name) { 13 static const char* GetFileName(const char* name) {
14 if (File::Exists(name)) { 14 if (File::Exists(name)) {
15 return name; 15 return name;
16 } else { 16 } else {
17 static const int kRuntimeLength = strlen("runtime/"); 17 static const int kRuntimeLength = strlen("runtime/");
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const char* kFilename = 50 const char* kFilename =
51 GetFileName("runtime/tests/vm/data/fixed_length_file"); 51 GetFileName("runtime/tests/vm/data/fixed_length_file");
52 File* file = File::Open(kFilename, File::kRead); 52 File* file = File::Open(kFilename, File::kRead);
53 EXPECT(file != NULL); 53 EXPECT(file != NULL);
54 EXPECT(file->ReadFully(buf, 12)); 54 EXPECT(file->ReadFully(buf, 12));
55 EXPECT_EQ(12, file->Position()); 55 EXPECT_EQ(12, file->Position());
56 EXPECT(file->ReadFully(buf, 6)); 56 EXPECT(file->ReadFully(buf, 6));
57 EXPECT_EQ(18, file->Position()); 57 EXPECT_EQ(18, file->Position());
58 delete file; 58 delete file;
59 } 59 }
OLDNEW
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/bin/file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698