// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2019 Joel Holdsworth // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #include #include "main.h" template struct check_ostream_impl { static void run() { const Array array(123); std::ostringstream ss; ss << array; VERIFY(ss.str() == "123"); check_ostream_impl< std::complex >::run(); }; }; template<> struct check_ostream_impl { static void run() { const Array array(1, 0); std::ostringstream ss; ss << array; VERIFY(ss.str() == "1 0"); }; }; template struct check_ostream_impl< std::complex > { static void run() { const Array,1,1> array(std::complex(12, 34)); std::ostringstream ss; ss << array; VERIFY(ss.str() == "(12,34)"); }; }; template static void check_ostream() { check_ostream_impl::run(); } EIGEN_DECLARE_TEST(rand) { CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); CALL_SUBTEST(check_ostream()); }