util: Remove usage of designated initializers in timespec_test.cpp

As the default option for msvc 2019 does support designated initializers
```
../src/util/tests/timespec_test.cpp(302): error C7555: use of designated initializers requires at least '/std:c++20'
../src/util/tests/timespec_test.cpp(303): error C7555: use of designated initializers requires at least '/std:c++20'
../src/util/tests/timespec_test.cpp(312): error C7555: use of designated initializers requires at least '/std:c++20'
../src/util/tests/timespec_test.cpp(313): error C7555: use of designated initializers requires at least '/std:c++20'
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
This commit is contained in:
Yonggang Luo 2022-04-09 21:32:18 +08:00 committed by Marge Bot
parent 672a93cd6d
commit 5abf590c71
1 changed files with 4 additions and 4 deletions

View File

@ -298,8 +298,8 @@ TEST(timespec_test, timespec_from_proto)
TEST(timespec_test, timespec_is_zero)
{
struct timespec zero = { 0 };
struct timespec non_zero_sec = { .tv_sec = 1, .tv_nsec = 0 };
struct timespec non_zero_nsec = { .tv_sec = 0, .tv_nsec = 1 };
struct timespec non_zero_sec = { 1, 0 };
struct timespec non_zero_nsec = { 0, 1 };
EXPECT_TRUE(timespec_is_zero(&zero));
EXPECT_FALSE(timespec_is_zero(&non_zero_nsec));
@ -308,8 +308,8 @@ TEST(timespec_test, timespec_is_zero)
TEST(timespec_test, timespec_eq)
{
struct timespec a = { .tv_sec = 2, .tv_nsec = 1 };
struct timespec b = { .tv_sec = -1, .tv_nsec = 2 };
struct timespec a = { 2, 1 };
struct timespec b = { -1, 2 };
EXPECT_TRUE(timespec_eq(&a, &a));
EXPECT_TRUE(timespec_eq(&b, &b));