Skip to content

Commit

Permalink
Fix buffer overflow issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tuesmiddt committed Oct 3, 2018
1 parent 098d7a4 commit 3a34868
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cow</name>
<comment>Project cow created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/TestApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
UserPrefs userPrefs = super.initPrefs(storage);
double x = Screen.getPrimary().getVisualBounds().getMinX();
double y = Screen.getPrimary().getVisualBounds().getMinY();
userPrefs.updateLastUsedGuiSetting(new GuiSettings(1400.0, 800.0, (int) x, (int) y));
userPrefs.updateLastUsedGuiSetting(new GuiSettings(1280.0, 800.0, (int) x, (int) y));
userPrefs.setAddressBookFilePath(saveFileLocation);
return userPrefs;
}
Expand Down
21 changes: 13 additions & 8 deletions src/test/java/seedu/address/ui/testutil/GuiTestAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/
public class GuiTestAssert {
/**
* Asserts that {@code actualCard} displays the same values as {@code expectedCard}.
* Asserts that {@code actualCard} displays the same values as
* {@code expectedCard}.
*/
public static void assertCardEquals(PersonCardHandle expectedCard, PersonCardHandle actualCard) {
assertEquals(expectedCard.getId(), actualCard.getId());
Expand All @@ -27,7 +28,8 @@ public static void assertCardEquals(PersonCardHandle expectedCard, PersonCardHan
}

/**
* Asserts that {@code actualCard} displays the details of {@code expectedPerson}.
* Asserts that {@code actualCard} displays the details of
* {@code expectedPerson}.
*/
public static void assertCardDisplaysPerson(Person expectedPerson, PersonCardHandle actualCard) {
assertEquals(expectedPerson.getName().fullName, actualCard.getName());
Expand All @@ -39,8 +41,8 @@ public static void assertCardDisplaysPerson(Person expectedPerson, PersonCardHan
}

/**
* Asserts that the list in {@code personListPanelHandle} displays the details of {@code persons} correctly and
* in the correct order.
* Asserts that the list in {@code personListPanelHandle} displays the details
* of {@code persons} correctly and in the correct order.
*/
public static void assertListMatching(PersonListPanelHandle personListPanelHandle, Person... persons) {
for (int i = 0; i < persons.length; i++) {
Expand All @@ -50,23 +52,26 @@ public static void assertListMatching(PersonListPanelHandle personListPanelHandl
}

/**
* Asserts that the list in {@code personListPanelHandle} displays the details of {@code persons} correctly and
* in the correct order.
* Asserts that the list in {@code personListPanelHandle} displays the details
* of {@code persons} correctly and in the correct order.
*/
public static void assertListMatching(PersonListPanelHandle personListPanelHandle, List<Person> persons) {
assertListMatching(personListPanelHandle, persons.toArray(new Person[0]));
}

/**
* Asserts the size of the list in {@code personListPanelHandle} equals to {@code size}.
* Asserts the size of the list in {@code personListPanelHandle} equals to
* {@code size}.
*/
public static void assertListSize(PersonListPanelHandle personListPanelHandle, int size) {
int numberOfPeople = personListPanelHandle.getListSize();

assertEquals(size, numberOfPeople);
}

/**
* Asserts the message shown in {@code resultDisplayHandle} equals to {@code expected}.
* Asserts the message shown in {@code resultDisplayHandle} equals to
* {@code expected}.
*/
public static void assertResultMessage(ResultDisplayHandle resultDisplayHandle, String expected) {
assertEquals(expected, resultDisplayHandle.getText());
Expand Down

0 comments on commit 3a34868

Please sign in to comment.