opensurgsim
Namespaces | Functions
OsgGroupTests.cpp File Reference

Tests for the Group class. More...

#include "SurgSim/Graphics/UnitTests/MockObjects.h"
#include "SurgSim/Graphics/UnitTests/MockOsgObjects.h"
#include "SurgSim/Graphics/OsgGroup.h"
#include <gtest/gtest.h>

Namespaces

 SurgSim
 Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui needs glew but we need to call glewInit() from a osg callback, using this call we avoid getting warnings about redefinitions.
 

Functions

 SurgSim::Graphics::TEST (OsgGroupTests, InitTest)
 
 SurgSim::Graphics::TEST (OsgGroupTests, OsgNodesTest)
 
 SurgSim::Graphics::TEST (OsgGroupTests, VisibilityTest)
 
 SurgSim::Graphics::TEST (OsgGroupTests, AddRemoveTest)
 
 SurgSim::Graphics::TEST (OsgGroupTests, AppendTest)
 
 SurgSim::Graphics::TEST (OsgGroupTests, ClearTest)
 

Detailed Description

Tests for the Group class.

Function Documentation

§ TEST() [1/2]

SurgSim::Graphics::TEST ( OsgGroupTests  ,
AddRemoveTest   
)

Add an representation and make sure the osg::Switch value for it is set correctly (should be true)

Set group to not visible and check the osg::Switch values

Add another representation and make sure the osg::Switch value for it is set correctly (should be false)

Set group to visible and check the osg::Switch values

Set group to not visible and check the osg::Switch values

Try to add a duplicate representation

Remove an representation

Try to remove an representation that is not in the group

Try to add a non-OSG representation

§ TEST() [2/2]

SurgSim::Graphics::TEST ( OsgGroupTests  ,
AppendTest   
)

Add 2 representations to group 1

Add an representation to group 2 and append group 1 to group 2.

Try to append a group that has already been appended - this will try to add duplicate representations.

Check that group 1 was not modified by appending it to group 2.

Try to append a group that is not a subclass of OsgGroup

Add an OSG and non-OSG representation to this group.