Codebase list arping / 790a10e
Import upstream version 2.22 Debian Janitor 2 years ago
15 changed file(s) with 152 addition(s) and 100 deletion(s). Raw diff Collapse all Expand all
00 *~
11 *.o
2 Makefile
3 Makefile.in
4 aclocal.m4
5 autom4te.cache/
6 compile
7 compile_commands.json
8 config.guess
9 config.h
10 config.h.in
11 config.log
12 config.status
13 config.sub
14 configure
15 depcomp
16 doc/Makefile
17 doc/Makefile.in
18 install-sh
19 missing
20 src/.deps/
21 src/Makefile
22 src/Makefile.in
23 src/arping
24 src/fuzz_pingip
25 stamp-h1
26 test-driver
22 include $(top_srcdir)/Makefile.am.common
33
44 SUBDIRS=src doc
5
6 lsp:
7 ~/.local/bin/intercept-build make
58
69 tarball:
710 ./extra/mktarball latest
1013 rm -f aclocal.m4 configure.scan depcomp missing install-sh config.h.in
1114 rm -f Makefile.in configure autoscan*.log config.guess config.sub
1215 rm -f ltmain.sh configure.in src/Makefile.in doc/Makefile.in
16 rm -f compile_commands.json test-driver compile
17 rm -fr .cache
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.2 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2020 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
135135 $(am__extra_recursive_targets)
136136 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
137137 cscope distdir distdir-am dist dist-all distcheck
138 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
139 $(LISP)config.h.in
138 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
139 config.h.in
140140 # Read a list of newline-separated strings from the standard input,
141141 # and print each of them once, without duplicates. Input order is
142142 # *not* preserved.
554554 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
555555 $(am__post_remove_distdir)
556556
557 dist-zstd: distdir
558 tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
559 $(am__post_remove_distdir)
560
557561 dist-tarZ: distdir
558562 @echo WARNING: "Support for distribution archives compressed with" \
559563 "legacy program 'compress' is deprecated." >&2
596600 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
597601 *.zip*) \
598602 unzip $(distdir).zip ;;\
603 *.tar.zst*) \
604 zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
599605 esac
600606 chmod -R a-w $(distdir)
601607 chmod u+w $(distdir)
773779 am--refresh check check-am clean clean-cscope clean-generic \
774780 cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
775781 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
776 distcheck distclean distclean-generic distclean-hdr \
782 dist-zstd distcheck distclean distclean-generic distclean-hdr \
777783 distclean-tags distcleancheck distdir distuninstallcheck dvi \
778784 dvi-am html html-am info info-am install install-am \
779785 install-data install-data-am install-dvi install-dvi-am \
788794 .PRECIOUS: Makefile
789795
790796
797 lsp:
798 ~/.local/bin/intercept-build make
799
791800 tarball:
792801 ./extra/mktarball latest
793802
795804 rm -f aclocal.m4 configure.scan depcomp missing install-sh config.h.in
796805 rm -f Makefile.in configure autoscan*.log config.guess config.sub
797806 rm -f ltmain.sh configure.in src/Makefile.in doc/Makefile.in
807 rm -f compile_commands.json test-driver compile
808 rm -fr .cache
798809
799810 # Tell versions [3.59,3.63) of GNU make to not export all variables.
800811 # Otherwise a system limit (for SysV at least) may be exceeded.
0 # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.16.2 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2121
22 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
22 # Copyright (C) 2002-2020 Free Software Foundation, Inc.
2323 #
2424 # This file is free software; the Free Software Foundation
2525 # gives unlimited permission to copy and/or distribute it,
3434 [am__api_version='1.16'
3535 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3636 dnl require some minimum version. Point them to the right macro.
37 m4_if([$1], [1.16.1], [],
37 m4_if([$1], [1.16.2], [],
3838 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3939 ])
4040
5050 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5151 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5252 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.16.1])dnl
53 [AM_AUTOMAKE_VERSION([1.16.2])dnl
5454 m4_ifndef([AC_AUTOCONF_VERSION],
5555 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5656 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5757
5858 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
5959
60 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
60 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
6161 #
6262 # This file is free software; the Free Software Foundation
6363 # gives unlimited permission to copy and/or distribute it,
109109
110110 # AM_CONDITIONAL -*- Autoconf -*-
111111
112 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
112 # Copyright (C) 1997-2020 Free Software Foundation, Inc.
113113 #
114114 # This file is free software; the Free Software Foundation
115115 # gives unlimited permission to copy and/or distribute it,
140140 Usually this means the macro was only invoked conditionally.]])
141141 fi])])
142142
143 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
143 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
144144 #
145145 # This file is free software; the Free Software Foundation
146146 # gives unlimited permission to copy and/or distribute it,
331331
332332 # Generate code to set up dependency tracking. -*- Autoconf -*-
333333
334 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
334 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
335335 #
336336 # This file is free software; the Free Software Foundation
337337 # gives unlimited permission to copy and/or distribute it,
370370 done
371371 if test $am_rc -ne 0; then
372372 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
373 for automatic dependency tracking. Try re-running configure with the
373 for automatic dependency tracking. If GNU make was not used, consider
374 re-running the configure script with MAKE="gmake" (or whatever is
375 necessary). You can also try re-running configure with the
374376 '--disable-dependency-tracking' option to at least be able to build
375377 the package (albeit without support for automatic dependency tracking).])
376378 fi
397399
398400 # Do all the work for Automake. -*- Autoconf -*-
399401
400 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
402 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
401403 #
402404 # This file is free software; the Free Software Foundation
403405 # gives unlimited permission to copy and/or distribute it,
594596 done
595597 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
596598
597 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
599 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
598600 #
599601 # This file is free software; the Free Software Foundation
600602 # gives unlimited permission to copy and/or distribute it,
615617 fi
616618 AC_SUBST([install_sh])])
617619
618 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
620 # Copyright (C) 2003-2020 Free Software Foundation, Inc.
619621 #
620622 # This file is free software; the Free Software Foundation
621623 # gives unlimited permission to copy and/or distribute it,
637639 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
638640 # From Jim Meyering
639641
640 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
642 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
641643 #
642644 # This file is free software; the Free Software Foundation
643645 # gives unlimited permission to copy and/or distribute it,
672674
673675 # Check to see how 'make' treats includes. -*- Autoconf -*-
674676
675 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
677 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
676678 #
677679 # This file is free software; the Free Software Foundation
678680 # gives unlimited permission to copy and/or distribute it,
715717
716718 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
717719
718 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
720 # Copyright (C) 1997-2020 Free Software Foundation, Inc.
719721 #
720722 # This file is free software; the Free Software Foundation
721723 # gives unlimited permission to copy and/or distribute it,
754756
755757 # Helper functions for option handling. -*- Autoconf -*-
756758
757 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
759 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
758760 #
759761 # This file is free software; the Free Software Foundation
760762 # gives unlimited permission to copy and/or distribute it,
783785 AC_DEFUN([_AM_IF_OPTION],
784786 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
785787
786 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
788 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
787789 #
788790 # This file is free software; the Free Software Foundation
789791 # gives unlimited permission to copy and/or distribute it,
830832 # For backward compatibility.
831833 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
832834
833 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
835 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
834836 #
835837 # This file is free software; the Free Software Foundation
836838 # gives unlimited permission to copy and/or distribute it,
849851
850852 # Check to make sure that the build environment is sane. -*- Autoconf -*-
851853
852 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
854 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
853855 #
854856 # This file is free software; the Free Software Foundation
855857 # gives unlimited permission to copy and/or distribute it,
930932 rm -f conftest.file
931933 ])
932934
933 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
935 # Copyright (C) 2009-2020 Free Software Foundation, Inc.
934936 #
935937 # This file is free software; the Free Software Foundation
936938 # gives unlimited permission to copy and/or distribute it,
990992 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
991993 ])
992994
993 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
995 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
994996 #
995997 # This file is free software; the Free Software Foundation
996998 # gives unlimited permission to copy and/or distribute it,
10181020 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10191021 AC_SUBST([INSTALL_STRIP_PROGRAM])])
10201022
1021 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
1023 # Copyright (C) 2006-2020 Free Software Foundation, Inc.
10221024 #
10231025 # This file is free software; the Free Software Foundation
10241026 # gives unlimited permission to copy and/or distribute it,
10371039
10381040 # Check how to create a tarball. -*- Autoconf -*-
10391041
1040 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
1042 # Copyright (C) 2004-2020 Free Software Foundation, Inc.
10411043 #
10421044 # This file is free software; the Free Software Foundation
10431045 # gives unlimited permission to copy and/or distribute it,
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
5252 MINGW*)
5353 file_conv=mingw
5454 ;;
55 CYGWIN*)
55 CYGWIN* | MSYS*)
5656 file_conv=cygwin
5757 ;;
5858 *)
6666 mingw/*)
6767 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
6868 ;;
69 cygwin/*)
69 cygwin/* | msys/*)
7070 file=`cygpath -m "$file" || echo "$file"`
7171 ;;
7272 wine/*)
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for arping 2.21.
2 # Generated by GNU Autoconf 2.69 for arping 2.22.
33 #
44 # Report bugs to <thomas@habets.se>.
55 #
579579 # Identity of this package.
580580 PACKAGE_NAME='arping'
581581 PACKAGE_TARNAME='arping'
582 PACKAGE_VERSION='2.21'
583 PACKAGE_STRING='arping 2.21'
582 PACKAGE_VERSION='2.22'
583 PACKAGE_STRING='arping 2.22'
584584 PACKAGE_BUGREPORT='thomas@habets.se'
585585 PACKAGE_URL=''
586586
12961296 # Omit some internal or obsolete options to make the list less imposing.
12971297 # This message is too long to be a string in the A/UX 3.1 sh.
12981298 cat <<_ACEOF
1299 \`configure' configures arping 2.21 to adapt to many kinds of systems.
1299 \`configure' configures arping 2.22 to adapt to many kinds of systems.
13001300
13011301 Usage: $0 [OPTION]... [VAR=VALUE]...
13021302
13681368
13691369 if test -n "$ac_init_help"; then
13701370 case $ac_init_help in
1371 short | recursive ) echo "Configuration of arping 2.21:";;
1371 short | recursive ) echo "Configuration of arping 2.22:";;
13721372 esac
13731373 cat <<\_ACEOF
13741374
14641464 test -n "$ac_init_help" && exit $ac_status
14651465 if $ac_init_version; then
14661466 cat <<\_ACEOF
1467 arping configure 2.21
1467 arping configure 2.22
14681468 generated by GNU Autoconf 2.69
14691469
14701470 Copyright (C) 2012 Free Software Foundation, Inc.
19331933 This file contains any messages produced by compilers while
19341934 running configure, to aid debugging if configure makes a mistake.
19351935
1936 It was created by arping $as_me 2.21, which was
1936 It was created by arping $as_me 2.22, which was
19371937 generated by GNU Autoconf 2.69. Invocation command line was
19381938
19391939 $ $0 $@
29082908
29092909 # Define the identity of the package.
29102910 PACKAGE='arping'
2911 VERSION='2.21'
2911 VERSION='2.22'
29122912
29132913
29142914 cat >>confdefs.h <<_ACEOF
60376037 # report actual input values of CONFIG_FILES etc. instead of their
60386038 # values after options handling.
60396039 ac_log="
6040 This file was extended by arping $as_me 2.21, which was
6040 This file was extended by arping $as_me 2.22, which was
60416041 generated by GNU Autoconf 2.69. Invocation command line was
60426042
60436043 CONFIG_FILES = $CONFIG_FILES
61036103 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
61046104 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
61056105 ac_cs_version="\\
6106 arping config.status 2.21
6106 arping config.status 2.22
61076107 configured by $0, generated by GNU Autoconf 2.69,
61086108 with options \\"\$ac_cs_config\\"
61096109
69146914 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
69156915 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
69166916 as_fn_error $? "Something went wrong bootstrapping makefile fragments
6917 for automatic dependency tracking. Try re-running configure with the
6917 for automatic dependency tracking. If GNU make was not used, consider
6918 re-running the configure script with MAKE=\"gmake\" (or whatever is
6919 necessary). You can also try re-running configure with the
69186920 '--disable-dependency-tracking' option to at least be able to build
69196921 the package (albeit without support for automatic dependency tracking).
69206922 See \`config.log' for more details" "$LINENO" 5; }
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ(2.61)
4 AC_INIT(arping, 2.21, thomas@habets.se)
4 AC_INIT(arping, 2.22, thomas@habets.se)
55 AC_CANONICAL_SYSTEM
66 AC_CONFIG_SRCDIR([src/arping.c])
77 AM_INIT_AUTOMAKE
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.2 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2020 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
450450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451451
452452 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453 (umask $cp_umask &&
454 { test -z "$stripcmd" || {
455 # Create $dsttmp read-write so that cp doesn't create it read-only,
456 # which would cause strip to fail.
457 if test -z "$doit"; then
458 : >"$dsttmp" # No need to fork-exec 'touch'.
459 else
460 $doit touch "$dsttmp"
461 fi
462 }
463 } &&
464 $doit_exec $cpprog "$src" "$dsttmp") &&
454465
455466 # and set any options; do chmod last to preserve setuid bits.
456467 #
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
0 # Makefile.in generated by automake 1.16.2 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2020 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3434 #include "config.h"
3535 #endif
3636
37 #include <errno.h>
3738 #include <stdio.h>
3839 #include <stdlib.h>
40 #include <string.h>
3941 #include <limits.h>
4042 #include <math.h>
4143 #include <poll.h>
3939 extern int mock_libnet_lo_ok;
4040 extern int mock_libnet_null_ok;
4141
42 struct registered_test {
43 void* fn;
44 const char* name;
45 };
46
47 static int numtests = 0;
48 static struct registered_test test_registry[1024];
49
50 static int num_exit_tests = 0;
51 static struct registered_test test_exit_registry[1024];
52
5342 int get_mac_addr(const char *in, char *out);
5443 void strip_newline(char* s);
5544
56
57 #define MYTEST(a) static void a(int);__attribute__((constructor)) \
58 static void cons_##a() { \
59 test_registry[numtests].fn = a; \
60 test_registry[numtests].name = #a; \
61 numtests++; \
62 } START_TEST(a)
63
64 #define MY_EXIT_TEST(a) static void a(int);__attribute__((constructor)) \
65 static void cons_##a() { \
66 test_exit_registry[num_exit_tests].fn = a; \
67 test_exit_registry[num_exit_tests].name = #a; \
68 num_exit_tests++; \
69 } START_TEST(a)
7045
7146 /**
7247 *
235210 fprintf(stderr, "\n");
236211 }
237212
238 MYTEST(test_mkpacket)
213 START_TEST(test_mkpacket)
239214 {
240215 uint8_t correct_packet[] = {
241216 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa,
260235
261236
262237 // Received uninteresting packet, should not record anything.
263 MYTEST(pingip_uninteresting_packet)
238 START_TEST(pingip_uninteresting_packet)
264239 {
265240 struct pcap_pkthdr pkthdr;
266241 uint8_t* packet;
388363 } END_TEST
389364
390365 // Received reply that actually matches. Things should happen.
391 MYTEST(pingip_interesting_packet)
366 START_TEST(pingip_interesting_packet)
392367 {
393368 struct pcap_pkthdr pkthdr;
394369 extern uint8_t srcmac[ETH_ALEN];
448423 "numrecvd not incremented second time");
449424 } END_TEST
450425
451 MYTEST(strip_newline_test)
426 START_TEST(strip_newline_test)
452427 {
453428 const char *tests[][2] = {
454429 {"", ""},
468443 }
469444 } END_TEST
470445
471 MYTEST(get_mac_addr_success)
446 START_TEST(get_mac_addr_success)
472447 {
473448 const char *tests[][2] = {
474449 // Null.
500475 }
501476 } END_TEST
502477
503 MYTEST(get_mac_addr_fail)
478 START_TEST(get_mac_addr_fail)
504479 {
505480 const char *tests[] = {
506481 "",
516491 }
517492 } END_TEST
518493
519 MY_EXIT_TEST(libnet_init_bad_nolo)
494 START_TEST(libnet_init_bad_nolo)
520495 {
521496 // It'll only try lo if named interface fails.
522497 // So by accepting lo, we make sure it doesn't try lo.
524499 do_libnet_init("bad", 0);
525500 } END_TEST
526501
527 MY_EXIT_TEST(libnet_init_null_nolo_nonull)
502 START_TEST(libnet_init_null_nolo_nonull)
528503 {
529504 mock_libnet_lo_ok = 0;
530505 mock_libnet_null_ok = 0;
531506 do_libnet_init(NULL, 0);
532507 } END_TEST
533508
534 MYTEST(libnet_init_good)
509 START_TEST(libnet_init_good)
535510 {
536511 mock_libnet_lo_ok = 0; // Don't even try falling back to lo.
537512 do_libnet_init("good", 0);
538513 fail_if(libnet == NULL);
539514 } END_TEST
540515
541 MYTEST(libnet_init_null_nolo)
516 START_TEST(libnet_init_null_nolo)
542517 {
543518 mock_libnet_lo_ok = 0;
544519 mock_libnet_null_ok = 1;
545520 do_libnet_init(NULL, 0);
546521 fail_if(libnet == NULL);
547 } END_TEST
522 }
523 END_TEST
548524
549525 static Suite*
550526 arping_suite(void)
552528 int c;
553529 Suite* s = suite_create("Arping");
554530
555 //tcase_add_checked_fixture (tc_core, setup, teardown);
556 for (c = 0; c < numtests; c++) {
557 TCase *tc_core = tcase_create(test_registry[c].name);
558 tcase_add_test(tc_core, test_registry[c].fn);
559 suite_add_tcase(s, tc_core);
560 }
561 for (c = 0; c < num_exit_tests; c++) {
562 TCase *tc_core = tcase_create(test_exit_registry[c].name);
563 tcase_add_exit_test(tc_core, test_exit_registry[c].fn, 1);
564 suite_add_tcase(s, tc_core);
565 }
531
532 TCase *tc_core;
533
534 // libcheck broke test registries, so have to resort to code duplication. :-(
535 // https://github.com/libcheck/check/pull/158/files
536 #define SIGH_LIBCHECK(tn) \
537 tc_core = tcase_create(#tn); \
538 tcase_add_test(tc_core, tn); \
539 suite_add_tcase(s, tc_core);
540
541 SIGH_LIBCHECK(libnet_init_null_nolo);
542 SIGH_LIBCHECK(test_mkpacket);
543 SIGH_LIBCHECK(pingip_uninteresting_packet);
544 SIGH_LIBCHECK(pingip_interesting_packet);
545 SIGH_LIBCHECK(strip_newline_test);
546 SIGH_LIBCHECK(get_mac_addr_success);
547 SIGH_LIBCHECK(get_mac_addr_fail);
548 SIGH_LIBCHECK(libnet_init_good);
549
550
551 #define SIGH_LIBCHECK_EXIT(tn) \
552 tc_core = tcase_create(#tn); \
553 tcase_add_exit_test(tc_core, tn, 1); \
554 suite_add_tcase(s, tc_core);
555
556 SIGH_LIBCHECK_EXIT(libnet_init_bad_nolo);
557 SIGH_LIBCHECK_EXIT(libnet_init_null_nolo_nonull);
558
566559 return s;
567560 }
568561
576569 number_failed = srunner_ntests_failed (sr);
577570 srunner_free (sr);
578571 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
572 return 0;
579573 }
580574 /* ---- Emacs Variables ----
581575 * Local Variables:
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 2011-2018 Free Software Foundation, Inc.
5 # Copyright (C) 2011-2020 Free Software Foundation, Inc.
66 #
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by