Skip to content

Commit

Permalink
only daliinit and use critical section
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed May 23, 2024
1 parent 89bef7d commit 5cf5897
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions testing/unittests/dalitests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ static unsigned initCounter = 0; // counter for initialiser
// Declared in dadfs.cpp *only* when CPPUNIT is active
extern void removeLogical(const char *fname, IUserDescriptor *user);

CriticalSection crit;
void daliClientInit()
{
CriticalBlock b(crit);
// Only initialise on first pass
if (initCounter != 0)
return;
Expand All @@ -74,6 +76,7 @@ void daliClientInit()

void daliClientEnd()
{
CriticalBlock b(crit);
if (!initCounter)
return;
else if (1 == initCounter) // Only destroy on last pass
Expand Down Expand Up @@ -3045,7 +3048,7 @@ class CSysInfoLoggerTester : public CppUnit::TestFixture
/* Note: All global messages with time stamp before before 2000-02-29 will be deleted */
CPPUNIT_TEST_SUITE(CSysInfoLoggerTester);
CPPUNIT_TEST(testInit);
CPPUNIT_TEST(testSysInfoLogger);
// CPPUNIT_TEST(testSysInfoLogger);
CPPUNIT_TEST_SUITE_END();

struct TestCase
Expand Down Expand Up @@ -3287,7 +3290,7 @@ class CSysInfoLoggerTester : public CppUnit::TestFixture
};

CPPUNIT_TEST_SUITE_REGISTRATION( CSysInfoLoggerTester );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CSysInfoLoggerTester, "CSysInfoLogger" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CSysInfoLoggerTester, "CSysInfoLoggerTester" );


#endif // _USE_CPPUNIT

0 comments on commit 5cf5897

Please sign in to comment.