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=?Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/107...@github.com>
================ @@ -0,0 +1,38 @@ +//===-- Unittests for ctime -----------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "src/errno/libc_errno.h" +#include "src/time/ctime.h" +#include "test/UnitTest/Test.h" +#include "test/src/time/TmHelper.h" + +TEST(LlvmLibcCtime, Nullptr) { + char *result; + result = LIBC_NAMESPACE::ctime(nullptr); + ASSERT_ERRNO_EQ(EINVAL); + ASSERT_STREQ(nullptr, result); +} + +TEST(LlvmLibcCtime, ValidUnixTimestamp0) { + struct time_t t = 0; ---------------- michaelrj-google wrote: You need to remove `struct` from the `time_t` variables, since they aren't structs they are typedefs (here and in `ctime_r_test.cpp`.) ```suggestion time_t t = 0; ``` https://github.com/llvm/llvm-project/pull/107285 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits