Mercurial > hg > CbC > CbC_llvm
comparison unittests/Support/LockFileManagerTest.cpp @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
comparison
equal
deleted
inserted
replaced
146:3fc4d5c3e21e | 148:63bd29f05246 |
---|---|
1 //===- unittests/LockFileManagerTest.cpp - LockFileManager tests ----------===// | 1 //===- unittests/LockFileManagerTest.cpp - LockFileManager tests ----------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 // | 4 // See https://llvm.org/LICENSE.txt for license information. |
5 // This file is distributed under the University of Illinois Open Source | 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 // License. See LICENSE.TXT for details. | |
7 // | 6 // |
8 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
9 | 8 |
10 #include "llvm/Support/LockFileManager.h" | 9 #include "llvm/Support/LockFileManager.h" |
11 #include "llvm/Support/FileSystem.h" | 10 #include "llvm/Support/FileSystem.h" |
58 | 57 |
59 SmallString<64> TmpFileLock(TmpDir); | 58 SmallString<64> TmpFileLock(TmpDir); |
60 sys::path::append(TmpFileLock, "file.lock-000"); | 59 sys::path::append(TmpFileLock, "file.lock-000"); |
61 | 60 |
62 int FD; | 61 int FD; |
63 EC = sys::fs::openFileForWrite(StringRef(TmpFileLock), FD, sys::fs::F_None); | 62 EC = sys::fs::openFileForWrite(StringRef(TmpFileLock), FD); |
64 ASSERT_FALSE(EC); | 63 ASSERT_FALSE(EC); |
65 | 64 |
66 int Ret = close(FD); | 65 int Ret = close(FD); |
67 ASSERT_EQ(Ret, 0); | 66 ASSERT_EQ(Ret, 0); |
68 | 67 |