Skip to content

Commit

Permalink
remove annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmy77 committed Jan 26, 2025
1 parent 6b707f2 commit e0deb50
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/modules/Hosts/Hosts.FuzzTests/FuzzTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@ public static void FuzzValidIPv4(ReadOnlySpan<byte> input)
{
string address = System.Text.Encoding.UTF8.GetString(input);
bool isValid = ValidationHelper.ValidIPv4(address);

// Console.WriteLine($"Input:{address}, ValidIPv4:{isValid}");
}
catch (Exception ex) when (ex is OutOfMemoryException)
{
// This is an example. It's important to filter out any *expected* exceptions from our code here.
// However, catching all exceptions is considered an anti-pattern because it may suppress legitimate
// issues, such as a NullReferenceException thrown by our code. In this case, we still re-throw
// the exception, as the ToJsonFromXmlOrCsvAsync method is not expected to throw any exceptions.
throw;
}
}
Expand All @@ -35,15 +29,9 @@ public static void FuzzValidIPv6(ReadOnlySpan<byte> input)
{
string address = System.Text.Encoding.UTF8.GetString(input);
bool isValid = ValidationHelper.ValidIPv6(address);

// Console.WriteLine($"Input:{address}, ValidIPv6:{isValid}");
}
catch (Exception ex) when (ex is OutOfMemoryException)
{
// This is an example. It's important to filter out any *expected* exceptions from our code here.
// However, catching all exceptions is considered an anti-pattern because it may suppress legitimate
// issues, such as a NullReferenceException thrown by our code. In this case, we still re-throw
// the exception, as the ToJsonFromXmlOrCsvAsync method is not expected to throw any exceptions.
throw;
}
}
Expand All @@ -55,8 +43,6 @@ public static void FuzzValidHosts(ReadOnlySpan<byte> input)
{
string hosts = System.Text.Encoding.UTF8.GetString(input);
bool isValid = ValidationHelper.ValidHosts(hosts, true);

// Console.WriteLine($"Input:{hosts}, ValidHosts:{isValid}");
}
catch (Exception ex) when (ex is OutOfMemoryException)
{
Expand Down

0 comments on commit e0deb50

Please sign in to comment.