Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
BasicCam.cc File Reference

BasicCam unit tests. More...

Include dependency graph for BasicCam.cc:

Classes

class  BasicCamTests
 Unit Test Class for the BasicCam. More...

Functions

 TEST_F (BasicCamTests, ConstructorDestructor)
 Test the functionality of the BasicCam constructor and destructor.
 TEST_F (BasicCamTests, DoesNotLeak)
 Check that BasicCam doesn't leak any memory.
 TEST_F (BasicCamTests, Leaks)
 This should fail when the –check_for_leaks command line flag is specified.
 TEST_F (BasicCamTests, GetCameraIsOpen)
 Test the GetCameraIsOpen method.
 TEST_F (BasicCamTests, GetCameraLocation)
 Test the GetCameraLocation method.

Detailed Description

BasicCam unit tests.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05

Function Documentation

◆ TEST_F() [1/5]

TEST_F ( BasicCamTests ,
ConstructorDestructor  )

Test the functionality of the BasicCam constructor and destructor.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
78{
79 // Create a BasicCam object.
80 BasicCam basicCam("/dev/video0", 1280, 720, 30, PIXEL_FORMATS::eBGRA, 90.0, 60.0, false, 1);
81
82 // Check initial camera open status.
83 EXPECT_FALSE(basicCam.GetCameraIsOpen());
84
85 // Destructor will be called automatically when the object goes out of scope.
86}
This class implements and interfaces with the most common USB cameras and features....
Definition BasicCam.h:33
Here is the call graph for this function:

◆ TEST_F() [2/5]

TEST_F ( BasicCamTests ,
DoesNotLeak  )

Check that BasicCam doesn't leak any memory.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
96{
97 // Create a new BasicCam object.
98 BasicCam* pBasicCam = new BasicCam("/dev/video0", 1280, 720, 30, PIXEL_FORMATS::eBGRA, 90.0, 60.0, false, 1);
99 // Delete object.
100 delete pBasicCam;
101 // Point to null.
102 pBasicCam = nullptr;
103}

◆ TEST_F() [3/5]

TEST_F ( BasicCamTests ,
Leaks  )

This should fail when the –check_for_leaks command line flag is specified.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
113{
114 // Create a new BasicCam object.
115 BasicCam* pBasicCam = new BasicCam("/dev/video0", 1280, 720, 30, PIXEL_FORMATS::eBGRA, 90.0, 60.0, false, 1);
116 EXPECT_TRUE(pBasicCam != nullptr);
117}

◆ TEST_F() [4/5]

TEST_F ( BasicCamTests ,
GetCameraIsOpen  )

Test the GetCameraIsOpen method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
127{
128 // Create a BasicCam object.
129 BasicCam basicCam("/dev/video0", 1280, 720, 30, PIXEL_FORMATS::eBGRA, 90.0, 60.0, false, 1);
130
131 // Check initial camera open status.
132 EXPECT_FALSE(basicCam.GetCameraIsOpen());
133}
Here is the call graph for this function:

◆ TEST_F() [5/5]

TEST_F ( BasicCamTests ,
GetCameraLocation  )

Test the GetCameraLocation method.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-01-05
143{
144 // Create a BasicCam object.
145 BasicCam basicCam("/dev/video0", 1280, 720, 30, PIXEL_FORMATS::eBGRA, 90.0, 60.0, false, 1);
146
147 // Check camera location.
148 EXPECT_EQ(basicCam.GetCameraLocation(), "/dev/video0");
149}
Here is the call graph for this function: