Skip to content

Commit 4c57378

Browse files
use proxy header, new errno test framework.
1 parent bc73e94 commit 4c57378

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

libc/test/src/sys/time/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ add_libc_unittest(
88
utimes_test.cpp
99
DEPENDS
1010
libc.hdr.fcntl_macros
11+
libc.hdr.sys_stat_macros
1112
libc.src.errno.errno
1213
libc.src.fcntl.open
1314
libc.src.sys.time.utimes
@@ -16,4 +17,5 @@ add_libc_unittest(
1617
libc.src.unistd.write
1718
libc.src.stdio.remove
1819
libc.src.sys.stat.stat
20+
libc.test.UnitTest.ErrnoCheckingTest
1921
)

libc/test/src/sys/time/utimes_test.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "hdr/fcntl_macros.h"
10+
#include "hdr/sys_stat_macros.h"
1011
#include "hdr/types/struct_timeval.h"
1112
#include "src/errno/libc_errno.h"
1213
#include "src/fcntl/open.h"
1314
#include "src/stdio/remove.h"
1415
#include "src/sys/stat/stat.h"
1516
#include "src/sys/time/utimes.h"
1617
#include "src/unistd/close.h"
18+
19+
#include "test/UnitTest/ErrnoCheckingTest.h"
1720
#include "test/UnitTest/ErrnoSetterMatcher.h"
1821
#include "test/UnitTest/Test.h"
1922

20-
#include <sys/stat.h>
23+
using LlvmLibcUtimesTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
2124

2225
// SUCCESS: Takes a file and successfully updates
2326
// its last access and modified times.
24-
TEST(LlvmLibcUtimesTest, ChangeTimesSpecific) {
27+
TEST_F(LlvmLibcUtimesTest, ChangeTimesSpecific) {
2528
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
2629

2730
constexpr const char *FILE_PATH = "utimes_pass.test";
@@ -60,7 +63,7 @@ TEST(LlvmLibcUtimesTest, ChangeTimesSpecific) {
6063

6164
// FAILURE: Invalid values in the timeval struct
6265
// to check that utimes rejects it.
63-
TEST(LlvmLibcUtimesTest, InvalidMicroseconds) {
66+
TEST_F(LlvmLibcUtimesTest, InvalidMicroseconds) {
6467
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
6568
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
6669

0 commit comments

Comments
 (0)