mirror of
https://github.com/joyieldInc/predixy.git
synced 2026-02-05 01:42:24 +08:00
21 lines
419 B
C++
21 lines
419 B
C++
/*
|
|
* Minimal test for Buffer::fappend negative vsnprintf handling.
|
|
*/
|
|
|
|
#include "../src/Buffer.h"
|
|
#include "../src/Logger.h"
|
|
|
|
int main() {
|
|
Logger::gInst = nullptr;
|
|
Buffer* buf = BufferAlloc::create();
|
|
int before = buf->length();
|
|
Buffer* ret = buf->fappend("%");
|
|
if (ret && ret->length() < before) {
|
|
return 1;
|
|
}
|
|
if (buf->length() < before) {
|
|
return 2;
|
|
}
|
|
return 0;
|
|
}
|