BSON coder unit tests, fixes arising from test failures.

This commit is contained in:
px4dev
2012-10-29 21:47:51 -07:00
parent 3d750bc38c
commit 4c18aced36
4 changed files with 197 additions and 76 deletions
+3 -3
View File
@@ -452,7 +452,7 @@ param_reset(param_t param)
/* if we found one, erase it */
if (s != NULL) {
int pos = utarry_eltidx(param_values, s);
int pos = utarray_eltidx(param_values, s);
utarray_erase(param_values, pos, 1);
}
}
@@ -489,7 +489,7 @@ param_export(int fd, bool only_unsaved)
param_lock();
bson_encoder_init(&encoder, fd);
bson_encoder_init_file(&encoder, fd);
/* no modified parameters -> we are done */
if (param_values == NULL) {
@@ -680,7 +680,7 @@ param_import_internal(int fd, bool mark_saved)
int result = -1;
struct param_import_state state;
if (bson_decoder_init(&decoder, fd, param_import_callback, &state)) {
if (bson_decoder_init_file(&decoder, fd, param_import_callback, &state)) {
debug("decoder init failed");
goto out;
}