Skip to content
Snippets Groups Projects
TupleUtilityTest.cpp 574 B
#include <tuple>
#include <iostream>

#include <amdis/common/TupleUtility.hpp>

#include "Tests.hpp"

using namespace AMDiS;

int main()
{
  using Tuple1 = std::tuple<double,int>;
  using TupleDouble = std::tuple<double,double>;
  using TupleInt = std::tuple<int,int>;
  using Tuple2 = std::tuple<TupleDouble,TupleInt>;

  Tuple1 u = {1.3, 2};
  auto v = constructTuple<Tuple1>(1.5);
  auto w = foldTuples<Tuple2>(u,v);

  AMDIS_TEST(u == Tuple1({1.3, 2}));
  AMDIS_TEST(v == Tuple1({1.5, 1}));
  AMDIS_TEST(w == Tuple2( {{1.3, 1.5}, {2, 1}} ));

  return report_errors();
}