You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/06/06 12:10:27 UTC

svn commit: r544795 - /incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp

Author: faridz
Date: Wed Jun  6 03:10:25 2007
New Revision: 544795

URL: http://svn.apache.org/viewvc?view=rev&rev=544795
Log:
2007-06-06 Farid Zaripov <Fa...@epam.com>

	* 23.bitset.cons.stdcxx-297.cpp: new test from STDCXX-297 issue

Added:
    incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp   (with props)

Added: incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp?view=auto&rev=544795
==============================================================================
--- incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp (added)
+++ incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp Wed Jun  6 03:10:25 2007
@@ -0,0 +1,50 @@
+/************************************************************************
+ *
+ * 23.bitset.cons.stdcxx-297.cpp - test case from STDCXX-297 issue
+ *
+ * $Id$
+ *
+ ***************************************************************************
+ *
+ * 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
+ *
+ * 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.
+ * 
+ **************************************************************************/
+
+#include <cassert>
+#include <new>
+#include <bitset>
+#include <string>
+#include <cstddef>
+#include <string.h>
+
+int main ()
+{
+    typedef std::bitset<128> BitSet;
+    const std::size_t size = sizeof (BitSet);
+
+    char buf [size + 4];
+    memset (buf, '\xff', sizeof (buf));
+
+    BitSet* btest = new (buf) BitSet (std::basic_string<int> ());
+
+    for (std::size_t i = size; i < sizeof (buf); ++i)
+        assert ('\xff' == buf [i]);
+
+    btest->~BitSet ();
+
+    return 0;
+}

Propchange: incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/stdcxx/trunk/tests/regress/23.bitset.cons.stdcxx-297.cpp
------------------------------------------------------------------------------
    svn:keywords = Id