Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5200: ScriptCommands don't need to register the command to the Event…
…Manager.

Disable the sound module in the unit test environment.
  • Loading branch information
codereader committed Sep 17, 2020
1 parent 439e6f1 commit b375759
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions plugins/script/ScriptCommand.cpp
@@ -1,9 +1,9 @@
#include "ScriptCommand.h"

#include "icommandsystem.h"
#include "ieventmanager.h"

namespace script {
namespace script
{

ScriptCommand::ScriptCommand(const std::string& name,
const std::string& displayName,
Expand All @@ -18,9 +18,6 @@ ScriptCommand::ScriptCommand(const std::string& name,

ScriptCommand::~ScriptCommand()
{
// Add an event as well (for keyboard shortcuts)
GlobalEventManager().removeEvent(_name);

GlobalCommandSystem().removeCommand(_name);
}

Expand Down
7 changes: 5 additions & 2 deletions test/RadiantTest.h
Expand Up @@ -30,8 +30,11 @@ class RadiantTest :
protected:
RadiantTest()
{
// Initialise the context
_context.initialise(0, nullptr);
// Initialise the context, disable the sound player
std::string exePath("ignored");
std::string arg("--disable-sound");
char* args[] = { exePath.data(), arg.data() };
_context.initialise(2, args);

try
{
Expand Down

0 comments on commit b375759

Please sign in to comment.