59 lines
1.5 KiB
C
59 lines
1.5 KiB
C
|
/*
|
||
|
* Unit test for exclude.h
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include "exclude.h"
|
||
|
#include "test.h"
|
||
|
|
||
|
#include <assert.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
void test_exclude()
|
||
|
{
|
||
|
struct iso_hash_table table = { {0,}, 0};
|
||
|
|
||
|
printf("Testing exclude hashtable...");
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/otherdir") );
|
||
|
iso_exclude_add_path(&table, "/otherdir");
|
||
|
assert( iso_exclude_lookup(&table, "/otherdir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
iso_exclude_add_path(&table, "/dir");
|
||
|
assert( iso_exclude_lookup(&table, "/otherdir") );
|
||
|
assert( iso_exclude_lookup(&table, "/dir") );
|
||
|
iso_exclude_empty(&table);
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/otherdir") );
|
||
|
printf("\tOK\n");
|
||
|
}
|
||
|
/*
|
||
|
* Unit test for exclude.h
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include "exclude.h"
|
||
|
#include "test.h"
|
||
|
|
||
|
#include <assert.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
void test_exclude()
|
||
|
{
|
||
|
struct iso_hash_table table = { {0,}, 0};
|
||
|
|
||
|
printf("Testing exclude hashtable...");
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/otherdir") );
|
||
|
iso_exclude_add_path(&table, "/otherdir");
|
||
|
assert( iso_exclude_lookup(&table, "/otherdir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
iso_exclude_add_path(&table, "/dir");
|
||
|
assert( iso_exclude_lookup(&table, "/otherdir") );
|
||
|
assert( iso_exclude_lookup(&table, "/dir") );
|
||
|
iso_exclude_empty(&table);
|
||
|
assert( !iso_exclude_lookup(&table, "/dir") );
|
||
|
assert( !iso_exclude_lookup(&table, "/otherdir") );
|
||
|
printf("\tOK\n");
|
||
|
}
|