// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_ZUCCHINI_TEST_UTILS_H_ #define COMPONENTS_ZUCCHINI_TEST_UTILS_H_ #include #include #include namespace zucchini { // Parses space-separated list of byte hex values into list. std::vector ParseHexString(const std::string& hex_string); // Returns a vector that's the contatenation of two vectors of the same type. // Elements are copied by value. template std::vector Cat(const std::vector& a, const std::vector& b) { std::vector ret(a); ret.insert(ret.end(), b.begin(), b.end()); return ret; } // Returns a subvector of a vector. Elements are copied by value. template std::vector Sub(const std::vector& a, size_t lo, size_t hi) { return std::vector(a.begin() + lo, a.begin() + hi); } } // namespace zucchini #endif // COMPONENTS_ZUCCHINI_TEST_UTILS_H_