From: Damir Tomic Date: Sun, 26 Jul 2015 19:48:29 +0000 (+0200) Subject: run-ntp_scanner.c, ntp_scanner.c: X-Git-Tag: NTP_4_3_67~2^2~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fecc1b2bbcf3fc2c89a44262a3a0e2f76a96d77;p=thirdparty%2Fntp.git run-ntp_scanner.c, ntp_scanner.c: new file bk: 55b5398dhhumj2O71Gb0SgX_rFF2_g --- diff --git a/tests/ntpd/ntp_scanner.c b/tests/ntpd/ntp_scanner.c new file mode 100644 index 000000000..b1f52b0c1 --- /dev/null +++ b/tests/ntpd/ntp_scanner.c @@ -0,0 +1,29 @@ +#include "config.h" + +#include "unity.h" + +//#include +//#include +//#include +//#include +//#include + +//#include "ntpd.h" +//#include "ntp_config.h" +//#include "ntpsim.h" +#include "ntp_scanner.h" +//#include "ntp_parser.h" + +/* ntp_keyword.h declares finite state machine and token text */ +//#include "ntp_keyword.h" + +void test_keywordIncorrectToken(void){ + char * temp = keyword(999); + printf("%s",temp); +} + +void test_keywordServerToken(void){ + char * temp = keyword(401); + printf("%s",temp); //143 or 401 ? + +} diff --git a/tests/ntpd/run-ntp_scanner.c b/tests/ntpd/run-ntp_scanner.c new file mode 100644 index 000000000..35d2598bd --- /dev/null +++ b/tests/ntpd/run-ntp_scanner.c @@ -0,0 +1,55 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ + +//=======Test Runner Used To Run Each Test Below===== +#define RUN_TEST(TestFunc, TestLineNum) \ +{ \ + Unity.CurrentTestName = #TestFunc; \ + Unity.CurrentTestLineNumber = TestLineNum; \ + Unity.NumberOfTests++; \ + if (TEST_PROTECT()) \ + { \ + setUp(); \ + TestFunc(); \ + } \ + if (TEST_PROTECT() && !TEST_IS_IGNORED) \ + { \ + tearDown(); \ + } \ + UnityConcludeTest(); \ +} + +//=======Automagically Detected Files To Include===== +#include "unity.h" +#include +#include +#include "config.h" +#include "ntp_scanner.h" + +//=======External Functions This Runner Calls===== +extern void setUp(void); +extern void tearDown(void); +extern void test_keywordIncorrectToken(void); +extern void test_keywordServerToken(void); + + +//=======Test Reset Option===== +void resetTest(void); +void resetTest(void) +{ + tearDown(); + setUp(); +} + +char *progname; + + +//=======MAIN===== +int main(int argc, char *argv[]) +{ + progname = argv[0]; + UnityBegin("ntp_scanner.c"); + RUN_TEST(test_keywordIncorrectToken, 20); + RUN_TEST(test_keywordServerToken, 25); + + return (UnityEnd()); +}