Save this video free

5.4 - Functions (2026-09-28)

Chris Bourke · 52:31 · Watch on YouTube

Part of University of Nebraska-Lincoln CSCE 155E. See all 9 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Chris Bourke reviews informal unit testing in C, improving a hand-built test suite with diagnostic failures, pass/fail totals, and corner cases, then previews CMocka and its automated test reports. He explains how function calls create stack frames, why C passes arguments by value, and how pointers and memory addresses enable functions to modify caller data and support later topics such as dynamic memory.

Key takeaways

Chapters

0:00 Function Testing Review and the Informal Test Workflow
5:40 Adding Failure Diagnostics and a Test Summary in C
11:00 Testing Rounding Edge Cases and Monthly Payments
18:10 CMocka Preview: Automated C Test Cases and Reports
24:10 LIFO Stacks and Function Call Frames
30:00 Local Scope and What Happens When Functions Return
33:00 Why a C Swap Function Cannot Change Caller Variables
38:00 Memory Addresses, Contents, and Pointer Variables
45:00 Null Pointers, the Address-of Operator, and Python Tutor
50:00 What Pointers Enable: Swapping, Multiple Outputs, and Dynamic Memory

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:03 [music] [music] [music] [music] >> She's not there. >> [music] >> This part of this side >> [music] >> She is new. >> [music] >> Can we show our faces now?

0:51 >> [music] [music] >> I'm not in >> [music] >> She's [music] not >> [music] >> She's for us. >> [music] >> Can we show our faces >> [music] >> in the sky? >> [music] >> I am blind. >> [music]

1:41 >> Why can't I hear? >> [music] >> Show me >> [music] >> Speak in a phrase. >> [music] [music] [music] [music] [music] [music]

2:33 [music] >> All right, welcome back. Uh just to review what we were doing last week since we did have that exam review on Friday. We were talking we we'd of course introduced functions and using functions and creating functions. Uh but then we went on to unit testing. And what unit testing is is testing your functions, treating them as units and giving it input and then it produces output and you check that against an expected output. And if if that's the input output pair. And they have to be determined to be correct before you you actually run your test. Otherwise, you're not actually testing your code. Uh what we mean by that is by pulling out a calculator, doing it on a

3:21 piece of paper or up on a whiteboard or some other means other than your code to make sure that that expected output is correct. Uh if they match, the unit passes. If they fail, then or if it does not match, then the unit fails. And then we can group multiple unit tests together in one collection and we can call that a test suite. Then we can run the entire test suite in all in one shot. Uh and

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Chris Bourke.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.