nfs-ganesha 1.4

test_findlog.c

Go to the documentation of this file.
00001 // This is not a valid C file, it's just a bunch of Log function examples to test findlog.sh
00002 /* LogTest("/* comment"); */
00003 
00004 /* LogTest("/* multiline comment");
00005 */
00006 
00007         LogTest("tab");
00008 
00009  LogTest("space");
00010 
00011 // LogTest("// comment");
00012 
00013  // LogTest("2nd // comment");
00014 
00015  LogTest("space before semi") ;
00016 
00017  LogTest("space after semi"); 
00018  
00019  LogTest("function with ; in quotes");
00020 
00021  LogTest("parm 1",
00022         "parm 2");
00023 
00024  LogTest("parm 1",
00025         "parm 2 with space after semi");  
00026 
00027  LogTest("parm 1 with ;",
00028         "parm 2 with space after semi");  
00029 
00030  LogTest("parm 1",
00031         "parm 2 with ;");  
00032 
00033  LogTest("parm 1",
00034 
00035 
00036 
00037         "parm 2"); 
00038 
00039  LogTest
00040         ("paren on new line") ;
00041         
00042  
00043   LogVal = "dont find me"
00044   
00045   LogTest("But do find me");
00046  
00047 #define MACRO \
00048   LogWarn(COMPONENT_CONFIG,            \
00049           "MACRO")
00050 
00051 /* expected too much - need to figure out how to fix the script */
00052 
00053 #define MACRO \
00054   LogWarn(COMPONENT_CONFIG,            \
00055           "MACRO") \
00056           { }
00057 
00058 /* expected too much - need to figure out how to fix the script */
00059 
00060   LogComponents[dont find me];
00061   LogAlways("but find me on line 53");
00062       LogTest("and me",
00063               string, buff, compare);
00064   LogTest("and finally me");
00065   
00066 #define MACRO1                     \
00067         LogTest("M1 A",  \
00068                 parms);                 \
00069       LogTest("M1 B", parms); \
00070   }
00071 
00072 #define MACRO2 \
00073         LogTest("M2 A",  \
00074                 parms);                 \
00075       LogTest("M2 B", parms); \
00076       LogTest("M2 C", parms); \
00077   }
00078 
00079       else if(!STRCMP(key_name, "LogFile not me 1"))
00080           LogFile = "not me 2";
00081       else if(!STRCMP(key_name, "not me 3"))
00082               LogCrit(COMPONENT_CONFIG,
00083                       "find me 1 on 76",
00084                       key_name);
00085 
00086       else if(!STRCMP(key_name, "LogFile not me 5"))
00087           LogFile = "not me 6";
00088               LogCrit(COMPONENT_CONFIG,
00089                       "find me 2 on 82",
00090                       key_name);
00091 
00092   (Logtest("in parens"));
00093 
00094   LogTest("foo") ;
00095   if(LogTest("simple if"))
00096     foo;
00097   foo("oops shouldn't pick this up");
00098 
00099   if(LogTest("if with braces on same line")) {
00100     foo;
00101   }
00102   foo("oops shouldn't pick this up");
00103 
00104   if(LogTest("if with braces"))
00105     {
00106       foo;
00107     }
00108   foo("oops shouldn't pick this up");
00109 
00110   if(LogTest("if with braces 2"))
00111     {
00112       foo();
00113     }
00114   foo("oops shouldn't pick this up");
00115 
00116   LogTest("fini");