michael@0: /* michael@0: * Copyright 2012 The LibYuv Project Authors. All rights reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "libyuv/basic_types.h" michael@0: #include "libyuv/version.h" michael@0: #include "../unit_test/unit_test.h" michael@0: michael@0: namespace libyuv { michael@0: michael@0: // Tests SVN version against include/libyuv/version.h michael@0: // SVN version is bumped by documentation changes as well as code. michael@0: // Although the versions should match, once checked in, a tolerance is allowed. michael@0: TEST_F(libyuvTest, TestVersion) { michael@0: EXPECT_GE(LIBYUV_VERSION, 169); // 169 is first version to support version. michael@0: printf("LIBYUV_VERSION %d\n", LIBYUV_VERSION); michael@0: #ifdef LIBYUV_SVNREVISION michael@0: const char *ver = strchr(LIBYUV_SVNREVISION, ':'); michael@0: if (ver) { michael@0: ++ver; michael@0: } else { michael@0: ver = LIBYUV_SVNREVISION; michael@0: } michael@0: int svn_revision = atoi(ver); // NOLINT michael@0: printf("LIBYUV_SVNREVISION %d\n", svn_revision); michael@0: EXPECT_NEAR(LIBYUV_VERSION, svn_revision, 20); // Allow version to be close. michael@0: if (LIBYUV_VERSION != svn_revision) { michael@0: printf("WARNING - Versions do not match.\n"); michael@0: } michael@0: #endif michael@0: } michael@0: michael@0: } // namespace libyuv