Possibility to pass class method reference
[command.git] / tests / option / handles_string_value.cpp
index 574b5c5adfe7ed5d8a4a6d44cab6c508ee9b8aa2..c318351b6bbec00eadf717f4df736d6872612548 100644 (file)
@@ -9,31 +9,31 @@ using namespace command;
 #define NAME "test"
 #define VALUE "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
-#define OPTION NAME"="VALUE
+#define OPTION NAME "=" VALUE
 
 typedef std::string OptionType;
 
 OptionType test;
 
-void function(OptionType value) {
+void _function(OptionType value) {
     test = value;
 }
 
 int main() {
-    Option<OptionType> option(NAME, "Option with string value", function);
+    Option<OptionType> option(NAME, "Option with string value", _function);
 
     if (option.understand(OPTION)) {
         option.handle();
     }
     else {
-        cout << "Option class do not understand string values\n";
+        cout << option.describe() << " do not understand string values\n";
         return 1;
     }
 
     int cmp = strcmp(test.c_str(), VALUE);
 
     if (cmp == 0) {
-        cout << "Option class handles string values\n";
+        cout << option.describe() << " handles string values\n";
         return 0;
     }