1
#include "makernote.hpp"
7
void testMatch(const std::string& reg, const std::string& key);
11
testMatch("Canon", "Canon");
12
testMatch("Canon*", "Canon");
13
testMatch("Canon*", "Canon Corp.");
14
testMatch("*foo*bar*", "foobar");
15
testMatch("*foo*bar*", "barfoofoobarbar");
16
testMatch("foo*bar", "foo");
17
testMatch("foo*bar", "bar");
18
testMatch("foo*bar", "foobar");
19
testMatch("foo*bar", "fooYAHOObar");
20
testMatch("foo*bar", "Thefoobar");
21
testMatch("foo*bar", "foobarTrick");
22
testMatch("foo*bar", "ThefoobarTrick");
23
testMatch("foo*bar", "ThefooYAHOObarTrick");
25
testMatch("*", "anything");
26
testMatch("**", "anything times two");
28
testMatch("*bar", "bar");
29
testMatch("b*bar", "bar");
30
testMatch("b*bar", "bbar");
31
testMatch("*foobar", "bar");
32
testMatch("*bar", "foobar");
37
void testMatch(const std::string& reg, const std::string& key)
39
int rc = Exiv2::MakerNoteFactory::match(reg, key);
42
std::cout << "Key '" << key << "' matches '" << reg << "' "
43
<< "with a score of " << rc << ".\n";
46
std::cout << "Key '" << key << "' does not match '" << reg << "'.\n";