Skip to content

Java.Util.Date#247

Merged
tiny-express merged 128 commits intodevelopmentfrom
java.util.Date
Oct 19, 2017
Merged

Java.Util.Date#247
tiny-express merged 128 commits intodevelopmentfrom
java.util.Date

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 30, 2017

Remove old source.
Build + add test for java.util.Date

Copy link
Copy Markdown
Contributor

@thuydunq thuydunq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test for getYear setYear with year 4000.
Please re-check Date class from Java to verify.
Please shorten test for get/set test case.

/**
* Convert the time seconds to String
*
* @param pattern
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment for tm *timeManagement

static int getSequenceNumber(const String &inputString, int &indexStart);

/**
* Get Current Sequence Char From InputString From InputString
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate "From InputString"

*
* @param inputString
* @param indexStart
* @return string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String

/**
* Get time offset in second from local time zone to UTC
*
* @return time offset in second
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return long time offset in second


/**
* Returns a hash code value for this object.
* @return
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return long


inputString = Date::removeBracket(inputString);

int limit = inputString.length();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename variable

continue;
}
if (currentChar >= '0' && currentChar <='9') {
int curentNumber = Date::getSequenceNumber(inputString, index);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentNumber


// year < 1900
date.setYear(1889);
assertEquals(3789, date.getYear());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong test


// year < 0
date.setYear(-1);
assertEquals(1899, date.getYear());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong test


// year = 0
date.setYear(0);
assertEquals(1900, date.getYear());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong test

@tiny-express tiny-express merged commit 4009e24 into development Oct 19, 2017
@tiny-express tiny-express deleted the java.util.Date branch November 25, 2017 10:15
@tiny-express tiny-express restored the java.util.Date branch November 25, 2017 10:16
@tiny-express tiny-express deleted the java.util.Date branch November 25, 2017 10:16
@loint loint restored the java.util.Date branch April 15, 2018 07:17
@tiny-express tiny-express deleted the java.util.Date branch May 3, 2018 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

6 participants