Fixed CTests bugs, minor plugin enhancements, and removed old files

- Fixed incorrect message buffer size in sendCTRL function.
 - Fixed a bug in sendCTRLTest where not all DREF sizes were being set.
 - Increased message buffer size in sendReadTest to account for assumptions made by sendUDP.
 - Fixed a bug in updateLog where the log message would sometimes start with several null characters, causing the log message to be effectively ignored by fprintf.

 - The xpcPlugin Visual Studio solution now supports 32 bit and 64 bit builds.
 - Logging performed by the plugin now works correctly on Windows.
 - Long log messages are now truncated to 500 characters. Previously, messages over 500 characters would be omitted, and an error message logged in their place.

 - Several files which were incorrectly added to source control have been deleted.
This commit is contained in:
Jason Watkins
2015-03-24 13:12:17 -07:00
parent 88e659d62c
commit fbeb297717
17 changed files with 25 additions and 68 deletions

View File

@@ -272,28 +272,19 @@ int updateLog(const char *buffer, int length)
time_t rawtime;
struct tm * timeinfo;
char logBuffer[522] = {0};
char logBuffer[523] = { 0 };
FILE * logFile;
char errorMessage[100] = "Log Message Omitted-Too Long (500 character max)";
logFile = fopen("xpcLog.txt","a");
time(&rawtime);
timeinfo = localtime(&rawtime);
#if defined _WIN32
// strftime(logBuffer,500,"[%F %T] ",timeinfo);
#else
strftime(logBuffer,500,"[%F %T] ",timeinfo);
#endif
// Format is equivalent to [%F %T], but neither of those specifiers is
// supported on Windows as of Visual Studio 13
strftime(logBuffer, 523, "[%Y-%m-%d %H:%M:%S] ", timeinfo);
if (length <= 500)
{
memcpy(&(logBuffer[22]),buffer,length);
}
else
{
memcpy(&(logBuffer[22]),errorMessage,strlen(errorMessage));
}
length = length < 500 ? length : 500;
memcpy(&(logBuffer[22]), buffer, length);
fprintf(logFile,"%s\n",logBuffer);