From stdcxx-commits-return-1607-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Wed Aug 08 16:33:15 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 86225 invoked from network); 8 Aug 2007 16:33:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Aug 2007 16:33:15 -0000 Received: (qmail 46005 invoked by uid 500); 8 Aug 2007 16:33:14 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 45981 invoked by uid 500); 8 Aug 2007 16:33:14 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 45970 invoked by uid 99); 8 Aug 2007 16:33:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 09:33:14 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 16:33:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EAABA1A981A; Wed, 8 Aug 2007 09:32:44 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r563932 - /incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp Date: Wed, 08 Aug 2007 16:32:43 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070808163244.EAABA1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebor Date: Wed Aug 8 09:32:42 2007 New Revision: 563932 URL: http://svn.apache.org/viewvc?view=rev&rev=563932 Log: 2007-08-08 Martin Sebor * 18.limits.cvqual.cpp (test_limits): Exercised quiet NAN. Modified: incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp Modified: incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp?view=diff&rev=563932&r1=563931&r2=563932 ============================================================================== --- incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp (original) +++ incubator/stdcxx/trunk/tests/support/18.limits.cvqual.cpp Wed Aug 8 09:32:42 2007 @@ -1,28 +1,32 @@ -// -*- C++ -*- /*************************************************************************** * - * 18.limits.cvqual.cpp - test exercising lib.numeric.limits + * 18.limits.cvqual.cpp: + * + * Test exercising lib.numeric.limits, numeric_limits specializations + * on cv-qualified scalar types. See DR 559 for details: + * http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#559 * * $Id$ * *************************************************************************** * - * Copyright 2006 The Apache Software Foundation or its licensors, - * as applicable. - * - * Copyright 2006 Rogue Wave Software. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + * Copyright 2006-2007 Rogue Wave Software, Inc. * **************************************************************************/ @@ -52,6 +56,8 @@ typedef std::numeric_limits limits; typedef std::numeric_limits cv_limits; + // verify that the member has the same value as the same member + // of a specialization of numeric_limits on the cv-qualified T # define TEST(member) \ rw_assert (limits::member == cv_limits::member, 0, __LINE__, \ "numeric_limits<%s>::%s == numeric_limits<%s %1$s>::%2$s", \ @@ -61,6 +67,9 @@ typedef std::numeric_limits > limits; typedef std::numeric_limits cv_limits; + // verify that the member has the same value as the same member + // of a specialization of numeric_limits on some user-defined T + // (i.e., the primary template) # define TEST(member) \ rw_assert (limits::member == cv_limits::member, 0, __LINE__, \ "numeric_limits<%s>::%s == numeric_limits<%s %1$s>::%2$s", \ @@ -98,7 +107,13 @@ TEST (signaling_NaN ()); } else { - // test NaN + const bool expect = limits::has_quiet_NaN; + + rw_assert (expect == (limits::quiet_NaN () != cv_limits::quiet_NaN ()), + 0, __LINE__, + "numeric_limits<%s>::qNaN() %{?}!=%{:}==%{;} " + "numeric_limits<%s %1$s>::qNaN ()", + tname, expect, quals); } TEST (denorm_min ()); @@ -120,7 +135,8 @@ typedef volatile T volatile_T; typedef const volatile T const_volatile_T; - rw_info (0, 0, 0, "std::numeric_limits with T = cv-qualified %s", tname); + rw_info (0, 0, __LINE__, + "std::numeric_limits with T = cv-qualified %s", tname); test_limits ((T*)0, (const_T*)0, tname, "const"); test_limits ((T*)0, (volatile_T*)0, tname, "volatile"); @@ -184,5 +200,5 @@ "specializations on cv-qualifed types", run_test, 0, - 0); + (void*)0); }