Add ReverseByteOrder(buffer)

This commit is contained in:
2025-06-09 15:35:03 -05:00
parent 70d721aef3
commit a29e8cb6bd
2 changed files with 35 additions and 0 deletions

View File

@@ -64,6 +64,21 @@ void TestReverseByteOrderIfLittleEndian(const std::string& type_name, T original
std::cout << std::endl;
}
void TestBuffer()
{
int data[500];
for (int i = 0; i < 500; i++)
{
data[i] = i*5;
}
Endianness::ReverseByteOrder(data, 500);
Endianness::ReverseByteOrder(data, 500);
}
int main()
{
for (int i = 0; i < 256; i++)
@@ -75,6 +90,8 @@ int main()
TestRoundTrip<float>("float", i / 3.14159f);
}
TestBuffer();
return 0;
}