From 07bad40387611229efd82dbdf526114d494c4c14 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 11 Mar 2014 22:23:15 +0400 Subject: [PATCH] Added tests for proper linking of generated types. Now these tests are failing to pass - will be fixed soon. --- libuavcan/test/dsdl_test/dsdl_const_1.cpp | 20 ++++++++++++++++++++ libuavcan/test/dsdl_test/dsdl_const_2.cpp | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 libuavcan/test/dsdl_test/dsdl_const_1.cpp create mode 100644 libuavcan/test/dsdl_test/dsdl_const_2.cpp diff --git a/libuavcan/test/dsdl_test/dsdl_const_1.cpp b/libuavcan/test/dsdl_test/dsdl_const_1.cpp new file mode 100644 index 0000000000..1816e2aa69 --- /dev/null +++ b/libuavcan/test/dsdl_test/dsdl_const_1.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2014 Pavel Kirienko + */ + +#include +#include + +/* + * Objective of this test is to make sure that the generated types are being linked correcly. + * This test requests the address of some static const member variables to make sure that there + * will be no duplicated symbol linking errors. + */ +TEST(DsdlConst1, FigureOfMerit) +{ + using uavcan::FigureOfMerit; + + std::cout << &FigureOfMerit::MAX << std::endl; + std::cout << &FigureOfMerit::MIN << std::endl; + std::cout << &FigureOfMerit::UNKNOWN << std::endl; +} diff --git a/libuavcan/test/dsdl_test/dsdl_const_2.cpp b/libuavcan/test/dsdl_test/dsdl_const_2.cpp new file mode 100644 index 0000000000..93524490a4 --- /dev/null +++ b/libuavcan/test/dsdl_test/dsdl_const_2.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2014 Pavel Kirienko + */ + +#include +#include + + +TEST(DsdlConst2, FigureOfMerit) +{ + using uavcan::FigureOfMerit; + + std::cout << &FigureOfMerit::MAX << std::endl; + std::cout << &FigureOfMerit::MIN << std::endl; + std::cout << &FigureOfMerit::UNKNOWN << std::endl; +}