Commit 85d78c16d97d5b397489efa0fb8e15b5c1838a12

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Thu Jul 08 13:58:25 CEST 2010
Added some improvements for the tests

Now using define for SIGUSR1 instead of hardcoded value
Made sure to remove the target file before copying (otherwise we got an
error)
Increased timeouts
tests/jsloggertests.cpp
(7 / 4)
  
3232#include <iostream>
3333#include <fstream>
3434
35#include <signal.h>
36
3537#include "core/base.h"
3638#include "core/scripting/scriptobject.h"
3739#include "core/scripting/jslogger.h"
183183
184184 BOOST_CHECK(fs::exists(getTempDir() + "blalog"));
185185
186 fs::copy_file(getTempDir() + "blalog", "blalog1");
186 fs::remove(getTempDir() + "blalog1");
187 fs::copy_file(getTempDir() + "blalog", getTempDir() + "blalog1");
187188 fs::remove(getTempDir() + "blalog");
188189
189190 boost::shared_ptr<Event> pEvent(new Event("SIGNAL"));
190 pEvent->setProperty("signum", "10");
191 pEvent->setProperty("signum", intToString(SIGUSR1));
191192 queue.pushEvent(pEvent);
192193
193 sleepMS(1000);
194 sleepMS(3000);
194195
195196 {
196197 boost::scoped_ptr<ScriptContext> ctx(env->getContext());
206206
207207 queue.shutdown();
208208 interpreter.terminate();
209 sleepMS(1500);
209 sleepMS(2500);
210210}
211211
212212BOOST_AUTO_TEST_SUITE_END()