diff options
author | fluxgen <fluxgen> | 2004-05-02 21:23:35 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-05-02 21:23:35 (GMT) |
commit | 955c2358fbd8364be5629504cc720e0a9227d630 (patch) | |
tree | 00918b1f788434f131660f49b7ae8f1236c88a34 /src/tests | |
parent | e5c0b02496e5d332174a27b607079a397c6d313b (diff) | |
download | fluxbox_lack-955c2358fbd8364be5629504cc720e0a9227d630.zip fluxbox_lack-955c2358fbd8364be5629504cc720e0a9227d630.tar.bz2 |
testing menu parser
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/parsertest.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tests/parsertest.cc b/src/tests/parsertest.cc new file mode 100644 index 0000000..9854074 --- /dev/null +++ b/src/tests/parsertest.cc | |||
@@ -0,0 +1,31 @@ | |||
1 | #include "../FbMenuParser.hh" | ||
2 | |||
3 | #include <iostream> | ||
4 | |||
5 | using namespace std; | ||
6 | |||
7 | |||
8 | int main(int argc, char **argv) { | ||
9 | if (argc < 2) { | ||
10 | cerr<<"you must supply an argument!"<<endl; | ||
11 | exit(0); | ||
12 | } | ||
13 | cerr<<"Loading: "<<argv[1]<<endl; | ||
14 | Parser *p = new FbMenuParser(argv[1]); | ||
15 | if (!p->isLoaded()) { | ||
16 | cerr<<"Couldn't load file: "<<argv[1]<<endl; | ||
17 | delete p; | ||
18 | exit(0); | ||
19 | } | ||
20 | |||
21 | Parser::Item item, item2, item3; | ||
22 | int args = 0; | ||
23 | int last_line_num = 0; | ||
24 | std::string last_line; | ||
25 | std::string type, name, argument; | ||
26 | while (!p->eof()) { | ||
27 | (*p)>>item>>item2>>item3; | ||
28 | cerr<<item.second<<","<<item2.second<<", "<<item3.second<<endl; | ||
29 | } | ||
30 | delete p; | ||
31 | } | ||