Skip to content

Commit 8e6d707

Browse files
Matthäus G. ChajdasMatthäus G. Chajdas
authored andcommitted
RDF 1.1.1
1 parent f32c2fb commit 8e6d707

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ The `amdrdf` library provides the following forwards/backwards compatibility gua
3030

3131
Use `RDF_INTERFACE_VERSION` and `RDF_MAKE_VERSION` to check for the library version.
3232

33-
## Changelog
33+
Patch releases (for example, `1.1.1`) will be bumped for bug fixes and other improvements.
3434

35-
Interface-level changes only:
35+
## Changelog
3636

3737
* **1.0**: Initial release
3838
* **1.1**: Improve naming consistency: Add `rdfStreamFromUserStream`, mark `rdfStreamCreateFromUserStream` as deprecated
39-
39+
* **1.1.1**: Fix `rdfChunkFileContainsChunk` returning `rdfResultError` when a chunk was not found instead of `rdfResultOk`

rdf/inc/amdrdf.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020

2121
#define RDF_IDENTIFIER_SIZE 16
2222

23-
#define RDF_MAKE_VERSION(major, minor) \
23+
#define RDF_MAKE_VERSION(major, minor, patch) \
2424
((static_cast<std::uint32_t>(major) << 22) | \
25-
(static_cast<std::uint32_t>(minor) << 12))
25+
(static_cast<std::uint32_t>(minor) << 12) | \
26+
(static_cast<std::uint32_t>(patch)))
2627

27-
#define RDF_INTERFACE_VERSION RDF_MAKE_VERSION(1, 1)
28+
#define RDF_INTERFACE_VERSION RDF_MAKE_VERSION(1, 1, 1)
2829

2930
extern "C" {
3031
struct rdfChunkFile;

rdf/src/amdrdf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ namespace internal
332332

333333
auto it = chunkTypeRange_.find(id);
334334
if (it == chunkTypeRange_.end()) {
335-
throw std::runtime_error("Chunk not found");
335+
return false;
336336
}
337337

338338
if (chunkIndex >= (it->second.last - it->second.first)) {
339-
throw std::runtime_error("Chunk index out of range");
339+
return false;
340340
}
341341

342342
return true;

rdf/test/src/IO_test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ TEST_CASE("rdf::LoadKnownGoodFile", "[rdf]")
9393
CHECK(cf.ContainsChunk("chunk1"));
9494
CHECK(cf.ContainsChunk("chunk2"));
9595

96+
CHECK(cf.ContainsChunk("chunk0", 0));
97+
CHECK(cf.ContainsChunk("chunk0", 1));
98+
CHECK(!cf.ContainsChunk("chunk0", 2));
99+
100+
CHECK(!cf.ContainsChunk("chunk3"));
101+
96102
cf.ReadChunkData("chunk0", 0, [](size_t size, const void* data) -> void {
97103
CHECK(std::string(
98104
static_cast<const char*>(data),

0 commit comments

Comments
 (0)