xref: /haiku/src/tests/servers/launch/SettingsParserTest.h (revision 95c9effd68127df2dce202d5e254a7c86560010a)
1 /*
2  * Copyright 2015, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef SETTINGS_PARSER_TEST_H
6 #define SETTINGS_PARSER_TEST_H
7 
8 
9 #include <TestCase.h>
10 #include <TestSuite.h>
11 
12 #include <Message.h>
13 
14 
15 class SettingsParserTest : public CppUnit::TestCase {
16 public:
17 								SettingsParserTest();
18 	virtual						~SettingsParserTest();
19 
20 			void				TestConditionsEmpty();
21 			void				TestConditionsMultiLine();
22 			void				TestConditionsFlat();
23 			void				TestConditionsFlatWithNot();
24 			void				TestConditionsFlatWithArgs();
25 			void				TestConditionsFlatWithNotAndArgs();
26 			void				TestConditionsMultiLineFlatNot();
27 			void				TestConditionsMultiLineFlatNotWithArgs();
28 			void				TestConditionsMultiLineNot();
29 
30 			void				TestEventsEmpty();
31 			void				TestEventsMultiLine();
32 			void				TestEventsFlat();
33 			void				TestEventsFlatWithArgs();
34 
35 			void				TestEnvironmentMultiLine();
36 			void				TestEnvironmentFlat();
37 
38 			void				TestRunFlat();
39 			void				TestRunMultiLine();
40 			void				TestRunIfThenElseFlat();
41 			void				TestRunIfThenElseMultiLine();
42 
43 	static	void				AddTests(BTestSuite& suite);
44 
45 private:
46 			status_t			_ParseCondition(const char* text,
47 									BMessage& message);
48 			status_t			_ParseEvent(const char* text,
49 									BMessage& message);
50 			status_t			_ParseName(const char* name, const char* text,
51 									BMessage& message);
52 			int32				_ArrayCount(BMessage& message,
53 									const char* name);
54 };
55 
56 
57 #endif	// SETTINGS_PARSER_TEST_H
58