diff --git a/test/unitTest/media/test_media_decoder.cpp b/test/unitTest/media/test_media_decoder.cpp
index 4b51aa48341f84cd1cfa4923b417aba9d883e6c4..e44755bd415929736df9ec3627e81b9b4a1e149b 100644
--- a/test/unitTest/media/test_media_decoder.cpp
+++ b/test/unitTest/media/test_media_decoder.cpp
@@ -113,21 +113,9 @@ MediaDecoderTest::testAudioFile()
 template<typename Word>
 static std::ostream& write(std::ostream& os, Word value, unsigned size)
 {
-    union {
-        uint32_t i;
-        char c[4];
-    } big = {0x01020304};
-
-    // big endian if 0x01 is the first byte
-    if (big.c[0] == 1) {
-        while (size)
-            os.put(static_cast<char>((value >> (8 * --size)) & 0xFF));
-        return os;
-    } else {
-        for (; size; --size, value >>= 8)
-            os.put(static_cast<char>(value & 0xFF));
-        return os;
-    }
+    for (; size; --size, value >>= 8)
+        os.put(static_cast<char>(value & 0xFF));
+    return os;
 }
 
 void