Commit Graph
31 Commits
Author SHA1 Message Date
Aaron e4fd76b739 Added changed from feedback from Andy 2015-08-17 17:02:40 -07:00
Aaron 1a796b5924 Changes to make converting beteween UTF8 and UTF16 2015-08-14 10:51:25 -07:00
Aaron 72ea5abd0b New line for { 2015-08-13 10:53:09 -07:00
Aaron f496f91af0 Added changes to code based on additional documention and using a 16 bit string 2015-08-13 09:47:10 -07:00
Aaron 01f85ecf1c Fixed Merge Confilct with CMakeLists.txt 2015-08-12 14:04:39 -07:00
Andrew Schwartzmeyer 9a42b894f2 Convert to Allman style with 4-space indentation 2015-08-07 18:43:58 -07:00
Andrew Schwartzmeyer f8e9dfde8c Fix style issues
- Use Doxygen style comments (with better comments)
- Use `type* ident` instead of `type *ident`
- Start { on new lines
- Use TRUE/FALSE from PAL.H
2015-08-07 12:03:31 -07:00
Andrew Schwartzmeyer b379fb4a6b Rename to GetUserNameW since it is Unicode 2015-08-06 16:28:29 -07:00
Andrew Schwartzmeyer 447896aede Use WCHAR sizes instead of CHAR sizes
Such that lpnSize is the length (number of UTF-16 characters, including
null) of the username. Must be multiplied by sizeof(char16_t) for bytes.
2015-08-04 18:31:54 -07:00
Aaron 54618f1750 Made changes based off feedback from Peter. Also added more unit tests 2015-08-04 14:38:53 -07:00
Andrew Schwartzmeyer e64c8961c9 Update GetUserName tests
Note that these fail when run in a Docker container because a) the
current container's locale is not completely set, and b) getlogin()
returns null with ENOENT since /var/run/utmp is being mapped to the
host, and thus denied access from within the container.

The container needs the locale set and its own /run/utmp, see
https://lists.linuxcontainers.org/pipermail/lxc-users/2011-July/002374.html
2015-08-04 14:16:57 -07:00
Aaron c979881804 added more error handling 2015-08-03 13:54:07 -07:00
Andrew Schwartzmeyer 0c9fb0d01b Rename userName in test to expectedUsername
To clarify that it is for comparison; not the result of GetUserName.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 9426e9c455 Use LOGIN_NAME_MAX instead of L_cuserid
Since L_cuserid is only for cuserid, not getlogin_r

Unit test for L_cuserid removed because the macro may not be available
on all platforms.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer cbee353d0d Add more unit test coverage for GetUserName 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 0f07a65f50 Use test fixture in GetUserName unit tests 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer e8cb7e24fe Use L_cuserid instead of 64 and given lpnSize 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 3ab3408378 Factor out using directives 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 41a00d9279 Clarify lpBuffer layout in GetUserName unit test 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer ff0b43015b Test UTF-16 output of GetUserName 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer f8eedc7210 Add unit test for GetUserName 2015-08-03 12:58:59 -07:00
Aaron 7a85d035c0 Add error handing for bad enivronment and bad parameter 2015-08-03 10:48:46 -07:00
Aaron fb5279ad1e Merge remote-tracking branch 'origin/develop' into dev/9-getcomputername
Conflicts:
	src/CMakeLists.txt
2015-07-31 14:59:13 -07:00
Aaron 4661081c7d Added test for buffer not having enough space to write computer name 2015-07-30 13:47:31 -07:00
Aaron b8ae6d13a9 Added failure casex 2015-07-30 12:47:10 -07:00
Peter Honeder 8eeb24ece9 added hostutil.h, added tests for hostutil, added more cmdline options to PS host 2015-07-30 16:53:35 +02:00
Aaron Katz 299e362d11 changed spacing and using std::string instead of TCHAR 2015-04-09 15:16:37 -07:00
Aaron Katz ea7b78ef1c changes based on comments 2015-04-06 09:57:16 -07:00
Peter Honeder 70645d5bc1 fetched changes from branch feature/GetComputerName 2015-04-03 10:22:05 -07:00
Pete Baker 0c5f78a223 built and tested - pass 2015-03-19 13:09:36 -07:00
Peter Honeder beb5be9ffa initial commit 2015-03-05 14:58:25 -08:00