mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-16 01:56:09 +00:00
Add Buffer range expectation
This commit is contained in:
parent
4502441604
commit
49fe566d05
@ -303,6 +303,11 @@ namespace detail {
|
|||||||
expected.push_back(singleValue);
|
expected.push_back(singleValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
ExpectEq<T>::ExpectEq(const T* values, const unsigned int count) {
|
||||||
|
expected.assign(values, values + count);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
testing::AssertionResult ExpectEq<T>::Check(const void* data, size_t size) {
|
testing::AssertionResult ExpectEq<T>::Check(const void* data, size_t size) {
|
||||||
ASSERT(size == sizeof(T) * expected.size());
|
ASSERT(size == sizeof(T) * expected.size());
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#define EXPECT_BUFFER_U32_EQ(expected, buffer, offset) \
|
#define EXPECT_BUFFER_U32_EQ(expected, buffer, offset) \
|
||||||
AddBufferExpectation(__FILE__, __LINE__, buffer, offset, sizeof(uint32_t), new detail::ExpectEq<uint32_t>(expected));
|
AddBufferExpectation(__FILE__, __LINE__, buffer, offset, sizeof(uint32_t), new detail::ExpectEq<uint32_t>(expected));
|
||||||
|
|
||||||
|
#define EXPECT_BUFFER_U32_RANGE_EQ(expected, buffer, offset, count) \
|
||||||
|
AddBufferExpectation(__FILE__, __LINE__, buffer, offset, sizeof(uint32_t) * count, new detail::ExpectEq<uint32_t>(expected, count));
|
||||||
|
|
||||||
// Test a pixel of the mip level 0 of a 2D texture.
|
// Test a pixel of the mip level 0 of a 2D texture.
|
||||||
#define EXPECT_PIXEL_RGBA8_EQ(expected, texture, x, y) \
|
#define EXPECT_PIXEL_RGBA8_EQ(expected, texture, x, y) \
|
||||||
AddTextureExpectation(__FILE__, __LINE__, texture, x, y, 1, 1, sizeof(RGBA8), new detail::ExpectEq<RGBA8>(expected));
|
AddTextureExpectation(__FILE__, __LINE__, texture, x, y, 1, 1, sizeof(RGBA8), new detail::ExpectEq<RGBA8>(expected));
|
||||||
@ -133,6 +136,7 @@ namespace detail {
|
|||||||
class ExpectEq : public Expectation {
|
class ExpectEq : public Expectation {
|
||||||
public:
|
public:
|
||||||
ExpectEq(T singleValue);
|
ExpectEq(T singleValue);
|
||||||
|
ExpectEq(const T* values, const unsigned int count);
|
||||||
|
|
||||||
testing::AssertionResult Check(const void* data, size_t size) override;
|
testing::AssertionResult Check(const void* data, size_t size) override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user