MCPcopy Create free account
hub / github.com/Tencent/MMKV / testInt32

Function testInt32

POSIX/demo/UnitTest.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void testInt32(MMKV *mmkv) {
53 auto ret = mmkv->set(numeric_limits<int32_t>::max(), "int32");
54 assert(ret);
55
56 auto value = mmkv->getInt32("int32");
57 assert(value == numeric_limits<int32_t>::max());
58
59 value = mmkv->getInt32(KeyNotExist);
60 assert(value == 0);
61
62 value = mmkv->getInt32(KeyNotExist, -1);
63 assert(value == -1);
64
65 printf("test int32: passed\n");
66}
67
68void testUInt32(MMKV *mmkv) {
69 auto ret = mmkv->set(numeric_limits<uint32_t>::max(), "uint32");

Callers 1

mainFunction · 0.85

Calls 2

setMethod · 0.45
getInt32Method · 0.45

Tested by

no test coverage detected