mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 02:23:34 +08:00
Added example of assignment to already created object.
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ sudo: false
|
||||
install:
|
||||
- pip install --user cpp-coveralls
|
||||
script:
|
||||
- cmake -DCMAKE_BUILD_TYPE=Profile -DTEST=ON -DFORMAT=ON .
|
||||
- cmake -DCMAKE_BUILD_TYPE=Profile -DTESTING=ON -DFORMAT=ON .
|
||||
- make
|
||||
- make check_format
|
||||
- ctest -V
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
option(SUPPORT_STDIOSTREAM
|
||||
"If enabled provides support for << operator (as used with
|
||||
std::cout)" OFF)
|
||||
option(TEST "Enable testing" OFF)
|
||||
option(TESTING "Enable testing" OFF)
|
||||
option(FORMAT "Enable formatting" OFF)
|
||||
|
||||
if(SUPPORT_STDIOSTREAM)
|
||||
@@ -62,7 +62,7 @@ include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
file(GLOB_RECURSE COV_SRCS matrix/*.hpp matrix/*.cpp)
|
||||
|
||||
if(TEST)
|
||||
if(TESTING)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
+2
-1
@@ -130,7 +130,8 @@ int main()
|
||||
Eulerf eulerf(float(deg2rad)*float(roll),
|
||||
float(deg2rad)*float(pitch),
|
||||
float(deg2rad)*float(yaw));
|
||||
Dcm<float> dcm_from_eulerf(eulerf);
|
||||
Dcm<float> dcm_from_eulerf;
|
||||
dcm_from_eulerf = eulerf;
|
||||
Euler<float> euler_outf(dcm_from_eulerf);
|
||||
TEST(isEqual(float(rad2deg)*eulerf_expected,
|
||||
float(rad2deg)*euler_outf));
|
||||
|
||||
Reference in New Issue
Block a user