|
| 1 | +package generatedtest; |
| 2 | + |
| 3 | +import java.util.logging.LogRecord; |
| 4 | +import org.apache.logging.log4j.Logger; |
| 5 | +import org.apache.logging.log4j.message.EntryMessage; |
| 6 | +import org.apache.logging.log4j.message.Message; |
| 7 | +import org.slf4j.spi.LoggingEventBuilder; |
| 8 | + |
| 9 | +// Test case generated by GenerateFlowTestCase.ql |
| 10 | +public class Test { |
| 11 | + |
| 12 | + Object source() { |
| 13 | + return null; |
| 14 | + } |
| 15 | + |
| 16 | + void sink(Object o) {} |
| 17 | + |
| 18 | + public void test() throws Exception { |
| 19 | + |
| 20 | + { |
| 21 | + // "java.util.logging;LogRecord;false;LogRecord;;;Argument[1];Argument[-1];taint" |
| 22 | + LogRecord out = null; |
| 23 | + String in = (String) source(); |
| 24 | + out = new LogRecord(null, in); |
| 25 | + sink(out); // $ hasTaintFlow |
| 26 | + } |
| 27 | + { |
| 28 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(Message);;Argument[0];ReturnValue;taint" |
| 29 | + EntryMessage out = null; |
| 30 | + Message in = (Message) source(); |
| 31 | + Logger instance = null; |
| 32 | + out = instance.traceEntry(in); |
| 33 | + sink(out); // $ hasTaintFlow |
| 34 | + } |
| 35 | + { |
| 36 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint" |
| 37 | + EntryMessage out = null; |
| 38 | + Object[] in = (Object[]) source(); |
| 39 | + Logger instance = null; |
| 40 | + out = instance.traceEntry((String) null, in); |
| 41 | + sink(out); // $ hasTaintFlow |
| 42 | + } |
| 43 | + { |
| 44 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint" |
| 45 | + EntryMessage out = null; |
| 46 | + String in = (String) source(); |
| 47 | + Logger instance = null; |
| 48 | + out = instance.traceEntry(in, (Object[]) null); |
| 49 | + sink(out); // $ hasTaintFlow |
| 50 | + } |
| 51 | + { |
| 52 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint" |
| 53 | + EntryMessage out = null; |
| 54 | + String in = (String) source(); |
| 55 | + Logger instance = null; |
| 56 | + out = instance.traceEntry(in, (org.apache.logging.log4j.util.Supplier[]) null); |
| 57 | + sink(out); // $ hasTaintFlow |
| 58 | + } |
| 59 | + { |
| 60 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint" |
| 61 | + EntryMessage out = null; |
| 62 | + org.apache.logging.log4j.util.Supplier[] in = |
| 63 | + (org.apache.logging.log4j.util.Supplier[]) source(); |
| 64 | + Logger instance = null; |
| 65 | + out = instance.traceEntry((String) null, in); |
| 66 | + sink(out); // $ hasTaintFlow |
| 67 | + } |
| 68 | + { |
| 69 | + // "org.apache.logging.log4j;Logger;true;traceEntry;(Supplier[]);;Argument[0];ReturnValue;taint" |
| 70 | + EntryMessage out = null; |
| 71 | + org.apache.logging.log4j.util.Supplier[] in = |
| 72 | + (org.apache.logging.log4j.util.Supplier[]) source(); |
| 73 | + Logger instance = null; |
| 74 | + out = instance.traceEntry(in); |
| 75 | + sink(out); // $ hasTaintFlow |
| 76 | + } |
| 77 | + { |
| 78 | + // "org.apache.logging.log4j;Logger;true;traceExit;(EntryMessage,Object);;Argument[1];ReturnValue;value" |
| 79 | + Object out = null; |
| 80 | + Object in = (Object) source(); |
| 81 | + Logger instance = null; |
| 82 | + out = instance.traceExit((EntryMessage) null, in); |
| 83 | + sink(out); // $ hasValueFlow |
| 84 | + } |
| 85 | + { |
| 86 | + // "org.apache.logging.log4j;Logger;true;traceExit;(Message,Object);;Argument[1];ReturnValue;value" |
| 87 | + Object out = null; |
| 88 | + Object in = (Object) source(); |
| 89 | + Logger instance = null; |
| 90 | + out = instance.traceExit((Message) null, in); |
| 91 | + sink(out); // $ hasValueFlow |
| 92 | + } |
| 93 | + { |
| 94 | + // "org.apache.logging.log4j;Logger;true;traceExit;(Object);;Argument[0];ReturnValue;value" |
| 95 | + Object out = null; |
| 96 | + Object in = (Object) source(); |
| 97 | + Logger instance = null; |
| 98 | + out = instance.traceExit(in); |
| 99 | + sink(out); // $ hasValueFlow |
| 100 | + } |
| 101 | + { |
| 102 | + // "org.apache.logging.log4j;Logger;true;traceExit;(String,Object);;Argument[1];ReturnValue;value" |
| 103 | + Object out = null; |
| 104 | + Object in = (Object) source(); |
| 105 | + Logger instance = null; |
| 106 | + out = instance.traceExit((String) null, in); |
| 107 | + sink(out); // $ hasValueFlow |
| 108 | + } |
| 109 | + { |
| 110 | + // "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[-1];ReturnValue;value" |
| 111 | + LoggingEventBuilder out = null; |
| 112 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 113 | + out = in.addArgument((Object) null); |
| 114 | + sink(out); // $ hasValueFlow |
| 115 | + } |
| 116 | + { |
| 117 | + // "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[-1];ReturnValue;value" |
| 118 | + LoggingEventBuilder out = null; |
| 119 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 120 | + out = in.addArgument((java.util.function.Supplier) null); |
| 121 | + sink(out); // $ hasValueFlow |
| 122 | + } |
| 123 | + { |
| 124 | + // "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[-1];ReturnValue;value" |
| 125 | + LoggingEventBuilder out = null; |
| 126 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 127 | + out = in.addKeyValue((String) null, (Object) null); |
| 128 | + sink(out); // $ hasValueFlow |
| 129 | + } |
| 130 | + { |
| 131 | + // "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[-1];ReturnValue;value" |
| 132 | + LoggingEventBuilder out = null; |
| 133 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 134 | + out = in.addKeyValue((String) null, (java.util.function.Supplier) null); |
| 135 | + sink(out); // $ hasValueFlow |
| 136 | + } |
| 137 | + { |
| 138 | + // "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[-1];taint" |
| 139 | + LoggingEventBuilder out = null; |
| 140 | + Object in = (Object) source(); |
| 141 | + out.addKeyValue((String) null, in); |
| 142 | + sink(out); // $ hasTaintFlow |
| 143 | + } |
| 144 | + { |
| 145 | + // "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[-1];taint" |
| 146 | + LoggingEventBuilder out = null; |
| 147 | + java.util.function.Supplier in = (java.util.function.Supplier) source(); |
| 148 | + out.addKeyValue((String) null, in); |
| 149 | + sink(out); // $ hasTaintFlow |
| 150 | + } |
| 151 | + { |
| 152 | + // "org.slf4j.spi;LoggingEventBuilder;true;addMarker;;;Argument[-1];ReturnValue;value" |
| 153 | + LoggingEventBuilder out = null; |
| 154 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 155 | + out = in.addMarker(null); |
| 156 | + sink(out); // $ hasValueFlow |
| 157 | + } |
| 158 | + { |
| 159 | + // "org.slf4j.spi;LoggingEventBuilder;true;setCause;;;Argument[-1];ReturnValue;value" |
| 160 | + LoggingEventBuilder out = null; |
| 161 | + LoggingEventBuilder in = (LoggingEventBuilder) source(); |
| 162 | + out = in.setCause(null); |
| 163 | + sink(out); // $ hasValueFlow |
| 164 | + } |
| 165 | + |
| 166 | + } |
| 167 | + |
| 168 | +} |
0 commit comments