From 651262c4f0d18b009e7da8f623a22db5efe251e8 Mon Sep 17 00:00:00 2001 From: Bhuvan Bezawada <bhuvan_777@outlook.com> Date: Mon, 25 Jun 2018 15:56:35 +0100 Subject: [PATCH] Minor changes added for build tests re #22553 --- Framework/Kernel/inc/MantidKernel/ContainerDtype.h | 6 +----- Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h | 3 +++ .../test/python/mantid/kernel/ArrayPropertyTest.py | 6 +++--- .../test/python/mantid/kernel/PropertyWithValueTest.py | 4 ++-- .../test/python/mantid/kernel/TimeSeriesPropertyTest.py | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Framework/Kernel/inc/MantidKernel/ContainerDtype.h b/Framework/Kernel/inc/MantidKernel/ContainerDtype.h index a9181e88f4a..49550391b9e 100644 --- a/Framework/Kernel/inc/MantidKernel/ContainerDtype.h +++ b/Framework/Kernel/inc/MantidKernel/ContainerDtype.h @@ -47,13 +47,9 @@ namespace dtypeHelper { // Free function to determine data type being stored in container template <template <class> class Container, typename HeldType> -std::string dtype(Container<HeldType>) { +std::string dtype(const Container<HeldType>) { if (std::is_same<HeldType, bool>::value) { return "b"; - } else if (std::is_same<HeldType, std::int32_t>::value) { - return "int32"; - } else if (std::is_same<HeldType, std::int64_t>::value) { - return "int64"; } else if (std::is_integral<HeldType>::value) { return "i"; } else if (std::is_same<HeldType, std::float_t>::value) { diff --git a/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h b/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h index 1f39d3d73a9..90a6b801636 100644 --- a/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h +++ b/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h @@ -120,6 +120,9 @@ class DLLExport TimeSeriesProperty : public Property, public: /// Constructor explicit TimeSeriesProperty(const std::string &name); + + TimeSeriesProperty(const std::string &name, TimeSeriesProperty<TYPE> &type); + /// Virtual destructor ~TimeSeriesProperty() override; /// "Virtual" copy constructor diff --git a/Framework/PythonInterface/test/python/mantid/kernel/ArrayPropertyTest.py b/Framework/PythonInterface/test/python/mantid/kernel/ArrayPropertyTest.py index bd2da0e12bb..b1639f72f18 100644 --- a/Framework/PythonInterface/test/python/mantid/kernel/ArrayPropertyTest.py +++ b/Framework/PythonInterface/test/python/mantid/kernel/ArrayPropertyTest.py @@ -129,7 +129,7 @@ class ArrayPropertyTest(unittest.TestCase): FloatArrayProperty("Input", Direction.Input), "Float array") def PyExec(self): self._input_values = self.getProperty("Input").value - + input_values = range(1, 5) self._do_algorithm_test(AlgWithFloatArrayProperty, input_values) @@ -144,7 +144,7 @@ class ArrayPropertyTest(unittest.TestCase): # Create float array float_input_values = [1.1, 2.5, 5.6, 4.6, 9.0, 6.0] float_arr = FloatArrayProperty("floats", float_input_values, validator, direc) - + # Create int array int_input_values = [1, 2, 5, 4, 9, 6] int_arr = IntArrayProperty("integers", int_input_values, validator, direc) @@ -152,7 +152,7 @@ class ArrayPropertyTest(unittest.TestCase): # Create string array str_input_values =["a", "b", "c", "d", "e"] str_arr = StringArrayProperty("letters", str_input_values, validator, direc) - + # Test self.assertEquals(float_arr.dtype(), "d") self.assertEquals(int_arr.dtype(), "i") diff --git a/Framework/PythonInterface/test/python/mantid/kernel/PropertyWithValueTest.py b/Framework/PythonInterface/test/python/mantid/kernel/PropertyWithValueTest.py index b0d2411eef3..ecab49de0d4 100644 --- a/Framework/PythonInterface/test/python/mantid/kernel/PropertyWithValueTest.py +++ b/Framework/PythonInterface/test/python/mantid/kernel/PropertyWithValueTest.py @@ -126,9 +126,9 @@ class PropertyWithValueTest(unittest.TestCase): result = det_list_prop.valueAsPrettyStr(40,False) self.assertEquals(result.startswith("1,2,3,"), True) self.assertEquals(result.endswith("98,99"), True) - + # Check the dtype return value - self.assertEquals(det_list_prop.dtype(), "int32") + self.assertEquals(det_list_prop.dtype(), "i") def _do_vector_double_numpy_test(self, int_type=False): create_ws = AlgorithmManager.createUnmanaged('CreateWorkspace') diff --git a/Framework/PythonInterface/test/python/mantid/kernel/TimeSeriesPropertyTest.py b/Framework/PythonInterface/test/python/mantid/kernel/TimeSeriesPropertyTest.py index 6da8d40c794..5017ae8da86 100644 --- a/Framework/PythonInterface/test/python/mantid/kernel/TimeSeriesPropertyTest.py +++ b/Framework/PythonInterface/test/python/mantid/kernel/TimeSeriesPropertyTest.py @@ -69,7 +69,7 @@ class TimeSeriesPropertyTest(unittest.TestCase): self.assertEquals(log_series.size(), self._nframes) self.assertEquals(log_series.nthValue(1), 1436) # Check the dtype return value - self.assertEquals(log_series.dtype(), "int64") + self.assertEquals(log_series.dtype(), "i") def test_time_series_string_can_be_extracted(self): log_series = self._test_ws.getRun()["icp_event"] -- GitLab