check_PROGRAMS = \
test-leapsec \
+ test-rc_cmdlength \
$(NULL)
if GTEST_AVAILABLE
tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \
g_ntpdtest.cpp \
$(top_srcdir)/ntpd/ntp_leapsec.c \
+ $(top_srcdir)/ntpd/rc_cmdlength.c \
g_leapsec.cpp \
$(NULL)
BUILT_SOURCES += \
$(srcdir)/run-leapsec.c \
+ $(srcdir)/run-rc_cmdlength.c \
$(NULL)
noinst_HEADERS = g_ntpdtest.h \
$(run_unity) leapsec.c run-leapsec.c
###
+test_rc_cmdlength_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_rc_cmdlength_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_rc_cmdlength_SOURCES = \
+ rc_cmdlength.c \
+ run-rc_cmdlength.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list)
+ $(run_unity) rc_cmdlength.c run-rc_cmdlength.c
+
TESTS =
--- /dev/null
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "unity.h"
+
+#include <string.h>
+
+#include "test-libntp.h"
+
+
+void
+test_EvaluateCommandLength(void){
+ const char *src_buf = "This is random command";
+ const char *src_end = "This is random command";
+
+ size_t commandLength = remoteconfig_cmdlength(src_buf, src_end);
+
+ TEST_ASSERT_EQUAL(strlen(src_buf), commandLength );
+}