mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Trim test files + remove duplicate newlines
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
|
||||
class FalsePositiveCases
|
||||
{
|
||||
// regular FVN
|
||||
|
||||
@@ -20,4 +20,3 @@ public class ArrayTest {
|
||||
e[1, 1] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class test_stmts
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public static void tryCatchFinally()
|
||||
{
|
||||
int x = 5;
|
||||
|
||||
@@ -26,5 +26,3 @@ class UsingStmt
|
||||
o3.DoSomething();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
|
||||
|
||||
Class is defined in three places, and requires the alias to disambiguate them.
|
||||
*/
|
||||
|
||||
|
||||
@@ -14,5 +14,3 @@ namespace TestAssemblies
|
||||
Locations.Test l = new Locations.Test();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
|
||||
@@ -138,5 +138,3 @@ class Assignables
|
||||
using var x = new System.IO.MemoryStream();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,5 +54,3 @@ namespace Semmle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
* 2 constructed methods of F<T>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
namespace Methods
|
||||
{
|
||||
public class Class1
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Test
|
||||
|
||||
@@ -10,7 +10,6 @@ class C { }
|
||||
|
||||
/* A multiline comment */
|
||||
|
||||
|
||||
// 2) Comment blocks
|
||||
|
||||
// A line on its own is a commentblock
|
||||
|
||||
@@ -51,5 +51,3 @@ class Assertions
|
||||
Contract.Assume(s != null, "s is non-null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Disposal : IDisposable
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using System;
|
||||
|
||||
class NonGeneratedCode { }
|
||||
|
||||
|
||||
|
||||
@@ -146,5 +146,3 @@ class ExitMethods
|
||||
Console.WriteLine("dead");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -300,5 +300,3 @@ class NegationInConstructor
|
||||
new NegationInConstructor(i: 0, b: !(i > 0) && s != null, s: "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -94,5 +94,3 @@ class AssertTests
|
||||
return b1 && !b2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -103,4 +102,3 @@ public class Collections
|
||||
Console.WriteLine(args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
|
||||
#nullable enable
|
||||
|
||||
@@ -349,4 +349,3 @@ public class Guards
|
||||
o.ToString(); // null guarded
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,5 +45,3 @@ class C<T1, T2, T3, T4, T5, T6>
|
||||
x1 = x15; // not a boxing conversion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,5 +28,3 @@ class C<T>
|
||||
x10 = x9;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,5 +91,3 @@ class C3<T5, T6> where T5 : C1
|
||||
{
|
||||
public I4<T5, T6> M(I4<C1, T6> x) => x;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,5 +79,3 @@ class IndexInitializers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class DefaultLiterals
|
||||
{
|
||||
void f()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class InModifiers
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class StackAllocs
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class StaticLocalFunctions
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Ranges
|
||||
|
||||
@@ -24,4 +24,4 @@ public class AnonObj
|
||||
{
|
||||
List<int> list = new();// { 1, 2, 3 }; todo: the initializer causes an extraction error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ public class BinaryPattern
|
||||
_ => "other"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ class A
|
||||
class B : A
|
||||
{
|
||||
public override B M1() { throw null; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ public class Discard
|
||||
i = (int _, int _) => 42;
|
||||
i = delegate (int _, int _) { return 0; };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
public class FnPointer
|
||||
{
|
||||
public unsafe static class Program
|
||||
@@ -49,4 +47,4 @@ public class FnPointer
|
||||
class A { }
|
||||
class B : A { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
Global statements are not allowed in 'library' target.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
@@ -22,4 +20,4 @@ public class Attr : Attribute
|
||||
{
|
||||
Console.WriteLine("3");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,4 +34,4 @@ public class C1
|
||||
Prop0 = 0
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ public class Class1
|
||||
|
||||
await Task.Run(async () => { await Task.CompletedTask; });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ public class LocalFunction
|
||||
|
||||
dup(true, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ public class NativeInt
|
||||
var test6 = (x + y).GetType(); // System.IntPtr
|
||||
var test7 = (x + v).GetType(); // System.Int64
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ class ParenthesizedPattern
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void M2(object o)
|
||||
{
|
||||
var r = o switch
|
||||
|
||||
@@ -20,4 +20,4 @@ public class RelationalPattern
|
||||
_ => "other"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ public class TargetType
|
||||
}
|
||||
|
||||
public static implicit operator int(TargetType d) => 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ class B2 : A2
|
||||
class B3 : A2
|
||||
{
|
||||
public override void F2<T>(T? t) where T: struct { } // value type
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ public class TypePattern
|
||||
System.Object o => o
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ public class UnaryPattern
|
||||
_ => "other"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,6 @@ public class A
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void CallSinkIfFalse(object o, bool cond)
|
||||
{
|
||||
if (!cond)
|
||||
@@ -138,7 +137,6 @@ public class A
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void LocalCallSensitivity(object o, bool c)
|
||||
{
|
||||
object o1 = o;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
|
||||
|
||||
@@ -502,5 +502,3 @@ static class IEnumerableExtensions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@@ -95,4 +94,3 @@ public class LibraryTypeDataFlow
|
||||
public string AString { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,5 +180,3 @@ public class Ssa
|
||||
Check(ssaSink5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -96,6 +96,5 @@ class ModulusAnalysis
|
||||
System.Console.WriteLine(k); // congruent 0 mod 3
|
||||
}
|
||||
|
||||
|
||||
int[] GetArray() { return new int[42]; }
|
||||
}
|
||||
@@ -487,5 +487,3 @@ class SignAnalysis
|
||||
System.Console.WriteLine(x); // strictly negative
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,5 +35,3 @@ class Tuples
|
||||
|
||||
static void Use<T>(T u) { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public class A
|
||||
{
|
||||
public void M() { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Class
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
@@ -138,7 +138,6 @@ public class ViableCallable
|
||||
d.Event += (EventHandler<string>)(() => { });
|
||||
d.Event -= (EventHandler<string>)(() => { });
|
||||
|
||||
|
||||
// Viable callables: C8.M3(), C9.M3()
|
||||
d = Mock<C8>();
|
||||
d.M3();
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class SBCS
|
||||
{
|
||||
string sbcs = "<22>";
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace Events
|
||||
{
|
||||
public delegate void EventHandler(object sender, object e);
|
||||
|
||||
|
||||
public class Button
|
||||
{
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class C1
|
||||
{
|
||||
public int P1 => 0;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class Autogen
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class C2
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class C3
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class C4
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
namespace Microsoft.Xml.Serialization.GeneratedAssembly
|
||||
{
|
||||
class C1
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
namespace System.CodeDom.Compiler
|
||||
{
|
||||
class GeneratedCodeAttribute : Attribute
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class C1
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,5 +24,3 @@ namespace VisualStudioTests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
using NHibernate;
|
||||
using NHibernate.SqlCommand;
|
||||
|
||||
@@ -59,4 +56,4 @@ namespace NHibernateTest
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,3 @@ struct Dispose1Struct : IDisposable
|
||||
{
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
|
||||
@@ -24,5 +24,3 @@ namespace VisualStudioTests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,5 +68,3 @@ class Queries
|
||||
|
||||
class C : List<int> { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace P1.P2
|
||||
namespace Empty
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
namespace Q1.Q2
|
||||
|
||||
@@ -287,5 +287,3 @@ namespace overrides
|
||||
class A11 : A10, I6 { }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -196,5 +194,3 @@ class C3<T> : C2<C4<T>> { }
|
||||
class C4<T> : C2<C3<T>> { }
|
||||
|
||||
class C5 : C4<C5> { }
|
||||
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
class CheckFileNameEscaping { }
|
||||
class CheckFileNameEscaping { }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class Cfg
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
This contains various errors which would normally result in an extraction failure.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// Error: Missing reference
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class C1
|
||||
{
|
||||
void QualifierAccess()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
class C
|
||||
|
||||
@@ -65,7 +65,6 @@ namespace Statements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MainSwitch(string[] args)
|
||||
{
|
||||
int n = args.Length;
|
||||
@@ -136,7 +135,6 @@ namespace Statements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MainForeach(string[] args)
|
||||
{
|
||||
foreach (string s in args)
|
||||
@@ -280,5 +278,3 @@ namespace Statements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,5 +60,3 @@ class ToStringWithTypes
|
||||
|
||||
public event Delegate<string> Event;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
@@ -87,5 +85,3 @@ class Test
|
||||
return sc == null ? throw new Exception() : sc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -121,5 +121,3 @@ class FormatInvalid
|
||||
|
||||
System.IO.StringWriter sw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user