| 50 | } |
| 51 | |
| 52 | void 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 | |
| 68 | void testUInt32(MMKV *mmkv) { |
| 69 | auto ret = mmkv->set(numeric_limits<uint32_t>::max(), "uint32"); |