New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test various load functions #1048
Conversation
|
Ready for CR and merge @luizirber @camillescott. Note, it merges cleanly with #1031 with all tests passing, too. |
…cated_hash Conflicts: ChangeLog
if (!(*diskp != 0)) { // sanity check. | ||
throw khmer_exception(); | ||
} | ||
assert((*diskp != 0)); // sanity check! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought we were trying to avoid assert
s in the C++ code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Jun 04, 2015 at 06:38:49PM -0700, Camille Scott wrote:
@@ -1350,20 +1355,22 @@ void SubsetPartition::merge_from_disk(string other_filename)
diskp = (PartitionID *) (buf + i);
i += sizeof(PartitionID);
if (!(*diskp != 0)) { // sanity check.
throw khmer_exception();
}
assert((*diskp != 0)); // sanity check!
Thought we were trying to avoid
assert
s in the C++ code?
I was unable to think of a way to trigger this in a test, and this is a
reasonable check on things when debugging or modifying other code. I think
we're trying to avoid asserts as things that are actually raised for users, but
I don't see any reason not to leave them in as sanity checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough!
On Thu, Jun 4, 2015 at 6:46 PM, C. Titus Brown notifications@github.com
wrote:
In lib/subset.cc
#1048 (comment):@@ -1350,20 +1355,22 @@ void SubsetPartition::merge_from_disk(string other_filename)
diskp = (PartitionID *) (buf + i);
i += sizeof(PartitionID);
if (!(*diskp != 0)) { // sanity check.
throw khmer_exception();
}
assert((*diskp != 0)); // sanity check!
On Thu, Jun 04, 2015 at 06:38:49PM -0700, Camille Scott wrote: > @@
-1350,20 +1355,22 @@ void SubsetPartition::merge_from_disk(string
other_filename) > diskp = (PartitionID _) (buf + i); > i +=
sizeof(PartitionID); > > - if (!(_diskp != 0)) { // sanity check. > - throw
khmer_exception(); > - } > + assert((*diskp != 0)); // sanity check!
Thought we were trying to avoidassert
s in the C++ code?
I was unable to think of a way to trigger this in a test, and this is a
reasonable check on things when debugging or modifying other code. I think
we're trying to avoid asserts as things that are actually raised for users,
but I don't see any reason not to leave them in as sanity checks.—
Reply to this email directly or view it on GitHub
https://github.com/dib-lab/khmer/pull/1048/files#r31782427.
Camille Scott
Department of Computer Science
Lab for Data Intensive Biology
University of California, Davis
…cated_hash Conflicts: ChangeLog
Fine fine, keep your extraneous statements ;P LGTM; merging |
test various load functions
Responsive to #1037.