Skip to content

Commit

Permalink
Fix listing
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Mar 28, 2024
1 parent d424a66 commit 51940b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Errata.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Zhou Jing | 3 | 102 | Change Listing 2.18 to " the Working with Strings listing
Zhou Jing | 3 | 102 | Changed 'restrictive' to 'less restrictive' in "In each of these cases, the variable declaration is restrictive because the variable may be assigned."
Zhou Jing | 23 | 1077 | Change "Point Declaration" to "Pointer Declaration" in mindmap
Zhou Jing | 22 | 1074 | Change "Chapter 19" to "Chapter 20" in "we pointed out in Chapter 19"
Zhou Jing | 9 | 541 | Change output 9.4 to "ReadOnly, Hidden = 3"
Zhou Jing | 9 | 541 | Change output 9.4 to "ReadOnly, Hidden = 3"
Jinhang He | 5 | 255 | Edit listing 5.20 to used `image[index]` for the second print statement
9 changes: 3 additions & 6 deletions src/Chapter05.Tests/Listing05.20.ReturningAReference.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ public class ProgramTests
public void Main_InputInigoMontoya_WriteFullName()
{
string expected = @"image\[*\]=Red
image\[*\]=Black";
image\[*\]=Yellow";

IntelliTect.TestTools.Console.ConsoleAssert.ExpectLike(expected,
() =>
{
Program.Main();
});
IntelliTect.TestTools.Console.ConsoleAssert.ExpectLike(expected,
() => Program.Main());
}
}
6 changes: 3 additions & 3 deletions src/Chapter05/Listing05.20.ReturningAReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public static void Main()
#region HIGHLIGHT
// Obtain a reference to the first red pixel
ref byte redPixel = ref FindFirstRedEyePixel(image);
// Update it to be Black
redPixel = (byte)ConsoleColor.Black;
// Update it to be Yellow
redPixel = (byte)ConsoleColor.Yellow;
#endregion HIGHLIGHT
Console.WriteLine(
$"image[{index}]={(ConsoleColor)image[redPixel]}");
$"image[{index}]={(ConsoleColor)image[index]}");
}
#endregion INCLUDE
}

0 comments on commit 51940b3

Please sign in to comment.