[rtems commit] psxhdrs: POSIX Signature Test for syslog.h (GCI2018)

Joel Sherrill joel at rtems.org
Sat Dec 8 17:43:56 UTC 2018


Module:    rtems
Branch:    master
Commit:    15d806b0f9304782d49217d00fcdcee667b36686
Changeset: http://git.rtems.org/rtems/commit/?id=15d806b0f9304782d49217d00fcdcee667b36686

Author:    ABR290B <abhimanyuraghuvanshi29 at gmail.com>
Date:      Sat Dec  8 11:42:24 2018 -0600

psxhdrs:  POSIX Signature Test for syslog.h (GCI2018)

---

 testsuites/psxtests/Makefile.am                 |  4 +++
 testsuites/psxtests/psxhdrs/syslog/closelog.c   | 34 ++++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/syslog/openlog.c    | 35 +++++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/syslog/setlogmask.c | 33 +++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/syslog/syslog.c     | 34 ++++++++++++++++++++++++
 5 files changed, 140 insertions(+)

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 9464909..c7a320f 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1610,6 +1610,10 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
 	psxhdrs/arpa/inet/inet_ntop.c \
 	psxhdrs/arpa/inet/inet_ntoa.c \
 	psxhdrs/arpa/inet/inet_pton.c \
+	psxhdrs/syslog/closelog.c \
+	psxhdrs/syslog/openlog.c \
+	psxhdrs/syslog/setlogmask.c \
+	psxhdrs/syslog/syslog.c \
 	psxhdrs/wchar/btowc.c \
 	psxhdrs/wchar/fgetwc.c \
 	psxhdrs/wchar/fgetws.c \
diff --git a/testsuites/psxtests/psxhdrs/syslog/closelog.c b/testsuites/psxtests/psxhdrs/syslog/closelog.c
new file mode 100644
index 0000000..9cd31a7
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/syslog/closelog.c
@@ -0,0 +1,34 @@
+/**
+ *  @file
+ *  @brief closelog() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Abhimanyu Raghuvanshi
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ * 
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <syslog.h>
+
+int test(void);
+
+int test(void)
+{
+  closelog();
+  return 0;
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/syslog/openlog.c b/testsuites/psxtests/psxhdrs/syslog/openlog.c
new file mode 100644
index 0000000..bd2fc34
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/syslog/openlog.c
@@ -0,0 +1,35 @@
+/**
+ *  @file
+ *  @brief openlog() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Abhimanyu Raghuvanshi
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ * 
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <syslog.h>
+
+int test(void);
+
+int test(void)
+{
+  const char *a = "/var/log/sample.log";
+  openlog( a,  LOG_PID,  LOG_USER);
+  return 0;
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/syslog/setlogmask.c b/testsuites/psxtests/psxhdrs/syslog/setlogmask.c
new file mode 100644
index 0000000..c251777
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/syslog/setlogmask.c
@@ -0,0 +1,33 @@
+/**
+ *  @file
+ *  @brief setlogmask() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Abhimanyu Raghuvanshi
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ * 
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <syslog.h>
+
+int test(void);
+
+int test(void)
+{
+  return setlogmask(LOG_ALERT);
+}
diff --git a/testsuites/psxtests/psxhdrs/syslog/syslog.c b/testsuites/psxtests/psxhdrs/syslog/syslog.c
new file mode 100644
index 0000000..8e54d2f
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/syslog/syslog.c
@@ -0,0 +1,34 @@
+/**
+ *  @file
+ *  @brief syslog() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Abhimanyu Raghuvanshi
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ * 
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <syslog.h>
+
+int test(void);
+
+int test(void)
+{
+  syslog( LOG_USER, "A sample message" );
+  return 0;
+}




More information about the vc mailing list