| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 std::string GetUnusedLoopDevice(); | 38 std::string GetUnusedLoopDevice(); |
| 39 | 39 |
| 40 // Returns true iff a == b | 40 // Returns true iff a == b |
| 41 bool ExpectVectorsEq(const std::vector<char>& a, const std::vector<char>& b); | 41 bool ExpectVectorsEq(const std::vector<char>& a, const std::vector<char>& b); |
| 42 | 42 |
| 43 inline int System(const std::string& cmd) { | 43 inline int System(const std::string& cmd) { |
| 44 return system(cmd.c_str()); | 44 return system(cmd.c_str()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void FillWithData(std::vector<char>* buffer); |
| 48 |
| 47 namespace { | 49 namespace { |
| 48 // 300 byte pseudo-random string. Not null terminated. | 50 // 300 byte pseudo-random string. Not null terminated. |
| 49 // This does not gzip compress well. | 51 // This does not gzip compress well. |
| 50 const unsigned char kRandomString[] = { | 52 const unsigned char kRandomString[] = { |
| 51 0xf2, 0xb7, 0x55, 0x92, 0xea, 0xa6, 0xc9, 0x57, | 53 0xf2, 0xb7, 0x55, 0x92, 0xea, 0xa6, 0xc9, 0x57, |
| 52 0xe0, 0xf8, 0xeb, 0x34, 0x93, 0xd9, 0xc4, 0x8f, | 54 0xe0, 0xf8, 0xeb, 0x34, 0x93, 0xd9, 0xc4, 0x8f, |
| 53 0xcb, 0x20, 0xfa, 0x37, 0x4b, 0x40, 0xcf, 0xdc, | 55 0xcb, 0x20, 0xfa, 0x37, 0x4b, 0x40, 0xcf, 0xdc, |
| 54 0xa5, 0x08, 0x70, 0x89, 0x79, 0x35, 0xe2, 0x3d, | 56 0xa5, 0x08, 0x70, 0x89, 0x79, 0x35, 0xe2, 0x3d, |
| 55 0x56, 0xa4, 0x75, 0x73, 0xa3, 0x6d, 0xd1, 0xd5, | 57 0x56, 0xa4, 0x75, 0x73, 0xa3, 0x6d, 0xd1, 0xd5, |
| 56 0x26, 0xbb, 0x9c, 0x60, 0xbd, 0x2f, 0x5a, 0xfa, | 58 0x26, 0xbb, 0x9c, 0x60, 0xbd, 0x2f, 0x5a, 0xfa, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 static std::string StaticType() { return "ObjectCollectorAction"; } | 171 static std::string StaticType() { return "ObjectCollectorAction"; } |
| 170 std::string Type() const { return StaticType(); } | 172 std::string Type() const { return StaticType(); } |
| 171 const T& object() const { return object_; } | 173 const T& object() const { return object_; } |
| 172 private: | 174 private: |
| 173 T object_; | 175 T object_; |
| 174 }; | 176 }; |
| 175 | 177 |
| 176 } // namespace chromeos_update_engine | 178 } // namespace chromeos_update_engine |
| 177 | 179 |
| 178 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ | 180 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__ |
| OLD | NEW |