Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and tennessee-google committed Dec 14, 2023
1 parent c3bbb99 commit 5ece86a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/lib/support/TimeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ bool CalendarDateToDaysSinceUnixEpoch(uint16_t year, uint8_t month, uint8_t dayO
bool DaysSinceUnixEpochToCalendarDate(uint32_t daysSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth);
bool AdjustCalendarDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, int32_t relativeDays);
bool CalendarTimeToSecondsSinceUnixEpoch(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute,
uint8_t second, uint32_t & secondsSinceEpoch);
uint8_t second, uint32_t & secondsSinceEpoch);
void SecondsSinceUnixEpochToCalendarTime(uint32_t secondsSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth,
uint8_t & hour, uint8_t & minute, uint8_t & second);
uint8_t & hour, uint8_t & minute, uint8_t & second);

/**
* @brief Convert a calendar date and time to the number of seconds since CHIP Epoch (2000-01-01 00:00:00 UTC).
Expand All @@ -146,7 +146,7 @@ void SecondsSinceUnixEpochToCalendarTime(uint32_t secondsSinceEpoch, uint16_t &
* representable range.
*/
bool CalendarToChipEpochTime(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second,
uint32_t & chipEpochTime);
uint32_t & chipEpochTime);

/**
* @brief Convert the number of seconds since CHIP Epoch (2000-01-01 00:00:00 UTC) to a calendar date and time.
Expand All @@ -163,7 +163,7 @@ bool CalendarToChipEpochTime(uint16_t year, uint8_t month, uint8_t dayOfMonth, u
* @param second Second (0-59).
*/
void ChipEpochToCalendarTime(uint32_t chipEpochTime, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, uint8_t & hour,
uint8_t & minute, uint8_t & second);
uint8_t & minute, uint8_t & second);

/**
* @brief Convert the number of seconds since Unix Epoch (1970-01-01 00:00:00 GMT TAI) to
Expand Down
26 changes: 13 additions & 13 deletions src/lib/support/tests/TestTimeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@

#include <nlunit-test.h>

#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/TimeUtils.h>
#include <lib/support/UnitTestRegistration.h>
#include <lib/support/logging/CHIPLogging.h>

using namespace chip;

#define TestAssert(cond, message) \
do \
{ \
if (!(cond)) \
{ \
ChipLogError(NotSpecified, "%s", (message)); \
} \
NL_TEST_ASSERT(inSuite, (cond)); \
\
if (!(cond)) return; \
} while (0)

#define TestAssert(cond, message) \
do \
{ \
if (!(cond)) \
{ \
ChipLogError(NotSpecified, "%s", (message)); \
} \
NL_TEST_ASSERT(inSuite, (cond)); \
\
if (!(cond)) \
return; \
} while (0)

struct OrdinalDateTestValue
{
Expand Down

0 comments on commit 5ece86a

Please sign in to comment.