FSTFuzzTestFieldPath.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2018 Google
  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 agreed 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. */
  16. #ifndef FIRESTORE_EXAMPLE_FUZZTESTS_FUZZINGTARGETS_FSTFUZZTESTFIELDPATH_H_
  17. #define FIRESTORE_EXAMPLE_FUZZTESTS_FUZZINGTARGETS_FSTFUZZTESTFIELDPATH_H_
  18. #import <Foundation/Foundation.h>
  19. #include <string>
  20. namespace firebase {
  21. namespace firestore {
  22. namespace fuzzing {
  23. // Returns the location of the FieldPath dictionary file.
  24. inline std::string GetFieldPathDictionaryLocation(std::string resources_location) {
  25. return resources_location + "/FieldPath/fieldpath.dictionary";
  26. }
  27. // Returns the location of the FieldPath corpus directory.
  28. inline std::string GetFieldPathCorpusLocation(std::string resources_location) {
  29. return resources_location + "/FieldPath/Corpus";
  30. }
  31. // Fuzz-test creating FIRFieldPath objects.
  32. int FuzzTestFieldPath(const uint8_t *data, size_t size);
  33. } // namespace fuzzing
  34. } // namespace firestore
  35. } // namespace firebase
  36. #endif // FIRESTORE_EXAMPLE_FUZZTESTS_FUZZINGTARGETS_FSTFUZZTESTFIELDPATH_H_