#include "gate/tests.hpp"
#include "gate/io/videosources.hpp"
using namespace gate;
using namespace gate::io;
GATEXX_TEST_UNIT(VideoFrame)
{
VideoFormat format;
format.frames_per_second = 30.0f;
format.width = 640;
format.height = 480;
format.bits_per_pixel = 32;
GATEXX_TEST_CHECK(format.hashCode() != 0);
{
const VideoFormat format2(format);
VideoFormat format3;
format3 = format2;<--- Variable 'format3' is reassigned a value before the old one has been used.
format3 = format;<--- Variable 'format3' is reassigned a value before the old one has been used.
GATEXX_TEST_CHECK_EQUAL(format.encoding_id, format3.encoding_id);
GATEXX_TEST_CHECK_EQUAL(format.compression, format3.compression);
GATEXX_TEST_CHECK_EQUAL(format.frames_per_second, format3.frames_per_second);
GATEXX_TEST_CHECK_EQUAL(format.width, format3.width);
GATEXX_TEST_CHECK_EQUAL(format.height, format3.height);
GATEXX_TEST_CHECK_EQUAL(format.bits_per_pixel, format3.bits_per_pixel);
}
VideoFrame frame(format);
GATEXX_TEST_CHECK(frame.c_impl() != NULL);
GATEXX_TEST_CHECK_NOTHROW(frame.getFormat());
GATEXX_TEST_CHECK_NOTHROW(frame.getImage());
GATEXX_TEST_CHECK_NOTHROW(frame.getRecordTime());
{
VideoFrame frame2(frame);
VideoFrame frame3(format);
frame3 = frame2;
GATEXX_TEST_CHECK_EQUAL(frame3.getFormat().hashCode(), frame.getFormat().hashCode());
}
}
GATEXX_TEST_UNIT(VideoSource)
{
Array<VideoSource> sources;
GATEXX_TRY_IGNORE(sources = VideoSources::enumSources());
GATEXX_ENUMERATE(const VideoSource, source, sources.enumerate())
{
GATEXX_TEST_CHECK(source->c_impl() != NULL);
}
}
GATEXX_TEST_UNIT(VideoScreenControl)
{
GATEXX_TRY_IGNORE(
VideoScreenControl control;
control.c_impl();
)
}