Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / multiprecision / test / test_checked_mixed_cpp_int.cpp
index 91e587a..2120470 100644 (file)
@@ -4,7 +4,7 @@
 //  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
 
 #ifdef _MSC_VER
-#  define _SCL_SECURE_NO_WARNINGS
+#define _SCL_SECURE_NO_WARNINGS
 #endif
 
 #include <boost/multiprecision/cpp_int.hpp>
@@ -16,19 +16,20 @@ void check_result_type(const T&, const U&)
    BOOST_CHECK(0);
 }
 
-void check_result_type(const boost::multiprecision::checked_int1024_t&, const boost::multiprecision::checked_int1024_t&){}
+void check_result_type(const boost::multiprecision::checked_int1024_t&, const boost::multiprecision::checked_int1024_t&) {}
 
 int main()
 {
 #ifndef BOOST_NO_EXCEPTIONS
-   try{
+   try
+   {
 #endif
-      typedef boost::multiprecision::checked_int1024_t big_type;
-      typedef boost::multiprecision::checked_int512_t  small_type;
-      typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<32, 32, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void>, boost::multiprecision::et_off>  little_type;
+      typedef boost::multiprecision::checked_int1024_t                                                                                                                                                    big_type;
+      typedef boost::multiprecision::checked_int512_t                                                                                                                                                     small_type;
+      typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<32, 32, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void>, boost::multiprecision::et_off> little_type;
 
-      big_type big_val = (big_type(1) << 1000) + 1;
-      small_type small_val = 1;
+      big_type    big_val    = (big_type(1) << 1000) + 1;
+      small_type  small_val  = 1;
       little_type little_val = 1;
 
       check_result_type(big_val, big_val + small_val);
@@ -46,7 +47,6 @@ int main()
       check_result_type(big_val, small_val & big_val);
       check_result_type(big_val, small_val ^ big_val);
 
-
       check_result_type(big_val, big_val + little_val);
       check_result_type(big_val, big_val - little_val);
       check_result_type(big_val, big_val * little_val);
@@ -89,7 +89,7 @@ int main()
       BOOST_CHECK_EQUAL(little_val != big_val, true);
 #ifndef BOOST_NO_EXCEPTIONS
    }
-   catch(const std::exception& e)
+   catch (const std::exception& e)
    {
       std::cout << "Failed with unexpected exception: " << e.what() << std::endl;
       return 1;
@@ -97,4 +97,3 @@ int main()
 #endif
    return boost::report_errors();
 }
-