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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io_test/mount_test.cc

Issue 17552017: [NaCl SDK] Additional fix for r207878: Add dummy unistd.h for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more osunistd.h 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 | « native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/stat.h>
9 #include <string> 10 #include <string>
10 #include <sys/stat.h>
11 11
12 #include "gtest/gtest.h"
12 #include "nacl_io/mount.h" 13 #include "nacl_io/mount.h"
13 #include "nacl_io/mount_dev.h" 14 #include "nacl_io/mount_dev.h"
14 #include "nacl_io/mount_mem.h" 15 #include "nacl_io/mount_mem.h"
15 #include "nacl_io/osdirent.h" 16 #include "nacl_io/osdirent.h"
16 17 #include "nacl_io/osunistd.h"
17 #include "gtest/gtest.h"
18 18
19 namespace { 19 namespace {
20 20
21 class MountMemMock : public MountMem { 21 class MountMemMock : public MountMem {
22 public: 22 public:
23 MountMemMock() { 23 MountMemMock() {
24 StringMap_t map; 24 StringMap_t map;
25 EXPECT_EQ(0, Init(1, map, NULL)); 25 EXPECT_EQ(0, Init(1, map, NULL));
26 } 26 }
27 27
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 double expected_count = kTotalSamples / 256.; 262 double expected_count = kTotalSamples / 256.;
263 double chi_squared = 0; 263 double chi_squared = 0;
264 for (int i = 0; i < 256; ++i) { 264 for (int i = 0; i < 256; ++i) {
265 double difference = byte_count[i] - expected_count; 265 double difference = byte_count[i] - expected_count;
266 chi_squared += difference * difference / expected_count; 266 chi_squared += difference * difference / expected_count;
267 } 267 }
268 268
269 // Approximate chi-squared value for p-value 0.05, 255 degrees-of-freedom. 269 // Approximate chi-squared value for p-value 0.05, 255 degrees-of-freedom.
270 EXPECT_LE(chi_squared, 293.24); 270 EXPECT_LE(chi_squared, 293.24);
271 } 271 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698