$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: [boost] Preferred way to simulate system calls
From: James E. King, III (jking_at_[hidden])
Date: 2017-11-06 22:00:41
I like to test every branch, and I have a class that calls
open/read/close. It uses a hardcoded filename ("/dev/urandom"). It is a
template in a detail namespace. What's the "boost way" when it comes to
mocking these system calls? Should I make protected methods that normally
call open/read/close, then subclass in a test and override them with
different logic to force error paths?
- Jim