forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
HistogramXTest.h
37 lines (31 loc) · 1.52 KB
/
HistogramXTest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include <cxxtest/TestSuite.h>
#include "MantidHistogramData/FixedLengthVector.h"
#include "MantidHistogramData/HistogramX.h"
#include "MantidHistogramData/Offsetable.h"
#include "MantidHistogramData/Scalable.h"
using namespace Mantid;
using namespace HistogramData;
class HistogramXTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static HistogramXTest *createSuite() { return new HistogramXTest(); }
static void destroySuite(HistogramXTest *suite) { delete suite; }
// The implementation of the testee is based on mixins and a few
// compiler-generated constructors. Tests for the features provided by mixins
// can be found in the respective mixin tests. Here we simply test that we
// have the expected mixins.
void test_has_correct_mixins() {
HistogramX x;
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(dynamic_cast<detail::FixedLengthVector<HistogramX> &>(x)));
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(dynamic_cast<detail::Offsetable<HistogramX> &>(x)));
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(dynamic_cast<detail::Scalable<HistogramX> &>(x)));
}
};