Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tests #244

Merged
merged 4 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Application_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
#include "ignition/gui/Plugin.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Application_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/MainWindow_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

std::string kTestConfigFile = "/tmp/ign-gui-test.config"; // NOLINT(*)
int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./MainWindow_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ Plugin::Plugin() : dataPtr(new PluginPrivate)
/////////////////////////////////////////////////
Plugin::~Plugin()
{
delete this->dataPtr->pluginItem;
if (this->dataPtr->pluginItem)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. The pluginItem is initialized to nullptr, and using delete on a nullptr shouldn't have any impact.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also curious about why this was added. But it shouldn't hurt, so I'm ok leaving it in.

delete this->dataPtr->pluginItem;
}

/////////////////////////////////////////////////
Expand Down
5 changes: 4 additions & 1 deletion src/Plugin_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#include "ignition/gui/Plugin.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Plugin_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/ign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#include "ignition/gui/MainWindow.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./ignition")),
};

//////////////////////////////////////////////////
extern "C" IGNITION_GUI_VISIBLE char *ignitionVersion()
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/publisher/Publisher_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
#include "Publisher.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Publisher_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/screenshot/Screenshot_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
#include "Screenshot.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Screenshot_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/topic_viewer/TopicViewer_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@


int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./TopicViewer_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/world_control/WorldControl_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#include "WorldControl.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./WorldControl_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/world_stats/WorldStats_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#include "WorldStats.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./WorldStats_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion test/integration/Examples_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
#include "ignition/gui/Application.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Examples_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down
5 changes: 4 additions & 1 deletion test/integration/scene3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
#include "ignition/gui/MainWindow.hh"

int g_argc = 1;
char **g_argv = new char *[g_argc];
char* g_argv[] =
{
reinterpret_cast<char*>(const_cast<char*>("./Scene3d_TEST")),
};

using namespace ignition;
using namespace gui;
Expand Down