1f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#ifndef __TEST_HELPERS_H 2f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#define __TEST_HELPERS_H 3f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski 4f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#include <ostream> 5f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski 631245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski#include <androidfw/ResourceTypes.h> 7f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#include <utils/String8.h> 8f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#include <utils/String16.h> 960293197379e522c870c4a28462804207bab505dAdam Lesinski#include <gtest/gtest.h> 10f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski 11f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinskistatic inline ::std::ostream& operator<<(::std::ostream& out, const android::String8& str) { 12f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski return out << str.string(); 13f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski} 14f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski 15f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinskistatic inline ::std::ostream& operator<<(::std::ostream& out, const android::String16& str) { 16f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski return out << android::String8(str).string(); 17f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski} 18f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski 1931245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinskinamespace android { 2031245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski 2160293197379e522c870c4a28462804207bab505dAdam Lesinskienum { MAY_NOT_BE_BAG = false }; 2260293197379e522c870c4a28462804207bab505dAdam Lesinski 2331245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinskistatic inline bool operator==(const android::ResTable_config& a, const android::ResTable_config& b) { 2431245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski return memcmp(&a, &b, sizeof(a)) == 0; 2531245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski} 2631245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski 2731245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinskistatic inline ::std::ostream& operator<<(::std::ostream& out, const android::ResTable_config& c) { 2831245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski return out << c.toString().string(); 2931245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski} 3031245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski 3160293197379e522c870c4a28462804207bab505dAdam Lesinski::testing::AssertionResult IsStringEqual(const ResTable& table, uint32_t resourceId, const char* expectedStr); 3260293197379e522c870c4a28462804207bab505dAdam Lesinski 3331245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski} // namespace android 3431245b4f06003f1c8cd44c31b387c96ab4e282f9Adam Lesinski 35f90f2f8dc36e7243b85e0b6a7fd5a590893c827eAdam Lesinski#endif // __TEST_HELPERS_H 36