summaryrefslogtreecommitdiff
path: root/pr/tests
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2000-05-22 18:30:06 +0000
committerwtc%netscape.com <devnull@localhost>2000-05-22 18:30:06 +0000
commit0ac59058ca250bf653c05a05fc438c399ac52be8 (patch)
tree59f66cb2ecdb77ea6693d8c908910ca7e74e8658 /pr/tests
parentaf719eb059e69987ff2fba455fc8831c3806f838 (diff)
downloadnspr-hg-0ac59058ca250bf653c05a05fc438c399ac52be8.tar.gz
Bugzilla bug #39110: added a new test freeif.c to catch this bug.
Added file: freeif.c Modified files: Makefile, Makefile.in, runtests.ksh
Diffstat (limited to 'pr/tests')
-rw-r--r--pr/tests/Makefile1
-rw-r--r--pr/tests/Makefile.in1
-rw-r--r--pr/tests/freeif.c47
-rwxr-xr-xpr/tests/runtests.ksh1
4 files changed, 50 insertions, 0 deletions
diff --git a/pr/tests/Makefile b/pr/tests/Makefile
index b0006bb3..d98edb29 100644
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -62,6 +62,7 @@ CSRCS = \
fileio.c \
foreign.c \
forktest.c \
+ freeif.c \
fsync.c \
gethost.c \
getproto.c \
diff --git a/pr/tests/Makefile.in b/pr/tests/Makefile.in
index 47b9877f..c6e6ac5e 100644
--- a/pr/tests/Makefile.in
+++ b/pr/tests/Makefile.in
@@ -67,6 +67,7 @@ CSRCS = \
fileio.c \
foreign.c \
forktest.c \
+ freeif.c \
fsync.c \
gethost.c \
getproto.c \
diff --git a/pr/tests/freeif.c b/pr/tests/freeif.c
new file mode 100644
index 00000000..5dab11b2
--- /dev/null
+++ b/pr/tests/freeif.c
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 2000 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+/*
+ * A test to see if the macros PR_DELETE and PR_FREEIF are
+ * properly defined. (See Bugzilla bug #39110.)
+ */
+
+#include "nspr.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static void Fail(void)
+{
+ printf("FAIL\n");
+ exit(1);
+}
+
+int main()
+{
+ int foo = 1;
+ char *ptr = NULL;
+
+ if (foo)
+ PR_FREEIF(ptr);
+ else
+ Fail();
+
+ printf("PASS\n");
+ return 0;
+}
diff --git a/pr/tests/runtests.ksh b/pr/tests/runtests.ksh
index 49716369..4f0892a4 100755
--- a/pr/tests/runtests.ksh
+++ b/pr/tests/runtests.ksh
@@ -98,6 +98,7 @@ exit
fdcach
fileio
foreign
+freeif
fsync
gethost
getproto