Fix std::map<> typemap
Use simple fixed typemap instead of trying to use the much more complex one from the UTL which doesn't work for C. Add a simple test case for std::map<>.
This commit is contained in:
parent
b88491fe89
commit
9efb508eda
3 changed files with 87 additions and 2 deletions
|
|
@ -66,7 +66,6 @@ FAILING_CPP_TESTS := \
|
|||
li_boost_shared_ptr_director \
|
||||
li_boost_shared_ptr_template \
|
||||
li_std_deque \
|
||||
li_std_map \
|
||||
li_std_pair_using \
|
||||
li_std_wstring \
|
||||
li_windows \
|
||||
|
|
|
|||
26
Examples/test-suite/c/li_std_map_runme.c
Normal file
26
Examples/test-suite/c/li_std_map_runme.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "li_std_map/li_std_map_wrap.h"
|
||||
#include <assert.h>
|
||||
|
||||
int main() {
|
||||
A* a1 = A_new_i(3);
|
||||
A* a2 = A_new_i(7);
|
||||
|
||||
mapA* mA = mapA_new();
|
||||
mapA_set(mA, 1, a1);
|
||||
mapA_set(mA, 2, a2);
|
||||
|
||||
assert( mapA_size(mA) == 2 );
|
||||
|
||||
{
|
||||
A* a = mapA_get(mA, 1);
|
||||
assert( A_val_get(a) == 3 );
|
||||
}
|
||||
|
||||
assert( !mapA_has_key(mA, 3) );
|
||||
|
||||
mapA_delete(mA);
|
||||
A_delete(a2);
|
||||
A_delete(a1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue