Added test case for array templates

This commit is contained in:
Pherring04 2024-07-12 14:41:04 -05:00
parent 67fc66d066
commit 9b320fe3e4
2 changed files with 54 additions and 0 deletions

View File

@ -9,8 +9,25 @@ LIBRARY DEPENDENCIES:
#include "sim_objects/default_trick_sys.sm" #include "sim_objects/default_trick_sys.sm"
##include "test_ip/include/ClassOfEverything.hh" ##include "test_ip/include/ClassOfEverything.hh"
##include "test_ip/include/ArrayTemplate.hh"
##include "test_ip/include/OverloadedVariable.hh" ##include "test_ip/include/OverloadedVariable.hh"
class ArrayTemplateSimObject : public Trick::SimObject
{
public:
ArrayTemplateSimObject(const ArrayTemplateSimObject&) = delete;
ArrayTemplateSimObject& operator=(const ArrayTemplateSimObject&) = delete;
double a[3];
ArrayTemplate<double[3]> arryTemp;
ArrayTemplateSimObject()
: arryTemp(a)
{
}
};
ArrayTemplateSimObject arry_temp_object;
class testSimObject : public Trick::SimObject { class testSimObject : public Trick::SimObject {
public: public:

View File

@ -0,0 +1,37 @@
/**
@file
@verbatim
PURPOSE:
(Test if we can build with arrays as template parameters)
@endverbatim
*******************************************************************************/
#ifndef ARRAY_TEMPLATE_TESTS_HH
#define ARRAY_TEMPLATE_TESTS_HH
// System include files.
#include <string>
#include <iostream>
#include <sstream>
template <class SourceType>
class ArrayTemplate
{
public:
ArrayTemplate(const SourceType& source)
: source(source)
{
}
ArrayTemplate(const ArrayTemplate&) = delete;
ArrayTemplate& operator=(const ArrayTemplate&) = delete;
private:
const SourceType& source;
};
#endif