[libc-commits] [libc] [libc] Add `ctime_s` (PR #110676)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Thu Nov 14 11:28:03 PST 2024
================
@@ -0,0 +1,76 @@
+//===-- Unittests for ctime_s ---------------------------------------------===//
+//
+// 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 "hdr/errno_macros.h"
+#include "src/errno/libc_errno.h"
+#include "src/time/ctime_s.h"
+#include "src/time/time_utils.h"
+#include "test/UnitTest/Test.h"
+#include "test/src/time/TmHelper.h"
+
+using LIBC_NAMESPACE::time_utils::TimeConstants;
+
+TEST(LlvmLibcCtimeS, Nullptr) {
+ int result;
+ result = LIBC_NAMESPACE::ctime_s(nullptr, 0, nullptr);
----------------
nickdesaulniers wrote:
```suggestion
int result = LIBC_NAMESPACE::ctime_s(nullptr, 0, nullptr);
```
https://github.com/llvm/llvm-project/pull/110676
More information about the libc-commits
mailing list