]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/align/test/aligned_alloc_test.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / align / test / aligned_alloc_test.cpp
index 2c10e06e5a23e149f549c9604e265d576fb7b791..925d77f86e979b5ab673c9d6b5064c83b4f126ef 100644 (file)
@@ -1,10 +1,9 @@
 /*
-(c) 2014 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
+Copyright 2014 Glen Joseph Fernandes
+(glenjofe@gmail.com)
 
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
 */
 #include <boost/align/aligned_alloc.hpp>
 #include <boost/align/is_aligned.hpp>
@@ -14,29 +13,20 @@ http://boost.org/LICENSE_1_0.txt
 void test(std::size_t alignment)
 {
     {
-        void* p = boost::alignment::aligned_alloc(alignment,
-            alignment);
+        void* p = boost::alignment::aligned_alloc(alignment, alignment + 1);
         BOOST_TEST(p != 0);
         BOOST_TEST(boost::alignment::is_aligned(p, alignment));
-        std::memset(p, 0, 1);
+        std::memset(p, 0, alignment);
         boost::alignment::aligned_free(p);
     }
     {
-        void* p = boost::alignment::aligned_alloc(alignment,
-            alignment + 1);
+        void* p = boost::alignment::aligned_alloc(alignment, 1);
         BOOST_TEST(p != 0);
         BOOST_TEST(boost::alignment::is_aligned(p, alignment));
         std::memset(p, 0, 1);
         boost::alignment::aligned_free(p);
     }
-    if (alignment > 1) {
-        void* p = boost::alignment::aligned_alloc(alignment,
-            alignment - 1);
-        BOOST_TEST(p != 0);
-        BOOST_TEST(boost::alignment::is_aligned(p, alignment));
-        std::memset(p, 0, 1);
-        boost::alignment::aligned_free(p);
-    } else {
+    {
         void* p = boost::alignment::aligned_alloc(alignment, 0);
         boost::alignment::aligned_free(p);
     }