Coder Social home page Coder Social logo

Write a test for mb_format.c about mb-system HOT 2 OPEN

dwcaress avatar dwcaress commented on July 29, 2024
Write a test for mb_format.c

from mb-system.

Comments (2)

schwehr avatar schwehr commented on July 29, 2024

cvt_to_nix_path should only be defined if #ifdef WIN32 and it should be a void return type. e.g.

#ifdef WIN32
void cvt_to_nix_path(char *path) {
	/* Replace back slashes by slashes and trim first two chars in paths like "C:/path" */
	const size_t len = strlen(path);

	if (len == 0)
		return;
	for (int k = 0; k < len; k++)
		if (path[k] == '\\')
			path[k] = '/';

	if (path[1] == ':') {
		for (int k = 0; k < len - 2; k++)
			path[k] = path[k + 2];
		path[len - 2] = '\0'; /* Make sure it's null terminated */
	}
}
#endif

from mb-system.

schwehr avatar schwehr commented on July 29, 2024

#125 adds a test for utilities/mbformat.c which covers some of mb_get_format(), mb_format(), and mb_format_description(). However, it would still be better to have direct testing of all the functions in mbio/mb_format.c.

from mb-system.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.