fix coding style
This commit is contained in:
@@ -109,9 +109,10 @@ CallbackTest::IsWrong (void)
|
||||
!m_test4 ||
|
||||
!gTest5 ||
|
||||
!gTest6 ||
|
||||
!gTest7) {
|
||||
!gTest7)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,9 +159,10 @@ CallbackTest::RunTests (void)
|
||||
f0 (1);
|
||||
g0 (1);
|
||||
|
||||
if (IsWrong ()) {
|
||||
if (IsWrong ())
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reset ();
|
||||
|
||||
@@ -184,9 +186,10 @@ CallbackTest::RunTests (void)
|
||||
|
||||
Callback<void, int64_t,int64_t> a2;
|
||||
|
||||
if (IsWrong ()) {
|
||||
if (IsWrong ())
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,11 +99,12 @@ private:
|
||||
m_objPtr = o.m_objPtr;
|
||||
}
|
||||
void RemoveFromList (void) {
|
||||
if (m_prev == this) {
|
||||
if (m_prev == this)
|
||||
{
|
||||
//assert (m_next == this);
|
||||
delete m_objPtr;
|
||||
m_objPtr = OBJ_PTR ();
|
||||
}
|
||||
}
|
||||
m_prev->m_next = m_next;
|
||||
m_next->m_prev = m_prev;
|
||||
}
|
||||
|
||||
@@ -40,10 +40,11 @@ TestManager::TestManager ()
|
||||
TestManager::~TestManager ()
|
||||
{
|
||||
TestsI i = m_tests.begin ();
|
||||
while (i != m_tests.end ()) {
|
||||
while (i != m_tests.end ())
|
||||
{
|
||||
delete (*i).second;
|
||||
i = m_tests.erase (i);
|
||||
}
|
||||
}
|
||||
}
|
||||
void
|
||||
TestManager::Add (Test *test, char const *name)
|
||||
@@ -69,22 +70,29 @@ bool
|
||||
TestManager::RealRunTests (void)
|
||||
{
|
||||
bool isSuccess = true;
|
||||
for (TestsCI i = m_tests.begin (); i != m_tests.end (); i++) {
|
||||
for (TestsCI i = m_tests.begin (); i != m_tests.end (); i++)
|
||||
{
|
||||
std::string *testName = (*i).second;
|
||||
if (!(*i).first->RunTests ()) {
|
||||
if (!(*i).first->RunTests ())
|
||||
{
|
||||
isSuccess = false;
|
||||
if (m_verbose) {
|
||||
if (m_verbose)
|
||||
{
|
||||
std::cerr << "FAIL " << *testName << std::endl;
|
||||
}
|
||||
} else {
|
||||
if (m_verbose) {
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_verbose)
|
||||
{
|
||||
std::cerr << "PASS "<<*testName << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isSuccess) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isSuccess)
|
||||
{
|
||||
std::cerr << "FAIL" << std::endl;
|
||||
}
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,19 +81,21 @@ SystemFilePrivate::Open (char const *filename)
|
||||
void
|
||||
SystemFilePrivate::Write (uint8_t const*buffer, uint32_t size)
|
||||
{
|
||||
while (size > 0) {
|
||||
while (size > 0)
|
||||
{
|
||||
uint32_t toCopy = min (BUFFER_SIZE - m_current, size);
|
||||
memcpy (m_data + m_current, buffer, toCopy);
|
||||
size -= toCopy;
|
||||
m_current += toCopy;
|
||||
buffer += toCopy;
|
||||
if (m_current == BUFFER_SIZE) {
|
||||
if (m_current == BUFFER_SIZE)
|
||||
{
|
||||
ssize_t written = 0;
|
||||
written = ::write (m_fd, m_data, BUFFER_SIZE);
|
||||
assert (written == BUFFER_SIZE);
|
||||
m_current = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SystemFile::SystemFile ()
|
||||
|
||||
Reference in New Issue
Block a user