openh264/test/api/simple_test.cpp

28 lines
668 B
C++
Raw Normal View History

2013-12-12 03:56:52 +01:00
#include <gtest/gtest.h>
#include <stdlib.h>
#include <time.h>
2014-05-20 08:19:23 +02:00
#include <stdio.h>
#include <string.h>
2013-12-12 03:56:52 +01:00
2014-05-20 08:19:23 +02:00
2014-06-05 10:20:50 +02:00
#if (defined(ANDROID_NDK)||defined(APPLE_IOS))
2014-06-26 03:50:41 +02:00
int CodecUtMain (int argc , char** argv) {
2014-05-20 08:19:23 +02:00
#else
int main (int argc, char** argv) {
2014-05-20 08:19:23 +02:00
#endif
2014-06-26 04:57:39 +02:00
#if (defined(ANDROID_NDK)||defined(APPLE_IOS))
2014-06-26 03:50:41 +02:00
char xmlPath[1024] = "";
sprintf (xmlPath, "xml:%s", argv[1]);
::testing::GTEST_FLAG (output) = xmlPath;
2014-05-20 08:19:23 +02:00
#endif
::testing::InitGoogleTest (&argc, argv);
unsigned int seed = (unsigned int) time (NULL);
if (argc >= 2 && !strncmp (argv[1], "--seed=", 7))
seed = atoi (argv[1] + 7);
printf ("Random seed: %u\n", seed);
srand (seed);
2013-12-12 03:56:52 +01:00
return RUN_ALL_TESTS();
}