aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-03 12:27:36 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-03 12:27:36 +0000
commitc55327290e5d894333f2d2002e1a778bc5b7ba2e (patch)
tree3bd81b35d27b94c36848dbab6d2e70fe4e3077c6 /searchsummary
parentf3bccc8450b74978635ba5f47f0da9743dbe9601 (diff)
return from main instead of exit
Diffstat (limited to 'searchsummary')
-rw-r--r--searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp6
-rw-r--r--searchsummary/src/tests/extractkeywords/extractkeywordstest.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp b/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
index 9b2510ac3df..4abbe7d2613 100644
--- a/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
+++ b/searchsummary/src/tests/extractkeywords/extractkeywordstest.cpp
@@ -18,7 +18,7 @@ ExtractKeywordsTest::Main()
bool failed = false;
if (_argc == 1)
- Usage(_argv[0]);
+ return Usage(_argv[0]);
// default initialize to not run any tests.
for (int n = 0; n < NUMTESTS; n++)
@@ -271,7 +271,7 @@ ExtractKeywordsTest::RunTest(int testno, bool verify)
return result;
}
-void
+int
ExtractKeywordsTest::Usage(char *progname)
{
printf("%s {testnospec}+\n\
@@ -279,7 +279,7 @@ ExtractKeywordsTest::Usage(char *progname)
num: single test\n\
num-num: inclusive range (open range permitted)\n",progname);
printf("There are tests from %d to %d\n\n", 0, NUMTESTS-1);
- exit(-1);
+ return EXIT_FAILURE;
}
int
diff --git a/searchsummary/src/tests/extractkeywords/extractkeywordstest.h b/searchsummary/src/tests/extractkeywords/extractkeywordstest.h
index e3c79bfc202..739ba4bf1ff 100644
--- a/searchsummary/src/tests/extractkeywords/extractkeywordstest.h
+++ b/searchsummary/src/tests/extractkeywords/extractkeywordstest.h
@@ -15,7 +15,7 @@ private:
search::docsummary::KeywordExtractor *_extractor;
int Main() override;
- void Usage(char *progname);
+ int Usage(char *progname);
bool ShowResult(int testNo, const char *actual, const char *correct);
bool RunTest(int i, bool verify);