Skip to content

File tddcontainer.h

File List > code_source > templat > include > TempLat > util > tdd > tddcontainer.h

Go to the documentation of this file

#ifndef TEMPLAT_UTIL_TDD_TDDCONTAINER_H
#define TEMPLAT_UTIL_TDD_TDDCONTAINER_H

/* This file is part of TempLat, available at https://cosmolattice.github.io/templat .
   Copyright 2021-2026 The TempLat authors, see AUTHORS.md.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Wessel Valkenburg, Year: 2019

#include "TempLat/util/tdd/tddcontainerbase.h"
#include "TempLat/util/tdd/tddassertion.h"
#include "TempLat/util/tdd/tddregister.h"
#include "TempLat/util/tdd/tddmacros.h"

namespace TempLat
{

  template <class TESTME> class TDDContainer : public TDDContainerBase
  {
  public:
    // Put public methods here. These should change very little over time.
    TDDContainer() { TDDRegister::add(this, typeid(TESTME).name()); }

    TDDContainer(const TDDContainer &other) = delete;

    TDDContainer &operator=(const TDDContainer &other) = delete;

    virtual int Test()
    {
      TDDAssertion assert;
      TESTME::Test(assert);
      sayShort << assert << "\n";
      return assert.FailCount();
    }

  private:
    /* Put all member variables and private methods here. These may change arbitrarily. */
  };

  class TDDContainerDummy
  {
  };

} // namespace TempLat

#endif