Skip to content

Commit

Permalink
Update tests for concat
Browse files Browse the repository at this point in the history
  • Loading branch information
cuprumbot committed Jan 29, 2025
1 parent 8fe12e6 commit 26c2e48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/classroom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: read
jobs:
run-autograding-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.actor != 'github-classroom[bot]'
steps:
- name: Checkout repository
Expand All @@ -24,4 +24,4 @@ jobs:
run: pip install pycparser tabulate psutil

- name: Run tests
run: ./check
run: ./check
2 changes: 1 addition & 1 deletion grading/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def check_concatbits():
exp = exp.strip()
out = out.strip()
if exp == out:
grade += 35 / 6
grade += 35 / 8
else:
wrong += 1
if wrong == 6:
Expand Down
2 changes: 2 additions & 0 deletions tests/concat_bits_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ int main(int argc, const char * argv[]) {
test_concat_bits(0x000000cc, 4, 0x00000044, 4, 0xffffffc4);
test_concat_bits(0x000000aa, 8, 0x0000cccc, 16, 0xffaacccc);
test_concat_bits(0x00000066, 6, 0xfffffccc, 10, 0xffff98cc);
test_concat_bits(0x87654321, 12, 0x12345678, 12, 0x00321678);
test_concat_bits(0x87654321, 16, 0x12345678, 16, 0x43215678);
printf("\n");
return 0;
}

0 comments on commit 26c2e48

Please sign in to comment.