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

Unified Diff: libraries/nacl-mounts/test/DevMountTest.cc

Issue 10377102: Added simplest device mount implementation (includes NullDevice and RandomDevice) (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libraries/nacl-mounts/test.nacl/SimpleTest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libraries/nacl-mounts/test/DevMountTest.cc
===================================================================
--- libraries/nacl-mounts/test/DevMountTest.cc (revision 0)
+++ libraries/nacl-mounts/test/DevMountTest.cc (revision 0)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "../dev/DevMount.h"
+#include "gtest/gtest.h"
+
+TEST(DevMountTest, Sanity) {
+ DevMount* bm = new DevMount();
+
+ // just make sure all of the calls run
+ struct stat st;
+ struct dirent dir;
+ EXPECT_EQ(bm->GetNode("/", &st), 0);
+ EXPECT_EQ(0, bm->Stat(1, &st));
+ EXPECT_EQ(1, S_ISDIR(st.st_mode));
+ EXPECT_GT(bm->Getdents(1, 0, &dir, 1024), 1);
+ bm->GetNode("/null", &st);
+ int node = st.st_ino;
+ char buf[10];
+ EXPECT_EQ(5, bm->Write(node, 0, reinterpret_cast<void*>(buf), 5));
+ EXPECT_EQ(0, bm->Isatty(0));
+}
+
« no previous file with comments | « libraries/nacl-mounts/test.nacl/SimpleTest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698