diff options
author | resec <resec0109@gmail.com> | 2017-07-20 06:15:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-20 06:15:03 +0300 |
commit | e1672c7a8a23ce77d33e0eaff17db9058016fdb1 (patch) | |
tree | 946467ae1ba7ea811b9ba306d2551f0e35a47a09 /src/sentencepiece_processor_test.cc | |
parent | 266f274da0b1c706114bebf15dff2404d2f00907 (diff) |
Add test case for loading model from std::istream
EXPECT_DEATH(sp.LoadOrDie(std::istringstream ss(std::string("__UNKNOWN_STREAM__")));
Diffstat (limited to 'src/sentencepiece_processor_test.cc')
-rw-r--r-- | src/sentencepiece_processor_test.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sentencepiece_processor_test.cc b/src/sentencepiece_processor_test.cc index fb99b02..9ef5348 100644 --- a/src/sentencepiece_processor_test.cc +++ b/src/sentencepiece_processor_test.cc @@ -14,6 +14,7 @@ #include "sentencepiece_processor.h" #include <unordered_map> +#include <sstream> #include "builder.h" #include "model_interface.h" #include "normalizer.h" @@ -371,6 +372,8 @@ TEST(SentencePieceProcessorTest, LoadInvalidModelTest) { SentencePieceProcessor sp; EXPECT_DEATH(sp.LoadOrDie("")); EXPECT_DEATH(sp.LoadOrDie("__UNKNOWN_FILE__")); + std::istringstream ss("__UNKNOWN_STREAM__"); + EXPECT_DEATH(sp.LoadOrDie(ss)); } TEST(SentencePieceProcessorTest, EndToEndTest) { |