[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ossec-cvs] ossec-hids: Makefile (NEW) hash_test.c (NEW) prime_test.c (NEW) [dcid]
Module name: ossec-hids
Changes by: dcid 07/08/16 21:02:33
Added files:
Makefile hash_test.c prime_test.c
Log message:
Description: Simple tests for the shared libs.
--- NEW FILE: Makefile ---
# Makefile for misc tests
maketest:
$(CC) -g -o prime_test prime_test.c ../math_op.c -I../ -I../../ -I../../headers/ -I../headers/ -Wall
$(CC) -g -o hash_test hash_test.c ../hash_op.c ../math_op.c -I../ -I../../ -I../../headers/ -I../headers/ -Wall
clean:
-rm regex regex_str *.core
--- NEW FILE: hash_test.c ---
#include <stdio.h>
#include <string.h>
#include "hash_op.h"
int main(int argc, char **argv)
{
int i = 0;
char *tmp;
char buf[1024];
OSHash *mhash;
mhash = OSHash_Create();
while(1)
{
fgets(buf, 1024, stdin);
tmp = strchr(buf, '\n');
if(tmp)
*tmp = '\0';
printf("Adding key: '%s'\n", buf);
i = OSHash_Add(mhash, strdup(buf), NULL);
printf("rc = %d\n", i);
}
return(0);
}
/* EOF */
--- NEW FILE: prime_test.c ---
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "math_op.h"
int main(int argc, char **argv)
{
if(!argv[1])
{
printf("%s <int>\n", argv[0]);
exit(1);
}
printf("Value: %d\n", os_getprime(atoi(argv[1])));
return(0);
}
/* EOF */
OSSEC home |
Main Index |
Thread Index
OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.