paysages3d/src/tests/AtmosphereDefinition_Test.cpp

37 lines
757 B
C++
Raw Normal View History

2014-08-28 13:09:47 +00:00
#include "BaseTestCase.h"
#include "AtmosphereDefinition.h"
TEST(AtmosphereDefinition, setDaytime)
{
AtmosphereDefinition atmo(NULL);
atmo.setDaytime(0.0);
EXPECT_EQ(atmo.hour, 0);
EXPECT_EQ(atmo.minute, 0);
atmo.setDaytime(0.1);
EXPECT_EQ(atmo.hour, 2);
EXPECT_EQ(atmo.minute, 24);
atmo.setDaytime(0.25);
EXPECT_EQ(atmo.hour, 6);
EXPECT_EQ(atmo.minute, 0);
atmo.setDaytime(0.5);
EXPECT_EQ(atmo.hour, 12);
EXPECT_EQ(atmo.minute, 0);
atmo.setDaytime(1.0);
EXPECT_EQ(atmo.hour, 0);
EXPECT_EQ(atmo.minute, 0);
atmo.setDaytime(-0.5);
EXPECT_EQ(atmo.hour, 12);
EXPECT_EQ(atmo.minute, 0);
atmo.setDaytime(1.5);
EXPECT_EQ(atmo.hour, 12);
EXPECT_EQ(atmo.minute, 0);
}