Bugzilla bug #39110: added a new test freeif.c to catch this bug.
authorwtc%netscape.com
Mon, 22 May 2000 18:30:06 +0000
changeset 1372 6b85c0bddfa68bd8bbe1d10e8089838e323b1f56
parent 1371 61880cb66d07840c6af5fddc13f63659285f9254
child 1373 f921a4d17764a10cb37967ce655a5c3a63aa5019
push idunknown
push userunknown
push dateunknown
bugs39110
Bugzilla bug #39110: added a new test freeif.c to catch this bug. Added file: freeif.c Modified files: Makefile, Makefile.in, runtests.ksh
pr/tests/Makefile
pr/tests/Makefile.in
pr/tests/freeif.c
pr/tests/runtests.ksh
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -57,16 +57,17 @@ CSRCS =             \
 	dlltest.c		\
 	dtoa.c			\
 	errcodes.c		\
 	exit.c  		\
 	fdcach.c		\
 	fileio.c		\
 	foreign.c	    \
 	forktest.c	    \
+	freeif.c	    \
 	fsync.c	        \
 	gethost.c		\
 	getproto.c		\
 	i2l.c		    \
 	initclk.c		\
 	inrval.c		\
 	instrumt.c      \
 	intrio.c        \
--- a/pr/tests/Makefile.in
+++ b/pr/tests/Makefile.in
@@ -62,16 +62,17 @@ CSRCS =             \
 	dlltest.c		\
 	dtoa.c			\
 	errcodes.c		\
 	exit.c  		\
 	fdcach.c		\
 	fileio.c		\
 	foreign.c	    \
 	forktest.c	    \
+	freeif.c	    \
 	fsync.c	        \
 	gethost.c		\
 	getproto.c		\
 	i2l.c		    \
 	initclk.c		\
 	inrval.c		\
 	instrumt.c      \
 	intrio.c        \
new file mode 100644
--- /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;
+}
--- a/pr/tests/runtests.ksh
+++ b/pr/tests/runtests.ksh
@@ -93,16 +93,17 @@ cvar
 cvar2
 dlltest
 dtoa
 errcodes
 exit
 fdcach
 fileio
 foreign
+freeif
 fsync
 gethost
 getproto
 i2l
 initclk
 inrval
 instrumt
 intrio