diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index aeb2ffd6c..27cddb9da 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -87,6 +87,13 @@ jobs: # Make coverage report to avoid running the test exe because CI step will run it CODE_COVERAGE_COLLECT_ONLY: 1 BuildArgs: '-j 10' + Linux_x64_with_unit_test_release: + Pool: $(LinuxPool) + OSVmImage: + VcpkgInstall: 'curl[ssl] libxml2 openssl' + VCPKG_DEFAULT_TRIPLET: 'x64-linux' + CmakeArgs: ' -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON' + BuildArgs: '-j 10' Win_x86_with_unit_test: Pool: $(WindowsPool) OSVmImage: diff --git a/sdk/core/azure-core/src/datetime.cpp b/sdk/core/azure-core/src/datetime.cpp index 1af463a27..dc757d5c3 100644 --- a/sdk/core/azure-core/src/datetime.cpp +++ b/sdk/core/azure-core/src/datetime.cpp @@ -424,9 +424,13 @@ DateTime::operator std::chrono::system_clock::time_point() const DateTime DateTime::Parse(std::string const& dateTime, DateFormat format) { - int16_t year; - int8_t month; - int8_t day; + // The values that are not supposed to be read before they are written are set to -123... to avoid + // warnings on some compilers, yet provide a clearly bad value to make it obvious if things don't + // work as expected. + int16_t year = -12345; + int8_t month = -123; + int8_t day = -123; + int8_t hour = 0; int8_t minute = 0; int8_t second = 0; @@ -739,13 +743,17 @@ std::string DateTime::GetString(DateFormat format, TimeFractionFormat fractionFo } int16_t year = 1; - int8_t month; - int8_t day; - int8_t hour; - int8_t minute; - int8_t second; - int32_t fracSec; - int8_t dayOfWeek; + + // The values that are not supposed to be read before they are written are set to -123... to avoid + // warnings on some compilers, yet provide a clearly bad value to make it obvious if things don't + // work as expected. + int8_t month = -123; + int8_t day = -123; + int8_t hour = -123; + int8_t minute = -123; + int8_t second = -123; + int32_t fracSec = -1234567890; + int8_t dayOfWeek = -123; { auto remainder = time_since_epoch().count();