1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-15 01:04:37 +02:00

Require type for FUNCTION_TEST_RETURN*() macros.

This allows code to run after the return type has been generated in the case where it is an expression.

No new functionality here yet, but this will be used by a future commit that audits memory usage.
This commit is contained in:
David Steele
2022-04-24 19:19:46 -04:00
parent 91bbe81059
commit 1e2b545ba4
100 changed files with 725 additions and 676 deletions

View File

@ -66,7 +66,7 @@ yamlNew(const Buffer *const buffer)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN_TYPE_P(Yaml, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -81,38 +81,38 @@ yamlEventType(yaml_event_type_t type)
switch (type) switch (type)
{ {
case YAML_STREAM_START_EVENT: case YAML_STREAM_START_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeStreamBegin); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeStreamBegin);
case YAML_STREAM_END_EVENT: case YAML_STREAM_END_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeStreamEnd); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeStreamEnd);
case YAML_DOCUMENT_START_EVENT: case YAML_DOCUMENT_START_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeDocBegin); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeDocBegin);
case YAML_DOCUMENT_END_EVENT: case YAML_DOCUMENT_END_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeDocEnd); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeDocEnd);
case YAML_ALIAS_EVENT: case YAML_ALIAS_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeAlias); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeAlias);
case YAML_SCALAR_EVENT: case YAML_SCALAR_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeScalar); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeScalar);
case YAML_SEQUENCE_START_EVENT: case YAML_SEQUENCE_START_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeSeqBegin); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeSeqBegin);
case YAML_SEQUENCE_END_EVENT: case YAML_SEQUENCE_END_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeSeqEnd); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeSeqEnd);
case YAML_MAPPING_START_EVENT: case YAML_MAPPING_START_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeMapBegin); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeMapBegin);
case YAML_MAPPING_END_EVENT: case YAML_MAPPING_END_EVENT:
FUNCTION_TEST_RETURN(yamlEventTypeMapEnd); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeMapEnd);
default: default:
CHECK(FormatError, type == YAML_NO_EVENT, "expected yaml no event"); CHECK(FormatError, type == YAML_NO_EVENT, "expected yaml no event");
FUNCTION_TEST_RETURN(yamlEventTypeNone); FUNCTION_TEST_RETURN_TYPE(YamlEventType, yamlEventTypeNone);
} }
} }
@ -149,7 +149,7 @@ yamlEventNext(Yaml *this)
yaml_event_delete(&event); yaml_event_delete(&event);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(YamlEvent, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -164,7 +164,7 @@ yamlEventNextCheck(Yaml *this, YamlEventType type)
YamlEvent result = yamlEventNext(this); YamlEvent result = yamlEventNext(this);
yamlEventCheck(result, type); yamlEventCheck(result, type);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(YamlEvent, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -195,9 +195,9 @@ yamlBoolParse(YamlEvent event)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
if (strEq(event.value, FALSE_STR)) if (strEq(event.value, FALSE_STR))
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
else if (strEq(event.value, TRUE_STR)) else if (strEq(event.value, TRUE_STR))
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
THROW_FMT(FormatError, "invalid boolean '%s'", strZ(event.value)); THROW_FMT(FormatError, "invalid boolean '%s'", strZ(event.value));
} }

View File

@ -50,7 +50,8 @@ archiveAsyncSpoolQueue(ArchiveMode archiveMode)
FUNCTION_TEST_PARAM(STRING_ID, archiveMode); FUNCTION_TEST_PARAM(STRING_ID, archiveMode);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN((archiveMode == archiveModeGet ? STORAGE_SPOOL_ARCHIVE_IN_STR : STORAGE_SPOOL_ARCHIVE_OUT_STR)); FUNCTION_TEST_RETURN_CONST(
STRING, archiveMode == archiveModeGet ? STORAGE_SPOOL_ARCHIVE_IN_STR : STORAGE_SPOOL_ARCHIVE_OUT_STR);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -887,7 +887,7 @@ static ProtocolParallelJob *archiveGetAsyncCallback(void *data, unsigned int cli
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
void void

View File

@ -88,7 +88,7 @@ archivePushFileIo(ArchivePushFileIoType type, IoWrite *write, const Buffer *buff
} }
TRY_END(); TRY_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -48,7 +48,7 @@ archivePushDropWarning(const String *walFile, uint64_t queueMax)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
strNewFmt("dropped WAL file '%s' because archive queue exceeded %s", strZ(walFile), strZ(strSizeFormat(queueMax)))); STRING, strNewFmt("dropped WAL file '%s' because archive queue exceeded %s", strZ(walFile), strZ(strSizeFormat(queueMax))));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -502,7 +502,7 @@ archivePushAsyncCallback(void *data, unsigned int clientIdx)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
void void

View File

@ -1414,7 +1414,7 @@ backupProcessFilePrimary(RegExp *const standbyExp, const String *const name)
ASSERT(name != NULL); ASSERT(name != NULL);
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
strEqZ(name, MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL) || !regExpMatch(standbyExp, name)); BOOL, strEqZ(name, MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL) || !regExpMatch(standbyExp, name));
} }
// Comparator to order ManifestFile objects by size, date, and name // Comparator to order ManifestFile objects by size, date, and name
@ -1442,22 +1442,22 @@ backupProcessQueueComparator(const void *item1, const void *item2)
file2.size > backupProcessQueueComparatorBundleLimit) file2.size > backupProcessQueueComparatorBundleLimit)
{ {
if (file1.size < file2.size) if (file1.size < file2.size)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
else if (file1.size > file2.size) else if (file1.size > file2.size)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
} }
// If bundling order by time ascending so that older files are bundled with older files and newer with newer // If bundling order by time ascending so that older files are bundled with older files and newer with newer
if (backupProcessQueueComparatorBundle) if (backupProcessQueueComparatorBundle)
{ {
if (file1.timestamp > file2.timestamp) if (file1.timestamp > file2.timestamp)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
else if (file1.timestamp < file2.timestamp) else if (file1.timestamp < file2.timestamp)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
} }
// If size/time is the same then use name to generate a deterministic ordering (names must be unique) // If size/time is the same then use name to generate a deterministic ordering (names must be unique)
FUNCTION_TEST_RETURN(strCmp(file1.name, file2.name)); FUNCTION_TEST_RETURN(INT, strCmp(file1.name, file2.name));
} }
// Helper to generate the backup queues // Helper to generate the backup queues
@ -1610,11 +1610,11 @@ backupJobQueueNext(unsigned int clientIdx, int queueIdx, unsigned int queueTotal
// Deal with wrapping on either end // Deal with wrapping on either end
if (queueIdx < 0) if (queueIdx < 0)
FUNCTION_TEST_RETURN((int)queueTotal - 1); FUNCTION_TEST_RETURN(INT, (int)queueTotal - 1);
else if (queueIdx == (int)queueTotal) else if (queueIdx == (int)queueTotal)
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(INT, 0);
FUNCTION_TEST_RETURN(queueIdx); FUNCTION_TEST_RETURN(INT, queueIdx);
} }
// Callback to fetch backup jobs for the parallel executor // Callback to fetch backup jobs for the parallel executor
@ -1734,7 +1734,7 @@ static ProtocolParallelJob *backupJobCallback(void *data, unsigned int clientIdx
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
static void static void

View File

@ -32,7 +32,7 @@ segmentNumber(const String *pgFile)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
// Determine which segment number this is by checking for a numeric extension. No extension means segment 0. // Determine which segment number this is by checking for a numeric extension. No extension means segment 0.
FUNCTION_TEST_RETURN(regExpMatchOne(STRDEF("\\.[0-9]+$"), pgFile) ? cvtZToUInt(strrchr(strZ(pgFile), '.') + 1) : 0); FUNCTION_TEST_RETURN(UINT, regExpMatchOne(STRDEF("\\.[0-9]+$"), pgFile) ? cvtZToUInt(strrchr(strZ(pgFile), '.') + 1) : 0);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -37,7 +37,7 @@ checkArchiveCommand(const String *archiveCommand)
archiveCommand != NULL ? strZ(archiveCommand) : "[" NULL_Z "]", PROJECT_BIN); archiveCommand != NULL ? strZ(archiveCommand) : "[" NULL_Z "]", PROJECT_BIN);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -155,7 +155,7 @@ cmdOption(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(cmdOptionStr); FUNCTION_TEST_RETURN(STRING, cmdOptionStr);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -18,7 +18,7 @@ lockStopFileName(const String *stanza)
String *result = strNewFmt("%s/%s" STOP_FILE_EXT, strZ(cfgOptionStr(cfgOptLockPath)), stanza != NULL ? strZ(stanza) : "all"); String *result = strNewFmt("%s/%s" STOP_FILE_EXT, strZ(cfgOptionStr(cfgOptLockPath)), stanza != NULL ? strZ(stanza) : "all");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -90,7 +90,7 @@ helpRenderSplitSize(const String *string, const char *delimiter, size_t size)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING_LIST, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -777,7 +777,7 @@ stanzaInfoList(List *stanzaRepoList, const String *backupLabel, unsigned int rep
varLstAdd(result, stanzaInfo); varLstAdd(result, stanzaInfo);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -684,7 +684,7 @@ restoreManifestOwnerReplace(const String *const owner, const String *const owner
FUNCTION_TEST_PARAM(STRING, ownerDefaultRoot); FUNCTION_TEST_PARAM(STRING, ownerDefaultRoot);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(userRoot() ? (owner == NULL ? ownerDefaultRoot : owner) : NULL); FUNCTION_TEST_RETURN_CONST(STRING, userRoot() ? (owner == NULL ? ownerDefaultRoot : owner) : NULL);
} }
// Helper to get list of owners from a file/link/path list // Helper to get list of owners from a file/link/path list
@ -1934,54 +1934,54 @@ restoreProcessQueueComparator(const void *item1, const void *item2)
if (file1.size == 0) if (file1.size == 0)
{ {
if (file2.size != 0) if (file2.size != 0)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
} }
else if (file2.size == 0) else if (file2.size == 0)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
// If the bundle id differs that is enough to determine order // If the bundle id differs that is enough to determine order
if (file1.bundleId < file2.bundleId) if (file1.bundleId < file2.bundleId)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
else if (file1.bundleId > file2.bundleId) else if (file1.bundleId > file2.bundleId)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
// If the bundle ids are 0 // If the bundle ids are 0
if (file1.bundleId == 0) if (file1.bundleId == 0)
{ {
// If the size differs then that's enough to determine order // If the size differs then that's enough to determine order
if (file1.size < file2.size) if (file1.size < file2.size)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
else if (file1.size > file2.size) else if (file1.size > file2.size)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
// If size is the same then use name to generate a deterministic ordering (names must be unique) // If size is the same then use name to generate a deterministic ordering (names must be unique)
ASSERT(!strEq(file1.name, file2.name)); ASSERT(!strEq(file1.name, file2.name));
FUNCTION_TEST_RETURN(strCmp(file1.name, file2.name)); FUNCTION_TEST_RETURN(INT, strCmp(file1.name, file2.name));
} }
// If the reference differs that is enough to determine order // If the reference differs that is enough to determine order
if (file1.reference == NULL) if (file1.reference == NULL)
{ {
if (file2.reference != NULL) if (file2.reference != NULL)
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
} }
else if (file2.reference == NULL) else if (file2.reference == NULL)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
else else
{ {
const int backupLabelCmp = strCmp(file1.reference, file2.reference) * -1; const int backupLabelCmp = strCmp(file1.reference, file2.reference) * -1;
if (backupLabelCmp != 0) if (backupLabelCmp != 0)
FUNCTION_TEST_RETURN(backupLabelCmp); FUNCTION_TEST_RETURN(INT, backupLabelCmp);
} }
// Finally order by bundle offset // Finally order by bundle offset
ASSERT(file1.bundleOffset != file2.bundleOffset); ASSERT(file1.bundleOffset != file2.bundleOffset);
if (file1.bundleOffset < file2.bundleOffset) if (file1.bundleOffset < file2.bundleOffset)
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
} }
static uint64_t static uint64_t
@ -2081,6 +2081,7 @@ restoreFileZeroed(const String *manifestName, RegExp *zeroExp)
ASSERT(manifestName != NULL); ASSERT(manifestName != NULL);
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
BOOL,
zeroExp == NULL ? false : regExpMatch(zeroExp, manifestName) && !strEndsWith(manifestName, STRDEF("/" PG_FILE_PGVERSION))); zeroExp == NULL ? false : regExpMatch(zeroExp, manifestName) && !strEndsWith(manifestName, STRDEF("/" PG_FILE_PGVERSION)));
} }
@ -2101,7 +2102,7 @@ restoreFilePgPath(const Manifest *manifest, const String *manifestName)
if (strEq(manifestName, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL))) if (strEq(manifestName, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)))
result = strNewFmt("%s." STORAGE_FILE_TEMP_EXT, strZ(result)); result = strNewFmt("%s." STORAGE_FILE_TEMP_EXT, strZ(result));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
static uint64_t static uint64_t
@ -2235,11 +2236,11 @@ restoreJobQueueNext(unsigned int clientIdx, int queueIdx, unsigned int queueTota
// Deal with wrapping on either end // Deal with wrapping on either end
if (queueIdx < 0) if (queueIdx < 0)
FUNCTION_TEST_RETURN((int)queueTotal - 1); FUNCTION_TEST_RETURN(INT, (int)queueTotal - 1);
else if (queueIdx == (int)queueTotal) else if (queueIdx == (int)queueTotal)
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(INT, 0);
FUNCTION_TEST_RETURN(queueIdx); FUNCTION_TEST_RETURN(INT, queueIdx);
} }
// Callback to fetch restore jobs for the parallel executor // Callback to fetch restore jobs for the parallel executor
@ -2363,7 +2364,7 @@ static ProtocolParallelJob *restoreJobCallback(void *data, unsigned int clientId
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -31,7 +31,7 @@ cipherPassGen(CipherType cipherType)
result = strNewEncode(encodeBase64, BUF(buffer, sizeof(buffer))); result = strNewEncode(encodeBase64, BUF(buffer, sizeof(buffer)));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -61,5 +61,5 @@ pgValidate(void)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(PgControl, result);
} }

View File

@ -91,7 +91,7 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
else else
result = true; result = true;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -179,7 +179,7 @@ verifyFileLoad(const String *pathFileName, const String *cipherPass)
if (compressTypeFromName(pathFileName) != compressTypeNone) if (compressTypeFromName(pathFileName) != compressTypeNone)
ioFilterGroupAdd(ioReadFilterGroup(read), decompressFilter(compressTypeFromName(pathFileName))); ioFilterGroupAdd(ioReadFilterGroup(read), decompressFilter(compressTypeFromName(pathFileName)));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STORAGE_READ, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -805,7 +805,7 @@ verifyArchive(void *data)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1050,7 +1050,7 @@ verifyBackup(void *data)
break; break;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1090,7 +1090,7 @@ verifyJobCallback(void *data, unsigned int clientIdx)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1114,7 +1114,7 @@ verifyErrorMsg(VerifyResult verifyResult)
else else
result = strCatZ(result, "invalid result"); result = strCatZ(result, "invalid result");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1138,14 +1138,12 @@ verifyLogInvalidResult(const String *fileType, VerifyResult verifyResult, unsign
if (strEq(fileType, STORAGE_REPO_ARCHIVE_STR) && verifyResult == verifyFileMissing) if (strEq(fileType, STORAGE_REPO_ARCHIVE_STR) && verifyResult == verifyFileMissing)
{ {
LOG_WARN_PID_FMT(processId, "%s '%s'", strZ(verifyErrorMsg(verifyResult)), strZ(filePathName)); LOG_WARN_PID_FMT(processId, "%s '%s'", strZ(verifyErrorMsg(verifyResult)), strZ(filePathName));
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(UINT, 0);
}
else
{
LOG_ERROR_PID_FMT(
processId, errorTypeCode(&FileInvalidError), "%s '%s'", strZ(verifyErrorMsg(verifyResult)), strZ(filePathName));
FUNCTION_TEST_RETURN(1);
} }
LOG_ERROR_PID_FMT(
processId, errorTypeCode(&FileInvalidError), "%s '%s'", strZ(verifyErrorMsg(verifyResult)), strZ(filePathName));
FUNCTION_TEST_RETURN(UINT, 1);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1220,7 +1218,7 @@ verifySetBackupCheckArchive(
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1399,7 +1397,7 @@ verifyRender(List *archiveIdResultList, List *backupResultList)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -71,5 +71,5 @@ bz2Error(int error)
THROWP_FMT(errorType, "bz2 error: [%d] %s", error, errorMsg); THROWP_FMT(errorType, "bz2 error: [%d] %s", error, errorMsg);
} }
FUNCTION_TEST_RETURN(error); FUNCTION_TEST_RETURN(INT, error);
} }

View File

@ -135,7 +135,7 @@ bz2CompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -152,7 +152,7 @@ bz2CompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -122,7 +122,7 @@ bz2DecompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -139,7 +139,7 @@ bz2DecompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -140,7 +140,7 @@ gzCompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -157,7 +157,7 @@ gzCompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -122,7 +122,7 @@ gzDecompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -139,7 +139,7 @@ gzDecompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -122,7 +122,7 @@ compressTypeEnum(const StringId type)
if (result == LENGTH_OF(compressHelperLocal)) if (result == LENGTH_OF(compressHelperLocal))
THROW_FMT(AssertError, "invalid compression type '%s'", strZ(strIdToStr(type))); THROW_FMT(AssertError, "invalid compression type '%s'", strZ(strIdToStr(type)));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(ENUM, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -151,7 +151,7 @@ compressTypeStr(CompressType type)
ASSERT(type < LENGTH_OF(compressHelperLocal)); ASSERT(type < LENGTH_OF(compressHelperLocal));
FUNCTION_TEST_RETURN(compressHelperLocal[type].type); FUNCTION_TEST_RETURN_CONST(STRING, compressHelperLocal[type].type);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -173,7 +173,7 @@ compressTypeFromName(const String *name)
if (result == LENGTH_OF(compressHelperLocal)) if (result == LENGTH_OF(compressHelperLocal))
result = compressTypeNone; result = compressTypeNone;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(ENUM, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -187,7 +187,7 @@ compressLevelDefault(CompressType type)
ASSERT(type < LENGTH_OF(compressHelperLocal)); ASSERT(type < LENGTH_OF(compressHelperLocal));
compressTypePresent(type); compressTypePresent(type);
FUNCTION_TEST_RETURN(compressHelperLocal[type].levelDefault); FUNCTION_TEST_RETURN(INT, compressHelperLocal[type].levelDefault);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -203,7 +203,7 @@ compressFilter(CompressType type, int level)
ASSERT(type != compressTypeNone); ASSERT(type != compressTypeNone);
compressTypePresent(type); compressTypePresent(type);
FUNCTION_TEST_RETURN(compressHelperLocal[type].compressNew(level)); FUNCTION_TEST_RETURN(IO_FILTER, compressHelperLocal[type].compressNew(level));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -256,7 +256,7 @@ decompressFilter(CompressType type)
ASSERT(type != compressTypeNone); ASSERT(type != compressTypeNone);
compressTypePresent(type); compressTypePresent(type);
FUNCTION_TEST_RETURN(compressHelperLocal[type].decompressNew()); FUNCTION_TEST_RETURN(IO_FILTER, compressHelperLocal[type].decompressNew());
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -269,7 +269,7 @@ compressExtStr(CompressType type)
ASSERT(type < LENGTH_OF(compressHelperLocal)); ASSERT(type < LENGTH_OF(compressHelperLocal));
FUNCTION_TEST_RETURN(compressHelperLocal[type].ext); FUNCTION_TEST_RETURN_CONST(STRING, compressHelperLocal[type].ext);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -302,5 +302,5 @@ compressExtStrip(const String *file, CompressType type)
if (!strEndsWith(file, compressExtStr(type))) if (!strEndsWith(file, compressExtStr(type)))
THROW_FMT(FormatError, "'%s' must have '%s' extension", strZ(file), strZ(compressExtStr(type))); THROW_FMT(FormatError, "'%s' must have '%s' extension", strZ(file), strZ(compressExtStr(type)));
FUNCTION_TEST_RETURN(strSubN(file, 0, strSize(file) - strSize(compressExtStr(type)))); FUNCTION_TEST_RETURN(STRING, strSubN(file, 0, strSize(file) - strSize(compressExtStr(type))));
} }

View File

@ -21,7 +21,7 @@ lz4Error(LZ4F_errorCode_t error)
if (LZ4F_isError(error)) if (LZ4F_isError(error))
THROW_FMT(FormatError, "lz4 error: [%zd] %s", (ssize_t)error, LZ4F_getErrorName(error)); THROW_FMT(FormatError, "lz4 error: [%zd] %s", (ssize_t)error, LZ4F_getErrorName(error));
FUNCTION_TEST_RETURN(error); FUNCTION_TEST_RETURN_TYPE(LZ4F_errorCode_t, error);
} }
#endif // HAVE_LIBLZ4 #endif // HAVE_LIBLZ4

View File

@ -103,7 +103,7 @@ lz4CompressBuffer(Lz4Compress *this, size_t required, Buffer *output)
result = this->buffer; result = this->buffer;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BUFFER, result);
} }
// Helper to flush output data to compressed buffer // Helper to flush output data to compressed buffer
@ -221,7 +221,7 @@ lz4CompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->flushing && !this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->flushing && !this->inputSame);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -238,7 +238,7 @@ lz4CompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -135,7 +135,7 @@ lz4DecompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -152,7 +152,7 @@ lz4DecompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -26,7 +26,7 @@ zstError(size_t error)
if (ZSTD_isError(error)) if (ZSTD_isError(error))
THROW_FMT(FormatError, "zst error: [%zd] %s", (ssize_t)error, ZSTD_getErrorName(error)); THROW_FMT(FormatError, "zst error: [%zd] %s", (ssize_t)error, ZSTD_getErrorName(error));
FUNCTION_TEST_RETURN(error); FUNCTION_TEST_RETURN(SIZE, error);
} }
#endif // HAVE_LIBZST #endif // HAVE_LIBZST

View File

@ -142,7 +142,7 @@ zstCompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->flushing && !this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->flushing && !this->inputSame);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -159,7 +159,7 @@ zstCompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -134,7 +134,7 @@ zstDecompressDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done); FUNCTION_TEST_RETURN(BOOL, this->done);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -151,7 +151,7 @@ zstDecompressInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -360,7 +360,7 @@ cipherBlockDone(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->done && !this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->done && !this->inputSame);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -377,7 +377,7 @@ cipherBlockInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -81,7 +81,7 @@ bool
cryptoIsInit(void) cryptoIsInit(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(cryptoInitDone); FUNCTION_TEST_RETURN(BOOL, cryptoInitDone);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -327,17 +327,49 @@ Ignore DEBUG_TEST_TRACE_MACRO if DEBUG is not defined because the underlying fun
FUNCTION_TEST_BEGIN(); \ FUNCTION_TEST_BEGIN(); \
FUNCTION_TEST_END(); FUNCTION_TEST_END();
#define FUNCTION_TEST_RETURN(...) \ #define FUNCTION_TEST_RETURN_TYPE_BASE(typePre, type, typePost, ...) \
do \ do \
{ \ { \
/* CHECK for presense of FUNCTION_TEST_BEGIN*() */ \ /* CHECK for presense of FUNCTION_TEST_BEGIN*() */ \
(void)FUNCTION_TEST_BEGIN_exists; \ (void)FUNCTION_TEST_BEGIN_exists; \
\ \
typePre type typePost FUNCTION_TEST_result = __VA_ARGS__; \
\
STACK_TRACE_POP(true); \ STACK_TRACE_POP(true); \
return __VA_ARGS__; \ \
return FUNCTION_TEST_result; \
} \ } \
while (0) while (0)
#define FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(typePre, typeMacroPrefix, typePost, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(typePre, FUNCTION_LOG_##typeMacroPrefix##_TYPE, typePost, __VA_ARGS__)
#define FUNCTION_TEST_RETURN(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(, typeMacroPrefix, , __VA_ARGS__)
#define FUNCTION_TEST_RETURN_P(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(, typeMacroPrefix, *, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_PP(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(, typeMacroPrefix, **, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_CONST(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(const, typeMacroPrefix, , __VA_ARGS__)
#define FUNCTION_TEST_RETURN_CONST_P(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(const, typeMacroPrefix, *, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_CONST_PP(typeMacroPrefix, ...) \
FUNCTION_TEST_RETURN_TYPE_MACRO_BASE(const, typeMacroPrefix, **, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(, type, , __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE_P(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(, type, *, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE_PP(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(, type, **, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE_CONST(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(const, type, , __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE_CONST_P(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(const, type, *, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_TYPE_CONST_PP(type, ...) \
FUNCTION_TEST_RETURN_TYPE_BASE(const, type, **, __VA_ARGS__)
#define FUNCTION_TEST_RETURN_VOID() \ #define FUNCTION_TEST_RETURN_VOID() \
do \ do \
{ \ { \
@ -355,8 +387,33 @@ Ignore DEBUG_TEST_TRACE_MACRO if DEBUG is not defined because the underlying fun
#define FUNCTION_TEST_PARAM_PP(typeMacroPrefix, param) #define FUNCTION_TEST_PARAM_PP(typeMacroPrefix, param)
#define FUNCTION_TEST_END() #define FUNCTION_TEST_END()
#define FUNCTION_TEST_VOID() #define FUNCTION_TEST_VOID()
#define FUNCTION_TEST_RETURN(...) \
#define FUNCTION_TEST_RETURN(typeMacroPrefix, ...) \
return __VA_ARGS__ return __VA_ARGS__
#define FUNCTION_TEST_RETURN_P(typeMacroPrefix, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_PP(typeMacroPrefix, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_CONST(typeMacroPrefix, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_CONST_P(typeMacroPrefix, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_CONST_PP(typeMacroPrefix, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE_P(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE_PP(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE_CONST(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE_CONST_P(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_TYPE_CONST_PP(type, ...) \
return __VA_ARGS__
#define FUNCTION_TEST_RETURN_VOID() \ #define FUNCTION_TEST_RETURN_VOID() \
return return
#endif // DEBUG_TEST_TRACE_MACRO #endif // DEBUG_TEST_TRACE_MACRO

View File

@ -95,7 +95,7 @@ encodeToStrSizeBase64(size_t sourceSize)
encodeGroupTotal++; encodeGroupTotal++;
// Four characters are needed to encode each group // Four characters are needed to encode each group
FUNCTION_TEST_RETURN(encodeGroupTotal * 4); FUNCTION_TEST_RETURN(SIZE, encodeGroupTotal * 4);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -221,7 +221,7 @@ decodeToBinSizeBase64(const char *source)
destinationSize--; destinationSize--;
} }
FUNCTION_TEST_RETURN(destinationSize); FUNCTION_TEST_RETURN(SIZE, destinationSize);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -311,7 +311,7 @@ encodeToStrSizeBase64Url(size_t sourceSize)
break; break;
} }
FUNCTION_TEST_RETURN(encodeTotal); FUNCTION_TEST_RETURN(SIZE, encodeTotal);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -367,7 +367,7 @@ encodeToStrSize(EncodeType type, size_t sourceSize)
break; break;
} }
FUNCTION_TEST_RETURN(destinationSize); FUNCTION_TEST_RETURN(SIZE, destinationSize);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -418,5 +418,5 @@ decodeToBinSize(EncodeType type, const char *source)
ASSERT_MSG("unsupported"); ASSERT_MSG("unsupported");
} }
FUNCTION_TEST_RETURN(destinationSize); FUNCTION_TEST_RETURN(SIZE, destinationSize);
} }

View File

@ -294,7 +294,7 @@ execFdRead(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fdRead); FUNCTION_TEST_RETURN(INT, this->fdRead);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -46,7 +46,7 @@ exitSignalName(SignalType signalType)
THROW(AssertError, "no name for signal none"); THROW(AssertError, "no name for signal none");
} }
FUNCTION_TEST_RETURN(name); FUNCTION_TEST_RETURN_CONST(STRINGZ, name);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -88,6 +88,7 @@ exitErrorDetail(void)
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
STRING,
strCatFmt( strCatFmt(
strNew(), strNew(),
"--------------------------------------------------------------------\n" "--------------------------------------------------------------------\n"

View File

@ -40,7 +40,7 @@ iniNew(void)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(INI, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -73,7 +73,7 @@ iniGetInternal(const Ini *this, const String *section, const String *key, bool r
if (result == NULL && required) if (result == NULL && required)
THROW_FMT(FormatError, "section '%s', key '%s' does not exist", strZ(section), strZ(key)); THROW_FMT(FormatError, "section '%s', key '%s' does not exist", strZ(section), strZ(key));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(VARIANT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -86,14 +86,7 @@ iniGet(const Ini *this, const String *section, const String *key)
FUNCTION_TEST_PARAM(STRING, key); FUNCTION_TEST_PARAM(STRING, key);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
ASSERT(this != NULL); FUNCTION_TEST_RETURN_CONST(STRING, varStr(iniGetInternal(this, section, key, true)));
ASSERT(section != NULL);
ASSERT(key != NULL);
// Get the value
const Variant *result = iniGetInternal(this, section, key, true);
FUNCTION_TEST_RETURN(varStr(result));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -107,14 +100,10 @@ iniGetDefault(const Ini *this, const String *section, const String *key, const S
FUNCTION_TEST_PARAM(STRING, defaultValue); FUNCTION_TEST_PARAM(STRING, defaultValue);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
ASSERT(this != NULL);
ASSERT(section != NULL);
ASSERT(key != NULL);
// Get the value // Get the value
const Variant *result = iniGetInternal(this, section, key, false); const Variant *result = iniGetInternal(this, section, key, false);
FUNCTION_TEST_RETURN(result == NULL ? defaultValue : varStr(result)); FUNCTION_TEST_RETURN_CONST(STRING, result == NULL ? defaultValue : varStr(result));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -127,14 +116,10 @@ iniGetList(const Ini *this, const String *section, const String *key)
FUNCTION_TEST_PARAM(STRING, key); FUNCTION_TEST_PARAM(STRING, key);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
ASSERT(this != NULL);
ASSERT(section != NULL);
ASSERT(key != NULL);
// Get the value // Get the value
const Variant *result = iniGetInternal(this, section, key, false); const Variant *result = iniGetInternal(this, section, key, false);
FUNCTION_TEST_RETURN(result == NULL ? NULL : strLstNewVarLst(varVarLst(result))); FUNCTION_TEST_RETURN(STRING_LIST, result == NULL ? NULL : strLstNewVarLst(varVarLst(result)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -147,14 +132,10 @@ iniSectionKeyIsList(const Ini *this, const String *section, const String *key)
FUNCTION_TEST_PARAM(STRING, key); FUNCTION_TEST_PARAM(STRING, key);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
ASSERT(this != NULL);
ASSERT(section != NULL);
ASSERT(key != NULL);
// Get the value // Get the value
const Variant *result = iniGetInternal(this, section, key, true); const Variant *result = iniGetInternal(this, section, key, true);
FUNCTION_TEST_RETURN(varType(result) == varTypeVariantList); FUNCTION_TEST_RETURN(BOOL, varType(result) == varTypeVariantList);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -187,7 +168,7 @@ iniSectionKeyList(const Ini *this, const String *section)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -211,7 +192,7 @@ iniSectionList(const Ini *this)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -58,7 +58,7 @@ fdReadyRetry(int pollResult, int errNo, bool first, TimeMSec *timeout, TimeMSec
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
bool bool

View File

@ -139,7 +139,7 @@ ioFdReadFd(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fd); FUNCTION_TEST_RETURN(INT, this->fd);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -97,7 +97,7 @@ ioFdWriteFd(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fd); FUNCTION_TEST_RETURN(INT, this->fd);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -99,7 +99,7 @@ ioBufferInputSame(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->inputSame); FUNCTION_TEST_RETURN(BOOL, this->inputSame);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -123,7 +123,7 @@ ioFilterDone(const IoFilter *this)
if (this->flushing) if (this->flushing)
result = this->pub.interface.done != NULL ? this->pub.interface.done(this->pub.driver) : !ioFilterInputSame(this); result = this->pub.interface.done != NULL ? this->pub.interface.done(this->pub.driver) : !ioFilterInputSame(this);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -136,7 +136,7 @@ ioFilterInputSame(const IoFilter *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->pub.interface.inputSame != NULL ? this->pub.interface.inputSame(this->pub.driver) : false); FUNCTION_TEST_RETURN(BOOL, this->pub.interface.inputSame != NULL ? this->pub.interface.inputSame(this->pub.driver) : false);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -149,7 +149,7 @@ ioFilterResult(const IoFilter *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->pub.interface.result ? this->pub.interface.result(this->pub.driver) : NULL); FUNCTION_TEST_RETURN(PACK, this->pub.interface.result ? this->pub.interface.result(this->pub.driver) : NULL);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -142,7 +142,7 @@ ioFilterGroupGet(const IoFilterGroup *this, unsigned int filterIdx)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN((IoFilterData *)lstGet(this->pub.filterList, filterIdx)); FUNCTION_TEST_RETURN(IO_FILTER_DATA, (IoFilterData *)lstGet(this->pub.filterList, filterIdx));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -49,7 +49,7 @@ httpDateToTime(const String *lastModified)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(TIME, result);
} }
String * String *
@ -63,6 +63,7 @@ httpDateFromTime(const time_t time)
gmtime_r(&time, &timePart); gmtime_r(&time, &timePart);
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
STRING,
strNewFmt( strNewFmt(
"%s, %02d %s %04d %02d:%02d:%02d GMT", httpCommonDayList[timePart.tm_wday], timePart.tm_mday, "%s, %02d %s %04d %02d:%02d:%02d GMT", httpCommonDayList[timePart.tm_wday], timePart.tm_mday,
httpCommonMonthList[timePart.tm_mon], timePart.tm_year + 1900, timePart.tm_hour, timePart.tm_min, httpCommonMonthList[timePart.tm_mon], timePart.tm_year + 1900, timePart.tm_hour, timePart.tm_min,
@ -111,7 +112,7 @@ httpUriDecode(const String *uri)
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -147,5 +148,5 @@ httpUriEncode(const String *uri, bool path)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }

View File

@ -38,7 +38,7 @@ httpHeaderNew(const StringList *redactList)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_HEADER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -68,7 +68,7 @@ httpHeaderDup(const HttpHeader *header, const StringList *redactList)
OBJ_NEW_END(); OBJ_NEW_END();
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_HEADER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -108,7 +108,7 @@ httpHeaderAdd(HttpHeader *this, const String *key, const String *value)
else else
kvPut(this->kv, keyVar, VARSTR(value)); kvPut(this->kv, keyVar, VARSTR(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_HEADER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -123,7 +123,7 @@ httpHeaderGet(const HttpHeader *this, const String *key)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(key != NULL); ASSERT(key != NULL);
FUNCTION_TEST_RETURN(varStr(kvGet(this->kv, VARSTR(key)))); FUNCTION_TEST_RETURN_CONST(STRING, varStr(kvGet(this->kv, VARSTR(key))));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -136,7 +136,7 @@ httpHeaderList(const HttpHeader *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(strLstSort(strLstNewVarLst(kvKeyList(this->kv)), sortOrderAsc)); FUNCTION_TEST_RETURN(STRING_LIST, strLstSort(strLstNewVarLst(kvKeyList(this->kv)), sortOrderAsc));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -156,7 +156,7 @@ httpHeaderPut(HttpHeader *this, const String *key, const String *value)
// Store the key // Store the key
kvPut(this->kv, VARSTR(key), VARSTR(value)); kvPut(this->kv, VARSTR(key), VARSTR(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_HEADER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -182,7 +182,7 @@ httpHeaderPutRange(HttpHeader *const this, const uint64_t offset, const Variant
httpHeaderPut(this, HTTP_HEADER_RANGE_STR, range); httpHeaderPut(this, HTTP_HEADER_RANGE_STR, range);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_HEADER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -197,7 +197,7 @@ httpHeaderRedact(const HttpHeader *this, const String *key)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(key != NULL); ASSERT(key != NULL);
FUNCTION_TEST_RETURN(this->redactList != NULL && strLstExists(this->redactList, key)); FUNCTION_TEST_RETURN(BOOL, this->redactList != NULL && strLstExists(this->redactList, key));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -40,7 +40,7 @@ httpQueryNew(HttpQueryNewParam param)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -92,7 +92,7 @@ httpQueryNewStr(const String *query)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -122,7 +122,7 @@ httpQueryDup(const HttpQuery *query, HttpQueryDupParam param)
OBJ_NEW_END(); OBJ_NEW_END();
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -148,7 +148,7 @@ httpQueryAdd(HttpQuery *this, const String *key, const String *value)
// Store the key // Store the key
kvPut(this->kv, keyVar, VARSTR(value)); kvPut(this->kv, keyVar, VARSTR(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -163,7 +163,7 @@ httpQueryGet(const HttpQuery *this, const String *key)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(key != NULL); ASSERT(key != NULL);
FUNCTION_TEST_RETURN(varStr(kvGet(this->kv, VARSTR(key)))); FUNCTION_TEST_RETURN_CONST(STRING, varStr(kvGet(this->kv, VARSTR(key))));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -176,7 +176,7 @@ httpQueryList(const HttpQuery *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(strLstSort(strLstNewVarLst(kvKeyList(this->kv)), sortOrderAsc)); FUNCTION_TEST_RETURN(STRING_LIST, strLstSort(strLstNewVarLst(kvKeyList(this->kv)), sortOrderAsc));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -204,7 +204,7 @@ httpQueryMerge(HttpQuery *this, const HttpQuery *query)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -224,7 +224,7 @@ httpQueryPut(HttpQuery *this, const String *key, const String *value)
// Store the key // Store the key
kvPut(this->kv, VARSTR(key), VARSTR(value)); kvPut(this->kv, VARSTR(key), VARSTR(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_QUERY, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -239,7 +239,7 @@ httpQueryRedact(const HttpQuery *this, const String *key)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(key != NULL); ASSERT(key != NULL);
FUNCTION_TEST_RETURN(this->redactList != NULL && strLstExists(this->redactList, key)); FUNCTION_TEST_RETURN(BOOL, this->redactList != NULL && strLstExists(this->redactList, key));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -284,7 +284,7 @@ httpQueryRender(const HttpQuery *this, HttpQueryRenderParam param)
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -395,7 +395,7 @@ httpResponseContent(HttpResponse *this)
} }
} }
FUNCTION_TEST_RETURN(this->content); FUNCTION_TEST_RETURN(BUFFER, this->content);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -72,7 +72,7 @@ httpSessionIoRead(HttpSession *const this, const HttpSessionIoReadParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(ioSessionIoReadP(this->ioSession, .ignoreUnexpectedEof = param.ignoreUnexpectedEof)); FUNCTION_TEST_RETURN(IO_READ, ioSessionIoReadP(this->ioSession, .ignoreUnexpectedEof = param.ignoreUnexpectedEof));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -85,5 +85,5 @@ httpSessionIoWrite(HttpSession *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(ioSessionIoWrite(this->ioSession)); FUNCTION_TEST_RETURN(IO_WRITE, ioSessionIoWrite(this->ioSession));
} }

View File

@ -191,7 +191,7 @@ httpUrlNewParse(const String *const url, HttpUrlNewParseParam param)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(HTTP_URL, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -27,7 +27,7 @@ size_t
ioBufferSize(void) ioBufferSize(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(bufferSize); FUNCTION_TEST_RETURN(SIZE, bufferSize);
} }
void void
@ -47,7 +47,7 @@ TimeMSec
ioTimeoutMs(void) ioTimeoutMs(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(timeoutMs); FUNCTION_TEST_RETURN(TIME_MSEC, timeoutMs);
} }
void void
@ -92,7 +92,7 @@ ioReadBuf(IoRead *read)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BUFFER, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -170,5 +170,5 @@ ioReadDrain(IoRead *read)
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }

View File

@ -264,7 +264,7 @@ ioReadSmall(IoRead *this, Buffer *buffer)
} }
while (!bufFull(buffer) && !ioReadEof(this)); while (!bufFull(buffer) && !ioReadEof(this));
FUNCTION_TEST_RETURN(outputRemains - bufRemains(buffer)); FUNCTION_TEST_RETURN(SIZE, outputRemains - bufRemains(buffer));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -72,7 +72,7 @@ ioSessionFd(IoSession *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->pub.interface->fd == NULL ? -1 : this->pub.interface->fd(this->pub.driver)); FUNCTION_TEST_RETURN(INT, this->pub.interface->fd == NULL ? -1 : this->pub.interface->fd(this->pub.driver));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -146,7 +146,7 @@ sckClientName(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->name); FUNCTION_TEST_RETURN_CONST(STRING, this->name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -129,7 +129,7 @@ sckServerName(THIS_VOID)
ASSERT(this != NULL); // {vm_covered} ASSERT(this != NULL); // {vm_covered}
FUNCTION_TEST_RETURN(this->name); // {vm_covered} FUNCTION_TEST_RETURN_CONST(STRING, this->name); // {vm_covered}
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -101,7 +101,7 @@ sckSessionFd(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fd); FUNCTION_TEST_RETURN(INT, this->fd);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -117,7 +117,7 @@ sckSessionIoRead(THIS_VOID, const bool ignoreUnexpectedEof)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->read); FUNCTION_TEST_RETURN(IO_READ, this->read);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -132,7 +132,7 @@ sckSessionIoWrite(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->write); FUNCTION_TEST_RETURN(IO_WRITE, this->write);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -147,7 +147,7 @@ sckSessionRole(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->role); FUNCTION_TEST_RETURN(STRING_ID, this->role);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -329,7 +329,7 @@ tlsClientName(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(ioClientName(this->ioClient)); FUNCTION_TEST_RETURN_CONST(STRING, ioClientName(this->ioClient));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -27,6 +27,7 @@ tlsAsn1ToStr(ASN1_STRING *const nameAsn1)
THROW(CryptoError, "TLS certificate name entry is missing"); THROW(CryptoError, "TLS certificate name entry is missing");
FUNCTION_TEST_RETURN( // {vm_covered} FUNCTION_TEST_RETURN( // {vm_covered}
STRING,
strNewZN( strNewZN(
#if OPENSSL_VERSION_NUMBER < 0x10100000L #if OPENSSL_VERSION_NUMBER < 0x10100000L
(const char *)ASN1_STRING_data(nameAsn1), (const char *)ASN1_STRING_data(nameAsn1),
@ -70,7 +71,7 @@ tlsCertCommonName(X509 *const certificate)
// Check for NULLs in the name // Check for NULLs in the name
tlsCertNameVerify(result); // {vm_covered} tlsCertNameVerify(result); // {vm_covered}
FUNCTION_TEST_RETURN(result); // {vm_covered} FUNCTION_TEST_RETURN(STRING, result); // {vm_covered}
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -182,5 +183,5 @@ tlsContext(void)
// Disable auto-retry to prevent SSL_read() from hanging // Disable auto-retry to prevent SSL_read() from hanging
SSL_CTX_clear_mode(result, SSL_MODE_AUTO_RETRY); SSL_CTX_clear_mode(result, SSL_MODE_AUTO_RETRY);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE_P(SSL_CTX, result);
} }

View File

@ -247,7 +247,7 @@ tlsServerName(THIS_VOID)
ASSERT(this != NULL); // {vm_covered} ASSERT(this != NULL); // {vm_covered}
FUNCTION_TEST_RETURN(this->host); // {vm_covered} FUNCTION_TEST_RETURN_CONST(STRING, this->host); // {vm_covered}
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -314,7 +314,7 @@ tlsSessionIoRead(THIS_VOID, const bool ignoreUnexpectedEof)
this->ignoreUnexpectedEof = ignoreUnexpectedEof; this->ignoreUnexpectedEof = ignoreUnexpectedEof;
FUNCTION_TEST_RETURN(this->read); FUNCTION_TEST_RETURN(IO_READ, this->read);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -329,7 +329,7 @@ tlsSessionIoWrite(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->write); FUNCTION_TEST_RETURN(IO_WRITE, this->write);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -344,7 +344,7 @@ tlsSessionRole(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(ioSessionRole(this->ioSession)); FUNCTION_TEST_RETURN(STRING_ID, ioSessionRole(this->ioSession));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -67,7 +67,7 @@ lockFileName(const String *const stanza, const LockType lockType)
FUNCTION_TEST_PARAM(ENUM, lockType); FUNCTION_TEST_PARAM(ENUM, lockType);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(strNewFmt("%s-%s" LOCK_FILE_EXT, strZ(stanza), lockTypeName[lockType])); FUNCTION_TEST_RETURN(STRING, strNewFmt("%s-%s" LOCK_FILE_EXT, strZ(stanza), lockTypeName[lockType]));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -124,7 +124,7 @@ logLevelEnum(const StringId logLevelId)
// Check that the log level was found // Check that the log level was found
CHECK(AssertError, result != LOG_LEVEL_TOTAL, "invalid log level"); CHECK(AssertError, result != LOG_LEVEL_TOTAL, "invalid log level");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(ENUM, result);
} }
const char * const char *
@ -136,7 +136,7 @@ logLevelStr(LogLevel logLevel)
ASSERT(logLevel <= LOG_LEVEL_MAX); ASSERT(logLevel <= LOG_LEVEL_MAX);
FUNCTION_TEST_RETURN(logLevelList[logLevel].name); FUNCTION_TEST_RETURN_CONST(STRINGZ, logLevelList[logLevel].name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -165,7 +165,7 @@ logAny(LogLevel logLevel)
ASSERT_LOG_LEVEL(logLevel); ASSERT_LOG_LEVEL(logLevel);
FUNCTION_TEST_RETURN(logLevel <= logLevelAny); FUNCTION_TEST_RETURN(BOOL, logLevel <= logLevelAny);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -260,7 +260,7 @@ logFileSet(const char *logFile)
logAnySet(); logAnySet();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -295,7 +295,7 @@ logRange(LogLevel logLevel, LogLevel logRangeMin, LogLevel logRangeMax)
ASSERT_LOG_LEVEL(logRangeMax); ASSERT_LOG_LEVEL(logRangeMax);
ASSERT(logRangeMin <= logRangeMax); ASSERT(logRangeMin <= logRangeMax);
FUNCTION_TEST_RETURN(logLevel >= logRangeMin && logLevel <= logRangeMax); FUNCTION_TEST_RETURN(BOOL, logLevel >= logRangeMin && logLevel <= logRangeMax);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -442,7 +442,7 @@ logPre(LogLevel logLevel, unsigned int processId, const char *fileName, const ch
functionName); functionName);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(LogPreResult, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -118,7 +118,7 @@ memAllocInternal(size_t size)
THROW_FMT(MemoryError, "unable to allocate %zu bytes", size); THROW_FMT(MemoryError, "unable to allocate %zu bytes", size);
// Return the buffer // Return the buffer
FUNCTION_TEST_RETURN(buffer); FUNCTION_TEST_RETURN_P(VOID, buffer);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -139,7 +139,7 @@ memAllocPtrArrayInternal(size_t size)
buffer[ptrIdx] = NULL; buffer[ptrIdx] = NULL;
// Return the buffer // Return the buffer
FUNCTION_TEST_RETURN(buffer); FUNCTION_TEST_RETURN_P(VOID, buffer);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -163,7 +163,7 @@ memReAllocInternal(void *bufferOld, size_t sizeNew)
THROW_FMT(MemoryError, "unable to reallocate %zu bytes", sizeNew); THROW_FMT(MemoryError, "unable to reallocate %zu bytes", sizeNew);
// Return the buffer // Return the buffer
FUNCTION_TEST_RETURN(bufferNew); FUNCTION_TEST_RETURN_P(VOID, bufferNew);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -186,7 +186,7 @@ memReAllocPtrArrayInternal(void *bufferOld, size_t sizeOld, size_t sizeNew)
bufferNew[ptrIdx] = NULL; bufferNew[ptrIdx] = NULL;
// Return the buffer // Return the buffer
FUNCTION_TEST_RETURN(bufferNew); FUNCTION_TEST_RETURN_P(VOID, bufferNew);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -252,7 +252,7 @@ memContextNewIndex(MemContext *memContext)
} }
} }
FUNCTION_TEST_RETURN(memContext->contextChildFreeIdx); FUNCTION_TEST_RETURN(UINT, memContext->contextChildFreeIdx);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -308,7 +308,7 @@ memContextNew(const char *const name, const MemContextNewParam param)
}; };
// Return context // Return context
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(MEM_CONTEXT, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -322,7 +322,7 @@ memContextAllocExtra(MemContext *const this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(this->allocExtra != 0); ASSERT(this->allocExtra != 0);
FUNCTION_TEST_RETURN(this + 1); FUNCTION_TEST_RETURN_P(VOID, this + 1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -336,7 +336,7 @@ memContextFromAllocExtra(void *const allocExtra)
ASSERT(allocExtra != NULL); ASSERT(allocExtra != NULL);
ASSERT(((MemContext *)allocExtra - 1)->allocExtra != 0); ASSERT(((MemContext *)allocExtra - 1)->allocExtra != 0);
FUNCTION_TEST_RETURN((MemContext *)allocExtra - 1); FUNCTION_TEST_RETURN(MEM_CONTEXT, (MemContext *)allocExtra - 1);
} }
const MemContext * const MemContext *
@ -349,7 +349,7 @@ memContextConstFromAllocExtra(const void *const allocExtra)
ASSERT(allocExtra != NULL); ASSERT(allocExtra != NULL);
ASSERT(((MemContext *)allocExtra - 1)->allocExtra != 0); ASSERT(((MemContext *)allocExtra - 1)->allocExtra != 0);
FUNCTION_TEST_RETURN((MemContext *)allocExtra - 1); FUNCTION_TEST_RETURN(MEM_CONTEXT, (MemContext *)allocExtra - 1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -466,7 +466,7 @@ memContextAllocNew(size_t size)
// Update free index to next location. This location may not actually be free but it is where the search should start next time. // Update free index to next location. This location may not actually be free but it is where the search should start next time.
contextCurrent->allocFreeIdx++; contextCurrent->allocFreeIdx++;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE_P(MemContextAlloc, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -489,7 +489,7 @@ memContextAllocResize(MemContextAlloc *alloc, size_t size)
// Update pointer in allocation list in case the realloc moved the allocation // Update pointer in allocation list in case the realloc moved the allocation
memContextStack[memContextCurrentStackIdx].memContext->allocList[alloc->allocIdx] = alloc; memContextStack[memContextCurrentStackIdx].memContext->allocList[alloc->allocIdx] = alloc;
FUNCTION_TEST_RETURN(alloc); FUNCTION_TEST_RETURN_TYPE_P(MemContextAlloc, alloc);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -500,7 +500,7 @@ memNew(size_t size)
FUNCTION_TEST_PARAM(SIZE, size); FUNCTION_TEST_PARAM(SIZE, size);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(MEM_CONTEXT_ALLOC_BUFFER(memContextAllocNew(size))); FUNCTION_TEST_RETURN_P(VOID, MEM_CONTEXT_ALLOC_BUFFER(memContextAllocNew(size)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -518,7 +518,7 @@ memNewPtrArray(size_t size)
for (size_t ptrIdx = 0; ptrIdx < size; ptrIdx++) for (size_t ptrIdx = 0; ptrIdx < size; ptrIdx++)
buffer[ptrIdx] = NULL; buffer[ptrIdx] = NULL;
FUNCTION_TEST_RETURN(buffer); FUNCTION_TEST_RETURN_P(VOID, buffer);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -530,7 +530,7 @@ memResize(const void *buffer, size_t size)
FUNCTION_TEST_PARAM(SIZE, size); FUNCTION_TEST_PARAM(SIZE, size);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(MEM_CONTEXT_ALLOC_BUFFER(memContextAllocResize(MEM_CONTEXT_ALLOC_HEADER(buffer), size))); FUNCTION_TEST_RETURN_P(VOID, MEM_CONTEXT_ALLOC_BUFFER(memContextAllocResize(MEM_CONTEXT_ALLOC_HEADER(buffer), size)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -694,7 +694,7 @@ MemContext *
memContextTop(void) memContextTop(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(&contextTop); FUNCTION_TEST_RETURN(MEM_CONTEXT, &contextTop);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -702,7 +702,7 @@ MemContext *
memContextCurrent(void) memContextCurrent(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(memContextStack[memContextCurrentStackIdx].memContext); FUNCTION_TEST_RETURN(MEM_CONTEXT, memContextStack[memContextCurrentStackIdx].memContext);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -715,7 +715,7 @@ memContextFreeing(const MemContext *const this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->state == memContextStateFreeing); FUNCTION_TEST_RETURN(BOOL, this->state == memContextStateFreeing);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -732,7 +732,7 @@ memContextName(const MemContext *const this)
if (this->state != memContextStateActive) if (this->state != memContextStateActive)
THROW(AssertError, "cannot get name for inactive context"); THROW(AssertError, "cannot get name for inactive context");
FUNCTION_TEST_RETURN(this->name); FUNCTION_TEST_RETURN_CONST(STRINGZ, this->name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -748,7 +748,7 @@ memContextPrior(void)
while (memContextStack[memContextCurrentStackIdx - priorIdx].type == memContextStackTypeNew) while (memContextStack[memContextCurrentStackIdx - priorIdx].type == memContextStackTypeNew)
priorIdx++; priorIdx++;
FUNCTION_TEST_RETURN(memContextStack[memContextCurrentStackIdx - priorIdx].memContext); FUNCTION_TEST_RETURN(MEM_CONTEXT, memContextStack[memContextCurrentStackIdx - priorIdx].memContext);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -778,7 +778,7 @@ memContextSize(const MemContext *this)
result += this->allocList[allocIdx]->size; result += this->allocList[allocIdx]->size;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -90,7 +90,7 @@ regExpNew(const String *expression)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(REGEXP, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -125,7 +125,7 @@ regExpMatch(RegExp *this, const String *string)
this->matchSize = 0; this->matchSize = 0;
} }
FUNCTION_TEST_RETURN(result == 0); FUNCTION_TEST_RETURN(BOOL, result == 0);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -140,7 +140,7 @@ regExpMatchPtr(RegExp *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->matchPtr); FUNCTION_TEST_RETURN_CONST(STRINGZ, this->matchPtr);
} }
size_t size_t
@ -152,7 +152,7 @@ regExpMatchSize(RegExp *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->matchSize); FUNCTION_TEST_RETURN(SIZE, this->matchSize);
} }
String * String *
@ -164,7 +164,7 @@ regExpMatchStr(RegExp *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->matchPtr == NULL ? NULL : strNewZN(regExpMatchPtr(this), regExpMatchSize(this))); FUNCTION_TEST_RETURN(STRING, this->matchPtr == NULL ? NULL : strNewZN(regExpMatchPtr(this), regExpMatchSize(this)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -192,7 +192,7 @@ regExpMatchOne(const String *expression, const String *string)
} }
TRY_END(); TRY_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -245,5 +245,5 @@ regExpPrefix(const String *expression)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }

View File

@ -82,7 +82,7 @@ statGetOrCreate(const String *key)
ASSERT(stat != NULL); ASSERT(stat != NULL);
} }
FUNCTION_TEST_RETURN(stat); FUNCTION_TEST_RETURN_TYPE_P(Stat, stat);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -98,7 +98,7 @@ statInc(const String *key)
statGetOrCreate(key)->total++; statGetOrCreate(key)->total++;
FUNCTION_TEST_RETURN(); FUNCTION_TEST_RETURN_VOID();
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -134,5 +134,5 @@ statToJson(void)
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }

View File

@ -23,7 +23,7 @@ timeMSec(void)
struct timeval currentTime; struct timeval currentTime;
gettimeofday(&currentTime, NULL); gettimeofday(&currentTime, NULL);
FUNCTION_TEST_RETURN(((TimeMSec)currentTime.tv_sec * MSEC_PER_SEC) + (TimeMSec)currentTime.tv_usec / MSEC_PER_USEC); FUNCTION_TEST_RETURN(TIME_MSEC, ((TimeMSec)currentTime.tv_sec * MSEC_PER_SEC) + (TimeMSec)currentTime.tv_usec / MSEC_PER_USEC);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -125,7 +125,7 @@ tzOffsetSeconds(int tzHour, int tzMinute)
tzHour = sign * tzHour; tzHour = sign * tzHour;
} }
FUNCTION_TEST_RETURN(sign * (tzHour * 3600 + tzMinute * 60)); FUNCTION_TEST_RETURN(INT, sign * (tzHour * 3600 + tzMinute * 60));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -136,7 +136,7 @@ yearIsLeap(int year)
FUNCTION_TEST_PARAM(INT, year); FUNCTION_TEST_PARAM(INT, year);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)); FUNCTION_TEST_RETURN(BOOL, (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -157,7 +157,7 @@ dayOfYear(int year, int month, int day)
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}, {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},
}; };
FUNCTION_TEST_RETURN(cumulativeDaysPerMonth[yearIsLeap(year) ? 1 : 0][month - 1] + day); FUNCTION_TEST_RETURN(INT, cumulativeDaysPerMonth[yearIsLeap(year) ? 1 : 0][month - 1] + day);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -178,6 +178,7 @@ epochFromParts(int year, int month, int day, int hour, int minute, int second, i
// Return epoch using calculation from https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16 // Return epoch using calculation from https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
TIME,
-1 * tzOffsetSecond + second + minute * 60 + hour * 3600 + -1 * tzOffsetSecond + second + minute * 60 + hour * 3600 +
(dayOfYear(year, month, day) - 1) * 86400 + (year - 1900 - 70) * 31536000 + (dayOfYear(year, month, day) - 1) * 86400 + (year - 1900 - 70) * 31536000 +
((year - 1900 - 69) / 4) * 86400 - ((year - 1900 - 1) / 100) * 86400 + ((year - 1900 + 299) / 400) * 86400); ((year - 1900 - 69) / 4) * 86400 - ((year - 1900 - 1) / 100) * 86400 + ((year - 1900 + 299) / 400) * 86400);

View File

@ -61,7 +61,7 @@ bufNew(size_t size)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -80,7 +80,7 @@ bufNewC(const void *buffer, size_t size)
memcpy(this->pub.buffer, buffer, bufSize(this)); memcpy(this->pub.buffer, buffer, bufSize(this));
this->pub.used = bufSize(this); this->pub.used = bufSize(this);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -97,7 +97,7 @@ bufNewDecode(EncodeType type, const String *string)
decodeToBin(type, strZ(string), bufPtr(this)); decodeToBin(type, strZ(string), bufPtr(this));
bufUsedSet(this, bufSize(this)); bufUsedSet(this, bufSize(this));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -118,7 +118,7 @@ bufDup(const Buffer *buffer)
this->pub.used = bufSize(this); this->pub.used = bufSize(this);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -135,7 +135,7 @@ bufCat(Buffer *this, const Buffer *cat)
if (cat != NULL) if (cat != NULL)
bufCatC(this, cat->pub.buffer, 0, bufUsed(cat)); bufCatC(this, cat->pub.buffer, 0, bufUsed(cat));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -164,7 +164,7 @@ bufCatC(Buffer *this, const unsigned char *cat, size_t catOffset, size_t catSize
this->pub.used += catSize; this->pub.used += catSize;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -188,7 +188,7 @@ bufCatSub(Buffer *this, const Buffer *cat, size_t catOffset, size_t catSize)
bufCatC(this, cat->pub.buffer, catOffset, catSize); bufCatC(this, cat->pub.buffer, catOffset, catSize);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -204,9 +204,9 @@ bufEq(const Buffer *this, const Buffer *compare)
ASSERT(compare != NULL); ASSERT(compare != NULL);
if (bufUsed(this) == bufUsed(compare)) if (bufUsed(this) == bufUsed(compare))
FUNCTION_TEST_RETURN(memcmp(bufPtrConst(this), bufPtrConst(compare), bufUsed(compare)) == 0); FUNCTION_TEST_RETURN(BOOL, memcmp(bufPtrConst(this), bufPtrConst(compare), bufUsed(compare)) == 0);
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -224,7 +224,7 @@ bufHex(const Buffer *this)
for (unsigned int bufferIdx = 0; bufferIdx < bufUsed(this); bufferIdx++) for (unsigned int bufferIdx = 0; bufferIdx < bufUsed(this); bufferIdx++)
strCatFmt(result, "%02x", bufPtrConst(this)[bufferIdx]); strCatFmt(result, "%02x", bufPtrConst(this)[bufferIdx]);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -280,7 +280,7 @@ bufResize(Buffer *this, size_t size)
this->pub.size = bufSizeAlloc(this); this->pub.size = bufSizeAlloc(this);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(BUFFER, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -63,7 +63,7 @@ cvtZToInt64Internal(const char *value, const char *type, int base)
// Validate the result // Validate the result
cvtZToIntValid(errno, base, value, endPtr, type); cvtZToIntValid(errno, base, value, endPtr, type);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT64, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -88,7 +88,7 @@ cvtZToUInt64Internal(const char *value, const char *type, int base)
// Validate the result // Validate the result
cvtZToIntValid(errno, base, value, endPtr, type); cvtZToIntValid(errno, base, value, endPtr, type);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -108,7 +108,7 @@ cvtBoolToZ(bool value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
const char * const char *
@ -134,7 +134,7 @@ cvtCharToZ(char value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -178,7 +178,7 @@ cvtDoubleToZ(double value, char *buffer, size_t bufferSize)
end[1] = 0; end[1] = 0;
// Return string length // Return string length
FUNCTION_TEST_RETURN((size_t)(end - buffer + 1)); FUNCTION_TEST_RETURN(SIZE, (size_t)(end - buffer + 1));
} }
double double
@ -196,7 +196,7 @@ cvtZToDouble(const char *value)
if (result == 0 && strcmp(value, "0") != 0) if (result == 0 && strcmp(value, "0") != 0)
THROW_FMT(FormatError, "unable to convert string '%s' to double", value); THROW_FMT(FormatError, "unable to convert string '%s' to double", value);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(DOUBLE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -216,7 +216,7 @@ cvtIntToZ(int value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
int int
@ -233,7 +233,7 @@ cvtZToIntBase(const char *value, int base)
if (result > INT_MAX || result < INT_MIN) if (result > INT_MAX || result < INT_MIN)
THROW_FMT(FormatError, "unable to convert base %d string '%s' to int", base, value); THROW_FMT(FormatError, "unable to convert base %d string '%s' to int", base, value);
FUNCTION_TEST_RETURN((int)result); FUNCTION_TEST_RETURN(INT, (int)result);
} }
int int
@ -245,7 +245,7 @@ cvtZToInt(const char *value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToIntBase(value, 10)); FUNCTION_TEST_RETURN(INT, cvtZToIntBase(value, 10));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -265,7 +265,7 @@ cvtInt64ToZ(int64_t value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
int64_t int64_t
@ -277,7 +277,7 @@ cvtZToInt64Base(const char *value, int base)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToInt64Internal(value, "int64", base)); FUNCTION_TEST_RETURN(INT64, cvtZToInt64Internal(value, "int64", base));
} }
int64_t int64_t
@ -289,7 +289,7 @@ cvtZToInt64(const char *value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToInt64Base(value, 10)); FUNCTION_TEST_RETURN(INT64, cvtZToInt64Base(value, 10));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -309,7 +309,7 @@ cvtModeToZ(mode_t value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
mode_t mode_t
@ -321,7 +321,7 @@ cvtZToMode(const char *value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN((mode_t)cvtZToUIntBase(value, 8)); FUNCTION_TEST_RETURN(MODE, (mode_t)cvtZToUIntBase(value, 8));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -341,7 +341,7 @@ cvtSizeToZ(size_t value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
size_t size_t
@ -360,7 +360,7 @@ cvtSSizeToZ(ssize_t value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -381,7 +381,7 @@ cvtTimeToZ(time_t value, char *buffer, size_t bufferSize)
if (result == 0) if (result == 0)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -401,7 +401,7 @@ cvtUIntToZ(unsigned int value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
unsigned int unsigned int
@ -419,7 +419,7 @@ cvtZToUIntBase(const char *value, int base)
if (*value == '-' || result > UINT_MAX) if (*value == '-' || result > UINT_MAX)
THROW_FMT(FormatError, "unable to convert base %d string '%s' to unsigned int", base, value); THROW_FMT(FormatError, "unable to convert base %d string '%s' to unsigned int", base, value);
FUNCTION_TEST_RETURN((unsigned int)result); FUNCTION_TEST_RETURN(UINT, (unsigned int)result);
} }
unsigned int unsigned int
@ -431,7 +431,7 @@ cvtZToUInt(const char *value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToUIntBase(value, 10)); FUNCTION_TEST_RETURN(UINT, cvtZToUIntBase(value, 10));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -451,7 +451,7 @@ cvtUInt64ToZ(uint64_t value, char *buffer, size_t bufferSize)
if (result >= bufferSize) if (result >= bufferSize)
THROW(AssertError, "buffer overflow"); THROW(AssertError, "buffer overflow");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(SIZE, result);
} }
uint64_t uint64_t
@ -469,7 +469,7 @@ cvtZToUInt64Base(const char *value, int base)
if (*value == '-') if (*value == '-')
THROW_FMT(FormatError, "unable to convert base %d string '%s' to uint64", base, value); THROW_FMT(FormatError, "unable to convert base %d string '%s' to uint64", base, value);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
uint64_t uint64_t
@ -481,7 +481,7 @@ cvtZToUInt64(const char *value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToUInt64Base(value, 10)); FUNCTION_TEST_RETURN(UINT64, cvtZToUInt64Base(value, 10));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -558,5 +558,5 @@ cvtUInt64FromVarInt128(const uint8_t *const value, size_t *const valuePos)
if (byte >= 0x80) if (byte >= 0x80)
THROW(FormatError, "unterminated varint-128 integer"); THROW(FormatError, "unterminated varint-128 integer");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }

View File

@ -57,7 +57,7 @@ jsonToBoolInternal(const char *json, unsigned int *jsonPos)
else else
THROW_FMT(JsonFormatError, "expected boolean at '%s'", json + *jsonPos); THROW_FMT(JsonFormatError, "expected boolean at '%s'", json + *jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
bool bool
@ -77,7 +77,7 @@ jsonToBool(const String *json)
if (jsonPos != strSize(json)) if (jsonPos != strSize(json))
THROW_FMT(JsonFormatError, "unexpected characters after boolean at '%s'", strZ(json) + jsonPos); THROW_FMT(JsonFormatError, "unexpected characters after boolean at '%s'", strZ(json) + jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -125,7 +125,7 @@ jsonToNumberInternal(const char *json, unsigned int *jsonPos)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT, result);
} }
static Variant * static Variant *
@ -145,7 +145,7 @@ jsonToNumber(const String *json)
if (jsonPos != strSize(json)) if (jsonPos != strSize(json))
THROW_FMT(JsonFormatError, "unexpected characters after number at '%s'", strZ(json) + jsonPos); THROW_FMT(JsonFormatError, "unexpected characters after number at '%s'", strZ(json) + jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT, result);
} }
int int
@ -163,7 +163,7 @@ jsonToInt(const String *json)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT, result);
} }
int64_t int64_t
@ -181,7 +181,7 @@ jsonToInt64(const String *json)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT64, result);
} }
unsigned int unsigned int
@ -199,7 +199,7 @@ jsonToUInt(const String *json)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT, result);
} }
uint64_t uint64_t
@ -217,7 +217,7 @@ jsonToUInt64(const String *json)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -334,7 +334,7 @@ jsonToStrInternal(const char *json, unsigned int *jsonPos)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
String * String *
@ -359,7 +359,7 @@ jsonToStr(const String *json)
if (jsonPos != strSize(json)) if (jsonPos != strSize(json))
THROW_FMT(JsonFormatError, "unexpected characters after string at '%s'", strZ(json) + jsonPos); THROW_FMT(JsonFormatError, "unexpected characters after string at '%s'", strZ(json) + jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -411,7 +411,7 @@ jsonToKvInternal(const char *json, unsigned int *jsonPos)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(KEY_VALUE, result);
} }
KeyValue * KeyValue *
@ -434,7 +434,7 @@ jsonToKv(const String *json)
if (jsonPos != strSize(json)) if (jsonPos != strSize(json))
THROW_FMT(JsonFormatError, "unexpected characters after object at '%s'", strZ(json) + jsonPos); THROW_FMT(JsonFormatError, "unexpected characters after object at '%s'", strZ(json) + jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(KEY_VALUE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -486,7 +486,7 @@ jsonToVarLstInternal(const char *json, unsigned int *jsonPos)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
VariantList * VariantList *
@ -506,7 +506,7 @@ jsonToVarLst(const String *json)
if (jsonPos != strSize(json)) if (jsonPos != strSize(json))
THROW_FMT(JsonFormatError, "unexpected characters after array at '%s'", strZ(json) + jsonPos); THROW_FMT(JsonFormatError, "unexpected characters after array at '%s'", strZ(json) + jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -575,7 +575,7 @@ jsonToVarInternal(const char *json, unsigned int *jsonPos)
jsonConsumeWhiteSpace(json, jsonPos); jsonConsumeWhiteSpace(json, jsonPos);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT, result);
} }
Variant * Variant *
@ -604,7 +604,7 @@ jsonFromBool(bool value)
FUNCTION_TEST_PARAM(BOOL, value); FUNCTION_TEST_PARAM(BOOL, value);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(value ? TRUE_STR : FALSE_STR); FUNCTION_TEST_RETURN_CONST(STRING, value ? TRUE_STR : FALSE_STR);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -618,7 +618,7 @@ jsonFromInt(int number)
char working[CVT_BASE10_BUFFER_SIZE]; char working[CVT_BASE10_BUFFER_SIZE];
cvtIntToZ(number, working, sizeof(working)); cvtIntToZ(number, working, sizeof(working));
FUNCTION_TEST_RETURN(strNewZ(working)); FUNCTION_TEST_RETURN(STRING, strNewZ(working));
} }
String * String *
@ -631,7 +631,7 @@ jsonFromInt64(int64_t number)
char working[CVT_BASE10_BUFFER_SIZE]; char working[CVT_BASE10_BUFFER_SIZE];
cvtInt64ToZ(number, working, sizeof(working)); cvtInt64ToZ(number, working, sizeof(working));
FUNCTION_TEST_RETURN(strNewZ(working)); FUNCTION_TEST_RETURN(STRING, strNewZ(working));
} }
String * String *
@ -644,7 +644,7 @@ jsonFromUInt(unsigned int number)
char working[CVT_BASE10_BUFFER_SIZE]; char working[CVT_BASE10_BUFFER_SIZE];
cvtUIntToZ(number, working, sizeof(working)); cvtUIntToZ(number, working, sizeof(working));
FUNCTION_TEST_RETURN(strNewZ(working)); FUNCTION_TEST_RETURN(STRING, strNewZ(working));
} }
String * String *
@ -657,7 +657,7 @@ jsonFromUInt64(uint64_t number)
char working[CVT_BASE10_BUFFER_SIZE]; char working[CVT_BASE10_BUFFER_SIZE];
cvtUInt64ToZ(number, working, sizeof(working)); cvtUInt64ToZ(number, working, sizeof(working));
FUNCTION_TEST_RETURN(strNewZ(working)); FUNCTION_TEST_RETURN(STRING, strNewZ(working));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -773,7 +773,7 @@ jsonFromStr(const String *string)
String *json = strNew(); String *json = strNew();
jsonFromStrInternal(json, string); jsonFromStrInternal(json, string);
FUNCTION_TEST_RETURN(json); FUNCTION_TEST_RETURN(STRING, json);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -881,7 +881,7 @@ jsonFromKvInternal(const KeyValue *kv)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -52,7 +52,7 @@ kvNew(void)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(KEY_VALUE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -83,7 +83,7 @@ kvDup(const KeyValue *source)
this->pub.keyList = varLstDup(kvKeyList(source)); this->pub.keyList = varLstDup(kvKeyList(source));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(KEY_VALUE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -113,7 +113,7 @@ kvGetIdx(const KeyValue *this, const Variant *key)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -183,7 +183,7 @@ kvPut(KeyValue *this, const Variant *key, const Variant *value)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(KEY_VALUE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -229,7 +229,7 @@ kvAdd(KeyValue *this, const Variant *key, const Variant *value)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(KEY_VALUE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -253,7 +253,7 @@ kvPutKv(KeyValue *this, const Variant *key)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(KEY_VALUE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -276,7 +276,7 @@ kvGet(const KeyValue *this, const Variant *key)
if (listIdx != KEY_NOT_FOUND) if (listIdx != KEY_NOT_FOUND)
result = ((KeyValuePair *)lstGet(this->list, listIdx))->value; result = ((KeyValuePair *)lstGet(this->list, listIdx))->value;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -303,7 +303,7 @@ kvGetDefault(const KeyValue *this, const Variant *key, const Variant *defaultVal
else else
result = ((KeyValuePair *)lstGet(this->list, listIdx))->value; result = ((KeyValuePair *)lstGet(this->list, listIdx))->value;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(VARIANT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -329,5 +329,5 @@ kvGetList(const KeyValue *this, const Variant *key)
else else
result = varLstAdd(varLstNew(), varDup(value)); result = varLstAdd(varLstNew(), varDup(value));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }

View File

@ -50,7 +50,7 @@ lstNew(size_t itemSize, ListParam param)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -75,7 +75,7 @@ lstClear(List *this)
this->listSizeMax = 0; this->listSizeMax = 0;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -90,7 +90,7 @@ lstComparatorStr(const void *item1, const void *item2)
ASSERT(item1 != NULL); ASSERT(item1 != NULL);
ASSERT(item2 != NULL); ASSERT(item2 != NULL);
FUNCTION_TEST_RETURN(strCmp(*(String **)item1, *(String **)item2)); FUNCTION_TEST_RETURN(INT, strCmp(*(String **)item1, *(String **)item2));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -105,7 +105,7 @@ lstComparatorZ(const void *item1, const void *item2)
ASSERT(item1 != NULL); ASSERT(item1 != NULL);
ASSERT(item2 != NULL); ASSERT(item2 != NULL);
FUNCTION_TEST_RETURN(strcmp(*(char **)item1, *(char **)item2)); FUNCTION_TEST_RETURN(INT, strcmp(*(char **)item1, *(char **)item2));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -135,7 +135,7 @@ lstGet(const List *this, unsigned int listIdx)
THROW_FMT(AssertError, "cannot get index %u from list with %u value(s)", listIdx, lstSize(this)); THROW_FMT(AssertError, "cannot get index %u from list with %u value(s)", listIdx, lstSize(this));
// Return pointer to list item // Return pointer to list item
FUNCTION_TEST_RETURN(this->list + (listIdx * this->itemSize)); FUNCTION_TEST_RETURN_P(VOID, this->list + (listIdx * this->itemSize));
} }
void * void *
@ -152,7 +152,7 @@ lstGetLast(const List *this)
THROW(AssertError, "cannot get last from list with no values"); THROW(AssertError, "cannot get last from list with no values");
// Return pointer to list item // Return pointer to list item
FUNCTION_TEST_RETURN(lstGet(this, lstSize(this) - 1)); FUNCTION_TEST_RETURN_P(VOID, lstGet(this, lstSize(this) - 1));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -171,24 +171,24 @@ lstFind(const List *this, const void *item)
if (this->list != NULL) if (this->list != NULL)
{ {
if (this->sortOrder == sortOrderAsc) if (this->sortOrder == sortOrderAsc)
FUNCTION_TEST_RETURN(bsearch(item, this->list, lstSize(this), this->itemSize, this->comparator)); FUNCTION_TEST_RETURN_P(VOID, bsearch(item, this->list, lstSize(this), this->itemSize, this->comparator));
else if (this->sortOrder == sortOrderDesc) else if (this->sortOrder == sortOrderDesc)
{ {
// Assign the list for the descending comparator to use // Assign the list for the descending comparator to use
comparatorDescList = this; comparatorDescList = this;
FUNCTION_TEST_RETURN(bsearch(item, this->list, lstSize(this), this->itemSize, lstComparatorDesc)); FUNCTION_TEST_RETURN_P(VOID, bsearch(item, this->list, lstSize(this), this->itemSize, lstComparatorDesc));
} }
// Fall back on an iterative search // Fall back on an iterative search
for (unsigned int listIdx = 0; listIdx < lstSize(this); listIdx++) for (unsigned int listIdx = 0; listIdx < lstSize(this); listIdx++)
{ {
if (this->comparator(item, lstGet(this, listIdx)) == 0) if (this->comparator(item, lstGet(this, listIdx)) == 0)
FUNCTION_TEST_RETURN(lstGet(this, listIdx)); FUNCTION_TEST_RETURN_P(VOID, lstGet(this, listIdx));
} }
} }
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN_P(VOID, NULL);
} }
unsigned int unsigned int
@ -204,7 +204,7 @@ lstFindIdx(const List *this, const void *item)
void *result = lstFind(this, item); void *result = lstFind(this, item);
FUNCTION_TEST_RETURN(result == NULL ? LIST_NOT_FOUND : lstIdx(this, result)); FUNCTION_TEST_RETURN(UINT, result == NULL ? LIST_NOT_FOUND : lstIdx(this, result));
} }
void * void *
@ -221,7 +221,7 @@ lstFindDefault(const List *this, const void *item, void *itemDefault)
void *result= lstFind(this, item); void *result= lstFind(this, item);
FUNCTION_TEST_RETURN(result == NULL ? itemDefault : result); FUNCTION_TEST_RETURN_P(VOID, result == NULL ? itemDefault : result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -244,7 +244,7 @@ lstIdx(const List *this, const void *item)
// Item pointers should always be in range // Item pointers should always be in range
ASSERT(result < lstSize(this)); ASSERT(result < lstSize(this));
FUNCTION_TEST_RETURN((unsigned int)result); FUNCTION_TEST_RETURN(UINT, (unsigned int)result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -303,7 +303,7 @@ lstInsert(List *this, unsigned int listIdx, const void *item)
memcpy(itemPtr, item, this->itemSize); memcpy(itemPtr, item, this->itemSize);
this->pub.listSize++; this->pub.listSize++;
FUNCTION_TEST_RETURN(itemPtr); FUNCTION_TEST_RETURN_P(VOID, itemPtr);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -334,7 +334,7 @@ lstRemoveIdx(List *this, unsigned int listIdx)
(lstSize(this) - listIdx) * this->itemSize); (lstSize(this) - listIdx) * this->itemSize);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(LIST, this);
} }
bool bool
@ -353,10 +353,10 @@ lstRemove(List *this, const void *item)
if (listIdx != LIST_NOT_FOUND) if (listIdx != LIST_NOT_FOUND)
{ {
lstRemoveIdx(this, listIdx); lstRemoveIdx(this, listIdx);
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
} }
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
List * List *
@ -371,7 +371,7 @@ lstRemoveLast(List *this)
if (lstSize(this) == 0) if (lstSize(this) == 0)
THROW(AssertError, "cannot remove last from list with no values"); THROW(AssertError, "cannot remove last from list with no values");
FUNCTION_TEST_RETURN(lstRemoveIdx(this, lstSize(this) - 1)); FUNCTION_TEST_RETURN(LIST, lstRemoveIdx(this, lstSize(this) - 1));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -410,7 +410,7 @@ lstSort(List *this, SortOrder sortOrder)
this->sortOrder = sortOrder; this->sortOrder = sortOrder;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -427,7 +427,7 @@ lstComparatorSet(List *this, ListComparator *comparator)
this->comparator = comparator; this->comparator = comparator;
this->sortOrder = sortOrderNone; this->sortOrder = sortOrderNone;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -349,7 +349,7 @@ pckReadNewInternal(void)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_READ, this);
} }
PackRead * PackRead *
@ -371,7 +371,7 @@ pckReadNewIo(IoRead *read)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_READ, this);
} }
PackRead * PackRead *
@ -382,9 +382,9 @@ pckReadNew(const Pack *const pack)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
if (pack == NULL) if (pack == NULL)
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(PACK_READ, NULL);
FUNCTION_TEST_RETURN(pckReadNewC(bufPtrConst((const Buffer *)pack), bufUsed((const Buffer *)pack))); FUNCTION_TEST_RETURN(PACK_READ, pckReadNewC(bufPtrConst((const Buffer *)pack), bufUsed((const Buffer *)pack)));
} }
PackRead * PackRead *
@ -401,7 +401,7 @@ pckReadNewC(const unsigned char *const buffer, size_t size)
this->bufferPtr = buffer; this->bufferPtr = buffer;
this->bufferUsed = size; this->bufferUsed = size;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_READ, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -444,10 +444,10 @@ pckReadBuffer(PackRead *this, size_t size)
if (remaining < 1) if (remaining < 1)
THROW(FormatError, "unexpected EOF"); THROW(FormatError, "unexpected EOF");
FUNCTION_TEST_RETURN(remaining < size ? remaining : size); FUNCTION_TEST_RETURN(SIZE, remaining < size ? remaining : size);
} }
FUNCTION_TEST_RETURN(size); FUNCTION_TEST_RETURN(SIZE, size);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -510,7 +510,7 @@ pckReadU64Internal(PackRead *this)
if (byte >= 0x80) if (byte >= 0x80)
THROW(FormatError, "unterminated base-128 integer"); THROW(FormatError, "unterminated base-128 integer");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -623,7 +623,7 @@ pckReadTagNext(PackRead *this)
result = true; result = true;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -698,7 +698,7 @@ pckReadTag(PackRead *this, unsigned int *id, PackTypeMap typeMap, bool peek)
} }
while (1); while (1);
FUNCTION_TEST_RETURN(this->tagNextValue); FUNCTION_TEST_RETURN(UINT64, this->tagNextValue);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -712,7 +712,7 @@ pckReadNext(PackRead *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(this->tagNextId == 0); ASSERT(this->tagNextId == 0);
FUNCTION_TEST_RETURN(pckReadTagNext(this)); FUNCTION_TEST_RETURN(BOOL, pckReadTagNext(this));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -725,7 +725,7 @@ pckReadId(PackRead *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->tagNextId); FUNCTION_TEST_RETURN(UINT, this->tagNextId);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -739,7 +739,7 @@ pckReadSize(PackRead *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(packTypeMapData[this->tagNextTypeMap].size); ASSERT(packTypeMapData[this->tagNextTypeMap].size);
FUNCTION_TEST_RETURN(this->tagNextSize); FUNCTION_TEST_RETURN(SIZE, this->tagNextSize);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -773,7 +773,7 @@ pckReadBufPtr(PackRead *this)
ASSERT(packTypeMapData[this->tagNextTypeMap].size); ASSERT(packTypeMapData[this->tagNextTypeMap].size);
ASSERT(this->buffer == NULL); ASSERT(this->buffer == NULL);
FUNCTION_TEST_RETURN(this->bufferPtr + this->bufferPos); FUNCTION_TEST_RETURN_CONST_P(UCHARDATA, this->bufferPtr + this->bufferPos);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -797,11 +797,11 @@ pckReadNullInternal(PackRead *this, unsigned int *id)
if (*id < this->tagNextId) if (*id < this->tagNextId)
{ {
this->tagStack.top->idLast = *id; this->tagStack.top->idLast = *id;
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
} }
// The field is not NULL // The field is not NULL
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
bool bool
@ -814,7 +814,7 @@ pckReadNull(PackRead *this, PackIdParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(pckReadNullInternal(this, &param.id)); FUNCTION_TEST_RETURN(BOOL, pckReadNullInternal(this, &param.id));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -827,7 +827,7 @@ pckReadType(PackRead *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(packTypeMapData[this->tagNextTypeMap].type); FUNCTION_TEST_RETURN(STRING_ID, packTypeMapData[this->tagNextTypeMap].type);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -887,7 +887,7 @@ pckReadBin(PackRead *this, PckReadBinParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(BUFFER, NULL);
Buffer *result = NULL; Buffer *result = NULL;
@ -909,7 +909,7 @@ pckReadBin(PackRead *this, PckReadBinParam param)
else else
result = bufNew(0); result = bufNew(0);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BUFFER, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -925,9 +925,9 @@ pckReadBool(PackRead *this, PckReadBoolParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(BOOL, param.defaultValue);
FUNCTION_TEST_RETURN(pckReadTag(this, &param.id, pckTypeMapBool, false)); FUNCTION_TEST_RETURN(BOOL, pckReadTag(this, &param.id, pckTypeMapBool, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -943,9 +943,9 @@ pckReadI32(PackRead *this, PckReadI32Param param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(INT, param.defaultValue);
FUNCTION_TEST_RETURN(cvtInt32FromZigZag((uint32_t)pckReadTag(this, &param.id, pckTypeMapI32, false))); FUNCTION_TEST_RETURN(INT, cvtInt32FromZigZag((uint32_t)pckReadTag(this, &param.id, pckTypeMapI32, false)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -961,9 +961,9 @@ pckReadI64(PackRead *this, PckReadI64Param param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(INT64, param.defaultValue);
FUNCTION_TEST_RETURN(cvtInt64FromZigZag(pckReadTag(this, &param.id, pckTypeMapI64, false))); FUNCTION_TEST_RETURN(INT64, cvtInt64FromZigZag(pckReadTag(this, &param.id, pckTypeMapI64, false)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -979,9 +979,9 @@ pckReadMode(PackRead *this, PckReadModeParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(MODE, param.defaultValue);
FUNCTION_TEST_RETURN((mode_t)pckReadTag(this, &param.id, pckTypeMapMode, false)); FUNCTION_TEST_RETURN(MODE, (mode_t)pckReadTag(this, &param.id, pckTypeMapMode, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1044,7 +1044,7 @@ pckReadPackRead(PackRead *this, PckReadPackParam param)
if (result != NULL) if (result != NULL)
pckMove(pack, objMemContext(result)); pckMove(pack, objMemContext(result));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PACK_READ, result);
} }
PackRead * PackRead *
@ -1056,7 +1056,7 @@ pckReadPackReadConst(PackRead *this, PckReadPackParam param)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(PACK_READ, NULL);
// Read the tag // Read the tag
pckReadTag(this, &param.id, pckTypeMapPack, false); pckReadTag(this, &param.id, pckTypeMapPack, false);
@ -1065,7 +1065,7 @@ pckReadPackReadConst(PackRead *this, PckReadPackParam param)
pckReadConsumeBuffer(this); pckReadConsumeBuffer(this);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PACK_READ, result);
} }
Pack * Pack *
@ -1079,7 +1079,7 @@ pckReadPack(PackRead *const this, PckReadPackParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(PACK, NULL);
// Read the tag // Read the tag
pckReadTag(this, &param.id, pckTypeMapPack, false); pckReadTag(this, &param.id, pckTypeMapPack, false);
@ -1095,7 +1095,7 @@ pckReadPack(PackRead *const this, PckReadPackParam param)
this->bufferPos += size; this->bufferPos += size;
} }
FUNCTION_TEST_RETURN((Pack *)result); FUNCTION_TEST_RETURN(PACK, (Pack *)result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1110,9 +1110,9 @@ pckReadPtr(PackRead *this, PckReadPtrParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN_P(VOID, NULL);
FUNCTION_TEST_RETURN((void *)(uintptr_t)pckReadTag(this, &param.id, pckTypeMapPtr, false)); FUNCTION_TEST_RETURN_P(VOID, (void *)(uintptr_t)pckReadTag(this, &param.id, pckTypeMapPtr, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1128,7 +1128,7 @@ pckReadStr(PackRead *this, PckReadStrParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(strDup(param.defaultValue)); FUNCTION_TEST_RETURN(STRING, strDup(param.defaultValue));
String *result = NULL; String *result = NULL;
@ -1152,7 +1152,7 @@ pckReadStr(PackRead *this, PckReadStrParam param)
else else
result = strNew(); result = strNew();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1168,9 +1168,9 @@ pckReadStrId(PackRead *this, PckReadStrIdParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(STRING_ID, param.defaultValue);
FUNCTION_TEST_RETURN(pckReadTag(this, &param.id, pckTypeMapStrId, false)); FUNCTION_TEST_RETURN(STRING_ID, pckReadTag(this, &param.id, pckTypeMapStrId, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1185,7 +1185,7 @@ pckReadStrLst(PackRead *const this, PckReadStrLstParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(STRING_LIST, NULL);
pckReadArrayBeginP(this, .id = param.id); pckReadArrayBeginP(this, .id = param.id);
@ -1196,7 +1196,7 @@ pckReadStrLst(PackRead *const this, PckReadStrLstParam param)
pckReadArrayEndP(this); pckReadArrayEndP(this);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1212,9 +1212,9 @@ pckReadTime(PackRead *this, PckReadTimeParam param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(TIME, param.defaultValue);
FUNCTION_TEST_RETURN((time_t)cvtInt64FromZigZag(pckReadTag(this, &param.id, pckTypeMapTime, false))); FUNCTION_TEST_RETURN(TIME, (time_t)cvtInt64FromZigZag(pckReadTag(this, &param.id, pckTypeMapTime, false)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1230,9 +1230,9 @@ pckReadU32(PackRead *this, PckReadU32Param param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(UINT32, param.defaultValue);
FUNCTION_TEST_RETURN((uint32_t)pckReadTag(this, &param.id, pckTypeMapU32, false)); FUNCTION_TEST_RETURN(UINT32, (uint32_t)pckReadTag(this, &param.id, pckTypeMapU32, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1248,9 +1248,9 @@ pckReadU64(PackRead *this, PckReadU64Param param)
ASSERT(this != NULL); ASSERT(this != NULL);
if (pckReadNullInternal(this, &param.id)) if (pckReadNullInternal(this, &param.id))
FUNCTION_TEST_RETURN(param.defaultValue); FUNCTION_TEST_RETURN(UINT64, param.defaultValue);
FUNCTION_TEST_RETURN(pckReadTag(this, &param.id, pckTypeMapU64, false)); FUNCTION_TEST_RETURN(UINT64, pckReadTag(this, &param.id, pckTypeMapU64, false));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1304,7 +1304,7 @@ pckWriteNewInternal(void)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
PackWrite * PackWrite *
@ -1322,7 +1322,7 @@ pckWriteNew(const PckWriteNewParam param)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
PackWrite * PackWrite *
@ -1343,7 +1343,7 @@ pckWriteNewIo(IoWrite *write)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1557,11 +1557,11 @@ pckWriteDefaultNull(PackWrite *this, bool defaultWrite, bool defaultEqual)
if (!defaultWrite && defaultEqual) if (!defaultWrite && defaultEqual)
{ {
this->tagStack.top->nullTotal++; this->tagStack.top->nullTotal++;
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
} }
// Let the caller know that it should write the value // Let the caller know that it should write the value
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1574,7 +1574,7 @@ pckWriteNull(PackWrite *this)
this->tagStack.top->nullTotal++; this->tagStack.top->nullTotal++;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1594,7 +1594,7 @@ pckWriteArrayBegin(PackWrite *this, PackIdParam param)
// Add array to the tag stack so IDs can be tracked separately from the parent container // Add array to the tag stack so IDs can be tracked separately from the parent container
pckTagStackPush(objMemContext(this), &this->tagStack, pckTypeMapArray); pckTagStackPush(objMemContext(this), &this->tagStack, pckTypeMapArray);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
PackWrite * PackWrite *
@ -1615,7 +1615,7 @@ pckWriteArrayEnd(PackWrite *this)
// Pop array off the stack to revert to ID tracking for the prior container // Pop array off the stack to revert to ID tracking for the prior container
pckTagStackPop(&this->tagStack); pckTagStackPop(&this->tagStack);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1645,7 +1645,7 @@ pckWriteBin(PackWrite *this, const Buffer *value, PckWriteBinParam param)
} }
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1665,7 +1665,7 @@ pckWriteBool(PackWrite *this, bool value, PckWriteBoolParam param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapBool, param.id, value); pckWriteTag(this, pckTypeMapBool, param.id, value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1685,7 +1685,7 @@ pckWriteI32(PackWrite *this, int32_t value, PckWriteI32Param param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapI32, param.id, cvtInt32ToZigZag(value)); pckWriteTag(this, pckTypeMapI32, param.id, cvtInt32ToZigZag(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1705,7 +1705,7 @@ pckWriteI64(PackWrite *this, int64_t value, PckWriteI64Param param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapI64, param.id, cvtInt64ToZigZag(value)); pckWriteTag(this, pckTypeMapI64, param.id, cvtInt64ToZigZag(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1725,7 +1725,7 @@ pckWriteMode(PackWrite *this, mode_t value, PckWriteModeParam param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapMode, param.id, value); pckWriteTag(this, pckTypeMapMode, param.id, value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1745,7 +1745,7 @@ pckWriteObjBegin(PackWrite *this, PackIdParam param)
// Add object to the tag stack so IDs can be tracked separately from the parent container // Add object to the tag stack so IDs can be tracked separately from the parent container
pckTagStackPush(objMemContext(this), &this->tagStack, pckTypeMapObj); pckTagStackPush(objMemContext(this), &this->tagStack, pckTypeMapObj);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
PackWrite * PackWrite *
@ -1766,7 +1766,7 @@ pckWriteObjEnd(PackWrite *this)
// Pop object off the stack to revert to ID tracking for the prior container // Pop object off the stack to revert to ID tracking for the prior container
pckTagStackPop(&this->tagStack); pckTagStackPop(&this->tagStack);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1790,7 +1790,7 @@ pckWritePack(PackWrite *const this, const Pack *const value, const PckWritePackP
pckWriteBuffer(this, (Buffer *)value); pckWriteBuffer(this, (Buffer *)value);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1809,7 +1809,7 @@ pckWritePtr(PackWrite *this, const void *value, PckWritePtrParam param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == NULL)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == NULL))
pckWriteTag(this, pckTypeMapPtr, param.id, (uintptr_t)value); pckWriteTag(this, pckTypeMapPtr, param.id, (uintptr_t)value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1839,7 +1839,7 @@ pckWriteStr(PackWrite *this, const String *value, PckWriteStrParam param)
} }
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1859,7 +1859,7 @@ pckWriteStrId(PackWrite *this, uint64_t value, PckWriteStrIdParam param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapStrId, param.id, value); pckWriteTag(this, pckTypeMapStrId, param.id, value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1886,7 +1886,7 @@ pckWriteStrLst(PackWrite *const this, const StringList *const value, const PckWr
pckWriteArrayEndP(this); pckWriteArrayEndP(this);
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1906,7 +1906,7 @@ pckWriteTime(PackWrite *this, time_t value, PckWriteTimeParam param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapTime, param.id, cvtInt64ToZigZag(value)); pckWriteTag(this, pckTypeMapTime, param.id, cvtInt64ToZigZag(value));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1926,7 +1926,7 @@ pckWriteU32(PackWrite *this, uint32_t value, PckWriteU32Param param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapU32, param.id, value); pckWriteTag(this, pckTypeMapU32, param.id, value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1946,7 +1946,7 @@ pckWriteU64(PackWrite *this, uint64_t value, PckWriteU64Param param)
if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue)) if (!pckWriteDefaultNull(this, param.defaultWrite, value == param.defaultValue))
pckWriteTag(this, pckTypeMapU64, param.id, value); pckWriteTag(this, pckTypeMapU64, param.id, value);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1973,7 +1973,7 @@ pckWriteEnd(PackWrite *this)
else else
bufResize(this->buffer, bufUsed(this->buffer)); bufResize(this->buffer, bufUsed(this->buffer));
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PACK_WRITE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1993,7 +1993,7 @@ pckWriteResult(PackWrite *const this)
result = (Pack *)this->buffer; result = (Pack *)this->buffer;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(PACK, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -95,7 +95,7 @@ strNew(void)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -122,7 +122,7 @@ strNewFixed(const size_t size)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -142,7 +142,7 @@ strNewZ(const char *const string)
strncpy(this->pub.buffer, string, strSize(this)); strncpy(this->pub.buffer, string, strSize(this));
this->pub.buffer[strSize(this)] = '\0'; this->pub.buffer[strSize(this)] = '\0';
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -156,7 +156,7 @@ String *strNewDbl(double value)
cvtDoubleToZ(value, working, sizeof(working)); cvtDoubleToZ(value, working, sizeof(working));
FUNCTION_TEST_RETURN(strNewZ(working)); FUNCTION_TEST_RETURN(STRING, strNewZ(working));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -178,7 +178,7 @@ strNewBuf(const Buffer *buffer)
this->pub.buffer[strSize(this)] = 0; this->pub.buffer[strSize(this)] = 0;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -198,7 +198,7 @@ strNewEncode(EncodeType type, const Buffer *buffer)
// Encode buffer // Encode buffer
encodeToStr(type, bufPtrConst(buffer), bufUsed(buffer), this->pub.buffer); encodeToStr(type, bufPtrConst(buffer), bufUsed(buffer), this->pub.buffer);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -222,7 +222,7 @@ strNewFmt(const char *format, ...)
vsnprintf(this->pub.buffer, strSize(this) + 1, format, argumentList); vsnprintf(this->pub.buffer, strSize(this) + 1, format, argumentList);
va_end(argumentList); va_end(argumentList);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -243,7 +243,7 @@ strNewZN(const char *string, size_t size)
strncpy(this->pub.buffer, string, strSize(this)); strncpy(this->pub.buffer, string, strSize(this));
this->pub.buffer[strSize(this)] = 0; this->pub.buffer[strSize(this)] = 0;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -256,7 +256,7 @@ strBase(const String *this)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(strNewZ(strBaseZ(this))); FUNCTION_TEST_RETURN(STRING, strNewZ(strBaseZ(this)));
} }
const char * const char *
@ -273,7 +273,7 @@ strBaseZ(const String *this)
while (end > this->pub.buffer && *(end - 1) != '/') while (end > this->pub.buffer && *(end - 1) != '/')
end--; end--;
FUNCTION_TEST_RETURN(end); FUNCTION_TEST_RETURN_CONST(STRINGZ, end);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -288,7 +288,7 @@ strBeginsWith(const String *this, const String *beginsWith)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(beginsWith != NULL); ASSERT(beginsWith != NULL);
FUNCTION_TEST_RETURN(strBeginsWithZ(this, strZ(beginsWith))); FUNCTION_TEST_RETURN(BOOL, strBeginsWithZ(this, strZ(beginsWith)));
} }
bool bool
@ -308,7 +308,7 @@ strBeginsWithZ(const String *this, const char *beginsWith)
if (strSize(this) >= beginsWithSize) if (strSize(this) >= beginsWithSize)
result = strncmp(strZ(this), beginsWith, beginsWithSize) == 0; result = strncmp(strZ(this), beginsWith, beginsWithSize) == 0;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -362,7 +362,7 @@ strCat(String *this, const String *cat)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(cat != NULL); ASSERT(cat != NULL);
FUNCTION_TEST_RETURN(strCatZN(this, strZ(cat), strSize(cat))); FUNCTION_TEST_RETURN(STRING, strCatZN(this, strZ(cat), strSize(cat)));
} }
String * String *
@ -390,7 +390,7 @@ strCatZ(String *this, const char *cat)
this->pub.extra -= (unsigned int)sizeGrow; this->pub.extra -= (unsigned int)sizeGrow;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
String * String *
@ -420,7 +420,7 @@ strCatZN(String *this, const char *cat, size_t size)
this->pub.extra -= (unsigned int)size; this->pub.extra -= (unsigned int)size;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -435,7 +435,7 @@ strCatBuf(String *const this, const Buffer *const buffer)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(buffer != NULL); ASSERT(buffer != NULL);
FUNCTION_TEST_RETURN(strCatZN(this, (char *)bufPtrConst(buffer), bufUsed(buffer))); FUNCTION_TEST_RETURN(STRING, strCatZN(this, (char *)bufPtrConst(buffer), bufUsed(buffer)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -458,7 +458,7 @@ strCatChr(String *this, char cat)
this->pub.buffer[this->pub.size] = 0; this->pub.buffer[this->pub.size] = 0;
this->pub.extra--; this->pub.extra--;
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -489,7 +489,7 @@ strCatEncode(String *this, EncodeType type, const Buffer *buffer)
this->pub.extra -= (unsigned int)encodeSize; this->pub.extra -= (unsigned int)encodeSize;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -524,7 +524,7 @@ strCatFmt(String *this, const char *format, ...)
this->pub.extra -= (unsigned int)sizeGrow; this->pub.extra -= (unsigned int)sizeGrow;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -537,16 +537,16 @@ strCmp(const String *this, const String *compare)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
if (this != NULL && compare != NULL) if (this != NULL && compare != NULL)
FUNCTION_TEST_RETURN(strcmp(strZ(this), strZ(compare))); FUNCTION_TEST_RETURN(INT, strcmp(strZ(this), strZ(compare)));
else if (this == NULL) else if (this == NULL)
{ {
if (compare == NULL) if (compare == NULL)
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(INT, 0);
FUNCTION_TEST_RETURN(-1); FUNCTION_TEST_RETURN(INT, -1);
} }
FUNCTION_TEST_RETURN(1); FUNCTION_TEST_RETURN(INT, 1);
} }
int int
@ -557,7 +557,7 @@ strCmpZ(const String *this, const char *compare)
FUNCTION_TEST_PARAM(STRINGZ, compare); FUNCTION_TEST_PARAM(STRINGZ, compare);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(strCmp(this, compare == NULL ? NULL : STR(compare))); FUNCTION_TEST_RETURN(INT, strCmp(this, compare == NULL ? NULL : STR(compare)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -573,7 +573,7 @@ strDup(const String *this)
if (this != NULL) if (this != NULL)
result = strNewZ(strZ(this)); result = strNewZ(strZ(this));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -584,7 +584,7 @@ strEmpty(const String *this)
FUNCTION_TEST_PARAM(STRING, this); FUNCTION_TEST_PARAM(STRING, this);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(strSize(this) == 0); FUNCTION_TEST_RETURN(BOOL, strSize(this) == 0);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -599,7 +599,7 @@ strEndsWith(const String *this, const String *endsWith)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(endsWith != NULL); ASSERT(endsWith != NULL);
FUNCTION_TEST_RETURN(strEndsWithZ(this, strZ(endsWith))); FUNCTION_TEST_RETURN(BOOL, strEndsWithZ(this, strZ(endsWith)));
} }
bool bool
@ -619,7 +619,7 @@ strEndsWithZ(const String *this, const char *endsWith)
if (strSize(this) >= endsWithSize) if (strSize(this) >= endsWithSize)
result = strcmp(strZ(this) + (strSize(this) - endsWithSize), endsWith) == 0; result = strcmp(strZ(this) + (strSize(this) - endsWithSize), endsWith) == 0;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -644,7 +644,7 @@ strEq(const String *this, const String *compare)
else else
result = this == NULL && compare == NULL; result = this == NULL && compare == NULL;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
bool bool
@ -658,7 +658,7 @@ strEqZ(const String *this, const char *compare)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(compare != NULL); ASSERT(compare != NULL);
FUNCTION_TEST_RETURN(strcmp(strZ(this), compare) == 0); FUNCTION_TEST_RETURN(BOOL, strcmp(strZ(this), compare) == 0);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -674,7 +674,7 @@ strFirstUpper(String *this)
if (strSize(this) > 0) if (strSize(this) > 0)
this->pub.buffer[0] = (char)toupper(this->pub.buffer[0]); this->pub.buffer[0] = (char)toupper(this->pub.buffer[0]);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -690,7 +690,7 @@ strFirstLower(String *this)
if (strSize(this) > 0) if (strSize(this) > 0)
this->pub.buffer[0] = (char)tolower(this->pub.buffer[0]); this->pub.buffer[0] = (char)tolower(this->pub.buffer[0]);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -706,7 +706,7 @@ strUpper(String *this)
for (size_t idx = 0; idx < strSize(this); idx++) for (size_t idx = 0; idx < strSize(this); idx++)
this->pub.buffer[idx] = (char)toupper(this->pub.buffer[idx]); this->pub.buffer[idx] = (char)toupper(this->pub.buffer[idx]);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -722,7 +722,7 @@ strLower(String *this)
for (size_t idx = 0; idx < strSize(this); idx++) for (size_t idx = 0; idx < strSize(this); idx++)
this->pub.buffer[idx] = (char)tolower(this->pub.buffer[idx]); this->pub.buffer[idx] = (char)tolower(this->pub.buffer[idx]);
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -740,7 +740,7 @@ strPath(const String *this)
while (end > this->pub.buffer && *(end - 1) != '/') while (end > this->pub.buffer && *(end - 1) != '/')
end--; end--;
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(STRING,
strNewZN( strNewZN(
this->pub.buffer, this->pub.buffer,
end - this->pub.buffer <= 1 ? (size_t)(end - this->pub.buffer) : (size_t)(end - this->pub.buffer - 1))); end - this->pub.buffer <= 1 ? (size_t)(end - this->pub.buffer) : (size_t)(end - this->pub.buffer - 1)));
@ -827,7 +827,7 @@ strPathAbsolute(const String *this, const String *base)
if (strstr(strZ(result), "/..") != NULL || strstr(strZ(result), "//") != NULL) if (strstr(strZ(result), "/..") != NULL || strstr(strZ(result), "//") != NULL)
THROW_FMT(AssertError, "result path '%s' is not absolute", strZ(result)); THROW_FMT(AssertError, "result path '%s' is not absolute", strZ(result));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -838,7 +838,7 @@ strZNull(const String *this)
FUNCTION_TEST_PARAM(STRING, this); FUNCTION_TEST_PARAM(STRING, this);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(this == NULL ? NULL : strZ(this)); FUNCTION_TEST_RETURN_CONST(STRINGZ, this == NULL ? NULL : strZ(this));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -853,7 +853,7 @@ strQuote(const String *this, const String *quote)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(quote != NULL); ASSERT(quote != NULL);
FUNCTION_TEST_RETURN(strQuoteZ(this, strZ(quote))); FUNCTION_TEST_RETURN(STRING, strQuoteZ(this, strZ(quote)));
} }
String * String *
@ -867,7 +867,7 @@ strQuoteZ(const String *this, const char *quote)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(quote != NULL); ASSERT(quote != NULL);
FUNCTION_TEST_RETURN(strNewFmt("%s%s%s", quote, strZ(this), quote)); FUNCTION_TEST_RETURN(STRING, strNewFmt("%s%s%s", quote, strZ(this), quote));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -888,7 +888,7 @@ strReplaceChr(String *this, char find, char replace)
this->pub.buffer[stringIdx] = replace; this->pub.buffer[stringIdx] = replace;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -903,7 +903,7 @@ strSub(const String *this, size_t start)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(start <= this->pub.size); ASSERT(start <= this->pub.size);
FUNCTION_TEST_RETURN(strSubN(this, start, strSize(this) - start)); FUNCTION_TEST_RETURN(STRING, strSubN(this, start, strSize(this) - start));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -920,7 +920,7 @@ strSubN(const String *this, size_t start, size_t size)
ASSERT(start <= strSize(this)); ASSERT(start <= strSize(this));
ASSERT(start + size <= strSize(this)); ASSERT(start + size <= strSize(this));
FUNCTION_TEST_RETURN(strNewZN(strZ(this) + start, size)); FUNCTION_TEST_RETURN(STRING, strNewZN(strZ(this) + start, size));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -963,7 +963,7 @@ strTrim(String *this)
} }
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -987,7 +987,7 @@ strChr(const String *this, char chr)
result = (int)(ptr - this->pub.buffer); result = (int)(ptr - this->pub.buffer);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1009,7 +1009,7 @@ strTrunc(String *this, int idx)
this->pub.buffer[strSize(this)] = 0; this->pub.buffer[strSize(this)] = 0;
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1070,7 +1070,7 @@ strSizeFormat(const uint64_t size)
result = strNewFmt("%" PRIu64 "GB", size / (1024 * 1024 * 1024)); result = strNewFmt("%" PRIu64 "GB", size / (1024 * 1024 * 1024));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -70,7 +70,7 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
break; break;
if (map[(uint8_t)buffer[bufferIdx]] == 0) if (map[(uint8_t)buffer[bufferIdx]] == 0)
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(STRING_ID, 0);
} }
// Set encoding in header // Set encoding in header
@ -123,7 +123,7 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
result |= (uint64_t)map[(uint8_t)buffer[0]] << 4; result |= (uint64_t)map[(uint8_t)buffer[0]] << 4;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_ID, result);
} }
// 6-bit encoding // 6-bit encoding
@ -159,7 +159,7 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
break; break;
if (map[(uint8_t)buffer[bufferIdx]] == 0) if (map[(uint8_t)buffer[bufferIdx]] == 0)
FUNCTION_TEST_RETURN(0); FUNCTION_TEST_RETURN(STRING_ID, 0);
} }
// Set encoding in header // Set encoding in header
@ -206,7 +206,7 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
result |= (uint64_t)map[(uint8_t)buffer[0]] << 4; result |= (uint64_t)map[(uint8_t)buffer[0]] << 4;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_ID, result);
} }
} }
} }
@ -232,7 +232,7 @@ strIdFromZN(const char *const buffer, const size_t size, const bool error)
THROW_FMT(FormatError, "'%s' contains invalid characters", buffer); THROW_FMT(FormatError, "'%s' contains invalid characters", buffer);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_ID, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -271,7 +271,7 @@ strIdToZN(StringId strId, char *const buffer)
strId >>= 5; \ strId >>= 5; \
\ \
if (strId == 0) \ if (strId == 0) \
FUNCTION_TEST_RETURN(idx + 1) FUNCTION_TEST_RETURN(SIZE, idx + 1)
// Char 1-11 // Char 1-11
STR5ID_TO_ZN_IDX(0); STR5ID_TO_ZN_IDX(0);
@ -294,10 +294,10 @@ strIdToZN(StringId strId, char *const buffer)
if (prefix) if (prefix)
{ {
buffer[12] = '+'; buffer[12] = '+';
FUNCTION_TEST_RETURN(13); FUNCTION_TEST_RETURN(SIZE, 13);
} }
FUNCTION_TEST_RETURN(12); FUNCTION_TEST_RETURN(SIZE, 12);
} }
// 6-bit decoding // 6-bit decoding
@ -314,7 +314,7 @@ strIdToZN(StringId strId, char *const buffer)
strId >>= 6; \ strId >>= 6; \
\ \
if (strId == 0) \ if (strId == 0) \
FUNCTION_TEST_RETURN(idx + 1) FUNCTION_TEST_RETURN(SIZE, idx + 1)
// Char 1-9 // Char 1-9
STR6ID_TO_ZN_IDX(0); STR6ID_TO_ZN_IDX(0);
@ -335,10 +335,10 @@ strIdToZN(StringId strId, char *const buffer)
if (prefix) if (prefix)
{ {
buffer[10] = '+'; buffer[10] = '+';
FUNCTION_TEST_RETURN(11); FUNCTION_TEST_RETURN(SIZE, 11);
} }
FUNCTION_TEST_RETURN(10); FUNCTION_TEST_RETURN(SIZE, 10);
} }
} }
} }
@ -354,7 +354,7 @@ strIdToStr(const StringId strId)
char buffer[STRID_MAX + 1]; char buffer[STRID_MAX + 1];
buffer[strIdToZN(strId, buffer)] = '\0'; buffer[strIdToZN(strId, buffer)] = '\0';
FUNCTION_TEST_RETURN(strNewZ(buffer)); FUNCTION_TEST_RETURN(STRING, strNewZ(buffer));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -369,7 +369,7 @@ strIdToZ(const StringId strId, char *const buffer)
size_t size = strIdToZN(strId, buffer); size_t size = strIdToZN(strId, buffer);
buffer[size] = '\0'; buffer[size] = '\0';
FUNCTION_TEST_RETURN(size); FUNCTION_TEST_RETURN(SIZE, size);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -72,7 +72,7 @@ strLstNewSplitZ(const String *string, const char *delimiter)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING_LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -99,7 +99,7 @@ strLstNewVarLst(const VariantList *sourceList)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING_LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -126,7 +126,7 @@ strLstDup(const StringList *sourceList)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(STRING_LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -148,7 +148,7 @@ strLstAdd(StringList *this, const String *string)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
String * String *
@ -164,9 +164,9 @@ strLstAddIfMissing(StringList *this, const String *string)
String **result = lstFind((List *)this, &string); String **result = lstFind((List *)this, &string);
if (result == NULL) if (result == NULL)
FUNCTION_TEST_RETURN(strLstAdd(this, string)); FUNCTION_TEST_RETURN(STRING, strLstAdd(this, string));
FUNCTION_TEST_RETURN(*result); FUNCTION_TEST_RETURN(STRING, *result);
} }
String * String *
@ -187,7 +187,7 @@ strLstAddZ(StringList *this, const char *string)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -210,7 +210,7 @@ strLstInsert(StringList *this, unsigned int listIdx, const String *string)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -240,7 +240,7 @@ strLstJoinQuote(const StringList *this, const char *separator, const char *quote
strCatFmt(join, "%s%s%s", quote, strZ(strLstGet(this, listIdx)), quote); strCatFmt(join, "%s%s%s", quote, strZ(strLstGet(this, listIdx)), quote);
} }
FUNCTION_TEST_RETURN(join); FUNCTION_TEST_RETURN(STRING, join);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -301,7 +301,7 @@ strLstMergeAnti(const StringList *this, const StringList *anti)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -326,7 +326,7 @@ strLstPtr(const StringList *this)
list[strLstSize(this)] = NULL; list[strLstSize(this)] = NULL;
FUNCTION_TEST_RETURN(list); FUNCTION_TEST_RETURN_CONST_P(STRINGZ, list);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -158,7 +158,7 @@ varDup(const Variant *this)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -213,7 +213,7 @@ varEq(const Variant *this1, const Variant *this2)
else else
result = this1 == NULL && this2 == NULL; result = this1 == NULL && this2 == NULL;
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -237,7 +237,7 @@ varNewBool(bool data)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -251,7 +251,7 @@ varBool(const Variant *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(varType(this) == varTypeBool); ASSERT(varType(this) == varTypeBool);
FUNCTION_TEST_RETURN(((VariantBool *)this)->pub.data); FUNCTION_TEST_RETURN(BOOL, ((VariantBool *)this)->pub.data);
} }
bool bool
@ -318,7 +318,7 @@ varBoolForce(const Variant *this)
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeBool]); THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeBool]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -342,7 +342,7 @@ varNewInt(int data)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -356,7 +356,7 @@ varInt(const Variant *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(varType(this) == varTypeInt); ASSERT(varType(this) == varTypeInt);
FUNCTION_TEST_RETURN(((VariantInt *)this)->pub.data); FUNCTION_TEST_RETURN(INT, ((VariantInt *)this)->pub.data);
} }
int int
@ -430,7 +430,7 @@ varIntForce(const Variant *this)
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeInt]); THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeInt]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -454,7 +454,7 @@ varNewInt64(int64_t data)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -468,7 +468,7 @@ varInt64(const Variant *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(varType(this) == varTypeInt64); ASSERT(varType(this) == varTypeInt64);
FUNCTION_TEST_RETURN(((VariantInt64 *)this)->pub.data); FUNCTION_TEST_RETURN(INT64, ((VariantInt64 *)this)->pub.data);
} }
int64_t int64_t
@ -526,7 +526,7 @@ varInt64Force(const Variant *this)
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeInt64]); THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeInt64]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT64, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -550,7 +550,7 @@ varNewUInt(unsigned int data)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -564,7 +564,7 @@ varUInt(const Variant *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(varType(this) == varTypeUInt); ASSERT(varType(this) == varTypeUInt);
FUNCTION_TEST_RETURN(((VariantUInt *)this)->pub.data); FUNCTION_TEST_RETURN(UINT, ((VariantUInt *)this)->pub.data);
} }
unsigned int unsigned int
@ -647,7 +647,7 @@ varUIntForce(const Variant *this)
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeUInt]); THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeUInt]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -671,7 +671,7 @@ varNewUInt64(uint64_t data)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -685,7 +685,7 @@ varUInt64(const Variant *this)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(varType(this) == varTypeUInt64); ASSERT(varType(this) == varTypeUInt64);
FUNCTION_TEST_RETURN(((VariantUInt64 *)this)->pub.data); FUNCTION_TEST_RETURN(UINT64, ((VariantUInt64 *)this)->pub.data);
} }
uint64_t uint64_t
@ -755,7 +755,7 @@ varUInt64Force(const Variant *this)
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeUInt64]); THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeUInt64]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -778,7 +778,7 @@ varNewKv(KeyValue *data)
if (data != NULL) if (data != NULL)
this->data = kvMove(data, memContextCurrent()); this->data = kvMove(data, memContextCurrent());
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -797,7 +797,7 @@ varKv(const Variant *this)
result = ((VariantKeyValue *)this)->data; result = ((VariantKeyValue *)this)->data;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(KEY_VALUE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -838,7 +838,7 @@ varNewStr(const String *data)
pubData->buffer[strSize(data)] = '\0'; pubData->buffer[strSize(data)] = '\0';
} }
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
Variant * Variant *
@ -848,7 +848,7 @@ varNewStrZ(const char *data)
FUNCTION_TEST_PARAM(STRINGZ, data); FUNCTION_TEST_PARAM(STRINGZ, data);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(varNewStr(data == NULL ? NULL : STR(data))); FUNCTION_TEST_RETURN(VARIANT, varNewStr(data == NULL ? NULL : STR(data)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -867,7 +867,7 @@ varStr(const Variant *this)
result = ((VariantString *)this)->pub.data; result = ((VariantString *)this)->pub.data;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
String * String *
@ -931,7 +931,7 @@ varStrForce(const Variant *this)
THROW_FMT(FormatError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeString]); THROW_FMT(FormatError, "unable to force %s to %s", variantTypeName[varType(this)], variantTypeName[varTypeString]);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -954,7 +954,7 @@ varNewVarLst(const VariantList *data)
if (data != NULL) if (data != NULL)
this->data = varLstDup(data); this->data = varLstDup(data);
FUNCTION_TEST_RETURN((Variant *)this); FUNCTION_TEST_RETURN(VARIANT, (Variant *)this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -973,7 +973,7 @@ varVarLst(const Variant *this)
result = ((VariantVariantList *)this)->data; result = ((VariantVariantList *)this)->data;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -30,7 +30,7 @@ varLstNewStrLst(const StringList *stringList)
varLstAdd(result, varNewStr(strLstGet(stringList, listIdx))); varLstAdd(result, varNewStr(strLstGet(stringList, listIdx)));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -51,5 +51,5 @@ varLstDup(const VariantList *source)
varLstAdd(result, varDup(varLstGet(source, listIdx))); varLstAdd(result, varDup(varLstGet(source, listIdx)));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }

View File

@ -79,7 +79,7 @@ static XmlNodeList *
xmlNodeLstNew(void) xmlNodeLstNew(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN((XmlNodeList *)lstNewP(sizeof(XmlNode *))); FUNCTION_TEST_RETURN(XML_NODE_LIST, (XmlNodeList *)lstNewP(sizeof(XmlNode *)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -99,7 +99,7 @@ xmlNodeNew(xmlNodePtr node)
.node = node, .node = node,
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(XML_NODE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -117,7 +117,7 @@ xmlNodeAdd(XmlNode *this, const String *name)
XmlNode *result = xmlNodeNew(xmlNewNode(NULL, BAD_CAST strZ(name))); XmlNode *result = xmlNodeNew(xmlNewNode(NULL, BAD_CAST strZ(name)));
xmlAddChild(this->node, result->node); xmlAddChild(this->node, result->node);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(XML_NODE, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -141,7 +141,7 @@ xmlNodeLstAdd(XmlNodeList *this, xmlNodePtr node)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(XML_NODE_LIST, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -165,7 +165,7 @@ xmlNodeAttribute(const XmlNode *this, const String *name)
xmlFree(value); xmlFree(value);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -185,7 +185,7 @@ xmlNodeContent(const XmlNode *this)
xmlFree(content); xmlFree(content);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
void void
@ -224,7 +224,7 @@ xmlNodeChildList(const XmlNode *this, const String *name)
xmlNodeLstAdd(list, currentNode); xmlNodeLstAdd(list, currentNode);
} }
FUNCTION_TEST_RETURN(list); FUNCTION_TEST_RETURN(XML_NODE_LIST, list);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -260,7 +260,7 @@ xmlNodeChildN(const XmlNode *this, const String *name, unsigned int index, bool
if (child == NULL && errorOnMissing) if (child == NULL && errorOnMissing)
THROW_FMT(FormatError, "unable to find child '%s':%u in node '%s'", strZ(name), index, this->node->name); THROW_FMT(FormatError, "unable to find child '%s':%u in node '%s'", strZ(name), index, this->node->name);
FUNCTION_TEST_RETURN(child); FUNCTION_TEST_RETURN(XML_NODE, child);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -281,7 +281,7 @@ xmlNodeChildTotal(const XmlNode *this, const String *name)
result++; result++;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -349,7 +349,7 @@ xmlDocumentNew(const String *rootName)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(XML_DOCUMENT, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -384,7 +384,7 @@ xmlDocumentNewBuf(const Buffer *buffer)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(XML_DOCUMENT, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -404,5 +404,5 @@ xmlDocumentBuf(const XmlDocument *this)
Buffer *result = bufNewC(xml, (size_t)xmlSize); Buffer *result = bufNewC(xml, (size_t)xmlSize);
xmlFree(xml); xmlFree(xml);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BUFFER, result);
} }

View File

@ -68,7 +68,7 @@ gid_t
groupId(void) groupId(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(userLocalData.groupId); FUNCTION_TEST_RETURN_TYPE(gid_t, userLocalData.groupId);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -84,10 +84,10 @@ groupIdFromName(const String *groupName)
struct group *groupData = getgrnam(strZ(groupName)); struct group *groupData = getgrnam(strZ(groupName));
if (groupData != NULL) if (groupData != NULL)
FUNCTION_TEST_RETURN(groupData->gr_gid); FUNCTION_TEST_RETURN_TYPE(gid_t, groupData->gr_gid);
} }
FUNCTION_TEST_RETURN((gid_t)-1); FUNCTION_TEST_RETURN_TYPE(gid_t, (gid_t)-1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -95,7 +95,7 @@ const String *
groupName(void) groupName(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(userLocalData.groupName); FUNCTION_TEST_RETURN_CONST(STRING, userLocalData.groupName);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -109,9 +109,9 @@ groupNameFromId(gid_t groupId)
struct group *groupData = getgrgid(groupId); struct group *groupData = getgrgid(groupId);
if (groupData != NULL) if (groupData != NULL)
FUNCTION_TEST_RETURN(strNewZ(groupData->gr_name)); FUNCTION_TEST_RETURN(STRING, strNewZ(groupData->gr_name));
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(STRING, NULL);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -119,7 +119,7 @@ uid_t
userId(void) userId(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(userLocalData.userId); FUNCTION_TEST_RETURN_TYPE(uid_t, userLocalData.userId);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -135,10 +135,10 @@ userIdFromName(const String *userName)
struct passwd *userData = getpwnam(strZ(userName)); struct passwd *userData = getpwnam(strZ(userName));
if (userData != NULL) if (userData != NULL)
FUNCTION_TEST_RETURN(userData->pw_uid); FUNCTION_TEST_RETURN_TYPE(uid_t, userData->pw_uid);
} }
FUNCTION_TEST_RETURN((uid_t)-1); FUNCTION_TEST_RETURN_TYPE(uid_t, (uid_t)-1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -146,7 +146,7 @@ const String *
userName(void) userName(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(userLocalData.userName); FUNCTION_TEST_RETURN_CONST(STRING, userLocalData.userName);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -160,9 +160,9 @@ userNameFromId(uid_t userId)
struct passwd *userData = getpwuid(userId); struct passwd *userData = getpwuid(userId);
if (userData != NULL) if (userData != NULL)
FUNCTION_TEST_RETURN(strNewZ(userData->pw_name)); FUNCTION_TEST_RETURN(STRING, strNewZ(userData->pw_name));
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(STRING, NULL);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -170,5 +170,5 @@ bool
userRoot(void) userRoot(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(userLocalData.userRoot); FUNCTION_TEST_RETURN(BOOL, userLocalData.userRoot);
} }

View File

@ -49,7 +49,7 @@ cfgParseSizeQualifier(const char qualifier)
THROW_FMT(AssertError, "'%c' is not a valid size qualifier", qualifier); THROW_FMT(AssertError, "'%c' is not a valid size qualifier", qualifier);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(INT64, result);
} }
int64_t int64_t
@ -106,7 +106,7 @@ cfgParseSize(const String *const value)
if (valueInt > INT64_MAX / multiplier) if (valueInt > INT64_MAX / multiplier)
THROW_FMT(FormatError, "value '%s' is out of range", strZ(value)); THROW_FMT(FormatError, "value '%s' is out of range", strZ(value));
FUNCTION_TEST_RETURN(valueInt * multiplier); FUNCTION_TEST_RETURN(INT64, valueInt * multiplier);
} }
THROW_FMT(FormatError, "value '%s' is not valid", strZ(value)); THROW_FMT(FormatError, "value '%s' is not valid", strZ(value));
@ -122,5 +122,5 @@ cfgParseTime(const String *const value)
ASSERT(value != NULL); ASSERT(value != NULL);
FUNCTION_TEST_RETURN((int64_t)(cvtZToDouble(strZ(value)) * MSEC_PER_SEC)); FUNCTION_TEST_RETURN(INT64, (int64_t)(cvtZToDouble(strZ(value)) * MSEC_PER_SEC));
} }

View File

@ -43,7 +43,7 @@ ConfigCommand
cfgCommand(void) cfgCommand(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(configLocal == NULL ? cfgCmdNone : configLocal->command); FUNCTION_TEST_RETURN(ENUM, configLocal == NULL ? cfgCmdNone : configLocal->command);
} }
ConfigCommandRole ConfigCommandRole
@ -51,7 +51,7 @@ cfgCommandRole(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
FUNCTION_TEST_RETURN(configLocal->commandRole); FUNCTION_TEST_RETURN(ENUM, configLocal->commandRole);
} }
void void
@ -77,7 +77,7 @@ cfgCommandHelp(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
FUNCTION_TEST_RETURN(configLocal->help); FUNCTION_TEST_RETURN(BOOL, configLocal->help);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -92,7 +92,7 @@ cfgCommandJobRetry(void)
unsigned int retryTotal = cfgOptionUInt(cfgOptJobRetry); unsigned int retryTotal = cfgOptionUInt(cfgOptJobRetry);
if (retryTotal == 0) if (retryTotal == 0)
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(VARIANT_LIST, NULL);
// Build retry list // Build retry list
VariantList *result = varLstNew(); VariantList *result = varLstNew();
@ -100,7 +100,7 @@ cfgCommandJobRetry(void)
for (unsigned int retryIdx = 0; retryIdx < cfgOptionUInt(cfgOptJobRetry); retryIdx++) for (unsigned int retryIdx = 0; retryIdx < cfgOptionUInt(cfgOptJobRetry); retryIdx++)
varLstAdd(result, varNewUInt64(retryIdx == 0 ? 0 : cfgOptionUInt64(cfgOptJobRetryInterval))); varLstAdd(result, varNewUInt64(retryIdx == 0 ? 0 : cfgOptionUInt64(cfgOptJobRetryInterval)));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(VARIANT_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -112,7 +112,7 @@ cfgCommandName(void)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(configLocal->command < cfgCmdNone); ASSERT(configLocal->command < cfgCmdNone);
FUNCTION_TEST_RETURN(cfgParseCommandName(configLocal->command)); FUNCTION_TEST_RETURN_CONST(STRINGZ, cfgParseCommandName(configLocal->command));
} }
String * String *
@ -120,7 +120,7 @@ cfgCommandRoleName(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(cfgParseCommandRoleName(cfgCommand(), cfgCommandRole(), COLON_STR)); FUNCTION_TEST_RETURN(STRING, cfgParseCommandRoleName(cfgCommand(), cfgCommandRole(), COLON_STR));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -140,7 +140,7 @@ cfgCommandParam(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(configLocal->paramList); FUNCTION_TEST_RETURN(STRING_LIST, configLocal->paramList);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -149,7 +149,7 @@ cfgExe(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
FUNCTION_TEST_RETURN(configLocal->exe); FUNCTION_TEST_RETURN(STRING, configLocal->exe);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -163,6 +163,7 @@ cfgLockRequired(void)
// Local roles never take a lock and the remote role has special logic for locking // Local roles never take a lock and the remote role has special logic for locking
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
BOOL,
// If a lock is required for the command and the role is main // If a lock is required for the command and the role is main
(configLocal->lockRequired && cfgCommandRole() == cfgCmdRoleMain) || (configLocal->lockRequired && cfgCommandRole() == cfgCmdRoleMain) ||
// Or any command when the role is async // Or any command when the role is async
@ -178,7 +179,7 @@ cfgLockRemoteRequired(void)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(configLocal->command != cfgCmdNone); ASSERT(configLocal->command != cfgCmdNone);
FUNCTION_TEST_RETURN(configLocal->lockRemoteRequired); FUNCTION_TEST_RETURN(BOOL, configLocal->lockRemoteRequired);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -190,7 +191,7 @@ cfgLockType(void)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(configLocal->command != cfgCmdNone); ASSERT(configLocal->command != cfgCmdNone);
FUNCTION_TEST_RETURN(configLocal->lockType); FUNCTION_TEST_RETURN(ENUM, configLocal->lockType);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -203,6 +204,7 @@ cfgLogFile(void)
ASSERT(configLocal->command != cfgCmdNone); ASSERT(configLocal->command != cfgCmdNone);
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
BOOL,
// If the command always logs to a file // If the command always logs to a file
configLocal->logFile || configLocal->logFile ||
// Or log-level-file was explicitly set as a param/env var // Or log-level-file was explicitly set as a param/env var
@ -220,7 +222,7 @@ cfgLogLevelDefault(void)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(configLocal->command != cfgCmdNone); ASSERT(configLocal->command != cfgCmdNone);
FUNCTION_TEST_RETURN(configLocal->logLevelDefault); FUNCTION_TEST_RETURN(ENUM, configLocal->logLevelDefault);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -234,7 +236,7 @@ cfgOptionGroup(ConfigOption optionId)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(configLocal->option[optionId].group); FUNCTION_TEST_RETURN(BOOL, configLocal->option[optionId].group);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -265,7 +267,7 @@ cfgOptionGroupName(const ConfigOptionGroup groupId, const unsigned int groupIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(strZ(group->indexName[groupIdx])); FUNCTION_TEST_RETURN_CONST(STRINGZ, strZ(group->indexName[groupIdx]));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -280,7 +282,7 @@ cfgOptionGroupId(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
ASSERT(configLocal->option[optionId].group); ASSERT(configLocal->option[optionId].group);
FUNCTION_TEST_RETURN(configLocal->option[optionId].groupId); FUNCTION_TEST_RETURN(UINT, configLocal->option[optionId].groupId);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -295,7 +297,7 @@ cfgOptionGroupIdxDefault(ConfigOptionGroup groupId)
ASSERT(groupId < CFG_OPTION_GROUP_TOTAL); ASSERT(groupId < CFG_OPTION_GROUP_TOTAL);
ASSERT(configLocal->optionGroup[groupId].indexDefaultExists); ASSERT(configLocal->optionGroup[groupId].indexDefaultExists);
FUNCTION_TEST_RETURN(configLocal->optionGroup[groupId].indexDefault); FUNCTION_TEST_RETURN(UINT, configLocal->optionGroup[groupId].indexDefault);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -311,7 +313,7 @@ cfgOptionGroupIdxToKey(ConfigOptionGroup groupId, unsigned int groupIdx)
ASSERT(groupId < CFG_OPTION_GROUP_TOTAL); ASSERT(groupId < CFG_OPTION_GROUP_TOTAL);
ASSERT(groupIdx < configLocal->optionGroup[groupId].indexTotal); ASSERT(groupIdx < configLocal->optionGroup[groupId].indexTotal);
FUNCTION_TEST_RETURN(configLocal->optionGroup[groupId].indexMap[groupIdx] + 1); FUNCTION_TEST_RETURN(UINT, configLocal->optionGroup[groupId].indexMap[groupIdx] + 1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -345,7 +347,7 @@ cfgOptionKeyToIdx(ConfigOption optionId, unsigned int key)
THROW_FMT(AssertError, "key '%u' is not valid for '%s' option", key, configLocal->option[optionId].name); THROW_FMT(AssertError, "key '%u' is not valid for '%s' option", key, configLocal->option[optionId].name);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -359,7 +361,7 @@ cfgOptionGroupIdxTotal(ConfigOptionGroup groupId)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(groupId < CFG_OPTION_GROUP_TOTAL); ASSERT(groupId < CFG_OPTION_GROUP_TOTAL);
FUNCTION_TEST_RETURN(configLocal->optionGroup[groupId].indexTotal); FUNCTION_TEST_RETURN(UINT, configLocal->optionGroup[groupId].indexTotal);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -373,7 +375,7 @@ cfgOptionGroupValid(ConfigOptionGroup groupId)
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
ASSERT(groupId < CFG_OPTION_GROUP_TOTAL); ASSERT(groupId < CFG_OPTION_GROUP_TOTAL);
FUNCTION_TEST_RETURN(configLocal->optionGroup[groupId].valid); FUNCTION_TEST_RETURN(BOOL, configLocal->optionGroup[groupId].valid);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -391,7 +393,7 @@ cfgOptionIdxDefault(ConfigOption optionId)
const ConfigOptionData *const option = &configLocal->option[optionId]; const ConfigOptionData *const option = &configLocal->option[optionId];
FUNCTION_TEST_RETURN(option->group ? configLocal->optionGroup[option->groupId].indexDefault : 0); FUNCTION_TEST_RETURN(UINT, option->group ? configLocal->optionGroup[option->groupId].indexDefault : 0);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -407,7 +409,7 @@ cfgOptionIdxTotal(ConfigOption optionId)
const ConfigOptionData *const option = &configLocal->option[optionId]; const ConfigOptionData *const option = &configLocal->option[optionId];
FUNCTION_TEST_RETURN(option->group ? configLocal->optionGroup[option->groupId].indexTotal : 1); FUNCTION_TEST_RETURN(UINT, option->group ? configLocal->optionGroup[option->groupId].indexTotal : 1);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -426,7 +428,7 @@ cfgOptionDefault(ConfigOption optionId)
if (option->defaultValue == NULL) if (option->defaultValue == NULL)
option->defaultValue = cfgParseOptionDefault(cfgCommand(), optionId); option->defaultValue = cfgParseOptionDefault(cfgCommand(), optionId);
FUNCTION_TEST_RETURN(option->defaultValue); FUNCTION_TEST_RETURN_CONST(STRING, option->defaultValue);
} }
void void
@ -484,22 +486,22 @@ cfgOptionDisplayVar(const Variant *const value, const ConfigOptionType optionTyp
if (varType(value) == varTypeString) if (varType(value) == varTypeString)
{ {
FUNCTION_TEST_RETURN(varStr(value)); FUNCTION_TEST_RETURN_CONST(STRING, varStr(value));
} }
else if (optionType == cfgOptTypeBoolean) else if (optionType == cfgOptTypeBoolean)
{ {
FUNCTION_TEST_RETURN(varBool(value) ? TRUE_STR : FALSE_STR); FUNCTION_TEST_RETURN_CONST(STRING, varBool(value) ? TRUE_STR : FALSE_STR);
} }
else if (optionType == cfgOptTypeTime) else if (optionType == cfgOptTypeTime)
{ {
FUNCTION_TEST_RETURN(strNewDbl((double)varInt64(value) / MSEC_PER_SEC)); FUNCTION_TEST_RETURN_CONST(STRING, strNewDbl((double)varInt64(value) / MSEC_PER_SEC));
} }
else if (optionType == cfgOptTypeStringId) else if (optionType == cfgOptTypeStringId)
{ {
FUNCTION_TEST_RETURN(strIdToStr(varUInt64(value))); FUNCTION_TEST_RETURN_CONST(STRING, strIdToStr(varUInt64(value)));
} }
FUNCTION_TEST_RETURN(varStrForce(value)); FUNCTION_TEST_RETURN(STRING, varStrForce(value));
} }
const String * const String *
@ -524,7 +526,7 @@ cfgOptionIdxDisplay(const ConfigOption optionId, const unsigned int optionIdx)
ConfigOptionValue *const option = &configLocal->option[optionId].index[optionIdx]; ConfigOptionValue *const option = &configLocal->option[optionId].index[optionIdx];
if (option->display != NULL) if (option->display != NULL)
FUNCTION_TEST_RETURN(option->display); FUNCTION_TEST_RETURN_CONST(STRING, option->display);
// Generate the display value based on the type // Generate the display value based on the type
MEM_CONTEXT_BEGIN(configLocal->memContext) MEM_CONTEXT_BEGIN(configLocal->memContext)
@ -534,7 +536,7 @@ cfgOptionIdxDisplay(const ConfigOption optionId, const unsigned int optionIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN(option->display); FUNCTION_TEST_RETURN_CONST(STRING, option->display);
} }
const String * const String *
@ -544,7 +546,7 @@ cfgOptionDisplay(const ConfigOption optionId)
FUNCTION_TEST_PARAM(ENUM, optionId); FUNCTION_TEST_PARAM(ENUM, optionId);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(cfgOptionIdxDisplay(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN_CONST(STRING, cfgOptionIdxDisplay(optionId, cfgOptionIdxDefault(optionId)));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -559,7 +561,7 @@ cfgOptionName(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(cfgOptionIdxName(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN_CONST(STRINGZ, cfgOptionIdxName(optionId, cfgOptionIdxDefault(optionId)));
} }
const char * const char *
@ -599,11 +601,11 @@ cfgOptionIdxName(ConfigOption optionId, unsigned int optionIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(strZ(option->indexName[optionIdx])); FUNCTION_TEST_RETURN_CONST(STRINGZ, strZ(option->indexName[optionIdx]));
} }
// Else not indexed // Else not indexed
FUNCTION_TEST_RETURN(option->name); FUNCTION_TEST_RETURN_CONST(STRINGZ, option->name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -614,7 +616,7 @@ cfgOptionNegate(ConfigOption optionId)
FUNCTION_TEST_PARAM(ENUM, optionId); FUNCTION_TEST_PARAM(ENUM, optionId);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(cfgOptionIdxNegate(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN(BOOL, cfgOptionIdxNegate(optionId, cfgOptionIdxDefault(optionId)));
} }
bool bool
@ -631,7 +633,7 @@ cfgOptionIdxNegate(ConfigOption optionId, unsigned int optionIdx)
ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal); ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal);
ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal)); ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal));
FUNCTION_TEST_RETURN(configLocal->option[optionId].index[optionIdx].negate); FUNCTION_TEST_RETURN(BOOL, configLocal->option[optionId].index[optionIdx].negate);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -642,7 +644,7 @@ cfgOptionReset(ConfigOption optionId)
FUNCTION_TEST_PARAM(ENUM, optionId); FUNCTION_TEST_PARAM(ENUM, optionId);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(cfgOptionIdxReset(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN(BOOL, cfgOptionIdxReset(optionId, cfgOptionIdxDefault(optionId)));
} }
bool bool
@ -659,7 +661,7 @@ cfgOptionIdxReset(ConfigOption optionId, unsigned int optionIdx)
ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal); ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal);
ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal)); ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal));
FUNCTION_TEST_RETURN(configLocal->option[optionId].index[optionIdx].reset); FUNCTION_TEST_RETURN(BOOL, configLocal->option[optionId].index[optionIdx].reset);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -702,7 +704,7 @@ cfgOptionIdxInternal(
else if (!nullAllowed) else if (!nullAllowed)
THROW_FMT(AssertError, "option '%s' is null but non-null was requested", cfgOptionIdxName(optionId, optionIdx)); THROW_FMT(AssertError, "option '%s' is null but non-null was requested", cfgOptionIdxName(optionId, optionIdx));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE_P(ConfigOptionValue, result);
} }
Variant * Variant *
@ -727,29 +729,29 @@ cfgOptionIdxVar(const ConfigOption optionId, const unsigned int optionIdx)
switch (option->dataType) switch (option->dataType)
{ {
case cfgOptDataTypeBoolean: case cfgOptDataTypeBoolean:
FUNCTION_TEST_RETURN(varNewBool(optionValueType->boolean)); FUNCTION_TEST_RETURN(VARIANT, varNewBool(optionValueType->boolean));
case cfgOptDataTypeHash: case cfgOptDataTypeHash:
FUNCTION_TEST_RETURN(varNewKv(kvDup(optionValueType->keyValue))); FUNCTION_TEST_RETURN(VARIANT, varNewKv(kvDup(optionValueType->keyValue)));
case cfgOptDataTypeInteger: case cfgOptDataTypeInteger:
FUNCTION_TEST_RETURN(varNewInt64(optionValueType->integer)); FUNCTION_TEST_RETURN(VARIANT, varNewInt64(optionValueType->integer));
case cfgOptDataTypeList: case cfgOptDataTypeList:
FUNCTION_TEST_RETURN(varNewVarLst(optionValueType->list)); FUNCTION_TEST_RETURN(VARIANT, varNewVarLst(optionValueType->list));
case cfgOptDataTypeStringId: case cfgOptDataTypeStringId:
FUNCTION_TEST_RETURN(varNewUInt64(optionValueType->stringId)); FUNCTION_TEST_RETURN(VARIANT, varNewUInt64(optionValueType->stringId));
default: default:
ASSERT(option->dataType == cfgOptDataTypeString); ASSERT(option->dataType == cfgOptDataTypeString);
break; break;
} }
FUNCTION_TEST_RETURN(varNewStr(optionValueType->string)); FUNCTION_TEST_RETURN(VARIANT, varNewStr(optionValueType->string));
} }
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(VARIANT, NULL);
} }
bool bool
@ -1004,7 +1006,7 @@ cfgOptionSource(ConfigOption optionId)
FUNCTION_TEST_PARAM(ENUM, optionId); FUNCTION_TEST_PARAM(ENUM, optionId);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(cfgOptionIdxSource(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN(ENUM, cfgOptionIdxSource(optionId, cfgOptionIdxDefault(optionId)));
} }
ConfigSource ConfigSource
@ -1021,7 +1023,7 @@ cfgOptionIdxSource(ConfigOption optionId, unsigned int optionIdx)
ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal); ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal);
ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal)); ASSERT((!group && optionIdx == 0) || (group && optionIdx < indexTotal));
FUNCTION_TEST_RETURN(configLocal->option[optionId].index[optionIdx].source); FUNCTION_TEST_RETURN(ENUM, configLocal->option[optionId].index[optionIdx].source);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1032,7 +1034,7 @@ cfgOptionTest(ConfigOption optionId)
FUNCTION_TEST_PARAM(ENUM, optionId); FUNCTION_TEST_PARAM(ENUM, optionId);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(cfgOptionIdxTest(optionId, cfgOptionIdxDefault(optionId))); FUNCTION_TEST_RETURN(BOOL, cfgOptionIdxTest(optionId, cfgOptionIdxDefault(optionId)));
} }
bool bool
@ -1049,7 +1051,7 @@ cfgOptionIdxTest(ConfigOption optionId, unsigned int optionIdx)
ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal); ASSERT_DECLARE(const unsigned int indexTotal = configLocal->optionGroup[configLocal->option[optionId].groupId].indexTotal);
ASSERT(!cfgOptionValid(optionId) || ((!group && optionIdx == 0) || (group && optionIdx < indexTotal))); ASSERT(!cfgOptionValid(optionId) || ((!group && optionIdx == 0) || (group && optionIdx < indexTotal)));
FUNCTION_TEST_RETURN(cfgOptionValid(optionId) && configLocal->option[optionId].index[optionIdx].set); FUNCTION_TEST_RETURN(BOOL, cfgOptionValid(optionId) && configLocal->option[optionId].index[optionIdx].set);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1063,7 +1065,7 @@ cfgOptionValid(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
ASSERT(configLocal != NULL); ASSERT(configLocal != NULL);
FUNCTION_TEST_RETURN(configLocal->option[optionId].valid); FUNCTION_TEST_RETURN(BOOL, configLocal->option[optionId].valid);
} }
void void

View File

@ -339,7 +339,7 @@ parseOptionIdxValue(ParseOption *optionList, unsigned int optionId, unsigned int
} }
// Return the indexed value // Return the indexed value
FUNCTION_TEST_RETURN(&optionList[optionId].indexList[optionKeyIdx]); FUNCTION_TEST_RETURN_TYPE_P(ParseOptionValue, &optionList[optionId].indexList[optionKeyIdx]);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -362,7 +362,7 @@ cfgParseCommandId(const char *const commandName)
break; break;
} }
FUNCTION_TEST_RETURN(commandId); FUNCTION_TEST_RETURN(ENUM, commandId);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -375,7 +375,7 @@ cfgParseCommandName(const ConfigCommand commandId)
ASSERT(commandId < cfgCmdNone); ASSERT(commandId < cfgCmdNone);
FUNCTION_TEST_RETURN(parseRuleCommand[commandId].name); FUNCTION_TEST_RETURN_CONST(STRINGZ, parseRuleCommand[commandId].name);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -393,13 +393,13 @@ cfgParseCommandRoleEnum(const String *const commandRole)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
if (commandRole == NULL) if (commandRole == NULL)
FUNCTION_TEST_RETURN(cfgCmdRoleMain); FUNCTION_TEST_RETURN(ENUM, cfgCmdRoleMain);
else if (strEq(commandRole, CONFIG_COMMAND_ROLE_ASYNC_STR)) else if (strEq(commandRole, CONFIG_COMMAND_ROLE_ASYNC_STR))
FUNCTION_TEST_RETURN(cfgCmdRoleAsync); FUNCTION_TEST_RETURN(ENUM, cfgCmdRoleAsync);
else if (strEq(commandRole, CONFIG_COMMAND_ROLE_LOCAL_STR)) else if (strEq(commandRole, CONFIG_COMMAND_ROLE_LOCAL_STR))
FUNCTION_TEST_RETURN(cfgCmdRoleLocal); FUNCTION_TEST_RETURN(ENUM, cfgCmdRoleLocal);
else if (strEq(commandRole, CONFIG_COMMAND_ROLE_REMOTE_STR)) else if (strEq(commandRole, CONFIG_COMMAND_ROLE_REMOTE_STR))
FUNCTION_TEST_RETURN(cfgCmdRoleRemote); FUNCTION_TEST_RETURN(ENUM, cfgCmdRoleRemote);
THROW_FMT(CommandInvalidError, "invalid command role '%s'", strZ(commandRole)); THROW_FMT(CommandInvalidError, "invalid command role '%s'", strZ(commandRole));
} }
@ -431,7 +431,7 @@ cfgParseCommandRoleStr(const ConfigCommandRole commandRole)
break; break;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -449,7 +449,7 @@ cfgParseCommandRoleName(const ConfigCommand commandId, const ConfigCommandRole c
if (commandRoleId != cfgCmdRoleMain) if (commandRoleId != cfgCmdRoleMain)
strCatFmt(result, "%s%s", strZ(separator), strZ(cfgParseCommandRoleStr(commandRoleId))); strCatFmt(result, "%s%s", strZ(separator), strZ(cfgParseCommandRoleStr(commandRoleId)));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -662,10 +662,10 @@ cfgParseOption(const String *const optionCandidate, const CfgParseOptionParam pa
THROW_FMT(OptionInvalidError, "option '%s' must have an index", strZ(optionCandidate)); THROW_FMT(OptionInvalidError, "option '%s' must have an index", strZ(optionCandidate));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(CfgParseOptionResult, result);
} }
FUNCTION_TEST_RETURN((CfgParseOptionResult){0}); FUNCTION_TEST_RETURN_TYPE(CfgParseOptionResult, (CfgParseOptionResult){0});
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -681,21 +681,21 @@ cfgParseOptionDataType(const ConfigOption optionId)
switch (parseRuleOption[optionId].type) switch (parseRuleOption[optionId].type)
{ {
case cfgOptTypeBoolean: case cfgOptTypeBoolean:
FUNCTION_TEST_RETURN(cfgOptDataTypeBoolean); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeBoolean);
case cfgOptTypeHash: case cfgOptTypeHash:
FUNCTION_TEST_RETURN(cfgOptDataTypeHash); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeHash);
case cfgOptTypeInteger: case cfgOptTypeInteger:
case cfgOptTypeSize: case cfgOptTypeSize:
case cfgOptTypeTime: case cfgOptTypeTime:
FUNCTION_TEST_RETURN(cfgOptDataTypeInteger); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeInteger);
case cfgOptTypeList: case cfgOptTypeList:
FUNCTION_TEST_RETURN(cfgOptDataTypeList); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeList);
case cfgOptTypeStringId: case cfgOptTypeStringId:
FUNCTION_TEST_RETURN(cfgOptDataTypeStringId); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeStringId);
default: default:
break; break;
@ -703,7 +703,7 @@ cfgParseOptionDataType(const ConfigOption optionId)
ASSERT(parseRuleOption[optionId].type == cfgOptTypePath || parseRuleOption[optionId].type == cfgOptTypeString); ASSERT(parseRuleOption[optionId].type == cfgOptTypePath || parseRuleOption[optionId].type == cfgOptTypeString);
FUNCTION_TEST_RETURN(cfgOptDataTypeString); FUNCTION_TEST_RETURN(ENUM, cfgOptDataTypeString);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -824,7 +824,7 @@ cfgParseOptionalRule(
if (optionalRules->pack == NULL) if (optionalRules->pack == NULL)
{ {
optionalRules->done = true; optionalRules->done = true;
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
} }
@ -838,7 +838,7 @@ cfgParseOptionalRule(
if (!pckReadNext(optionalRules->pack)) if (!pckReadNext(optionalRules->pack))
{ {
optionalRules->done = true; optionalRules->done = true;
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
optionalRules->typeNext = pckReadU32P(optionalRules->pack); optionalRules->typeNext = pckReadU32P(optionalRules->pack);
@ -945,7 +945,7 @@ cfgParseOptionalRule(
{ {
// If the optional rule type is greater than requested then return. The optional rule may be requested later. // If the optional rule type is greater than requested then return. The optional rule may be requested later.
if (optionalRules->typeNext > optionalRuleType) if (optionalRules->typeNext > optionalRuleType)
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
// Consume the unused optional rule // Consume the unused optional rule
pckReadConsume(optionalRules->pack); pckReadConsume(optionalRules->pack);
@ -957,7 +957,7 @@ cfgParseOptionalRule(
while (!result); while (!result);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1025,7 +1025,7 @@ cfgParseOptionalFilterDepend(PackRead *const filter, const Config *const config,
result.valid = true; result.valid = true;
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(CfgParseOptionalFilterDependResult, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1051,7 +1051,7 @@ cfgParseOptionDefault(ConfigCommand commandId, ConfigOption optionId)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1064,7 +1064,7 @@ cfgParseOptionName(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(parseRuleOption[optionId].name); FUNCTION_TEST_RETURN_CONST(STRINGZ, parseRuleOption[optionId].name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1086,11 +1086,11 @@ cfgParseOptionKeyIdxName(ConfigOption optionId, unsigned int keyIdx)
"%s%u%s", parseRuleOptionGroup[parseRuleOption[optionId].groupId].name, keyIdx + 1, "%s%u%s", parseRuleOptionGroup[parseRuleOption[optionId].groupId].name, keyIdx + 1,
parseRuleOption[optionId].name + strlen(parseRuleOptionGroup[parseRuleOption[optionId].groupId].name)); parseRuleOption[optionId].name + strlen(parseRuleOptionGroup[parseRuleOption[optionId].groupId].name));
FUNCTION_TEST_RETURN(strZ(name)); FUNCTION_TEST_RETURN_CONST(STRINGZ, strZ(name));
} }
// Else return the stored name // Else return the stored name
FUNCTION_TEST_RETURN(parseRuleOption[optionId].name); FUNCTION_TEST_RETURN_CONST(STRINGZ, parseRuleOption[optionId].name);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1121,9 +1121,9 @@ cfgParseOptionRequired(ConfigCommand commandId, ConfigOption optionId)
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
if (found) if (found)
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(BOOL, result);
FUNCTION_TEST_RETURN(parseRuleOption[optionId].required); FUNCTION_TEST_RETURN(BOOL, parseRuleOption[optionId].required);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1136,7 +1136,7 @@ cfgParseOptionSecure(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(parseRuleOption[optionId].secure); FUNCTION_TEST_RETURN(BOOL, parseRuleOption[optionId].secure);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1149,7 +1149,7 @@ cfgParseOptionType(ConfigOption optionId)
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(parseRuleOption[optionId].type); FUNCTION_TEST_RETURN(ENUM, parseRuleOption[optionId].type);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -1165,7 +1165,7 @@ cfgParseOptionValid(ConfigCommand commandId, ConfigCommandRole commandRoleId, Co
ASSERT(commandId < CFG_COMMAND_TOTAL); ASSERT(commandId < CFG_COMMAND_TOTAL);
ASSERT(optionId < CFG_OPTION_TOTAL); ASSERT(optionId < CFG_OPTION_TOTAL);
FUNCTION_TEST_RETURN(parseRuleOption[optionId].commandRoleValid[commandRoleId] & ((uint32_t)1 << commandId)); FUNCTION_TEST_RETURN(BOOL, parseRuleOption[optionId].commandRoleValid[commandRoleId] & ((uint32_t)1 << commandId));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -350,7 +350,7 @@ dbBackupStartQuery(unsigned int pgVersion, bool startFast)
// Complete query // Complete query
strCatZ(result, ") as lsn"); strCatZ(result, ") as lsn");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
DbBackupStartResult DbBackupStartResult
@ -520,7 +520,7 @@ dbBackupStopQuery(unsigned int pgVersion)
if (pgVersion < PG_VERSION_96) if (pgVersion < PG_VERSION_96)
strCatZ(result, " as lsn"); strCatZ(result, " as lsn");
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
DbBackupStopResult DbBackupStopResult

View File

@ -121,7 +121,7 @@ infoNewInternal(void)
.memContext = memContextCurrent(), .memContext = memContextCurrent(),
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(INFO, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -329,6 +329,7 @@ infoSaveSection(InfoSave *infoSaveData, const String *section, const String *sec
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
BOOL,
(infoSaveData->sectionLast == NULL || strCmp(section, infoSaveData->sectionLast) > 0) && (infoSaveData->sectionLast == NULL || strCmp(section, infoSaveData->sectionLast) > 0) &&
(sectionNext == NULL || strCmp(section, sectionNext) < 0)); (sectionNext == NULL || strCmp(section, sectionNext) < 0));
} }

View File

@ -52,7 +52,7 @@ infoArchiveNewInternal(void)
}, },
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(INFO_ARCHIVE, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -84,7 +84,7 @@ infoBackupNewInternal(void)
}, },
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(INFO_BACKUP, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -68,7 +68,7 @@ infoPgNewInternal(InfoPgType type)
.type = type, .type = type,
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(INFO_PG, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -175,9 +175,9 @@ manifestOwnerCache(Manifest *this, const String *owner)
ASSERT(this != NULL); ASSERT(this != NULL);
if (owner != NULL) if (owner != NULL)
FUNCTION_TEST_RETURN(strLstAddIfMissing(this->ownerList, owner)); FUNCTION_TEST_RETURN_CONST(STRING, strLstAddIfMissing(this->ownerList, owner));
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN_CONST(STRING, NULL);
} }
static void static void
@ -343,7 +343,7 @@ manifestFilePack(const Manifest *const manifest, const ManifestFile *const file)
memcpy(result + resultPos, (uint8_t *)strZ(file->checksumPageErrorList), strSize(file->checksumPageErrorList) + 1); memcpy(result + resultPos, (uint8_t *)strZ(file->checksumPageErrorList), strSize(file->checksumPageErrorList) + 1);
} }
FUNCTION_TEST_RETURN((ManifestFilePack *)result); FUNCTION_TEST_RETURN_TYPE_P(ManifestFilePack, (ManifestFilePack *)result);
} }
ManifestFile ManifestFile
@ -418,7 +418,7 @@ manifestFileUnpack(const Manifest *const manifest, const ManifestFilePack *const
if (flag & (1 << manifestFilePackFlagChecksumPageErrorList)) if (flag & (1 << manifestFilePackFlagChecksumPageErrorList))
result.checksumPageErrorList = (const String *)((const uint8_t *)filePack + bufferPos + ALIGN_OFFSET(StringPub, bufferPos)); result.checksumPageErrorList = (const String *)((const uint8_t *)filePack + bufferPos + ALIGN_OFFSET(StringPub, bufferPos));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(ManifestFile, result);
} }
void void
@ -589,7 +589,7 @@ manifestNewInternal(void)
.referenceList = strLstNew(), .referenceList = strLstNew(),
}; };
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(MANIFEST, this);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -619,7 +619,8 @@ static ManifestLinkCheck
manifestLinkCheckInit(void) manifestLinkCheckInit(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN((ManifestLinkCheck){.linkList = lstNewP(sizeof(ManifestLinkCheckItem), .comparator = lstComparatorStr)}); FUNCTION_TEST_RETURN_TYPE(
ManifestLinkCheck, (ManifestLinkCheck){.linkList = lstNewP(sizeof(ManifestLinkCheckItem), .comparator = lstComparatorStr)});
} }
// Helper to check a single link specified by targetIdx // Helper to check a single link specified by targetIdx
@ -1711,10 +1712,10 @@ manifestOwnerGet(const Variant *owner)
if (varType(owner) == varTypeBool) if (varType(owner) == varTypeBool)
{ {
CHECK(FormatError, !varBool(owner), "owner bool must be false"); CHECK(FormatError, !varBool(owner), "owner bool must be false");
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN_CONST(STRING, NULL);
} }
FUNCTION_TEST_RETURN(varStr(owner)); FUNCTION_TEST_RETURN_CONST(STRING, varStr(owner));
} }
// Helper to check the variant type of owner and duplicate (call in the containing context) // Helper to check the variant type of owner and duplicate (call in the containing context)
@ -1732,11 +1733,11 @@ manifestOwnerDefaultGet(const Variant *ownerDefault)
{ {
// Value must be false // Value must be false
CHECK(FormatError, !varBool(ownerDefault), "owner bool must be false"); CHECK(FormatError, !varBool(ownerDefault), "owner bool must be false");
FUNCTION_TEST_RETURN(BOOL_FALSE_VAR); FUNCTION_TEST_RETURN_CONST(VARIANT, BOOL_FALSE_VAR);
} }
// Return a duplicate of the owner passed in // Return a duplicate of the owner passed in
FUNCTION_TEST_RETURN(varDup(ownerDefault)); FUNCTION_TEST_RETURN_CONST(VARIANT, varDup(ownerDefault));
} }
static void static void
@ -2187,7 +2188,7 @@ manifestOwnerVar(const String *ownerDefault)
FUNCTION_TEST_PARAM(STRING, ownerDefault); FUNCTION_TEST_PARAM(STRING, ownerDefault);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(ownerDefault == NULL ? BOOL_FALSE_VAR : varNewStr(ownerDefault)); FUNCTION_TEST_RETURN_CONST(VARIANT, ownerDefault == NULL ? BOOL_FALSE_VAR : varNewStr(ownerDefault));
} }
static void static void
@ -2677,7 +2678,7 @@ manifestDbFind(const Manifest *this, const String *name)
if (result == NULL) if (result == NULL)
THROW_FMT(AssertError, "unable to find '%s' in manifest db list", strZ(name)); THROW_FMT(AssertError, "unable to find '%s' in manifest db list", strZ(name));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(MANIFEST_DB, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -2699,7 +2700,7 @@ manifestFilePackFindInternal(const Manifest *this, const String *name)
if (filePack == NULL) if (filePack == NULL)
THROW_FMT(AssertError, "unable to find '%s' in manifest file list", strZ(name)); THROW_FMT(AssertError, "unable to find '%s' in manifest file list", strZ(name));
FUNCTION_TEST_RETURN(filePack); FUNCTION_TEST_RETURN_TYPE_PP(ManifestFilePack, filePack);
} }
const ManifestFilePack * const ManifestFilePack *
@ -2713,7 +2714,7 @@ manifestFilePackFind(const Manifest *this, const String *name)
ASSERT(this != NULL); ASSERT(this != NULL);
ASSERT(name != NULL); ASSERT(name != NULL);
FUNCTION_TEST_RETURN(*manifestFilePackFindInternal(this, name)); FUNCTION_TEST_RETURN_TYPE_P(ManifestFilePack, *manifestFilePackFindInternal(this, name));
} }
void void
@ -2815,7 +2816,7 @@ manifestLinkFind(const Manifest *this, const String *name)
if (result == NULL) if (result == NULL)
THROW_FMT(AssertError, "unable to find '%s' in manifest link list", strZ(name)); THROW_FMT(AssertError, "unable to find '%s' in manifest link list", strZ(name));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(MANIFEST_LINK, result);
} }
void void
@ -2879,7 +2880,7 @@ manifestPathFind(const Manifest *this, const String *name)
if (result == NULL) if (result == NULL)
THROW_FMT(AssertError, "unable to find '%s' in manifest path list", strZ(name)); THROW_FMT(AssertError, "unable to find '%s' in manifest path list", strZ(name));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(MANIFEST_PATH, result);
} }
String * String *
@ -2894,7 +2895,7 @@ manifestPathPg(const String *manifestPath)
// If something in pg_data/ // If something in pg_data/
if (strBeginsWith(manifestPath, STRDEF(MANIFEST_TARGET_PGDATA "/"))) if (strBeginsWith(manifestPath, STRDEF(MANIFEST_TARGET_PGDATA "/")))
{ {
FUNCTION_TEST_RETURN(strNewZ(strZ(manifestPath) + sizeof(MANIFEST_TARGET_PGDATA))); FUNCTION_TEST_RETURN(STRING, strNewZ(strZ(manifestPath) + sizeof(MANIFEST_TARGET_PGDATA)));
} }
// Else not pg_data (this is faster since the length of everything else will be different than pg_data) // Else not pg_data (this is faster since the length of everything else will be different than pg_data)
else if (!strEq(manifestPath, MANIFEST_TARGET_PGDATA_STR)) else if (!strEq(manifestPath, MANIFEST_TARGET_PGDATA_STR))
@ -2903,10 +2904,10 @@ manifestPathPg(const String *manifestPath)
ASSERT( ASSERT(
strEq(manifestPath, MANIFEST_TARGET_PGTBLSPC_STR) || strBeginsWith(manifestPath, STRDEF(MANIFEST_TARGET_PGTBLSPC "/"))); strEq(manifestPath, MANIFEST_TARGET_PGTBLSPC_STR) || strBeginsWith(manifestPath, STRDEF(MANIFEST_TARGET_PGTBLSPC "/")));
FUNCTION_TEST_RETURN(strDup(manifestPath)); FUNCTION_TEST_RETURN(STRING, strDup(manifestPath));
} }
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(STRING, NULL);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -2928,7 +2929,7 @@ manifestTargetFind(const Manifest *this, const String *name)
if (result == NULL) if (result == NULL)
THROW_FMT(AssertError, "unable to find '%s' in manifest target list", strZ(name)); THROW_FMT(AssertError, "unable to find '%s' in manifest target list", strZ(name));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_CONST(MANIFEST_TARGET, result);
} }
String * String *
@ -2944,7 +2945,7 @@ manifestTargetPath(const Manifest *this, const ManifestTarget *target)
// If the target path is already absolute then just return it // If the target path is already absolute then just return it
if (strBeginsWith(target->path, FSLASH_STR)) if (strBeginsWith(target->path, FSLASH_STR))
FUNCTION_TEST_RETURN(strDup(target->path)); FUNCTION_TEST_RETURN(STRING, strDup(target->path));
// Construct it from the base pg path and a relative path // Construct it from the base pg path and a relative path
String *result = NULL; String *result = NULL;
@ -2966,7 +2967,7 @@ manifestTargetPath(const Manifest *this, const ManifestTarget *target)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
void void

View File

@ -114,7 +114,7 @@ pgClientEscape(const String *string)
strCatChr(result, '\''); strCatChr(result, '\'');
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -236,7 +236,7 @@ pgInterfaceVersion(unsigned int pgVersion)
if (result == NULL) if (result == NULL)
THROW_FMT(AssertError, "invalid " PG_NAME " version %u", pgVersion); THROW_FMT(AssertError, "invalid " PG_NAME " version %u", pgVersion);
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE_CONST_P(PgInterface, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -340,7 +340,7 @@ pgControlVersion(unsigned int pgVersion)
FUNCTION_TEST_PARAM(UINT, pgVersion); FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgInterfaceVersion(pgVersion)->controlVersion()); FUNCTION_TEST_RETURN(UINT32, pgInterfaceVersion(pgVersion)->controlVersion());
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -447,7 +447,7 @@ pgTablespaceId(unsigned int pgVersion, unsigned int pgCatalogVersion)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -470,7 +470,7 @@ pgLsnFromStr(const String *lsn)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(UINT64, result);
} }
String * String *
@ -480,7 +480,7 @@ pgLsnToStr(uint64_t lsn)
FUNCTION_TEST_PARAM(UINT64, lsn); FUNCTION_TEST_PARAM(UINT64, lsn);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(strNewFmt("%x/%x", (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF))); FUNCTION_TEST_RETURN(STRING, strNewFmt("%x/%x", (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -494,7 +494,7 @@ pgLsnToWalSegment(uint32_t timeline, uint64_t lsn, unsigned int walSegmentSize)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
strNewFmt("%08X%08X%08X", timeline, (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF) / walSegmentSize)); STRING, strNewFmt("%08X%08X%08X", timeline, (unsigned int)(lsn >> 32), (unsigned int)(lsn & 0xFFFFFFFF) / walSegmentSize));
} }
uint64_t uint64_t
@ -510,6 +510,7 @@ pgLsnFromWalSegment(const String *walSegment, unsigned int walSegmentSize)
ASSERT(walSegmentSize > 0); ASSERT(walSegmentSize > 0);
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
UINT64,
(cvtZToUInt64Base(strZ(strSubN(walSegment, 8, 8)), 16) << 32) + (cvtZToUInt64Base(strZ(strSubN(walSegment, 8, 8)), 16) << 32) +
(cvtZToUInt64Base(strZ(strSubN(walSegment, 16, 8)), 16) * walSegmentSize)); (cvtZToUInt64Base(strZ(strSubN(walSegment, 16, 8)), 16) * walSegmentSize));
} }
@ -530,7 +531,7 @@ pgTimelineFromWalSegment(const String *const walSegment)
strncpy(buffer, strZ(walSegment), sizeof(buffer) - 1); strncpy(buffer, strZ(walSegment), sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0'; buffer[sizeof(buffer) - 1] = '\0';
FUNCTION_TEST_RETURN(cvtZToUIntBase(buffer, 16)); FUNCTION_TEST_RETURN(UINT32, cvtZToUIntBase(buffer, 16));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -590,7 +591,7 @@ pgLsnRangeToWalSegmentList(
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING_LIST, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -601,7 +602,7 @@ pgLsnName(unsigned int pgVersion)
FUNCTION_TEST_PARAM(UINT, pgVersion); FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_LSN_STR : PG_NAME_LOCATION_STR); FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_LSN_STR : PG_NAME_LOCATION_STR);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -614,7 +615,7 @@ pgWalName(unsigned int pgVersion)
FUNCTION_TEST_PARAM(UINT, pgVersion); FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_WAL_STR : PG_NAME_XLOG_STR); FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_WAL_STR : PG_NAME_XLOG_STR);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -625,7 +626,7 @@ pgWalPath(unsigned int pgVersion)
FUNCTION_TEST_PARAM(UINT, pgVersion); FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGWAL_STR : PG_PATH_PGXLOG_STR); FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGWAL_STR : PG_PATH_PGXLOG_STR);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -636,7 +637,7 @@ pgXactPath(unsigned int pgVersion)
FUNCTION_TEST_PARAM(UINT, pgVersion); FUNCTION_TEST_PARAM(UINT, pgVersion);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN(pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGXACT_STR : PG_PATH_PGCLOG_STR); FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGXACT_STR : PG_PATH_PGCLOG_STR);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -41,7 +41,7 @@ protocolCommandNew(const StringId command)
} }
OBJ_NEW_END(); OBJ_NEW_END();
FUNCTION_TEST_RETURN(this); FUNCTION_TEST_RETURN(PROTOCOL_COMMAND, this);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -98,7 +98,7 @@ protocolCommandParam(ProtocolCommand *this)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(this->pack); FUNCTION_TEST_RETURN(PACK_WRITE, this->pack);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -340,7 +340,7 @@ protocolServerAuthorize(const String *authListStr, const String *const stanza)
// If * then all stanzas are authorized // If * then all stanzas are authorized
if (strEqZ(authListStr, "*")) if (strEqZ(authListStr, "*"))
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
// Check the list of stanzas for a match with the specified stanza. Each entry will need to be trimmed before comparing. // Check the list of stanzas for a match with the specified stanza. Each entry will need to be trimmed before comparing.
if (stanza != NULL) if (stanza != NULL)
@ -350,11 +350,11 @@ protocolServerAuthorize(const String *authListStr, const String *const stanza)
for (unsigned int authListIdx = 0; authListIdx < strLstSize(authList); authListIdx++) for (unsigned int authListIdx = 0; authListIdx < strLstSize(authList); authListIdx++)
{ {
if (strEq(strTrim(strLstGet(authList, authListIdx)), stanza)) if (strEq(strTrim(strLstGet(authList, authListIdx)), stanza))
FUNCTION_TEST_RETURN(true); FUNCTION_TEST_RETURN(BOOL, true);
} }
} }
FUNCTION_TEST_RETURN(false); FUNCTION_TEST_RETURN(BOOL, false);
} }
ProtocolServer * ProtocolServer *

View File

@ -103,7 +103,7 @@ storageReadAzureEof(THIS_VOID)
ASSERT(this != NULL && this->httpResponse != NULL); ASSERT(this != NULL && this->httpResponse != NULL);
ASSERT(httpResponseIoRead(this->httpResponse) != NULL); ASSERT(httpResponseIoRead(this->httpResponse) != NULL);
FUNCTION_TEST_RETURN(ioReadEof(httpResponseIoRead(this->httpResponse))); FUNCTION_TEST_RETURN(BOOL, ioReadEof(httpResponseIoRead(this->httpResponse)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -110,7 +110,7 @@ storageReadGcsEof(THIS_VOID)
ASSERT(this != NULL && this->httpResponse != NULL); ASSERT(this != NULL && this->httpResponse != NULL);
ASSERT(httpResponseIoRead(this->httpResponse) != NULL); ASSERT(httpResponseIoRead(this->httpResponse) != NULL);
FUNCTION_TEST_RETURN(ioReadEof(httpResponseIoRead(this->httpResponse))); FUNCTION_TEST_RETURN(BOOL, ioReadEof(httpResponseIoRead(this->httpResponse)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -150,7 +150,7 @@ storageGcsAuthToken(HttpRequest *request, time_t timeBegin)
} }
MEM_CONTEXT_PRIOR_END(); MEM_CONTEXT_PRIOR_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(StorageGcsAuthTokenResult, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -232,7 +232,7 @@ storageGcsAuthJwt(StorageGcs *this, time_t timeBegin)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
static StorageGcsAuthTokenResult static StorageGcsAuthTokenResult
@ -266,7 +266,7 @@ storageGcsAuthService(StorageGcs *this, time_t timeBegin)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(StorageGcsAuthTokenResult, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -301,7 +301,7 @@ storageGcsAuthAuto(StorageGcs *this, time_t timeBegin)
} }
MEM_CONTEXT_TEMP_END(); MEM_CONTEXT_TEMP_END();
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN_TYPE(StorageGcsAuthTokenResult, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -495,6 +495,7 @@ storageGcsCvtTime(const String *time)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
TIME,
epochFromParts( epochFromParts(
cvtZToInt(strZ(strSubN(time, 0, 4))), cvtZToInt(strZ(strSubN(time, 5, 2))), cvtZToInt(strZ(strSubN(time, 0, 4))), cvtZToInt(strZ(strSubN(time, 5, 2))),
cvtZToInt(strZ(strSubN(time, 8, 2))), cvtZToInt(strZ(strSubN(time, 11, 2))), cvtZToInt(strZ(strSubN(time, 8, 2))), cvtZToInt(strZ(strSubN(time, 11, 2))),

View File

@ -149,7 +149,7 @@ storageLocal(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageLocal); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageLocal);
} }
const Storage * const Storage *
@ -168,7 +168,7 @@ storageLocalWrite(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageLocalWrite); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageLocalWrite);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -197,7 +197,7 @@ storagePgGet(unsigned int pgIdx, bool write)
result = storagePosixNewP(cfgOptionIdxStr(cfgOptPgPath, pgIdx), .write = write); result = storagePosixNewP(cfgOptionIdxStr(cfgOptPgPath, pgIdx), .write = write);
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STORAGE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -222,14 +222,14 @@ storagePgIdx(unsigned int pgIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storagePg[pgIdx]); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storagePg[pgIdx]);
} }
const Storage * const Storage *
storagePg(void) storagePg(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(storagePgIdx(cfgOptionGroupIdxDefault(cfgOptGrpPg))); FUNCTION_TEST_RETURN_CONST(STORAGE, storagePgIdx(cfgOptionGroupIdxDefault(cfgOptGrpPg)));
} }
const Storage * const Storage *
@ -257,14 +257,14 @@ storagePgIdxWrite(unsigned int pgIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storagePgWrite[pgIdx]); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storagePgWrite[pgIdx]);
} }
const Storage * const Storage *
storagePgWrite(void) storagePgWrite(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(storagePgIdxWrite(cfgOptionGroupIdxDefault(cfgOptGrpPg))); FUNCTION_TEST_RETURN_CONST(STORAGE, storagePgIdxWrite(cfgOptionGroupIdxDefault(cfgOptGrpPg)));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -337,7 +337,7 @@ storageRepoPathExpression(const String *expression, const String *path)
else else
THROW_FMT(AssertError, "invalid expression '%s'", strZ(expression)); THROW_FMT(AssertError, "invalid expression '%s'", strZ(expression));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -388,7 +388,7 @@ storageRepoGet(unsigned int repoIdx, bool write)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STORAGE, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -421,14 +421,14 @@ storageRepoIdx(unsigned int repoIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageRepo[repoIdx]); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageRepo[repoIdx]);
} }
const Storage * const Storage *
storageRepo(void) storageRepo(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(storageRepoIdx(cfgOptionGroupIdxDefault(cfgOptGrpRepo))); FUNCTION_TEST_RETURN_CONST(STORAGE, storageRepoIdx(cfgOptionGroupIdxDefault(cfgOptGrpRepo)));
} }
const Storage * const Storage *
@ -464,14 +464,14 @@ storageRepoIdxWrite(unsigned int repoIdx)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageRepoWrite[repoIdx]); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageRepoWrite[repoIdx]);
} }
const Storage * const Storage *
storageRepoWrite(void) storageRepoWrite(void)
{ {
FUNCTION_TEST_VOID(); FUNCTION_TEST_VOID();
FUNCTION_TEST_RETURN(storageRepoIdxWrite(cfgOptionGroupIdxDefault(cfgOptGrpRepo))); FUNCTION_TEST_RETURN_CONST(STORAGE, storageRepoIdxWrite(cfgOptionGroupIdxDefault(cfgOptGrpRepo)));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -514,7 +514,7 @@ storageSpoolPathExpression(const String *expression, const String *path)
else else
THROW_FMT(AssertError, "invalid expression '%s'", strZ(expression)); THROW_FMT(AssertError, "invalid expression '%s'", strZ(expression));
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
@ -536,7 +536,7 @@ storageSpool(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageSpool); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageSpool);
} }
const Storage * const Storage *
@ -561,7 +561,7 @@ storageSpoolWrite(void)
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
FUNCTION_TEST_RETURN(storageHelper.storageSpoolWrite); FUNCTION_TEST_RETURN_CONST(STORAGE, storageHelper.storageSpoolWrite);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -186,7 +186,7 @@ storageReadPosixEof(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->eof); FUNCTION_TEST_RETURN(BOOL, this->eof);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -203,7 +203,7 @@ storageReadPosixFd(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fd); FUNCTION_TEST_RETURN(INT, this->fd);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -215,7 +215,7 @@ storageWritePosixFd(const THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->fd); FUNCTION_TEST_RETURN(INT, this->fd);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -206,7 +206,7 @@ storageReadRemoteEof(THIS_VOID)
ASSERT(this != NULL); ASSERT(this != NULL);
FUNCTION_TEST_RETURN(this->eof); FUNCTION_TEST_RETURN(BOOL, this->eof);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -106,7 +106,7 @@ storageReadS3Eof(THIS_VOID)
ASSERT(this != NULL && this->httpResponse != NULL); ASSERT(this != NULL && this->httpResponse != NULL);
ASSERT(httpResponseIoRead(this->httpResponse) != NULL); ASSERT(httpResponseIoRead(this->httpResponse) != NULL);
FUNCTION_TEST_RETURN(ioReadEof(httpResponseIoRead(this->httpResponse))); FUNCTION_TEST_RETURN(BOOL, ioReadEof(httpResponseIoRead(this->httpResponse)));
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -131,7 +131,7 @@ storageS3DateTime(time_t authTime)
strftime(buffer, sizeof(buffer), "%Y%m%dT%H%M%SZ", gmtime_r(&authTime, &timePart)) != ISO_8601_DATE_TIME_SIZE, AssertError, strftime(buffer, sizeof(buffer), "%Y%m%dT%H%M%SZ", gmtime_r(&authTime, &timePart)) != ISO_8601_DATE_TIME_SIZE, AssertError,
"unable to format date"); "unable to format date");
FUNCTION_TEST_RETURN(strNewZ(buffer)); FUNCTION_TEST_RETURN(STRING, strNewZ(buffer));
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -248,6 +248,7 @@ storageS3CvtTime(const String *time)
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( FUNCTION_TEST_RETURN(
TIME,
epochFromParts( epochFromParts(
cvtZToInt(strZ(strSubN(time, 0, 4))), cvtZToInt(strZ(strSubN(time, 5, 2))), cvtZToInt(strZ(strSubN(time, 0, 4))), cvtZToInt(strZ(strSubN(time, 5, 2))),
cvtZToInt(strZ(strSubN(time, 8, 2))), cvtZToInt(strZ(strSubN(time, 11, 2))), cvtZToInt(strZ(strSubN(time, 8, 2))), cvtZToInt(strZ(strSubN(time, 11, 2))),
@ -921,7 +922,7 @@ storageS3PathRemoveInternal(StorageS3 *this, HttpRequest *request, XmlDocument *
.content = xmlDocumentBuf(xml)); .content = xmlDocumentBuf(xml));
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(HTTP_REQUEST, result);
} }
static void static void

View File

@ -761,7 +761,7 @@ storagePath(const Storage *this, const String *pathExp, StoragePathParam param)
} }
} }
FUNCTION_TEST_RETURN(result); FUNCTION_TEST_RETURN(STRING, result);
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -180,10 +180,10 @@ static ProtocolParallelJob *testParallelJobCallback(void *data, unsigned int cli
ProtocolParallelJob *job = *(ProtocolParallelJob **)lstGet(listData->jobList, listData->jobIdx); ProtocolParallelJob *job = *(ProtocolParallelJob **)lstGet(listData->jobList, listData->jobIdx);
listData->jobIdx++; listData->jobIdx++;
FUNCTION_TEST_RETURN(protocolParallelJobMove(job, memContextCurrent())); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, protocolParallelJobMove(job, memContextCurrent()));
} }
FUNCTION_TEST_RETURN(NULL); FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, NULL);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************