<commit_before>// -*- Mode:C++ -*-

/**************************************************************************************************/
/*                                                                                                */
/* Copyright (C) 2014 University of Hull                                                          */
/*                                                                                                */
/**************************************************************************************************/
/*                                                                                                */
/*  module     :  field/test/value_multi.cpp                                                      */
/*  project    :                                                                                  */
/*  description:                                                                                  */
/*                                                                                                */
/**************************************************************************************************/

// includes, system

//#include <>

// includes, project

#include <field/value_multi.hpp>
#include <shared.hpp>

// internal unnamed namespace

namespace {
  
  // types, internal (class, enum, struct, union, typedef)
  
  // variables, internal
  
  // functions, internal

} // namespace {

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_get, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>                   c;
  value::multi<typename T::value_type> const f(c, "f");

  BOOST_CHECK(T() == f.get());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_set, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");
  
  BOOST_CHECK(T() == f.set(T()));
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_add, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");

  f.add(typename T::value_type());
  
  BOOST_CHECK(1 == f.get().size());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_sub, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f", T(2));

  f.sub(typename T::value_type());
  
  BOOST_CHECK(1 == f.get().size());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_set_initlist, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");
  
  BOOST_CHECK(T() == f.set({ }));
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_op_convert, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>                   c;
  value::multi<typename T::value_type> const f(c, "f");

  BOOST_CHECK(T() == static_cast<T>(f));
}
<commit_msg>add'l checks<commit_after>// -*- Mode:C++ -*-

/**************************************************************************************************/
/*                                                                                                */
/* Copyright (C) 2014 University of Hull                                                          */
/*                                                                                                */
/**************************************************************************************************/
/*                                                                                                */
/*  module     :  field/test/value_multi.cpp                                                      */
/*  project    :                                                                                  */
/*  description:                                                                                  */
/*                                                                                                */
/**************************************************************************************************/

// includes, system

//#include <>

// includes, project

#include <field/value_multi.hpp>
#include <shared.hpp>

// internal unnamed namespace

namespace {
  
  // types, internal (class, enum, struct, union, typedef)
  
  // variables, internal
  
  // functions, internal

} // namespace {

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_get, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>                   c;
  value::multi<typename T::value_type> const f(c, "f");

  BOOST_CHECK(T() == f.get());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_set, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");
  
  BOOST_CHECK(T() == f.set(T()));
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_add, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");

  BOOST_CHECK(f.add(typename T::value_type()));
  BOOST_CHECK(1 == f.get().size());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_sub, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f", T(2));

  BOOST_CHECK(f.sub(typename T::value_type()));
  BOOST_CHECK(1 == f.get().size());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_set_initlist, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>             c;
  value::multi<typename T::value_type> f(c, "f");
  
  BOOST_CHECK(T() == f.set({ }));
}

BOOST_AUTO_TEST_CASE_TEMPLATE(value_multi_op_convert, T, field::test::multi_types)
{
  using namespace field;
  
  test::container_multi<T>                   c;
  value::multi<typename T::value_type> const f(c, "f");

  BOOST_CHECK(T() == static_cast<T>(f));
}

{'fraction_non_alphanumeric': 0.21340388007054673, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 1.8023360287511232, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 52, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2868598', 'n_tokens_mistral': 1678, 'n_tokens_neox': 1619, 'n_words': 269}