Skip to content

Commit

Permalink
Merge branch 'CameraMetaData-non-final' into develop
Browse files Browse the repository at this point in the history
* CameraMetaData-non-final:
  CameraMetaData: add a test for inheritability
  Remove final from CameraMetaData to allow derived classes
  • Loading branch information
LebedevRI committed Oct 27, 2022
2 parents 70b0145 + fbe495e commit e5cbf27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librawspeed/metadata/CameraMetaData.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct CameraId {
}
};

class CameraMetaData final {
// NOTE: *NOT* `final`, could be derived from by downstream.
class CameraMetaData {
public:
CameraMetaData() = default;

Expand Down
4 changes: 4 additions & 0 deletions test/librawspeed/metadata/CameraMetaDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ namespace rawspeed_test {

static const std::string camfile(RAWSPEED_SOURCE_DIR "/data/cameras.xml");

TEST(CameraMetaDataTest, CompileTimeCanInherit) {
struct MyCameraMetaData : public CameraMetaData {};
}

TEST(CameraMetaDataTest, CamerasXml) {
ASSERT_NO_THROW({ CameraMetaData Data(camfile.c_str()); });

Expand Down

0 comments on commit e5cbf27

Please sign in to comment.