Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[tests] Do not export SSU_SANDBOX_DIR manually
Somehow I forgot to refactorize this in past. Available since 8b12419.
  • Loading branch information
martyone committed May 24, 2013
1 parent 7ad0e01 commit 096ff63
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/ut_ssuurlresolver/ssuurlresolvertest.cpp
Expand Up @@ -12,6 +12,8 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"

/**
* @class SsuUrlResolverTest
* @brief Tests libzypp UrlResolverPlugin plugin compatibility
Expand All @@ -20,8 +22,17 @@
*/

void SsuUrlResolverTest::initTestCase(){
m_sandbox = new Sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseDirectly, Sandbox::ChildProcesses);
if (!m_sandbox->activate()){
QFAIL("Failed to activate sandbox");
}
setenv("LD_PRELOAD", qPrintable(QString("%1/libsandboxhook.so").arg(TESTS_PATH)), 1);
setenv("SSU_SANDBOX_DIR", qPrintable(QString("%1/configroot").arg(TESTS_DATA_PATH)), 1);
}

void SsuUrlResolverTest::cleanupTestCase(){
delete m_sandbox;
m_sandbox = 0;
}

void SsuUrlResolverTest::test_data(){
Expand Down
7 changes: 7 additions & 0 deletions tests/ut_ssuurlresolver/ssuurlresolvertest.h
Expand Up @@ -10,15 +10,22 @@

#include <QObject>

class Sandbox;

class SsuUrlResolverTest: public QObject {
Q_OBJECT

public:
SsuUrlResolverTest(): m_sandbox(0) {}

private slots:
void initTestCase();
void cleanupTestCase();
void test_data();
void test();

private:
Sandbox *m_sandbox;
};

#endif

0 comments on commit 096ff63

Please sign in to comment.