test_platform.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2019 The Chromium project authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file is Chromium specific, to make the tests work. It will work
  5. // in the standalone (upstream) build, as well as in Chromium. In other code
  6. // bases (e.g. v8), a custom file with these two functions and with appropriate
  7. // includes may need to be provided, so it isn't necessarily part of a roll.
  8. //
  9. // Put another way: The tests, e.g. json_test.cc include *only* test_platform.h,
  10. // which provides CHECK and gunit functionality, and UTF8<->UTF16 conversion
  11. // functions.
  12. #ifndef CRDTP_TEST_PLATFORM_H_
  13. #define CRDTP_TEST_PLATFORM_H_
  14. #include <cstdint>
  15. #include <string>
  16. #include <vector>
  17. #include "base/check_op.h" // Provides CHECK and CHECK_EQ, etc.
  18. #include "span.h"
  19. #include "testing/gmock/include/gmock/gmock.h" // Provides Gunit
  20. #include "testing/gtest/include/gtest/gtest.h" // Provides Gmock
  21. // Provides UTF8<->UTF16 conversion routines (implemented in .cc file).
  22. namespace crdtp {
  23. std::string UTF16ToUTF8(span<uint16_t> in);
  24. std::vector<uint16_t> UTF8ToUTF16(span<uint8_t> in);
  25. } // namespace crdtp
  26. #endif // CRDTP_TEST_PLATFORM_H_