Guten Tag Weiming,
am Donnerstag, 11. Februar 2016 um 20:13 schrieben Sie:

> Basically, it shows that "output/filtered" is empty, which should have the
> same content as "witness/fallback1".

That's correct and it does so in my env.

> I didn't quite understand what Transformer::transform tries to achieve. Does
> it tries to filter out (delete) everything in "output/temp" which matches
> the patterns of the filters?

I don't think so, it applies the filters to each line and the filters
decide which lines are kept or removed. So one needs to look at the
filters applied in the test case and to me it seems that ControlFilter
gets a pattern which decides which lines are KEPT and I'm not sure
what LineNumberFilter is about currently. If I look at my "temp" file,
it doesn't contain any line numbers and input/xml/fallback1.xml
doesn't contain any as well. Additionally, it looks like ControlFilter
is a no-op currently? The pattern provided with operator<< doesn't
seem to be forwarded anywhere. If instead look at LineNumberFilter,
this does save pattern sin the instance.

So maybe the test is just wrong?

In the end, I think it would like to achieve that wrong lines in
output/temp are filtered until witness/fallback1 is the result. It's
currently the case in my env, but output/temp already contains the
needed lines 1:1. Don't know if that's right or wrong yet, but
ControlFilter applied without any filtering would of course don't
change anything and therefore the test would pass.

> If so, i think it makes sense for "output/filtered" to be empty.

That wouldn't make sense because "witness/fallback1" is not empty and
that's the expected result of the test.

If I understand Transformer::createSedCommandFile correctly, "sed" is
used to perform the actual pattern matching at least for
LineNumberFilter. Is that available in your PATH? It should because
else log4cxx would assert, but you may want to make sure. Additionally
you should make sure that your "sed" accepts the used -f arg and the
patterns of "temp.sed". You can see the content of that file if you
run the test suite with only the one test you are interested it,
something like:

> test_all.cmd errorhandlertestcase

where test_all.cmd is some wrapper of mine to adopt the suite to my
needs. My temp.sed contains the following:

> sQ [^ ]*[\\]Q Qg
> sQ([0-9]*)Q(X)Qg

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Reply via email to