summaryrefslogtreecommitdiff
path: root/tests/test-heap.c
Commit message (Collapse)AuthorAgeFilesLines
* Add read-only option to ovs-dpctl and ovs-ofctl commands.Ryan Moats2016-08-151-7/+7
| | | | | | | | | ovs-dpctl and ovs-ofctl lack a read-only option to prevent running of commands that perform read-write operations. Add it and the necessary scaffolding to each. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* command-line: add ovs_cmdl_contextRussell Bryant2015-03-171-11/+12
| | | | | | | | | | | | | | | | | | | | | | | I started working on a new command line utility that used this shared code. I wanted the ability to pass some data from common initialization code to all of the commands. You can find a similar pattern in ovs-vsctl. This patch updates the command handler to take a new struct, ovs_cmdl_context, instead of argc and argv directly. It includes argc and argv, but also includes an opaque type (void *), where the user of this API can attach its custom data it wants passed along to command handlers. This patch affected the ovstest sub-programs, as well. The patch includes a bit of an odd hack to OVSTEST_REGISTER() to avoid making the main() function of the sub-programs take a ovs_cmdl_context. The test main() functions still receive argc and argv directly, as that seems more natural. The test-subprograms themselves are able to make use of a context internally, though. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_ prefixRussell Bryant2015-03-161-2/+2
| | | | | | | | | | | | | | | | | The coding style guidelines include the following: - Pick a unique name prefix (ending with an underscore) for each module, and apply that prefix to all of that module's externally visible names. Names of macro parameters, struct and union members, and parameters in function prototypes are not considered externally visible for this purpose. This patch adds the new prefix to the externally visible names. This makes it a bit more obvious what code is coming from common command line handling code. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs_assert, tests: Support NDEBUG.Jarno Rajahalme2014-10-301-4/+3
| | | | | | | | | | | | | | | | | ./configure accepts --enable-ndebug option. Make ovs_assert() honor it, and make sure all test programs disable it. The order of include files in test programs is also made uniform: 1. #include <config.h> 2. #undef NDEBUG 3. Include file of the test subject (to make sure it itself has sufficient include directives). 4. System includes in alphapetical order. 5. OVS includes in aplhapetical order. Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: Add function to print command usage.Alex Wang2014-10-281-7/+8
| | | | | | | | | | | | | This commit adds a new variable in 'struct command' for recording the command usage. Also, a new function is added to print the usage given the array of defined commands. Later patch will use the output in bash command-line completion script. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* unit-test: Improve ovstest user interfaceAndy Zhou2014-04-031-1/+1
| | | | | | | | | Improve help output. Running without argument now exit with an error message and an error code. Simplify OVSTEST_REGISTER() since not all test programs uses sub_commands. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* unit-test: merge test-heap into ovstestAndy Zhou2014-03-311-5/+7
| | | | | | | Modify test-heap.c to use ovstest framework. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Rename NOT_REACHED to OVS_NOT_REACHEDHarold Lim2013-12-171-2/+2
| | | | | | | | This allows other libraries to use util.h that has already defined NOT_REACHED. Signed-off-by: Harold Lim <haroldl@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* heap: New library that implements a binary heap-based priority queue.Ben Pfaff2012-02-011-0/+486
Signed-off-by: Ben Pfaff <blp@nicira.com>