lab_graphs
Gangnam-Style Graphs
tests.cpp File Reference

Contains code to test the functions in GraphTools. More...

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "graph.h"
#include "premade_graphs.cpp"
#include "graph_tools.h"
+ Include dependency graph for tests.cpp:

Functions

void error (string programName)
 Show how to use the GraphTools tester. More...
 
void testMinWeight (Graph *graph, string fileName)
 Tests GraphTools::findMinWeight. More...
 
void testShortestPath (Graph *graph, Vertex start, Vertex end, string fileName)
 Tests GraphTools::findShortestPath. More...
 
void testKruskal (Graph *graph, string fileName)
 Tests GraphTools::findMST. More...
 
int main (int argc, char *argv[])
 Parses command line arguments and runs the appropriate test. More...
 

Detailed Description

Contains code to test the functions in GraphTools.

Written for CS 225 Spring 2011

Author
Sean Massung

Updated Spring 2012

Function Documentation

◆ error()

void error ( string  programName)

Show how to use the GraphTools tester.

Parameters
programName- the name to display in the usage text

◆ testMinWeight()

void testMinWeight ( Graph graph,
string  fileName 
)

Tests GraphTools::findMinWeight.

Parameters
graph- the graph to run the test on
fileName-the prefix for the filename to save the graph

◆ testShortestPath()

void testShortestPath ( Graph graph,
Vertex  start,
Vertex  end,
string  fileName 
)

Tests GraphTools::findShortestPath.

Parameters
graph- the graph to run the test on
start- the vertex to find a path from
end- the vertex to find a path to
fileName-the prefix for the filename to save the graph

◆ testKruskal()

void testKruskal ( Graph graph,
string  fileName 
)

Tests GraphTools::findMST.

Parameters
graph- the graph to run the test on
fileName-the prefix for the filename to save the graph

◆ main()

int main ( int  argc,
char *  argv[] 
)

Parses command line arguments and runs the appropriate test.