summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/libaudiofile/Makefile3
-rw-r--r--audio/libaudiofile/files/patch-gtest_gtest.h11
-rw-r--r--audio/libaudiofile/files/patch-libaudiofile_modules_SimpleModule.h11
-rw-r--r--audio/libaudiofile/files/patch-test_FloatToInt.cpp11
-rw-r--r--audio/libaudiofile/files/patch-test_IntToFloat.cpp11
-rw-r--r--audio/libaudiofile/files/patch-test_NeXT.cpp29
-rw-r--r--audio/libaudiofile/files/patch-test_Sign.cpp20
7 files changed, 96 insertions, 0 deletions
diff --git a/audio/libaudiofile/Makefile b/audio/libaudiofile/Makefile
index db5302bbe380..a7b2087ee54a 100644
--- a/audio/libaudiofile/Makefile
+++ b/audio/libaudiofile/Makefile
@@ -23,6 +23,9 @@ USE_LDCONFIG= yes
GNU_CONFIGURE= yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+do-test:
+ cd ${WRKSRC} && ${MAKE} check
+
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libaudiofile.so.1
diff --git a/audio/libaudiofile/files/patch-gtest_gtest.h b/audio/libaudiofile/files/patch-gtest_gtest.h
new file mode 100644
index 000000000000..d5e97a6b529b
--- /dev/null
+++ b/audio/libaudiofile/files/patch-gtest_gtest.h
@@ -0,0 +1,11 @@
+--- gtest/gtest.h.orig 2013-02-11 17:23:26 UTC
++++ gtest/gtest.h
+@@ -529,7 +529,7 @@
+ // feature depending on tuple with be disabled in this mode).
+ #ifndef GTEST_HAS_TR1_TUPLE
+ // The user didn't tell us not to do it, so we assume it's OK.
+-# define GTEST_HAS_TR1_TUPLE 1
++# define GTEST_HAS_TR1_TUPLE 0
+ #endif // GTEST_HAS_TR1_TUPLE
+
+ // Determines whether Google Test's own tr1 tuple implementation
diff --git a/audio/libaudiofile/files/patch-libaudiofile_modules_SimpleModule.h b/audio/libaudiofile/files/patch-libaudiofile_modules_SimpleModule.h
new file mode 100644
index 000000000000..641e80136ddf
--- /dev/null
+++ b/audio/libaudiofile/files/patch-libaudiofile_modules_SimpleModule.h
@@ -0,0 +1,11 @@
+--- libaudiofile/modules/SimpleModule.h.orig 2013-03-06 05:30:03 UTC
++++ libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+
+ static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+- static const int kMinSignedValue = -1 << kScaleBits;
++ static const int kMinSignedValue = ~0u << kScaleBits;
+
+ struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ {
diff --git a/audio/libaudiofile/files/patch-test_FloatToInt.cpp b/audio/libaudiofile/files/patch-test_FloatToInt.cpp
new file mode 100644
index 000000000000..887337422410
--- /dev/null
+++ b/audio/libaudiofile/files/patch-test_FloatToInt.cpp
@@ -0,0 +1,11 @@
+--- test/FloatToInt.cpp.orig 2013-02-11 17:23:26 UTC
++++ test/FloatToInt.cpp
+@@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = ~0u<<23;
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+
+ TEST_F(FloatToIntTest, Int24)
diff --git a/audio/libaudiofile/files/patch-test_IntToFloat.cpp b/audio/libaudiofile/files/patch-test_IntToFloat.cpp
new file mode 100644
index 000000000000..639526afe275
--- /dev/null
+++ b/audio/libaudiofile/files/patch-test_IntToFloat.cpp
@@ -0,0 +1,11 @@
+--- test/IntToFloat.cpp.orig 2013-02-11 17:23:26 UTC
++++ test/IntToFloat.cpp
+@@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = ~0u<<23;
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+
+ TEST_F(IntToFloatTest, Int24)
diff --git a/audio/libaudiofile/files/patch-test_NeXT.cpp b/audio/libaudiofile/files/patch-test_NeXT.cpp
new file mode 100644
index 000000000000..aaff4de4ceaa
--- /dev/null
+++ b/audio/libaudiofile/files/patch-test_NeXT.cpp
@@ -0,0 +1,29 @@
+--- test/NeXT.cpp.orig 2013-02-11 17:23:26 UTC
++++ test/NeXT.cpp
+@@ -37,7 +37,7 @@
+
+ #include "TestUtilities.h"
+
+-const char kDataUnspecifiedLength[] =
++const unsigned char kDataUnspecifiedLength[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
+@@ -57,7 +57,7 @@ const char kDataUnspecifiedLength[] =
+ 0, 55
+ };
+
+-const char kDataTruncated[] =
++const unsigned char kDataTruncated[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
+@@ -152,7 +152,7 @@ TEST(NeXT, Truncated)
+ ASSERT_EQ(::unlink(testFileName.c_str()), 0);
+ }
+
+-const char kDataZeroChannels[] =
++const unsigned char kDataZeroChannels[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
diff --git a/audio/libaudiofile/files/patch-test_Sign.cpp b/audio/libaudiofile/files/patch-test_Sign.cpp
new file mode 100644
index 000000000000..04c521685a7f
--- /dev/null
+++ b/audio/libaudiofile/files/patch-test_Sign.cpp
@@ -0,0 +1,20 @@
+--- test/Sign.cpp.orig 2013-02-11 17:23:26 UTC
++++ test/Sign.cpp
+@@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = ~0u<<23;
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ static const uint32_t kMaxUInt24 = (1<<24) - 1;
+
+@@ -157,7 +157,7 @@ TEST_F(SignConversionTest, Int32)
+ AFframecount framesRead = afReadFrames(file, AF_DEFAULT_TRACK, readData, frameCount);
+ ASSERT_EQ(framesRead, frameCount);
+ afCloseFile(file);
+- const uint32_t expectedData[] = { 0, -kMinInt32, kMaxUInt32 };
++ const uint32_t expectedData[] = { 0, -static_cast<uint32_t>(kMinInt32), kMaxUInt32 };
+ for (int i=0; i<frameCount; i++)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }