From: hama Date: Tue, 6 Jan 2015 10:35:19 +0000 (+0100) Subject: cunit test clean X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=7d306d4e93bc28fe7f1ae20b56a7a3e6a64aa738;p=crepublib cunit test clean --- diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp index 0a3b117..ed3223d 100644 --- a/os/ReDirTools.cpp +++ b/os/ReDirTools.cpp @@ -608,6 +608,10 @@ const ReStringList& ReDirStatistic::calculate(const char* base, int level, ReByteBuffer line; int traceCount = 0; while( (entry = traverser.rawNextFile(currentDepth))){ + //@todo + ReByteBuffer dummy(entry->m_path); dummy.append(entry->node()); + int passNo = entry->m_passNo; + const char* dummyStr = dummy.str(); if (currentDepth <= level && ! entry->m_path.equals(current->m_path)){ if (currentDepth <= topOfStack){ // close the entries of the stack above the new top level: @@ -630,9 +634,6 @@ const ReStringList& ReDirStatistic::calculate(const char* base, int level, // set up a new stack entry: if (currentDepth != topOfStack + 1) assert(currentDepth == topOfStack + 1); - //@todo - if (strstr("dir2", entry->node()) != NULL || strstr("dir2", entry->m_path.str())) - ReByteBuffer breaker; topOfStack++; if (dataStack[topOfStack] == NULL) diff --git a/os/ReTraverser.cpp b/os/ReTraverser.cpp index e690258..3d4d6d1 100644 --- a/os/ReTraverser.cpp +++ b/os/ReTraverser.cpp @@ -126,6 +126,7 @@ bool ReDirStatus_t::findFirst(){ closedir(m_handle); m_handle = opendir(m_path.str()); rc = m_handle != NULL && (m_data = readdir(m_handle)) != NULL; + m_status.st_ino = 0; #elif defined __WIN32__ if (m_handle != INVALID_HANDLE_VALUE) FindClose(m_handle); @@ -145,6 +146,7 @@ bool ReDirStatus_t::findFirst(){ bool ReDirStatus_t::findNext(){ #if defined __linux__ bool rc = m_handle != NULL && (m_data = readdir(m_handle)) != NULL; + m_status.st_ino = 0; #elif defined __WIN32__ bool rc = m_handle != INVALID_HANDLE_VALUE && FindNextFileA(m_handle, &m_data); #endif @@ -191,7 +193,8 @@ ReDirStatus_t::Type_t ReDirStatus_t::type(){ */ bool ReDirStatus_t::isDirectory() { #ifdef __linux__ - return (m_data->d_type != DT_UNKNOWN && m_data->d_type == DT_DIR) || S_ISDIR(getStatus()->st_mode); + return m_data->d_type == DT_DIR + || (m_data->d_type == DT_UNKNOWN && S_ISDIR(getStatus()->st_mode)); #elif defined __WIN32__ return 0 != (m_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); #endif @@ -206,7 +209,8 @@ bool ReDirStatus_t::isDirectory() { bool ReDirStatus_t::isLink() { bool rc; #ifdef __linux__ - rc = (m_data->d_type != DT_UNKNOWN && m_data->d_type == DT_LNK) || S_ISLNK(getStatus()->st_mode); + rc = m_data->d_type == DT_LNK + || (m_data->d_type == DT_UNKNOWN && S_ISLNK(getStatus()->st_mode)); #elif defined __WIN32__ rc = 0 != (m_data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT); #endif @@ -219,7 +223,8 @@ bool ReDirStatus_t::isLink() { */ bool ReDirStatus_t::isRegular() { #ifdef __linux__ - return (m_data->d_type != DT_UNKNOWN && m_data->d_type == DT_REG) || S_ISREG(getStatus()->st_mode); + return m_data->d_type == DT_REG + || (m_data->d_type == DT_UNKNOWN && S_ISREG(getStatus()->st_mode)); #elif defined __WIN32__ return 0 == (m_data.dwFileAttributes & (FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)); #endif