operation.cpp 604 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include <rtg/operation.hpp>
#include <sstream>
#include <string>
#include "test.hpp"

struct simple_operation
{
    std::string name() const { return "simple"; }
    rtg::shape compute_shape(std::vector<rtg::shape>) const { RTG_THROW("not computable"); }
    rtg::argument compute(std::vector<rtg::argument>) const { RTG_THROW("not computable"); }
};

void operation_copy_test()
{
    simple_operation s{};
Paul's avatar
Paul committed
17
    rtg::operation op1 = s;   // NOLINT
Paul's avatar
Paul committed
18
19
20
21
22
    rtg::operation op2 = op1; // NOLINT
    EXPECT(s.name() == op1.name());
    EXPECT(op2.name() == op1.name());
}

Paul's avatar
Paul committed
23
int main() { operation_copy_test(); }