Ignore some VS warnings coming from the tests

These warnings can't be fixed in the current signal system that
interntionally relies on casting
0.8
Bruno Van de Velde 2016-09-15 15:12:05 +02:00
parent 5a6824e823
commit 8e95f6eaeb
3 changed files with 23 additions and 4 deletions

View File

@ -25,7 +25,13 @@
#include "Tests.hpp"
#include <TGUI/Widgets/Button.hpp>
TEST_CASE("[Signal]") {
// Ignore warning "C4800: 'const int': forcing value to bool 'true' or 'false'" in Visual Studio
#if defined _MSC_VER
#pragma warning(disable : 4800)
#endif
TEST_CASE("[Signal]")
{
tgui::Widget::Ptr widget = tgui::ClickableWidget::create();
/*
@ -87,7 +93,8 @@ TODO: More tests:
// try testing with multiple operator() overloads
*/
SECTION("connect") {
SECTION("connect")
{
unsigned int id = widget->connect("PositionChanged", [](){});
REQUIRE(widget->connect("SizeChanged", [](){}) == ++id);
REQUIRE(widget->connect("Focused", [](){}) == ++id);
@ -113,7 +120,8 @@ TODO: More tests:
REQUIRE(widget->connect("All", [](){}) > id+3);
}
SECTION("connectEx") {
SECTION("connectEx")
{
unsigned int id = widget->connectEx("PositionChanged", [](const tgui::Callback&){});
REQUIRE(widget->connectEx("SizeChanged", [](const tgui::Callback&){}) == ++id);
REQUIRE(widget->connectEx("Focused", [](const tgui::Callback&){}) == ++id);
@ -133,7 +141,8 @@ TODO: More tests:
REQUIRE(widget->connectEx("All", [](const tgui::Callback&){}) > id+5);
}
SECTION("disconnect") {
SECTION("disconnect")
{
unsigned int i = 0;
unsigned int id = widget->connect("PositionChanged", [&](){ i++; });

View File

@ -25,6 +25,11 @@
#include "../Tests.hpp"
#include <TGUI/Widgets/CheckBox.hpp>
// Ignore warning "C4800: 'const int': forcing value to bool 'true' or 'false'" in Visual Studio
#if defined _MSC_VER
#pragma warning(disable : 4800)
#endif
TEST_CASE("[CheckBox]")
{
tgui::CheckBox::Ptr checkBox = tgui::CheckBox::create();

View File

@ -25,6 +25,11 @@
#include "../Tests.hpp"
#include <TGUI/Widgets/RadioButton.hpp>
// Ignore warning "C4800: 'const int': forcing value to bool 'true' or 'false'" in Visual Studio
#if defined _MSC_VER
#pragma warning(disable : 4800)
#endif
TEST_CASE("[RadioButton]")
{
tgui::RadioButton::Ptr radioButton = tgui::RadioButton::create();