This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Opened 18 years ago

Closed 18 years ago

Last modified 14 years ago

#158 closed defect (fixed)

CLogger unit test failure on Linux

Reported by: Philip Taylor Owned by: Philip Taylor
Priority: Should Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

The tests fail, probably because of differences between vsnprintf2 (the implementation used on Windows, based on MSVC's _vsnprintf) and vsnprintf (as implemented in glibc) in handling strings that are larger than the buffer.

../../../source/ps/tests/../../../source/ps/tests/test_CLogger.h:46: Error: Expected (lines[1] == msg1), found ("******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************" != "*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************")
../../../source/ps/tests/../../../source/ps/tests/test_CLogger.h:47: Error: Expected (lines[2] == clipped), found ("******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************" != "****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************...")
../../../source/ps/tests/../../../source/ps/tests/test_CLogger.h:48: Error: Expected (lines[3] == clipped), found ("******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************" != "****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************...")

Change History (3)

comment:1 by Philip Taylor, 18 years ago

Type: taskdefect

comment:2 by philip, 18 years ago

Resolution: fixed
Status: newclosed

(In [4625]) # Fixed string handling for Windows/Linux compatibility.

  • vsnprintf2: Made compatible between GCC and MSVC - it now always null-terminates the buffer, and returns -1 on overflow. Fixes #158. Added tests.
  • MeshManager: Use shared_ptr.expired() instead of checking for bad_weak_ptr exception.
  • Xeromyces: Added tests for GetXMBPath, because it does unusual things in sscanf which MSVC's /analyze complains about.
  • ConfigDB, ScriptGlue: Replaced some asserts with return-on-failure, to avoid invalid array accesses when continuing after the assert (as complained about by /analyze).
  • CStr: Removed "using namespace std". Added tests for handling of invalid UTF-8.

comment:3 by (none), 14 years ago

Milestone: ASAP

Milestone ASAP deleted

Note: See TracTickets for help on using tickets.