TestHelpers.h revision b7e1ce07756aaca829828c2053eca0d66dd4d440
1#ifndef __TEST_HELPERS_H
2#define __TEST_HELPERS_H
3
4#include <ostream>
5
6#include <androidfw/ResourceTypes.h>
7#include <utils/String8.h>
8#include <utils/String16.h>
9#include <gtest/gtest.h>
10
11static inline ::std::ostream& operator<<(::std::ostream& out, const android::String8& str) {
12    return out << str.string();
13}
14
15static inline ::std::ostream& operator<<(::std::ostream& out, const android::String16& str) {
16    return out << android::String8(str).string();
17}
18
19namespace android {
20
21enum { MAY_NOT_BE_BAG = false };
22
23static inline bool operator==(const android::ResTable_config& a, const android::ResTable_config& b) {
24    return a.compare(b) == 0;
25}
26
27static inline ::std::ostream& operator<<(::std::ostream& out, const android::ResTable_config& c) {
28    return out << c.toString().string();
29}
30
31::testing::AssertionResult IsStringEqual(const ResTable& table, uint32_t resourceId, const char* expectedStr);
32
33} // namespace android
34
35#endif // __TEST_HELPERS_H
36