summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/storage/test_phrase_index_logger.cpp2
-rw-r--r--utils/training/prune_k_mixture_model.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/storage/test_phrase_index_logger.cpp b/tests/storage/test_phrase_index_logger.cpp
index 74cd5af..c423c40 100644
--- a/tests/storage/test_phrase_index_logger.cpp
+++ b/tests/storage/test_phrase_index_logger.cpp
@@ -31,7 +31,7 @@ int main(int argc, char * argv[]){
phrase_index.load(1, chunk);
PhraseIndexRange range;
- phrase_index.get_range(1, range);
+ assert(ERROR_OK == phrase_index.get_range(1, range));
for (size_t i = range.m_range_begin; i < range.m_range_end; ++i ) {
phrase_index.add_unigram_frequency(i, 1);
}
diff --git a/utils/training/prune_k_mixture_model.cpp b/utils/training/prune_k_mixture_model.cpp
index 528d5ce..40dfb87 100644
--- a/utils/training/prune_k_mixture_model.cpp
+++ b/utils/training/prune_k_mixture_model.cpp
@@ -130,7 +130,11 @@ int main(int argc, char * argv[]){
bigram.attach(bigram_filename, ATTACH_READWRITE);
KMixtureModelMagicHeader magic_header;
- bigram.get_magic_header(magic_header);
+ if (!bigram.get_magic_header(magic_header)) {
+ fprintf(stderr, "no magic header in k mixture model.\n");
+ exit(ENODATA);
+ }
+
GArray * items = g_array_new(FALSE, FALSE, sizeof(phrase_token_t));
bigram.get_all_items(items);