diff --git a/main.cpp b/main.cpp index 5b12090..b7cff44 100644 --- a/main.cpp +++ b/main.cpp @@ -5,6 +5,12 @@ void test_basics(amap mapdo, void *map) { assert(NULL == mapdo(map, AMAP_GET, "asdf", NULL)); + int i = 42; + int *iptr; + assert(NULL != mapdo(map, AMAP_SET, "meanging", &i)); + assert(NULL != (iptr = (int *)mapdo(map, AMAP_GET, "asdf", NULL))); + assert(*iptr == 42); + assert(iptr == &i); } int main() { diff --git a/simap.h b/simap.h index ea46660..d02927c 100644 --- a/simap.h +++ b/simap.h @@ -210,7 +210,7 @@ static inline void *simap_force_add_internal(simap_instance *map, const char *ke /* Administer usage_end offset */ map->usage_end += storage_needed; - return NULL; + return data; } /**