Skip to content

Commit 26d222f

Browse files
jamesmosysMSStephen
authored andcommitted
HOTFIX found and fixed core issue - cmake was including wrong headers causing false-positive on tests
1 parent 3de18a0 commit 26d222f

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

include/opentrackio-cpp/OpenTrackIOTypes.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ namespace opentrackio::opentrackiotypes
132132
struct Format
133133
{
134134
Rational frameRate{};
135-
bool dropFrame = false;
136-
std::optional<bool> oddField = std::nullopt;
135+
std::optional<int> subFrame = std::nullopt;
137136
};
138137
Format format{};
139138

@@ -164,7 +163,6 @@ namespace opentrackio::opentrackiotypes
164163

165164
const bool formatFieldValid =
166165
tcJson["format"].contains("frameRate") &&
167-
tcJson["format"].contains("dropFrame") &&
168166
tcJson["format"]["frameRate"].contains("num") &&
169167
tcJson["format"]["frameRate"].contains("denom");
170168

@@ -175,23 +173,16 @@ namespace opentrackio::opentrackiotypes
175173
}
176174

177175
auto fr = Rational::parse(tcJson["format"], "frameRate", errors);
178-
bool drop;
179-
std::optional<bool> odd;
180-
181-
if (!OpenTrackIOHelpers::checkTypeAndSetField(tcJson["format"]["dropFrame"], drop))
182-
{
183-
errors.emplace_back("field: timing/timecode/format/dropFrame isn't of type: bool");
184-
return std::nullopt;
185-
}
176+
std::optional<int> sub;
186177

187178
if (!fr.has_value())
188179
{
189180
return std::nullopt;
190181
}
191182

192-
OpenTrackIOHelpers::assignField(tcJson["format"], "oddField", odd, "bool", errors);
183+
OpenTrackIOHelpers::assignField(tcJson["format"], "subFrame", sub, "int", errors);
193184

194-
return Timecode{hours.value(), minutes.value(), seconds.value(), frames.value(), Format{fr.value(), drop, odd}};
185+
return Timecode{hours.value(), minutes.value(), seconds.value(), frames.value(), Format{fr.value(), sub}};
195186
}
196187
};
197188

tests/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
4747
else()
4848
link_directories(${CMAKE_CURRENT_LIST_DIR}/../build/release/Release)
4949
endif()
50-
find_package(opentrackio-cpp REQUIRED PATHS "${CMAKE_CURRENT_LIST_DIR}/../install/cmake")
5150

5251
# Json validator
5352
FetchContent_Declare(nlohmann_json_schema_validator
@@ -64,7 +63,7 @@ add_executable(tests
6463
target_compile_features(tests PUBLIC cxx_std_20)
6564
target_include_directories(tests
6665
PRIVATE
67-
"${CMAKE_CURRENT_LIST_DIR}/../install/include"
66+
"${CMAKE_CURRENT_LIST_DIR}/../include"
6867
"${CMAKE_CURRENT_LIST_DIR}/../external"
6968
)
7069

0 commit comments

Comments
 (0)