From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26048 invoked by alias); 31 Jul 2011 18:58:30 -0000 Received: (qmail 26034 invoked by uid 22791); 31 Jul 2011 18:58:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mailslv1.informatik.hu-berlin.de (HELO mailslv1.informatik.hu-berlin.de) (141.20.20.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 31 Jul 2011 18:58:14 +0000 Received: from localhost.localdomain (brln-4dbaa5e0.pool.mediaWays.net [77.186.165.224]) (authenticated bits=0) by mailslv1.informatik.hu-berlin.de (8.14.2+Sun/8.14.2/INF-2.0-MA-SOLARIS-2.10-26) with ESMTP id p6VIuoXH007203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Jul 2011 20:56:51 +0200 (CEST) Date: Sun, 31 Jul 2011 18:58:00 -0000 From: Magnus =?UTF-8?B?TcO8bGxlcg==?= To: gcc-help@gcc.gnu.org Cc: noloader@gmail.com Subject: Re: G++ switch to make everything public in a class? Message-Id: <20110731205800.e3367671.mamuelle@informatik.hu-berlin.de> In-Reply-To: References: Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Sun__31_Jul_2011_20_58_00_+0200_X_sEL9.EiT_AWTh2" X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00356.txt.bz2 --Signature=_Sun__31_Jul_2011_20_58_00_+0200_X_sEL9.EiT_AWTh2 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 660 On Sun, 31 Jul 2011 14:35:48 -0400 Jeffrey Walton wrote: >>Hi All, >> >>I'm interested in writing test cases against c++ classes. For testing, >>I'd like everything to be public so I can call protected and private >>functions with bad data for negative test cases. >> >>I don't want to use friendship since its for testing only (it would >>pollute the interfaces). >> >>Is there a switch to force everything public? If not, how does one >>typically access the non-public stuff for testing? >> >>Jeff Define private to be public: gcc -Dprivate=3D"public" That could produce compile time errors, but it does no harm to try it. Magnus --Signature=_Sun__31_Jul_2011_20_58_00_+0200_X_sEL9.EiT_AWTh2 Content-Type: application/pgp-signature Content-length: 198 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk41pbgACgkQTx2Lgu47V3wsdACfZvd1NV/VDXwDpwGx29ZqiR0E eGQAnAinxX4vakDW+retS2iPdUFplM4y =eH2s -----END PGP SIGNATURE----- --Signature=_Sun__31_Jul_2011_20_58_00_+0200_X_sEL9.EiT_AWTh2--