Jed Estep | b8a693b | 2016-03-09 17:51:34 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agree to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Tao Bao | 4102b28 | 2016-11-02 16:17:17 -0700 | [diff] [blame] | 16 | |
Jed Estep | b8a693b | 2016-03-09 17:51:34 -0800 | [diff] [blame] | 17 | #ifndef _OTA_TEST_CONSTANTS_H |
| 18 | #define _OTA_TEST_CONSTANTS_H |
| 19 | |
Tianjie Xu | 113fe05 | 2017-10-24 16:12:35 -0700 | [diff] [blame] | 20 | #include <string> |
| 21 | |
Tao Bao | 9d91e89 | 2018-03-30 20:43:45 -0700 | [diff] [blame] | 22 | #include <android-base/file.h> |
| 23 | |
Tao Bao | ef0eb3b | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 24 | // Zip entries in ziptest_valid.zip. |
| 25 | static const std::string kATxtContents("abcdefghabcdefgh\n"); |
| 26 | static const std::string kBTxtContents("abcdefgh\n"); |
Tao Bao | 1036d36 | 2016-11-17 22:49:56 -0800 | [diff] [blame] | 27 | static const std::string kCTxtContents("abcdefghabcdefgh\n"); |
| 28 | static const std::string kDTxtContents("abcdefgh\n"); |
Tao Bao | ef0eb3b | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 29 | |
| 30 | // echo -n -e "abcdefghabcdefgh\n" | sha1sum |
| 31 | static const std::string kATxtSha1Sum("32c96a03dc8cd20097940f351bca6261ee5a1643"); |
| 32 | // echo -n -e "abcdefgh\n" | sha1sum |
| 33 | static const std::string kBTxtSha1Sum("e414af7161c9554089f4106d6f1797ef14a73666"); |
| 34 | |
Tao Bao | 9d91e89 | 2018-03-30 20:43:45 -0700 | [diff] [blame] | 35 | [[maybe_unused]] static std::string from_testdata_base(const std::string& fname) { |
| 36 | static std::string exec_dir = android::base::GetExecutableDirectory(); |
| 37 | return exec_dir + "/testdata/" + fname; |
Tao Bao | 4102b28 | 2016-11-02 16:17:17 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | #endif // _OTA_TEST_CONSTANTS_H |