mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-13 08:02:56 +00:00
lib: Allow test suite to access raw accounting values
This commit is contained in:
parent
fcd0e14c3e
commit
8af7d22ff0
2 changed files with 21 additions and 0 deletions
|
@ -139,6 +139,8 @@
|
|||
8388608 // 8 MiB, 2^23
|
||||
/* NOTE END */
|
||||
|
||||
#include "expat.h" // so we can use type XML_Parser below
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -146,6 +148,11 @@ extern "C" {
|
|||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
#if defined(XML_DTD)
|
||||
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
|
||||
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -7357,6 +7357,20 @@ accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
|
|||
return tolerated;
|
||||
}
|
||||
|
||||
unsigned long long
|
||||
testingAccountingGetCountBytesDirect(XML_Parser parser) {
|
||||
if (! parser)
|
||||
return 0;
|
||||
return parser->m_accounting.countBytesDirect;
|
||||
}
|
||||
|
||||
unsigned long long
|
||||
testingAccountingGetCountBytesIndirect(XML_Parser parser) {
|
||||
if (! parser)
|
||||
return 0;
|
||||
return parser->m_accounting.countBytesIndirect;
|
||||
}
|
||||
|
||||
static void
|
||||
entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
|
||||
const char *action, int sourceLine) {
|
||||
|
|
Loading…
Add table
Reference in a new issue