Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * A test to see if the macros PR_DELETE and PR_FREEIF are
8 * properly defined. (See Bugzilla bug #39110.)
9 */
11 #include "nspr.h"
13 #include <stdio.h>
14 #include <stdlib.h>
16 static void Noop(void) { }
18 static void Fail(void)
19 {
20 printf("FAIL\n");
21 exit(1);
22 }
24 int main(int argc, char **argv)
25 {
26 int foo = 1;
27 char *ptr = NULL;
29 /* this fails to compile with the old definition of PR_DELETE */
30 if (foo)
31 PR_DELETE(ptr);
32 else
33 Noop();
35 /* this nests incorrectly with the old definition of PR_FREEIF */
36 if (foo)
37 PR_FREEIF(ptr);
38 else
39 Fail();
41 printf("PASS\n");
42 return 0;
43 }