OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #include "../dev/DevMount.h" |
| 8 #include "gtest/gtest.h" |
| 9 |
| 10 TEST(DevMountTest, Sanity) { |
| 11 DevMount* bm = new DevMount(); |
| 12 |
| 13 // just make sure all of the calls run |
| 14 struct stat st; |
| 15 struct dirent dir; |
| 16 EXPECT_EQ(bm->GetNode("/", &st), 0); |
| 17 EXPECT_EQ(0, bm->Stat(1, &st)); |
| 18 EXPECT_EQ(1, S_ISDIR(st.st_mode)); |
| 19 EXPECT_GT(bm->Getdents(1, 0, &dir, 1024), 1); |
| 20 bm->GetNode("/null", &st); |
| 21 int node = st.st_ino; |
| 22 char buf[10]; |
| 23 EXPECT_EQ(5, bm->Write(node, 0, reinterpret_cast<void*>(buf), 5)); |
| 24 EXPECT_EQ(0, bm->Isatty(0)); |
| 25 } |
| 26 |
OLD | NEW |