Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cs50/2017/fall/resize/less/check50/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ def exists(self):
def compiles(self):
"""resize.c compiles."""
self.spawn("clang -std=c11 -o resize resize.c -lm -lcs50").exit(0)

@check("compiles")
def negfactor(self):
"""rejects a negative factor"""
self.spawn("./resize -1 small.bmp outfile.bmp").exit(1)

@check("compiles")
def zerofactor(self):
"""rejects a factor of zero"""
self.spawn("./resize 0 small.bmp outfile.bmp").exit(1)

@check("compiles")
def toolargefactor(self):
"""rejects a factor > 100"""
self.spawn("./resize 101 small.bmp outfile.bmp").exit(1)

@check("compiles")
def small_1(self):
Expand Down