query_param_test: Update Positive cases for Delegate
In {Top,Skip}Positive cases, canDelegate{Top,Skip} is set to false,
which is the same as the default value used in Negative cases. This
patch changes these value to true and update test cases.
Tested:
Build and unit test pass.
Change-Id: Iead9e5ed805344b1c399a7bbf586c16164f15554
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/redfish-core/include/utils/query_param_test.cpp b/redfish-core/include/utils/query_param_test.cpp
index 05abcfd..7520f3e 100644
--- a/redfish-core/include/utils/query_param_test.cpp
+++ b/redfish-core/include/utils/query_param_test.cpp
@@ -85,11 +85,11 @@
.top = 42,
};
QueryCapabilities capabilities{
- .canDelegateTop = false,
+ .canDelegateTop = true,
};
Query delegated = delegate(capabilities, query);
- EXPECT_EQ(delegated.top, std::numeric_limits<size_t>::max());
- EXPECT_EQ(query.top, 42);
+ EXPECT_EQ(delegated.top, 42);
+ EXPECT_EQ(query.top, std::numeric_limits<size_t>::max());
}
TEST(Delegate, SkipNegative)
@@ -108,11 +108,11 @@
.skip = 42,
};
QueryCapabilities capabilities{
- .canDelegateSkip = false,
+ .canDelegateSkip = true,
};
Query delegated = delegate(capabilities, query);
- EXPECT_EQ(delegated.skip, 0);
- EXPECT_EQ(query.skip, 42);
+ EXPECT_EQ(delegated.skip, 42);
+ EXPECT_EQ(query.skip, 0);
}
TEST(FormatQueryForExpand, NoSubQueryWhenQueryIsEmpty)