From 5e189025ca3d1f7bc629b3ff41d104f1e9d920c2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 6 May 2024 13:38:21 -0400 Subject: [PATCH] Fix build failure with clang A slight issue with feb1d10f60a2b9ae9cce48817b6a209a7ab007c8. --- src/libfetchers/fetchers.hh | 2 ++ tests/unit/libfetchers/public-key.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh index 42b184393..551be9a1f 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/fetchers.hh @@ -230,6 +230,8 @@ struct PublicKey { std::string type = "ssh-ed25519"; std::string key; + + auto operator <=>(const PublicKey &) const = default; }; std::string publicKeys_to_string(const std::vector&); diff --git a/tests/unit/libfetchers/public-key.cc b/tests/unit/libfetchers/public-key.cc index 7b763bb05..8a639da9f 100644 --- a/tests/unit/libfetchers/public-key.cc +++ b/tests/unit/libfetchers/public-key.cc @@ -22,7 +22,7 @@ public: TEST_F(FIXTURE, PublicKey_ ## NAME ## _from_json) { \ readTest(#NAME ".json", [&](const auto & encoded_) { \ fetchers::PublicKey expected { VAL }; \ - auto got = nlohmann::json::parse(encoded_); \ + fetchers::PublicKey got = nlohmann::json::parse(encoded_); \ ASSERT_EQ(got, expected); \ }); \ } \ @@ -47,7 +47,7 @@ TEST_F(PublicKeyTest, PublicKey_noRoundTrip_from_json) { readTest("noRoundTrip.json", [&](const auto & encoded_) { fetchers::PublicKey expected = { .type = "ssh-ed25519", .key = "ABCDE" }; fetchers::PublicKey got = nlohmann::json::parse(encoded_); - ASSERT_EQ(got, nlohmann::json(expected)); + ASSERT_EQ(got, expected); }); }