MCPcopy Create free account
hub / github.com/davisking/dlib / perform_test

Method perform_test

dlib/test/example.cpp:35–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 {}
34
35 void perform_test (
36 )
37 {
38 // This message gets logged to the file debug.txt if the user has enabled logging by
39 // supplying the -d option on the command line (and they haven't set the logging level
40 // to something higher than LINFO).
41 dlog << dlib::LINFO << "some message you want to log";
42
43 // This test is considered a success if this function doesn't throw an exception.
44 // So we can use the DLIB_TEST_MSG macro to perform our tests since it throws an
45 // exception containing a message if its first argument is false.
46
47 // make sure 3 is bigger than 2
48 DLIB_TEST_MSG(3 > 2,"This message prints if your compiler doesn't know 3 is bigger than 2");
49
50 // make sure 5 is not equal to 9
51 DLIB_TEST_MSG(5 != 9,"This message prints if your compiler thinks 5 is the same as 9");
52
53 // This is a form of test you can use when you don't care about having a message
54 DLIB_TEST(5 != 8);
55
56 // If your test takes a long time to run you can also call print_spinner()
57 // periodically. This will cause a spinning / character to display on the
58 // console to indicate to the user that your test is still running (rather
59 // than hung)
60 print_spinner();
61 }
62 };
63
64 // Create an instance of this object. Doing this causes this test

Callers

nothing calls this directly

Calls 1

print_spinnerFunction · 0.85

Tested by

no test coverage detected