#endif /* HAVE_STRINGS_H */
#include "sudo_compat.h"
+#include "sudo_util.h"
#ifdef HAVE_FNMATCH
# include <fnmatch.h>
char pattern[1024], string[1024], flagstr[1024];
int errors = 0, tests = 0, flags, got, want;
+ initprogname(argc > 0 ? argv[0] : "fnm_test");
+
if (argc > 1) {
if ((fp = fopen(argv[1], "r")) == NULL) {
perror(argv[1]);
#include <errno.h>
#include "sudo_compat.h"
+#include "sudo_util.h"
#define MAX_RESULTS 256
struct gl_entry entry;
size_t len;
+ initprogname(argc > 0 ? argv[0] : "globtest");
+
if (argc > 1) {
if ((fp = fopen(argv[1], "r")) == NULL) {
perror(argv[1]);
char pattern[1024], string[1024];
int errors = 0, tests = 0, got, want;
+ initprogname(argc > 0 ? argv[0] : "check_env_pattern");
+
if (argc > 1) {
if ((fp = fopen(argv[1], "r")) == NULL) {
perror(argv[1]);
#define SUDO_ERROR_WRAP 0
#include "sudo_compat.h"
+#include "sudo_util.h"
extern size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
unsigned char buf[32];
size_t len;
+ initprogname(argc > 0 ? argv[0] : "check_base64");
+
for (i = 0; i < ntests; i++) {
len = base64_decode(test_strings[i].encoded, buf, sizeof(buf));
buf[len] = '\0';
#include "sudo_compat.h"
#include "sudo_fatal.h"
#include "sudo_queue.h"
+#include "sudo_util.h"
#include "parse.h"
__dso_public int main(int argc, char *argv[]);
size_t digest_len;
int digest_type;
+ initprogname(argc > 0 ? argv[0] : "check_digest");
+
for (digest_type = 0; digest_type < SUDO_DIGEST_INVALID; digest_type++) {
for (i = 0; i < NUM_TESTS; i++) {
digest = check_digest(digest_type, test_strings[i],
#define SUDO_ERROR_WRAP 0
#include "sudo_compat.h"
+#include "sudo_util.h"
#include "sudoers_debug.h"
#include "parse.h"
int ntests, errors = 0;
time_t result;
+ initprogname(argc > 0 ? argv[0] : "check_gentime");
+
/* Do local time tests in Eastern Standard Time. */
putenv("TZ=EST5EST5");
tzset();
#define SUDO_ERROR_WRAP 0
#include "sudo_compat.h"
+#include "sudo_util.h"
int hexchar(const char *s);
struct hexchar_test *test_data;
int i, ntests, result, errors = 0;
+ initprogname(argc > 0 ? argv[0] : "check_hexchar");
+
/* Build up test data. */
ntests = 256 + 256 + 3;
test_data = calloc(sizeof(*test_data), ntests);