mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Implement pathutil::ResolveRelativePath fuzz test.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "tinyusdz.hh"
|
||||
#include "path-util.hh"
|
||||
|
||||
static void run(const uint8_t *data, size_t size)
|
||||
{
|
||||
@@ -30,6 +31,14 @@ static void run(const uint8_t *data, size_t size)
|
||||
|
||||
std::string s1 = std::string(reinterpret_cast<const char *>(data), loc-1);
|
||||
std::string s2 = std::string(reinterpret_cast<const char *>(data+loc), size-loc-1);
|
||||
|
||||
tinyusdz::Path base_path(s1, "");
|
||||
tinyusdz::Path rel_path(s2, "");
|
||||
tinyusdz::Path abs_path("", "");
|
||||
|
||||
bool ret = tinyusdz::pathutil::ResolveRelativePath(base_path, rel_path, &abs_path);
|
||||
(void)ret;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user