mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
40
test/io.cpp
40
test/io.cpp
@@ -11,52 +11,44 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
template<typename Scalar>
|
||||
struct check_ostream_impl
|
||||
{
|
||||
static void run()
|
||||
{
|
||||
const Array<Scalar,1,1> array(123);
|
||||
template <typename Scalar>
|
||||
struct check_ostream_impl {
|
||||
static void run() {
|
||||
const Array<Scalar, 1, 1> array(123);
|
||||
std::ostringstream ss;
|
||||
ss << array;
|
||||
VERIFY(ss.str() == "123");
|
||||
|
||||
check_ostream_impl< std::complex<Scalar> >::run();
|
||||
check_ostream_impl<std::complex<Scalar> >::run();
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct check_ostream_impl<bool>
|
||||
{
|
||||
static void run()
|
||||
{
|
||||
const Array<bool,1,2> array(1, 0);
|
||||
template <>
|
||||
struct check_ostream_impl<bool> {
|
||||
static void run() {
|
||||
const Array<bool, 1, 2> array(1, 0);
|
||||
std::ostringstream ss;
|
||||
ss << array;
|
||||
VERIFY(ss.str() == "1 0");
|
||||
};
|
||||
};
|
||||
|
||||
template<typename Scalar>
|
||||
struct check_ostream_impl< std::complex<Scalar> >
|
||||
{
|
||||
static void run()
|
||||
{
|
||||
const Array<std::complex<Scalar>,1,1> array(std::complex<Scalar>(12, 34));
|
||||
template <typename Scalar>
|
||||
struct check_ostream_impl<std::complex<Scalar> > {
|
||||
static void run() {
|
||||
const Array<std::complex<Scalar>, 1, 1> array(std::complex<Scalar>(12, 34));
|
||||
std::ostringstream ss;
|
||||
ss << array;
|
||||
VERIFY(ss.str() == "(12,34)");
|
||||
};
|
||||
};
|
||||
|
||||
template<typename Scalar>
|
||||
static void check_ostream()
|
||||
{
|
||||
template <typename Scalar>
|
||||
static void check_ostream() {
|
||||
check_ostream_impl<Scalar>::run();
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(rand)
|
||||
{
|
||||
EIGEN_DECLARE_TEST(rand) {
|
||||
CALL_SUBTEST(check_ostream<bool>());
|
||||
CALL_SUBTEST(check_ostream<float>());
|
||||
CALL_SUBTEST(check_ostream<double>());
|
||||
|
||||
Reference in New Issue
Block a user