Commit df0df4ab by Anton Danielsson

Fixed tests so they build on android.

- Added missing header to test/benchmark_test.cc - Changed std::stoul to std::atol in test/filter_test.cc because of a limitation in the android-ndk (http://stackoverflow.com/questions/17950814/how-to-use-stdstoul-and-stdstoull-in-android)
parent 0d35f5f6
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdlib>
#if defined(__GNUC__) #if defined(__GNUC__)
# define BENCHMARK_NOINLINE __attribute__((noinline)) # define BENCHMARK_NOINLINE __attribute__((noinline))
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <cstdlib>
#include <iostream> #include <iostream>
#include <limits> #include <limits>
...@@ -75,7 +76,7 @@ int main(int argc, char* argv[]) { ...@@ -75,7 +76,7 @@ int main(int argc, char* argv[]) {
// Make sure we ran all of the tests // Make sure we ran all of the tests
const size_t count = test_reporter.GetCount(); const size_t count = test_reporter.GetCount();
const size_t expected = (argc == 2) ? std::stoul(argv[1]) : count; const size_t expected = (argc == 2) ? std::atol(argv[1]) : count;
if (count != expected) { if (count != expected) {
std::cerr << "ERROR: Expected " << expected << " tests to be ran but only " std::cerr << "ERROR: Expected " << expected << " tests to be ran but only "
<< count << " completed" << std::endl; << count << " completed" << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment