summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_phrase_index.cpp5
-rw-r--r--tests/storage/test_pinyin_index.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/storage/test_phrase_index.cpp b/tests/storage/test_phrase_index.cpp
index c5d5828..12cc398 100644
--- a/tests/storage/test_phrase_index.cpp
+++ b/tests/storage/test_phrase_index.cpp
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <sys/time.h>
+#include <errno.h>
#include <glib.h>
#include "pinyin.h"
@@ -93,7 +94,7 @@ int main(int argc, char * argv[]){
FILE* infile = fopen("../../data/gb_char.table", "r");
if ( NULL == infile ){
printf("open gb_char.table failed!\n");
- exit(1);
+ exit(ENOENT);
}
phrase_index_load.load_text(1, infile);
@@ -102,7 +103,7 @@ int main(int argc, char * argv[]){
infile = fopen("../../data/gbk_char.table", "r");
if ( NULL == infile ){
printf("open gbk_char.table failed!\n");
- exit(1);
+ exit(ENOENT);
}
phrase_index_load.load_text(2, infile);
diff --git a/tests/storage/test_pinyin_index.cpp b/tests/storage/test_pinyin_index.cpp
index 90f0437..e0e42bf 100644
--- a/tests/storage/test_pinyin_index.cpp
+++ b/tests/storage/test_pinyin_index.cpp
@@ -51,7 +51,7 @@ int main( int argc, char * argv[]){
FILE* infile = fopen("../../data/gb_char.table", "r");
if ( NULL == infile ){
printf("open gb_char.table failed!\n");
- exit(1);
+ exit(ENOENT);
}
phrase_index.load_text(1, infile);
@@ -60,7 +60,7 @@ int main( int argc, char * argv[]){
infile = fopen("../../data/gbk_char.table", "r");
if ( NULL == infile ){
printf("open gbk_char.table failed!\n");
- exit(1);
+ exit(ENOENT);
}
phrase_index.load_text(2, infile);