Add at least a very minimal run test for std::vector
The test is trivial, but still better than nothing.
This commit is contained in:
parent
e1815634ec
commit
b88491fe89
1 changed files with 22 additions and 0 deletions
22
Examples/test-suite/c/li_std_vector_runme.c
Normal file
22
Examples/test-suite/c/li_std_vector_runme.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "li_std_vector/li_std_vector_wrap.h"
|
||||
#include <assert.h>
|
||||
|
||||
int main() {
|
||||
size_t i;
|
||||
|
||||
IntVector* iv = IntVector_new();
|
||||
assert( IntVector_size(iv) == 0 );
|
||||
|
||||
IntVector_push_back(iv, 1);
|
||||
IntVector_push_back(iv, 4);
|
||||
IntVector_push_back(iv, 9);
|
||||
assert( IntVector_size(iv) == 3 );
|
||||
|
||||
for ( i = 0; i < 3; i++ ) {
|
||||
assert( IntVector_get(iv, i) == (i + 1)*(i + 1) );
|
||||
}
|
||||
|
||||
IntVector_delete(iv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue