Skip to content

Commit 591d826

Browse files
committed
🐛 Fix test for supported sites
1 parent e42a734 commit 591d826

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/na/device/test_device.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <stdexcept>
2424
#include <string>
2525
#include <unordered_set>
26+
#include <utility>
2627
#include <vector>
2728

2829
namespace testing {
@@ -770,7 +771,13 @@ TEST_F(NADeviceTest, QueryOperationData) {
770771
ASSERT_THAT(result, testing::AnyOf(QDMI_SUCCESS,
771772
QDMI_ERROR_NOTSUPPORTED));
772773
if (result == QDMI_SUCCESS) {
773-
supportedSites.emplace(sitePair);
774+
// Ensure the pair is always in the same order when inserted
775+
// into the set, so that we can compare the sets later.
776+
if (sitePair.first < sitePair.second) {
777+
supportedSites.emplace(sitePair);
778+
} else {
779+
supportedSites.emplace(sitePair.second, sitePair.first);
780+
}
774781
std::string name(nameSize - 1, '\0');
775782
EXPECT_EQ(MQT_NA_QDMI_device_session_query_operation_property(
776783
session, operation, 0, nullptr, 0, nullptr,
@@ -912,7 +919,8 @@ TEST_F(NADeviceTest, QueryOperationData) {
912919
EXPECT_EQ(MQT_NA_QDMI_device_session_query_operation_property(
913920
session, operation, 0, nullptr, 0, nullptr,
914921
QDMI_OPERATION_PROPERTY_SITES, sitesSize,
915-
queriedSupportedSitesVec.data(), nullptr),
922+
static_cast<void*>(queriedSupportedSitesVec.data()),
923+
nullptr),
916924
QDMI_SUCCESS);
917925
const std::unordered_set queriedSupportedSitesSet(
918926
queriedSupportedSitesVec.cbegin(), queriedSupportedSitesVec.cend());

0 commit comments

Comments
 (0)