Skip to content
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

Merged
merged 11 commits into from Jun 5, 2015
Merged

test various load functions #1048

merged 11 commits into from Jun 5, 2015

Conversation

ctb
Copy link
Member

@ctb ctb commented May 30, 2015

Responsive to #1037.

@ctb
Copy link
Member Author

ctb commented May 31, 2015

  • Is it mergeable?
  • Did it pass the tests?
  • If it introduces new functionality in scripts/ is it tested?
    Check for code coverage with make clean diff-cover
  • Is it well formatted? Look at make pep8, make diff_pylint_report,
    make cppcheck, and make doc output. Use make format and manual
    fixing as needed.
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Is it documented in the ChangeLog?
    http://en.wikipedia.org/wiki/Changelog#Format
  • Was a spellchecker run on the source code and documentation after
    changes were made?
  • Is the Copyright year up to date?

@ctb
Copy link
Member Author

ctb commented May 31, 2015

Ready for CR and merge @luizirber @camillescott. Note, it merges cleanly with #1031 with all tests passing, too.

@ctb ctb added this to the 2.0 milestone May 31, 2015
if (!(*diskp != 0)) { // sanity check.
throw khmer_exception();
}
assert((*diskp != 0)); // sanity check!
Copy link
Member

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 asserts in the C++ code?

Copy link
Member Author

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 asserts 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.

Copy link
Member

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 avoid asserts 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

camille.scott.w@gmail.com

@camillescott
Copy link
Member

Fine fine, keep your extraneous statements ;P LGTM; merging

camillescott added a commit that referenced this pull request Jun 5, 2015
@camillescott camillescott merged commit 74351e5 into master Jun 5, 2015
@ctb ctb deleted the test/load_truncated_hash branch June 5, 2015 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants