1 #include <gtest/gtest.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #include <stdio.h> 5 #include <string.h> 6 7 8 #if (defined(ANDROID_NDK)||defined(APPLE_IOS)||defined(WINDOWS_PHONE)) CodecUtMain(int argc,char ** argv)9int CodecUtMain (int argc , char** argv) { 10 #else 11 int main (int argc, char** argv) { 12 #endif 13 14 #if (defined(ANDROID_NDK)||defined(APPLE_IOS)||defined(WINDOWS_PHONE)) 15 char xmlPath[1024] = ""; 16 sprintf (xmlPath, "xml:%s", argv[1]); 17 ::testing::GTEST_FLAG (output) = xmlPath; 18 #endif 19 ::testing::InitGoogleTest (&argc, argv); 20 unsigned int seed = (unsigned int) time (NULL); 21 if (argc >= 2 && !strncmp (argv[1], "--seed=", 7)) 22 seed = atoi (argv[1] + 7); 23 printf ("Random seed: %u\n", seed); 24 srand (seed); 25 26 return RUN_ALL_TESTS(); 27 } 28