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

Function testBool

POSIX/demo/UnitTest.cpp:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34static const string KeyNotExist = "KeyNotExist";
35
36void testBool(MMKV *mmkv) {
37 auto ret = mmkv->set(true, "bool");
38 assert(ret);
39
40 auto value = mmkv->getBool("bool");
41 assert(value);
42
43 value = mmkv->getBool(KeyNotExist);
44 assert(!value);
45
46 value = mmkv->getBool(KeyNotExist, true);
47 assert(value);
48
49 printf("test bool: passed\n");
50}
51
52void testInt32(MMKV *mmkv) {
53 auto ret = mmkv->set(numeric_limits<int32_t>::max(), "int32");

Callers 1

mainFunction · 0.85

Calls 2

setMethod · 0.45
getBoolMethod · 0.45

Tested by

no test coverage detected