haiku/src/tests/kits/storage/MimeSnifferTest.h
Tyler Dauwalder b657eab3cf + Fixed the uber scanner test yet again (this time wrt
NULL characters embedded in the token strings).
+ Added a number of sniffing tests. The rules returned
  by the parser appear to sniff properly now.

Incidentally, our sniffer supports conjunctions, i.e the rule

1.0 ('abc') [9] ('xyz')

is equivalent to the rule

1.0 ('abc______xyz' & 0xFFF000000FFF)

This is different than the R5 sniffer, which doesn't reject
rules like the former, but appears to ignore all expressions
in the rule except for the first, i.e. it would treat the first
rule as

1.0 ('abc')

The only problem I can see with this is if someone for
some reason wrote such a rule with multiple expressions
for use with the R5 sniffer. It would likely work differently
with ours. I'm going to search my MIME database and see
if any such rules exist. If so, it'll be easy to switch to the
R5 way of doing things.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-09 10:38:30 +00:00

27 lines
585 B
C++

// MimeSnifferTest.h
#ifndef __sk_parser_test_h__
#define __sk_parser_test_h__
#include <TestCase.h>
class MimeSnifferTest : public BTestCase {
public:
static CppUnit::Test* Suite();
//------------------------------------------------------------
// Test functions
//------------------------------------------------------------
void ScannerTest();
void ParserTest();
void SnifferTest();
//------------------------------------------------------------
// Helper functions
//------------------------------------------------------------
};
#endif // __sk_parser_test_h__