File: TestHelpers.h

package info (click to toggle)
android-framework-23 6.0.1%2Br72-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 233,244 kB
  • sloc: java: 1,707,033; xml: 247,323; cpp: 211,819; ansic: 2,748; python: 2,640; sh: 1,517; yacc: 343; javascript: 338; lex: 214; ruby: 183; perl: 88; makefile: 63; sed: 19
file content (35 lines) | stat: -rw-r--r-- 973 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __TEST_HELPERS_H
#define __TEST_HELPERS_H

#include <ostream>

#include <androidfw/ResourceTypes.h>
#include <utils/String8.h>
#include <utils/String16.h>
#include <gtest/gtest.h>

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();
}

namespace android {

enum { MAY_NOT_BE_BAG = false };

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();
}

::testing::AssertionResult IsStringEqual(const ResTable& table, uint32_t resourceId, const char* expectedStr);

} // namespace android

#endif // __TEST_HELPERS_H