changeset 637:900274ed996f

test endianness
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Oct 2013 14:28:49 +0000
parents 9ac1e8383877
children 51892be15618 a5f291f05bba
files UnitTestsSources/main.cpp
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/UnitTestsSources/main.cpp	Tue Oct 29 11:15:24 2013 +0100
+++ b/UnitTestsSources/main.cpp	Tue Oct 29 14:28:49 2013 +0000
@@ -522,6 +522,23 @@
 }
 
 
+TEST(Toolbox, Endianness)
+{
+#if defined(__powerpc__) || defined(__powerpc64__)
+  ASSERT_EQ(Endianness_Big, Toolbox::DetectEndianness());
+#endif
+
+#if defined(_WIN32)
+  ASSERT_EQ(Endianness_Little, Toolbox::DetectEndianness());
+#endif
+
+#if defined(__amd64__) || defined(__i386__)
+  ASSERT_EQ(Endianness_Little, Toolbox::DetectEndianness());
+#endif
+}
+
+
+
 int main(int argc, char **argv)
 {
   // Initialize Google's logging library.