OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <stdlib.h> | 11 #include <stdlib.h> |
12 #include <string.h> | 12 #include <string.h> |
13 | 13 |
14 #include "libyuv/basic_types.h" | 14 #include "libyuv/basic_types.h" |
15 #include "libyuv/version.h" | 15 #include "libyuv/version.h" |
16 #include "../unit_test/unit_test.h" | 16 #include "../unit_test/unit_test.h" |
17 | 17 |
18 namespace libyuv { | 18 namespace libyuv { |
19 | 19 |
20 // Tests SVN version against include/libyuv/version.h | 20 // Tests SVN version against include/libyuv/version.h |
21 // SVN version is bumped by documentation changes as well as code. | 21 // SVN version is bumped by documentation changes as well as code. |
22 // Although the versions should match, once checked in, a tolerance is allowed. | 22 // Although the versions should match, once checked in, a tolerance is allowed. |
23 TEST_F(libyuvTest, DISABLED_TestVersion) { | 23 TEST_F(LibYUVBaseTest, DISABLED_TestVersion) { |
24 EXPECT_GE(LIBYUV_VERSION, 169); // 169 is first version to support version. | 24 EXPECT_GE(LIBYUV_VERSION, 169); // 169 is first version to support version. |
25 printf("LIBYUV_VERSION %d\n", LIBYUV_VERSION); | 25 printf("LIBYUV_VERSION %d\n", LIBYUV_VERSION); |
26 #ifdef LIBYUV_SVNREVISION | 26 #ifdef LIBYUV_SVNREVISION |
27 const char *ver = strchr(LIBYUV_SVNREVISION, ':'); | 27 const char *ver = strchr(LIBYUV_SVNREVISION, ':'); |
28 if (ver) { | 28 if (ver) { |
29 ++ver; | 29 ++ver; |
30 } else { | 30 } else { |
31 ver = LIBYUV_SVNREVISION; | 31 ver = LIBYUV_SVNREVISION; |
32 } | 32 } |
33 int svn_revision = atoi(ver); // NOLINT | 33 int svn_revision = atoi(ver); // NOLINT |
34 printf("LIBYUV_SVNREVISION %d\n", svn_revision); | 34 printf("LIBYUV_SVNREVISION %d\n", svn_revision); |
35 EXPECT_NEAR(LIBYUV_VERSION, svn_revision, 20); // Allow version to be close. | 35 EXPECT_NEAR(LIBYUV_VERSION, svn_revision, 20); // Allow version to be close. |
36 if (LIBYUV_VERSION != svn_revision) { | 36 if (LIBYUV_VERSION != svn_revision) { |
37 printf("WARNING - Versions do not match.\n"); | 37 printf("WARNING - Versions do not match.\n"); |
38 } | 38 } |
39 #else | 39 #else |
40 printf("WARNING - SVN Version unavailable. Test not run.\n"); | 40 printf("WARNING - SVN Version unavailable. Test not run.\n"); |
41 #endif | 41 #endif |
42 } | 42 } |
43 | 43 |
44 } // namespace libyuv | 44 } // namespace libyuv |
OLD | NEW |