Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dcs_classifier
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
dcs_classifier
Commits
f0b62e19
Commit
f0b62e19
authored
Aug 07, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace ocd
parent
3bf0b33a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
dcs_test.c
src/dcs_test.c
+17
-11
No files found.
src/dcs_test.c
View file @
f0b62e19
/*
* Copyright (c) 2014 UPLEX - Nils Goroll Systemoptimierung
* Copyright (c) 2014
-2015
UPLEX - Nils Goroll Systemoptimierung
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -39,10 +39,9 @@
#include "gen/dcs_classifier.h"
/* need DCS_* */
#include "dcs_match.h"
int
test
(
const
char
*
fixup_remove_name
,
const
char
*
fixup_reorder_name
);
static
void
fixup_out
(
FILE
*
f_remove
,
FILE
*
f_reorder
,
const
int
i
,
const
int
r
);
int
test
(
const
char
*
,
const
char
*
);
static
void
fixup_out
(
FILE
*
,
FILE
*
,
const
int
,
const
int
);
int
main
(
int
argc
,
char
*
argv
[])
{
dcs_match_init
();
...
...
@@ -69,8 +68,10 @@ test_p_diff (const char *label, const int i, const char *testkey, const int r) {
if
(
dcs_entry
[
i
].
type
!=
dcs_entry
[
r
].
type
)
{
printf
(
"
\t
i: %8d (id %8d)
\t
%s
\t
%s
\n
"
"type
\t
r: %8d (id %8d)
\t
%s
\t
%s
\n
"
,
i
,
dcs_entry
[
i
].
id
,
dcs_entry
[
i
].
key
,
dcs_type
[
dcs_entry
[
i
].
type
],
r
,
dcs_entry
[
r
].
id
,
dcs_entry
[
r
].
key
,
dcs_type
[
dcs_entry
[
r
].
type
]);
i
,
dcs_entry
[
i
].
id
,
dcs_entry
[
i
].
key
,
dcs_type
[
dcs_entry
[
i
].
type
],
r
,
dcs_entry
[
r
].
id
,
dcs_entry
[
r
].
key
,
dcs_type
[
dcs_entry
[
r
].
type
]);
}
else
{
printf
(
"
\t
i: %8d (id %8d)
\t
%s
\n
"
"
\t
r: %8d (id %8d)
\t
%s
\n
"
,
...
...
@@ -180,15 +181,20 @@ test (const char *fixup_remove_name, const char *fixup_reorder_name) {
assert
(
strlen
(
dcs_entry
[
r
].
key
)
<
KEYLIM
);
/* append the negative token from entry r to entry i */
/*
* append the negative token from entry r to
* entry i
*/
if
(
nkey
[
0
]
==
'\0'
)
strcpy
(
nkey
,
dcs_entry
[
i
].
key
);
if
((
ntoke
=
strchr
(
ntok
,
'*'
))
!=
NULL
)
{
assert
((
strlen
(
nkey
)
+
(
ntoke
-
ntok
))
<
KEYLIM
);
assert
((
strlen
(
nkey
)
+
(
ntoke
-
ntok
))
<
KEYLIM
);
strncat
(
nkey
,
ntok
,
(
ntoke
-
ntok
));
}
else
{
assert
((
strlen
(
nkey
)
+
strlen
(
ntok
))
<
KEYLIM
);
assert
((
strlen
(
nkey
)
+
strlen
(
ntok
))
<
KEYLIM
);
strcat
(
nkey
,
ntok
);
}
r
=
dcs_match
(
nkey
,
mem
,
DCS_MATCH_MEM_SZ
);
...
...
@@ -240,7 +246,7 @@ test (const char *fixup_remove_name, const char *fixup_reorder_name) {
np
=
strtok_r
(
NULL
,
"*"
,
&
save
);
}
}
r
=
dcs_match
(
poskey
,
mem
,
DCS_MATCH_MEM_SZ
);
if
(
i
!=
r
)
{
test_p_diff
(
"miss np"
,
i
,
poskey
,
r
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment