2014-06-06 14:27:00 -07:00
|
|
|
#ifndef __TEST_HELPERS_H
|
|
|
|
#define __TEST_HELPERS_H
|
|
|
|
|
|
|
|
#include <ostream>
|
|
|
|
|
2014-08-22 19:10:56 -07:00
|
|
|
#include <androidfw/ResourceTypes.h>
|
2014-06-06 14:27:00 -07:00
|
|
|
#include <utils/String8.h>
|
|
|
|
#include <utils/String16.h>
|
2014-10-21 18:36:42 -07:00
|
|
|
#include <gtest/gtest.h>
|
2014-06-06 14:27:00 -07:00
|
|
|
|
|
|
|
static inline ::std::ostream& operator<<(::std::ostream& out, const android::String8& str) {
|
|
|
|
return out << str.string();
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ::std::ostream& operator<<(::std::ostream& out, const android::String16& str) {
|
|
|
|
return out << android::String8(str).string();
|
|
|
|
}
|
|
|
|
|
2014-08-22 19:10:56 -07:00
|
|
|
namespace android {
|
|
|
|
|
2014-10-21 18:36:42 -07:00
|
|
|
enum { MAY_NOT_BE_BAG = false };
|
|
|
|
|
2014-08-22 19:10:56 -07:00
|
|
|
static inline bool operator==(const android::ResTable_config& a, const android::ResTable_config& b) {
|
|
|
|
return memcmp(&a, &b, sizeof(a)) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ::std::ostream& operator<<(::std::ostream& out, const android::ResTable_config& c) {
|
|
|
|
return out << c.toString().string();
|
|
|
|
}
|
|
|
|
|
2014-10-21 18:36:42 -07:00
|
|
|
::testing::AssertionResult IsStringEqual(const ResTable& table, uint32_t resourceId, const char* expectedStr);
|
|
|
|
|
2014-08-22 19:10:56 -07:00
|
|
|
} // namespace android
|
|
|
|
|
2014-06-06 14:27:00 -07:00
|
|
|
#endif // __TEST_HELPERS_H
|